mirror of
https://github.com/4sval/FModel.git
synced 2026-09-19 06:54:28 -05:00
export from focused element + custom input gesture text
This commit is contained in:
18
FModel/Extensions/VisualTreeExtensions.cs
Normal file
18
FModel/Extensions/VisualTreeExtensions.cs
Normal file
@@ -0,0 +1,18 @@
|
||||
using System.Windows;
|
||||
using System.Windows.Media;
|
||||
|
||||
namespace FModel.Extensions;
|
||||
|
||||
public static class VisualTreeExtensions
|
||||
{
|
||||
public static T FindAncestor<T>(this DependencyObject current) where T : DependencyObject
|
||||
{
|
||||
while (current != null)
|
||||
{
|
||||
if (current is T t)
|
||||
return t;
|
||||
current = VisualTreeHelper.GetParent(current);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
@@ -27,11 +27,13 @@ public class Hotkey : ViewModel
|
||||
|
||||
public bool IsTriggered(Key e)
|
||||
{
|
||||
return e == Key && Keyboard.Modifiers.HasFlag(Modifiers);
|
||||
return Key != Key.None && e == Key && Keyboard.Modifiers.HasFlag(Modifiers);
|
||||
}
|
||||
|
||||
public override string ToString()
|
||||
{
|
||||
if (Key == Key.None) return string.Empty;
|
||||
|
||||
var str = new StringBuilder();
|
||||
|
||||
if (Modifiers.HasFlag(ModifierKeys.Control))
|
||||
@@ -46,4 +48,4 @@ public class Hotkey : ViewModel
|
||||
str.Append(Key);
|
||||
return str.ToString();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.ComponentModel;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
@@ -7,6 +8,7 @@ using System.Windows;
|
||||
using System.Windows.Controls;
|
||||
using System.Windows.Controls.Primitives;
|
||||
using System.Windows.Input;
|
||||
using FModel.Extensions;
|
||||
using FModel.Services;
|
||||
using FModel.Settings;
|
||||
using FModel.ViewModels;
|
||||
@@ -180,21 +182,21 @@ public partial class MainWindow
|
||||
};
|
||||
}
|
||||
else if (_applicationView.Status.IsReady && UserSettings.Default.ExportData.IsTriggered(e.Key))
|
||||
ExportSelected("Save_Data");
|
||||
OnExportHotkey("Save_Data");
|
||||
else if (_applicationView.Status.IsReady && UserSettings.Default.ExportProperties.IsTriggered(e.Key))
|
||||
ExportSelected("Save_Properties");
|
||||
OnExportHotkey("Save_Properties");
|
||||
else if (_applicationView.Status.IsReady && UserSettings.Default.ExportTextures.IsTriggered(e.Key))
|
||||
ExportSelected("Save_Textures");
|
||||
OnExportHotkey("Save_Textures");
|
||||
else if (_applicationView.Status.IsReady && UserSettings.Default.ExportModels.IsTriggered(e.Key))
|
||||
ExportSelected("Save_Models");
|
||||
OnExportHotkey("Save_Models");
|
||||
else if (_applicationView.Status.IsReady && UserSettings.Default.ExportWorlds.IsTriggered(e.Key))
|
||||
ExportSelected("Save_Worlds");
|
||||
OnExportHotkey("Save_Worlds");
|
||||
else if (_applicationView.Status.IsReady && UserSettings.Default.ExportAnimations.IsTriggered(e.Key))
|
||||
ExportSelected("Save_Animations");
|
||||
OnExportHotkey("Save_Animations");
|
||||
else if (_applicationView.Status.IsReady && UserSettings.Default.ExportAudio.IsTriggered(e.Key))
|
||||
ExportSelected("Save_Audio");
|
||||
OnExportHotkey("Save_Audio");
|
||||
else if (_applicationView.Status.IsReady && UserSettings.Default.ExportCode.IsTriggered(e.Key))
|
||||
ExportSelected("Save_Code");
|
||||
OnExportHotkey("Save_Code");
|
||||
else if (_applicationView.Status.IsReady && UserSettings.Default.FeaturePreviewNewAssetExplorer && UserSettings.Default.SwitchAssetExplorer.IsTriggered(e.Key))
|
||||
_applicationView.IsAssetsExplorerVisible = !_applicationView.IsAssetsExplorerVisible;
|
||||
else if (UserSettings.Default.AssetAddTab.IsTriggered(e.Key))
|
||||
@@ -395,13 +397,20 @@ public partial class MainWindow
|
||||
childFolder.IsSelected = true;
|
||||
}
|
||||
|
||||
private void ExportSelected(string trigger)
|
||||
private void OnExportHotkey(string trigger)
|
||||
{
|
||||
var selectedItems = AssetsListName.SelectedItems.Cast<object>().ToArray();
|
||||
if (selectedItems.Length == 0)
|
||||
if (!_applicationView.Status.IsReady || Keyboard.FocusedElement is not DependencyObject focused)
|
||||
return;
|
||||
|
||||
_applicationView.RightClickMenuCommand.Execute(_applicationView, new object[] { trigger, selectedItems });
|
||||
IList selection = focused.FindAncestor<TreeView>() == AssetsFolderName
|
||||
? new[] { AssetsFolderName.SelectedItem }
|
||||
: focused.FindAncestor<ListBox>()?.SelectedItems;
|
||||
|
||||
var exportable = selection?.OfType<object>().Where(static item => item is TreeItem or GameFileViewModel).ToArray() ?? [];
|
||||
if (exportable.Length == 0)
|
||||
return;
|
||||
|
||||
_applicationView.RightClickMenuCommand.Execute(new object[] { trigger, exportable });
|
||||
}
|
||||
|
||||
private CustomPopupPlacement[] OnQueueToastCustomPopupPlacement(Size popupSize, Size targetSize, Point offset)
|
||||
|
||||
@@ -382,14 +382,14 @@ public sealed class UserSettings : ViewModel
|
||||
set => SetProperty(ref _assetRightTab, value);
|
||||
}
|
||||
|
||||
private Hotkey _assetAddTab = new(Key.OemPlus, ModifierKeys.Control);
|
||||
private Hotkey _assetAddTab = new(Key.T, ModifierKeys.Control);
|
||||
public Hotkey AssetAddTab
|
||||
{
|
||||
get => _assetAddTab;
|
||||
set => SetProperty(ref _assetAddTab, value);
|
||||
}
|
||||
|
||||
private Hotkey _assetRemoveTab = new(Key.R, ModifierKeys.Control);
|
||||
private Hotkey _assetRemoveTab = new(Key.W, ModifierKeys.Control);
|
||||
public Hotkey AssetRemoveTab
|
||||
{
|
||||
get => _assetRemoveTab;
|
||||
@@ -431,56 +431,56 @@ public sealed class UserSettings : ViewModel
|
||||
set => SetProperty(ref _nextAudio, value);
|
||||
}
|
||||
|
||||
private Hotkey _exportData = new(Key.D, ModifierKeys.Control);
|
||||
private Hotkey _exportData = new(Key.None);
|
||||
public Hotkey ExportData
|
||||
{
|
||||
get => _exportData;
|
||||
set => SetProperty(ref _exportData, value);
|
||||
}
|
||||
|
||||
private Hotkey _exportProperties = new(Key.P, ModifierKeys.Control);
|
||||
private Hotkey _exportProperties = new(Key.None);
|
||||
public Hotkey ExportProperties
|
||||
{
|
||||
get => _exportProperties;
|
||||
set => SetProperty(ref _exportProperties, value);
|
||||
}
|
||||
|
||||
private Hotkey _exportTextures = new(Key.T, ModifierKeys.Control);
|
||||
private Hotkey _exportTextures = new(Key.None);
|
||||
public Hotkey ExportTextures
|
||||
{
|
||||
get => _exportTextures;
|
||||
set => SetProperty(ref _exportTextures, value);
|
||||
}
|
||||
|
||||
private Hotkey _exportModels = new(Key.M, ModifierKeys.Control);
|
||||
private Hotkey _exportModels = new(Key.None);
|
||||
public Hotkey ExportModels
|
||||
{
|
||||
get => _exportModels;
|
||||
set => SetProperty(ref _exportModels, value);
|
||||
}
|
||||
|
||||
private Hotkey _exportWorlds = new(Key.W, ModifierKeys.Control);
|
||||
private Hotkey _exportWorlds = new(Key.None);
|
||||
public Hotkey ExportWorlds
|
||||
{
|
||||
get => _exportWorlds;
|
||||
set => SetProperty(ref _exportWorlds, value);
|
||||
}
|
||||
|
||||
private Hotkey _exportAnimations = new(Key.N, ModifierKeys.Control);
|
||||
private Hotkey _exportAnimations = new(Key.None);
|
||||
public Hotkey ExportAnimations
|
||||
{
|
||||
get => _exportAnimations;
|
||||
set => SetProperty(ref _exportAnimations, value);
|
||||
}
|
||||
|
||||
private Hotkey _exportAudio = new(Key.U, ModifierKeys.Control);
|
||||
private Hotkey _exportAudio = new(Key.None);
|
||||
public Hotkey ExportAudio
|
||||
{
|
||||
get => _exportAudio;
|
||||
set => SetProperty(ref _exportAudio, value);
|
||||
}
|
||||
|
||||
private Hotkey _exportCode = new(Key.C, ModifierKeys.Control);
|
||||
private Hotkey _exportCode = new(Key.None);
|
||||
public Hotkey ExportCode
|
||||
{
|
||||
get => _exportCode;
|
||||
|
||||
@@ -2,62 +2,7 @@
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:adonisUi="clr-namespace:AdonisUI;assembly=AdonisUI"
|
||||
xmlns:settings="clr-namespace:FModel.Settings"
|
||||
xmlns:controls="clr-namespace:FModel.Views.Resources.Controls"
|
||||
xmlns:converters="clr-namespace:FModel.Views.Resources.Converters">
|
||||
<Style TargetType="{x:Type controls:HotkeyDisplay}">
|
||||
<Setter Property="VerticalAlignment"
|
||||
Value="Center" />
|
||||
<Setter Property="HorizontalAlignment"
|
||||
Value="Right" />
|
||||
<Setter Property="Focusable"
|
||||
Value="False" />
|
||||
<Setter Property="IsHitTestVisible"
|
||||
Value="False" />
|
||||
<Setter Property="ItemsPanel">
|
||||
<Setter.Value>
|
||||
<ItemsPanelTemplate>
|
||||
<StackPanel Orientation="Horizontal" />
|
||||
</ItemsPanelTemplate>
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
<Setter Property="ItemTemplate">
|
||||
<Setter.Value>
|
||||
<DataTemplate>
|
||||
<Border Margin="2,0,0,0"
|
||||
Padding="5,2"
|
||||
CornerRadius="3"
|
||||
Background="{DynamicResource {x:Static adonisUi:Brushes.Layer1HighlightBrush}}">
|
||||
<TextBlock Text="{Binding}"
|
||||
FontSize="10"
|
||||
Foreground="{DynamicResource {x:Static adonisUi:Brushes.ForegroundBrush}}" />
|
||||
</Border>
|
||||
</DataTemplate>
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
</Style>
|
||||
|
||||
<DataTemplate x:Key="HotkeyMenuHeaderTemplate">
|
||||
<Grid MinWidth="140">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="*" />
|
||||
<ColumnDefinition Width="Auto" />
|
||||
</Grid.ColumnDefinitions>
|
||||
|
||||
<ContentPresenter Content="{Binding}"
|
||||
VerticalAlignment="Center" />
|
||||
<controls:HotkeyDisplay Grid.Column="1"
|
||||
Margin="5,0,-12,0"
|
||||
HotKey="{Binding Tag, RelativeSource={RelativeSource AncestorType=MenuItem}}" />
|
||||
</Grid>
|
||||
</DataTemplate>
|
||||
|
||||
<Style x:Key="HotkeyMenuItemStyle"
|
||||
TargetType="{x:Type MenuItem}"
|
||||
BasedOn="{StaticResource {x:Type MenuItem}}">
|
||||
<Setter Property="HeaderTemplate"
|
||||
Value="{StaticResource HotkeyMenuHeaderTemplate}" />
|
||||
</Style>
|
||||
|
||||
<ContextMenu x:Key="FileContextMenu" x:Shared="False"
|
||||
DataContext="{Binding DataContext, RelativeSource={RelativeSource AncestorType=Window}}">
|
||||
<MenuItem Header="Extract in New Tab" Command="{Binding RightClickMenuCommand}">
|
||||
@@ -178,8 +123,7 @@
|
||||
</MenuItem.Icon>
|
||||
|
||||
<MenuItem Command="{Binding RightClickMenuCommand}"
|
||||
Style="{StaticResource HotkeyMenuItemStyle}"
|
||||
Tag="{Binding ExportData, Source={x:Static settings:UserSettings.Default}}">
|
||||
InputGestureText="{Binding ExportData, Source={x:Static settings:UserSettings.Default}}">
|
||||
<MenuItem.Header>
|
||||
<TextBlock
|
||||
Text="{Binding PlacementTarget.SelectedItem.Asset.Extension,
|
||||
@@ -203,8 +147,7 @@
|
||||
</MenuItem>
|
||||
<MenuItem Header="Properties (.json)"
|
||||
Command="{Binding RightClickMenuCommand}"
|
||||
Style="{StaticResource HotkeyMenuItemStyle}"
|
||||
Tag="{Binding ExportProperties, Source={x:Static settings:UserSettings.Default}}">
|
||||
InputGestureText="{Binding ExportProperties, Source={x:Static settings:UserSettings.Default}}">
|
||||
<MenuItem.CommandParameter>
|
||||
<MultiBinding Converter="{x:Static converters:MultiParameterConverter.Instance}">
|
||||
<Binding Source="Save_Properties" />
|
||||
@@ -219,21 +162,17 @@
|
||||
</Viewbox>
|
||||
</MenuItem.Icon>
|
||||
</MenuItem>
|
||||
|
||||
<MenuItem Header="Texture"
|
||||
Command="{Binding RightClickMenuCommand}"
|
||||
Style="{StaticResource HotkeyMenuItemStyle}"
|
||||
Tag="{Binding ExportTextures, Source={x:Static settings:UserSettings.Default}}">
|
||||
InputGestureText="{Binding ExportTextures, Source={x:Static settings:UserSettings.Default}}">
|
||||
<MenuItem.CommandParameter>
|
||||
<MultiBinding Converter="{x:Static converters:MultiParameterConverter.Instance}">
|
||||
<Binding Source="Save_Textures" />
|
||||
<Binding Path="PlacementTarget.SelectedItems"
|
||||
RelativeSource="{RelativeSource AncestorType=ContextMenu}" />
|
||||
<Binding Path="PlacementTarget.SelectedItems" RelativeSource="{RelativeSource AncestorType=ContextMenu}" />
|
||||
</MultiBinding>
|
||||
</MenuItem.CommandParameter>
|
||||
<MenuItem.IsEnabled>
|
||||
<Binding Path="PlacementTarget.SelectedItems"
|
||||
RelativeSource="{RelativeSource AncestorType=ContextMenu}">
|
||||
<Binding Path="PlacementTarget.SelectedItems" RelativeSource="{RelativeSource AncestorType=ContextMenu}">
|
||||
<Binding.Converter>
|
||||
<converters:AnyItemMeetsConditionConverter>
|
||||
<converters:AnyItemMeetsConditionConverter.Conditions>
|
||||
@@ -244,20 +183,16 @@
|
||||
</Binding>
|
||||
</MenuItem.IsEnabled>
|
||||
<MenuItem.Icon>
|
||||
<Viewbox Width="16"
|
||||
Height="16">
|
||||
<Canvas Width="24"
|
||||
Height="24">
|
||||
<Path Fill="{DynamicResource {x:Static adonisUi:Brushes.ForegroundBrush}}"
|
||||
Data="{StaticResource TextureIcon}" />
|
||||
<Viewbox Width="16" Height="16">
|
||||
<Canvas Width="24" Height="24">
|
||||
<Path Fill="{DynamicResource {x:Static adonisUi:Brushes.ForegroundBrush}}" Data="{StaticResource TextureIcon}" />
|
||||
</Canvas>
|
||||
</Viewbox>
|
||||
</MenuItem.Icon>
|
||||
</MenuItem>
|
||||
<MenuItem Header="Model"
|
||||
Command="{Binding RightClickMenuCommand}"
|
||||
Style="{StaticResource HotkeyMenuItemStyle}"
|
||||
Tag="{Binding ExportModels, Source={x:Static settings:UserSettings.Default}}">
|
||||
InputGestureText="{Binding ExportModels, Source={x:Static settings:UserSettings.Default}}">
|
||||
<MenuItem.CommandParameter>
|
||||
<MultiBinding Converter="{x:Static converters:MultiParameterConverter.Instance}">
|
||||
<Binding Source="Save_Models" />
|
||||
@@ -285,8 +220,7 @@
|
||||
</MenuItem>
|
||||
<MenuItem Header="World"
|
||||
Command="{Binding RightClickMenuCommand}"
|
||||
Style="{StaticResource HotkeyMenuItemStyle}"
|
||||
Tag="{Binding ExportWorlds, Source={x:Static settings:UserSettings.Default}}">
|
||||
InputGestureText="{Binding ExportWorlds, Source={x:Static settings:UserSettings.Default}}">
|
||||
<MenuItem.CommandParameter>
|
||||
<MultiBinding Converter="{x:Static converters:MultiParameterConverter.Instance}">
|
||||
<Binding Source="Save_Worlds" />
|
||||
@@ -318,8 +252,7 @@
|
||||
</MenuItem>
|
||||
<MenuItem Header="Animation"
|
||||
Command="{Binding RightClickMenuCommand}"
|
||||
Style="{StaticResource HotkeyMenuItemStyle}"
|
||||
Tag="{Binding ExportAnimations, Source={x:Static settings:UserSettings.Default}}">
|
||||
InputGestureText="{Binding ExportAnimations, Source={x:Static settings:UserSettings.Default}}">
|
||||
<MenuItem.CommandParameter>
|
||||
<MultiBinding Converter="{x:Static converters:MultiParameterConverter.Instance}">
|
||||
<Binding Source="Save_Animations" />
|
||||
@@ -347,8 +280,7 @@
|
||||
</MenuItem>
|
||||
<MenuItem Header="Audio"
|
||||
Command="{Binding RightClickMenuCommand}"
|
||||
Style="{StaticResource HotkeyMenuItemStyle}"
|
||||
Tag="{Binding ExportAudio, Source={x:Static settings:UserSettings.Default}}">
|
||||
InputGestureText="{Binding ExportAudio, Source={x:Static settings:UserSettings.Default}}">
|
||||
<MenuItem.CommandParameter>
|
||||
<MultiBinding Converter="{x:Static converters:MultiParameterConverter.Instance}">
|
||||
<Binding Source="Save_Audio" />
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:settings="clr-namespace:FModel.Settings"
|
||||
xmlns:adonisUi="clr-namespace:AdonisUI;assembly=AdonisUI"
|
||||
xmlns:converters="clr-namespace:FModel.Views.Resources.Converters"
|
||||
x:Class="FModel.Views.Resources.Controls.ContextMenus.FolderContextMenuDictionary">
|
||||
@@ -18,7 +19,8 @@
|
||||
</MenuItem.Icon>
|
||||
|
||||
<MenuItem Header="Raw Data (.uasset)"
|
||||
Command="{Binding RightClickMenuCommand}">
|
||||
Command="{Binding RightClickMenuCommand}"
|
||||
InputGestureText="{Binding ExportData, Source={x:Static settings:UserSettings.Default}}">
|
||||
<MenuItem.CommandParameter>
|
||||
<MultiBinding Converter="{x:Static converters:MultiParameterConverter.Instance}">
|
||||
<Binding Source="Save_Data" />
|
||||
@@ -38,7 +40,8 @@
|
||||
</MenuItem.Icon>
|
||||
</MenuItem>
|
||||
<MenuItem Header="Properties (.json)"
|
||||
Command="{Binding RightClickMenuCommand}">
|
||||
Command="{Binding RightClickMenuCommand}"
|
||||
InputGestureText="{Binding ExportProperties, Source={x:Static settings:UserSettings.Default}}">
|
||||
<MenuItem.CommandParameter>
|
||||
<MultiBinding Converter="{x:Static converters:MultiParameterConverter.Instance}">
|
||||
<Binding Source="Save_Properties" />
|
||||
@@ -58,7 +61,8 @@
|
||||
</MenuItem.Icon>
|
||||
</MenuItem>
|
||||
<MenuItem Header="Textures"
|
||||
Command="{Binding RightClickMenuCommand}">
|
||||
Command="{Binding RightClickMenuCommand}"
|
||||
InputGestureText="{Binding ExportTextures, Source={x:Static settings:UserSettings.Default}}">
|
||||
<MenuItem.CommandParameter>
|
||||
<MultiBinding Converter="{x:Static converters:MultiParameterConverter.Instance}">
|
||||
<Binding Source="Save_Textures" />
|
||||
@@ -78,7 +82,8 @@
|
||||
</MenuItem.Icon>
|
||||
</MenuItem>
|
||||
<MenuItem Header="Decompiled Blueprints"
|
||||
Command="{Binding RightClickMenuCommand}">
|
||||
Command="{Binding RightClickMenuCommand}"
|
||||
InputGestureText="{Binding ExportCode, Source={x:Static settings:UserSettings.Default}}">
|
||||
<MenuItem.CommandParameter>
|
||||
<MultiBinding Converter="{x:Static converters:MultiParameterConverter.Instance}">
|
||||
<Binding Source="Save_Code" />
|
||||
@@ -98,7 +103,8 @@
|
||||
</MenuItem.Icon>
|
||||
</MenuItem>
|
||||
<MenuItem Header="Models"
|
||||
Command="{Binding RightClickMenuCommand}">
|
||||
Command="{Binding RightClickMenuCommand}"
|
||||
InputGestureText="{Binding ExportModels, Source={x:Static settings:UserSettings.Default}}">
|
||||
<MenuItem.CommandParameter>
|
||||
<MultiBinding Converter="{x:Static converters:MultiParameterConverter.Instance}">
|
||||
<Binding Source="Save_Models" />
|
||||
@@ -118,7 +124,8 @@
|
||||
</MenuItem.Icon>
|
||||
</MenuItem>
|
||||
<MenuItem Header="Worlds"
|
||||
Command="{Binding RightClickMenuCommand}">
|
||||
Command="{Binding RightClickMenuCommand}"
|
||||
InputGestureText="{Binding ExportWorlds, Source={x:Static settings:UserSettings.Default}}">
|
||||
<MenuItem.CommandParameter>
|
||||
<MultiBinding Converter="{x:Static converters:MultiParameterConverter.Instance}">
|
||||
<Binding Source="Save_Worlds" />
|
||||
@@ -143,7 +150,8 @@
|
||||
</MenuItem.Icon>
|
||||
</MenuItem>
|
||||
<MenuItem Header="Animations"
|
||||
Command="{Binding RightClickMenuCommand}">
|
||||
Command="{Binding RightClickMenuCommand}"
|
||||
InputGestureText="{Binding ExportAnimations, Source={x:Static settings:UserSettings.Default}}">
|
||||
<MenuItem.CommandParameter>
|
||||
<MultiBinding Converter="{x:Static converters:MultiParameterConverter.Instance}">
|
||||
<Binding Source="Save_Animations" />
|
||||
@@ -163,7 +171,8 @@
|
||||
</MenuItem.Icon>
|
||||
</MenuItem>
|
||||
<MenuItem Header="Audio"
|
||||
Command="{Binding RightClickMenuCommand}">
|
||||
Command="{Binding RightClickMenuCommand}"
|
||||
InputGestureText="{Binding ExportAudio, Source={x:Static settings:UserSettings.Default}}">
|
||||
<MenuItem.CommandParameter>
|
||||
<MultiBinding Converter="{x:Static converters:MultiParameterConverter.Instance}">
|
||||
<Binding Source="Save_Audio" />
|
||||
|
||||
@@ -3,6 +3,7 @@ using System.Linq;
|
||||
using System.Windows;
|
||||
using System.Windows.Controls;
|
||||
using System.Windows.Media;
|
||||
using FModel.Extensions;
|
||||
using FModel.Services;
|
||||
using FModel.Settings;
|
||||
using FModel.ViewModels;
|
||||
@@ -23,7 +24,7 @@ public partial class FolderContextMenuDictionary
|
||||
if (sender is not ContextMenu { PlacementTarget: FrameworkElement fe } menu)
|
||||
return;
|
||||
|
||||
var listBox = FindAncestor<ListBox>(fe);
|
||||
var listBox = fe.FindAncestor<ListBox>();
|
||||
if (listBox != null)
|
||||
{
|
||||
menu.DataContext = listBox.DataContext;
|
||||
@@ -31,7 +32,7 @@ public partial class FolderContextMenuDictionary
|
||||
return;
|
||||
}
|
||||
|
||||
var treeView = FindAncestor<TreeView>(fe);
|
||||
var treeView = fe.FindAncestor<TreeView>();
|
||||
if (treeView != null)
|
||||
{
|
||||
menu.DataContext = treeView.DataContext;
|
||||
@@ -39,17 +40,6 @@ public partial class FolderContextMenuDictionary
|
||||
}
|
||||
}
|
||||
|
||||
private static T FindAncestor<T>(DependencyObject current) where T : DependencyObject
|
||||
{
|
||||
while (current != null)
|
||||
{
|
||||
if (current is T t)
|
||||
return t;
|
||||
current = VisualTreeHelper.GetParent(current);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
private void OnFavoriteDirectoryClick(object sender, RoutedEventArgs e)
|
||||
{
|
||||
if (sender is not MenuItem { CommandParameter: IEnumerable<object> list } || list.FirstOrDefault() is not TreeItem folder)
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Windows;
|
||||
using System.Windows.Controls;
|
||||
using System.Windows.Input;
|
||||
@@ -6,63 +5,6 @@ using FModel.Framework;
|
||||
|
||||
namespace FModel.Views.Resources.Controls;
|
||||
|
||||
public class HotkeySetting : Control
|
||||
{
|
||||
public string Label
|
||||
{
|
||||
get => (string) GetValue(LabelProperty);
|
||||
set => SetValue(LabelProperty, value);
|
||||
}
|
||||
|
||||
public static readonly DependencyProperty LabelProperty =
|
||||
DependencyProperty.Register(nameof(Label), typeof(string), typeof(HotkeySetting), new PropertyMetadata(string.Empty));
|
||||
|
||||
public Hotkey HotKey
|
||||
{
|
||||
get => (Hotkey) GetValue(HotKeyProperty);
|
||||
set => SetValue(HotKeyProperty, value);
|
||||
}
|
||||
|
||||
public static readonly DependencyProperty HotKeyProperty =
|
||||
DependencyProperty.Register(nameof(HotKey), typeof(Hotkey), typeof(HotkeySetting), new FrameworkPropertyMetadata(new Hotkey(Key.None), FrameworkPropertyMetadataOptions.BindsTwoWayByDefault));
|
||||
}
|
||||
|
||||
public class HotkeyDisplay : ItemsControl
|
||||
{
|
||||
public Hotkey HotKey
|
||||
{
|
||||
get => (Hotkey) GetValue(HotKeyProperty);
|
||||
set => SetValue(HotKeyProperty, value);
|
||||
}
|
||||
|
||||
public static readonly DependencyProperty HotKeyProperty =
|
||||
DependencyProperty.Register(nameof(HotKey), typeof(Hotkey), typeof(HotkeyDisplay), new PropertyMetadata(new Hotkey(Key.None), OnHotKeyChanged));
|
||||
|
||||
private static void OnHotKeyChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
|
||||
{
|
||||
if (d is HotkeyDisplay control)
|
||||
control.ItemsSource = GetKeys(control.HotKey);
|
||||
}
|
||||
|
||||
private static IEnumerable<string> GetKeys(Hotkey hotkey)
|
||||
{
|
||||
if (hotkey.Modifiers.HasFlag(ModifierKeys.Control))
|
||||
yield return "Ctrl";
|
||||
|
||||
if (hotkey.Modifiers.HasFlag(ModifierKeys.Shift))
|
||||
yield return "Shift";
|
||||
|
||||
if (hotkey.Modifiers.HasFlag(ModifierKeys.Alt))
|
||||
yield return "Alt";
|
||||
|
||||
if (hotkey.Modifiers.HasFlag(ModifierKeys.Windows))
|
||||
yield return "Win";
|
||||
|
||||
if (hotkey.Key != Key.None)
|
||||
yield return hotkey.Key.ToString();
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// https://tyrrrz.me/blog/hotkey-editor-control-in-wpf
|
||||
/// </summary>
|
||||
|
||||
24
FModel/Views/Resources/Controls/HotkeyPresenter.cs
Normal file
24
FModel/Views/Resources/Controls/HotkeyPresenter.cs
Normal file
@@ -0,0 +1,24 @@
|
||||
using System;
|
||||
using System.Windows;
|
||||
using System.Windows.Controls;
|
||||
|
||||
namespace FModel.Views.Resources.Controls;
|
||||
|
||||
public class HotkeyPresenter : ItemsControl
|
||||
{
|
||||
public static readonly DependencyProperty GestureProperty = DependencyProperty.Register(
|
||||
nameof(Gesture), typeof(string), typeof(HotkeyPresenter), new PropertyMetadata(null, OnGestureChanged));
|
||||
|
||||
public string Gesture
|
||||
{
|
||||
get => (string) GetValue(GestureProperty);
|
||||
set => SetValue(GestureProperty, value);
|
||||
}
|
||||
|
||||
private static void OnGestureChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
|
||||
{
|
||||
((HotkeyPresenter) d).ItemsSource = e.NewValue is string gesture
|
||||
? gesture.Split('+', StringSplitOptions.RemoveEmptyEntries | StringSplitOptions.TrimEntries)
|
||||
: null;
|
||||
}
|
||||
}
|
||||
@@ -1124,6 +1124,28 @@
|
||||
</Setter>
|
||||
</Style>
|
||||
|
||||
<Style TargetType="{x:Type controls:HotkeyPresenter}">
|
||||
<Setter Property="Focusable" Value="False" />
|
||||
<Setter Property="IsHitTestVisible" Value="False" />
|
||||
<Setter Property="ItemsPanel">
|
||||
<Setter.Value>
|
||||
<ItemsPanelTemplate>
|
||||
<StackPanel Orientation="Horizontal" />
|
||||
</ItemsPanelTemplate>
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
<Setter Property="ItemTemplate">
|
||||
<Setter.Value>
|
||||
<DataTemplate>
|
||||
<Border Margin="2, 0, 0, 0" Padding="5, 2" CornerRadius="3"
|
||||
Background="{DynamicResource {x:Static adonisUi:Brushes.Layer1HighlightBrush}}">
|
||||
<TextBlock Text="{Binding}" FontSize="10" />
|
||||
</Border>
|
||||
</DataTemplate>
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
</Style>
|
||||
|
||||
<Style x:Key="{x:Type MenuItem}" TargetType="{x:Type MenuItem}" BasedOn="{StaticResource {x:Type MenuItem}}">
|
||||
<Setter Property="Template">
|
||||
<Setter.Value>
|
||||
@@ -1175,13 +1197,13 @@
|
||||
HorizontalAlignment="Stretch"
|
||||
Margin="{Binding Margin, ElementName=ItemHeader}"/>
|
||||
|
||||
<TextBlock x:Name="RippleLayerInputGesturePresenter"
|
||||
Grid.Column="2"
|
||||
Text="{TemplateBinding InputGestureText}"
|
||||
TextElement.Foreground="{Binding Foreground, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type adonisControls:RippleHost}}}"
|
||||
VerticalAlignment="Center"
|
||||
HorizontalAlignment="Stretch"
|
||||
Margin="{Binding Margin, ElementName=InputGesturePresenter}"/>
|
||||
<controls:HotkeyPresenter x:Name="RippleLayerInputGesturePresenter"
|
||||
Grid.Column="2"
|
||||
Gesture="{TemplateBinding InputGestureText}"
|
||||
TextElement.Foreground="{Binding Foreground, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type adonisControls:RippleHost}}}"
|
||||
VerticalAlignment="Center"
|
||||
HorizontalAlignment="Right"
|
||||
Margin="{Binding Margin, ElementName=InputGesturePresenter}"/>
|
||||
|
||||
<Viewbox x:Name="RippleLayerArrowPresenter"
|
||||
Grid.Column="3"
|
||||
@@ -1227,13 +1249,13 @@
|
||||
HorizontalAlignment="Stretch"
|
||||
Margin="4, 0"/>
|
||||
|
||||
<TextBlock x:Name="InputGesturePresenter"
|
||||
Grid.Column="3"
|
||||
Text="{TemplateBinding InputGestureText}"
|
||||
Foreground="{TemplateBinding Foreground}"
|
||||
VerticalAlignment="Center"
|
||||
HorizontalAlignment="Stretch"
|
||||
Margin="4, 0"/>
|
||||
<controls:HotkeyPresenter x:Name="InputGesturePresenter"
|
||||
Grid.Column="3"
|
||||
Gesture="{TemplateBinding InputGestureText}"
|
||||
TextElement.Foreground="{TemplateBinding Foreground}"
|
||||
VerticalAlignment="Center"
|
||||
HorizontalAlignment="Right"
|
||||
Margin="4, 0"/>
|
||||
|
||||
<Viewbox x:Name="ArrowPresenter"
|
||||
Grid.Column="4"
|
||||
@@ -2285,34 +2307,4 @@
|
||||
</Style.Triggers>
|
||||
</Style>
|
||||
|
||||
<Style TargetType="{x:Type controls:HotkeySetting}">
|
||||
<Setter Property="Height"
|
||||
Value="32" />
|
||||
<Setter Property="HorizontalAlignment"
|
||||
Value="Stretch" />
|
||||
<Setter Property="Template">
|
||||
<Setter.Value>
|
||||
<ControlTemplate TargetType="{x:Type controls:HotkeySetting}">
|
||||
<Grid>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="100" />
|
||||
<ColumnDefinition Width="10" />
|
||||
<ColumnDefinition Width="*" />
|
||||
</Grid.ColumnDefinitions>
|
||||
<TextBlock Text="{TemplateBinding Label}"
|
||||
VerticalAlignment="Center" />
|
||||
<controls:HotkeyTextBox Grid.Column="2"
|
||||
Height="26"
|
||||
VerticalAlignment="Center"
|
||||
HorizontalAlignment="Stretch"
|
||||
HorizontalContentAlignment="Center"
|
||||
VerticalContentAlignment="Center"
|
||||
Style="{StaticResource TextBoxDefaultStyle}"
|
||||
HotKey="{Binding HotKey, RelativeSource={RelativeSource TemplatedParent}, Mode=TwoWay}" />
|
||||
</Grid>
|
||||
</ControlTemplate>
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
</Style>
|
||||
|
||||
</ResourceDictionary>
|
||||
|
||||
@@ -412,107 +412,107 @@
|
||||
</Grid>
|
||||
</DataTemplate>
|
||||
<DataTemplate x:Key="KeybindingsTemplate">
|
||||
<Grid>
|
||||
<Grid adonisExtensions:LayerExtension.Layer="2">
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="Auto" />
|
||||
<RowDefinition Height="Auto" />
|
||||
|
||||
<RowDefinition Height="Auto" />
|
||||
<RowDefinition Height="Auto" />
|
||||
|
||||
<RowDefinition Height="Auto" />
|
||||
<RowDefinition Height="Auto" />
|
||||
|
||||
<RowDefinition Height="Auto" />
|
||||
<RowDefinition Height="Auto" />
|
||||
<RowDefinition Height="Auto" />
|
||||
<RowDefinition Height="Auto" />
|
||||
<RowDefinition Height="Auto" />
|
||||
<RowDefinition Height="Auto" />
|
||||
<RowDefinition Height="Auto" />
|
||||
<RowDefinition Height="Auto" />
|
||||
<RowDefinition Height="Auto" />
|
||||
<RowDefinition Height="Auto" />
|
||||
<RowDefinition Height="Auto" />
|
||||
<RowDefinition Height="Auto" />
|
||||
<RowDefinition Height="Auto" />
|
||||
<RowDefinition Height="Auto" />
|
||||
<RowDefinition Height="Auto" />
|
||||
<RowDefinition Height="Auto" />
|
||||
<RowDefinition Height="Auto" />
|
||||
</Grid.RowDefinitions>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="Auto" />
|
||||
<ColumnDefinition Width="10" />
|
||||
<ColumnDefinition Width="*" />
|
||||
</Grid.ColumnDefinitions>
|
||||
|
||||
<Separator Grid.Row="0"
|
||||
Tag="DIRECTORY"
|
||||
Style="{StaticResource CustomSeparator}" />
|
||||
<!-- <TextBlock Grid.Row="0" Grid.Column="0" Text="Left Switch on Directory Tab" VerticalAlignment="Center" Margin="0 0 0 5" /> -->
|
||||
<!-- <controls:HotkeyTextBox Grid.Row="0" Grid.Column="2" Style="{StaticResource TextBoxDefaultStyle}" Margin="0 0 0 5" -->
|
||||
<!-- HotKey="{Binding DirLeftTab, Source={x:Static local:Settings.UserSettings.Default}, Mode=TwoWay}" /> -->
|
||||
<!-- <TextBlock Grid.Row="1" Grid.Column="0" Text="Right Switch on Directory Tab" VerticalAlignment="Center" /> -->
|
||||
<!-- <controls:HotkeyTextBox Grid.Row="1" Grid.Column="2" Style="{StaticResource TextBoxDefaultStyle}" -->
|
||||
<!-- HotKey="{Binding DirRightTab, Source={x:Static local:Settings.UserSettings.Default}, Mode=TwoWay}" /> -->
|
||||
<!-- -->
|
||||
<!-- <Separator Grid.Row="2" Grid.Column="0" Grid.ColumnSpan="3" Style="{StaticResource CustomSeparator}" /> -->
|
||||
|
||||
<StackPanel Grid.Row="1"
|
||||
HorizontalAlignment="Stretch"
|
||||
Margin="60,0">
|
||||
<controls:HotkeySetting Label="Previous Tab"
|
||||
HotKey="{Binding DirLeftTab, Source={x:Static local:Settings.UserSettings.Default}, Mode=TwoWay}" />
|
||||
<controls:HotkeySetting Label="Next Tab"
|
||||
HotKey="{Binding DirRightTab, Source={x:Static local:Settings.UserSettings.Default}, Mode=TwoWay}" />
|
||||
</StackPanel>
|
||||
<TextBlock Grid.Row="3" Grid.Column="0" Text="Switch Asset Explorer" VerticalAlignment="Center" Margin="0 0 0 5" />
|
||||
<controls:HotkeyTextBox Grid.Row="3" Grid.Column="2" Style="{StaticResource TextBoxDefaultStyle}" Margin="0 0 0 5"
|
||||
HotKey="{Binding SwitchAssetExplorer, Source={x:Static local:Settings.UserSettings.Default}, Mode=TwoWay}" />
|
||||
<!-- <TextBlock Grid.Row="4" Grid.Column="0" Text="Left Switch on Asset Tab" VerticalAlignment="Center" Margin="0 0 0 5" /> -->
|
||||
<!-- <controls:HotkeyTextBox Grid.Row="4" Grid.Column="2" Style="{StaticResource TextBoxDefaultStyle}" Margin="0 0 0 5" -->
|
||||
<!-- HotKey="{Binding AssetLeftTab, Source={x:Static local:Settings.UserSettings.Default}, Mode=TwoWay}" /> -->
|
||||
<!-- <TextBlock Grid.Row="5" Grid.Column="0" Text="Right Switch on Asset Tab" VerticalAlignment="Center" Margin="0 0 0 5" /> -->
|
||||
<!-- <controls:HotkeyTextBox Grid.Row="5" Grid.Column="2" Style="{StaticResource TextBoxDefaultStyle}" Margin="0 0 0 5" -->
|
||||
<!-- HotKey="{Binding AssetRightTab, Source={x:Static local:Settings.UserSettings.Default}, Mode=TwoWay}" /> -->
|
||||
<TextBlock Grid.Row="6" Grid.Column="0" Text="Add Asset Tab" VerticalAlignment="Center" Margin="0 0 0 5" />
|
||||
<controls:HotkeyTextBox Grid.Row="6" Grid.Column="2" Style="{StaticResource TextBoxDefaultStyle}" Margin="0 0 0 5"
|
||||
HotKey="{Binding AssetAddTab, Source={x:Static local:Settings.UserSettings.Default}, Mode=TwoWay}" />
|
||||
<TextBlock Grid.Row="7" Grid.Column="0" Text="Remove Selected Asset Tab" VerticalAlignment="Center" />
|
||||
<controls:HotkeyTextBox Grid.Row="7" Grid.Column="2" Style="{StaticResource TextBoxDefaultStyle}"
|
||||
HotKey="{Binding AssetRemoveTab, Source={x:Static local:Settings.UserSettings.Default}, Mode=TwoWay}" />
|
||||
|
||||
<Separator Grid.Row="2"
|
||||
Tag="ASSET EXPLORER"
|
||||
Style="{StaticResource CustomSeparator}" />
|
||||
<Separator Grid.Row="8" Grid.Column="0" Grid.ColumnSpan="3" Style="{StaticResource CustomSeparator}" />
|
||||
|
||||
<StackPanel Grid.Row="3"
|
||||
HorizontalAlignment="Stretch"
|
||||
Margin="60,0">
|
||||
<controls:HotkeySetting Label="Switch Explorer"
|
||||
HotKey="{Binding SwitchAssetExplorer, Source={x:Static local:Settings.UserSettings.Default}, Mode=TwoWay}" />
|
||||
<controls:HotkeySetting Label="Previous Tab"
|
||||
HotKey="{Binding AssetLeftTab, Source={x:Static local:Settings.UserSettings.Default}, Mode=TwoWay}" />
|
||||
<controls:HotkeySetting Label="Next Tab"
|
||||
HotKey="{Binding AssetRightTab, Source={x:Static local:Settings.UserSettings.Default}, Mode=TwoWay}" />
|
||||
<controls:HotkeySetting Label="Add Tab"
|
||||
HotKey="{Binding AssetAddTab, Source={x:Static local:Settings.UserSettings.Default}, Mode=TwoWay}" />
|
||||
<controls:HotkeySetting Label="Close Tab"
|
||||
HotKey="{Binding AssetRemoveTab, Source={x:Static local:Settings.UserSettings.Default}, Mode=TwoWay}" />
|
||||
</StackPanel>
|
||||
<TextBlock Grid.Row="9" Grid.Column="0" Text="Export Raw Data" VerticalAlignment="Center" Margin="0 0 0 5" />
|
||||
<controls:HotkeyTextBox Grid.Row="9" Grid.Column="2" Style="{StaticResource TextBoxDefaultStyle}" Margin="0 0 0 5"
|
||||
HotKey="{Binding ExportData, Source={x:Static local:Settings.UserSettings.Default}, Mode=TwoWay}" />
|
||||
<TextBlock Grid.Row="10" Grid.Column="0" Text="Export Properties" VerticalAlignment="Center" Margin="0 0 0 5" />
|
||||
<controls:HotkeyTextBox Grid.Row="10" Grid.Column="2" Style="{StaticResource TextBoxDefaultStyle}" Margin="0 0 0 5"
|
||||
HotKey="{Binding ExportProperties, Source={x:Static local:Settings.UserSettings.Default}, Mode=TwoWay}" />
|
||||
<TextBlock Grid.Row="11" Grid.Column="0" Text="Export Textures" VerticalAlignment="Center" Margin="0 0 0 5" />
|
||||
<controls:HotkeyTextBox Grid.Row="11" Grid.Column="2" Style="{StaticResource TextBoxDefaultStyle}" Margin="0 0 0 5"
|
||||
HotKey="{Binding ExportTextures, Source={x:Static local:Settings.UserSettings.Default}, Mode=TwoWay}" />
|
||||
<TextBlock Grid.Row="12" Grid.Column="0" Text="Export Models" VerticalAlignment="Center" Margin="0 0 0 5" />
|
||||
<controls:HotkeyTextBox Grid.Row="12" Grid.Column="2" Style="{StaticResource TextBoxDefaultStyle}" Margin="0 0 0 5"
|
||||
HotKey="{Binding ExportModels, Source={x:Static local:Settings.UserSettings.Default}, Mode=TwoWay}" />
|
||||
<TextBlock Grid.Row="13" Grid.Column="0" Text="Export Worlds" VerticalAlignment="Center" Margin="0 0 0 5" />
|
||||
<controls:HotkeyTextBox Grid.Row="13" Grid.Column="2" Style="{StaticResource TextBoxDefaultStyle}" Margin="0 0 0 5"
|
||||
HotKey="{Binding ExportWorlds, Source={x:Static local:Settings.UserSettings.Default}, Mode=TwoWay}" />
|
||||
<TextBlock Grid.Row="14" Grid.Column="0" Text="Export Animations" VerticalAlignment="Center" Margin="0 0 0 5" />
|
||||
<controls:HotkeyTextBox Grid.Row="14" Grid.Column="2" Style="{StaticResource TextBoxDefaultStyle}" Margin="0 0 0 5"
|
||||
HotKey="{Binding ExportAnimations, Source={x:Static local:Settings.UserSettings.Default}, Mode=TwoWay}" />
|
||||
<TextBlock Grid.Row="15" Grid.Column="0" Text="Export Audio" VerticalAlignment="Center" Margin="0 0 0 5" />
|
||||
<controls:HotkeyTextBox Grid.Row="15" Grid.Column="2" Style="{StaticResource TextBoxDefaultStyle}" Margin="0 0 0 5"
|
||||
HotKey="{Binding ExportAudio, Source={x:Static local:Settings.UserSettings.Default}, Mode=TwoWay}" />
|
||||
<TextBlock Grid.Row="16" Grid.Column="0" Text="Export Decompiled Blueprints" VerticalAlignment="Center" />
|
||||
<controls:HotkeyTextBox Grid.Row="16" Grid.Column="2" Style="{StaticResource TextBoxDefaultStyle}"
|
||||
HotKey="{Binding ExportCode, Source={x:Static local:Settings.UserSettings.Default}, Mode=TwoWay}" />
|
||||
|
||||
<Separator Grid.Row="4"
|
||||
Tag="AUDIO"
|
||||
Style="{StaticResource CustomSeparator}" />
|
||||
<Separator Grid.Row="17" Grid.Column="0" Grid.ColumnSpan="3" Style="{StaticResource CustomSeparator}" />
|
||||
|
||||
<StackPanel Grid.Row="5"
|
||||
HorizontalAlignment="Stretch"
|
||||
Margin="60,0">
|
||||
<controls:HotkeySetting Label="Add File"
|
||||
HotKey="{Binding AddAudio, Source={x:Static local:Settings.UserSettings.Default}, Mode=TwoWay}" />
|
||||
<controls:HotkeySetting Label="Play / Pause"
|
||||
HotKey="{Binding PlayPauseAudio, Source={x:Static local:Settings.UserSettings.Default}, Mode=TwoWay}" />
|
||||
<controls:HotkeySetting Label="Previous"
|
||||
HotKey="{Binding PreviousAudio, Source={x:Static local:Settings.UserSettings.Default}, Mode=TwoWay}" />
|
||||
<controls:HotkeySetting Label="Next"
|
||||
HotKey="{Binding NextAudio, Source={x:Static local:Settings.UserSettings.Default}, Mode=TwoWay}" />
|
||||
<controls:HotkeySetting Label="Remove"
|
||||
HotKey="{Binding RemoveAudio, Source={x:Static local:Settings.UserSettings.Default}, Mode=TwoWay}" />
|
||||
</StackPanel>
|
||||
|
||||
<Separator Grid.Row="6"
|
||||
Tag="EXPORT"
|
||||
Style="{StaticResource CustomSeparator}" />
|
||||
|
||||
<Grid Grid.Row="7"
|
||||
HorizontalAlignment="Stretch"
|
||||
Margin="15,0">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="*" />
|
||||
<ColumnDefinition Width="45" />
|
||||
<ColumnDefinition Width="*" />
|
||||
</Grid.ColumnDefinitions>
|
||||
|
||||
<StackPanel Grid.Column="0">
|
||||
<controls:HotkeySetting Label="Raw Data"
|
||||
HotKey="{Binding ExportData, Source={x:Static local:Settings.UserSettings.Default}, Mode=TwoWay}" />
|
||||
<controls:HotkeySetting Label="Properties"
|
||||
HotKey="{Binding ExportProperties, Source={x:Static local:Settings.UserSettings.Default}, Mode=TwoWay}" />
|
||||
<controls:HotkeySetting Label="Textures"
|
||||
HotKey="{Binding ExportTextures, Source={x:Static local:Settings.UserSettings.Default}, Mode=TwoWay}" />
|
||||
<controls:HotkeySetting Label="Models"
|
||||
HotKey="{Binding ExportModels, Source={x:Static local:Settings.UserSettings.Default}, Mode=TwoWay}" />
|
||||
</StackPanel>
|
||||
|
||||
<StackPanel Grid.Column="2">
|
||||
<controls:HotkeySetting Label="Worlds"
|
||||
HotKey="{Binding ExportWorlds, Source={x:Static local:Settings.UserSettings.Default}, Mode=TwoWay}" />
|
||||
<controls:HotkeySetting Label="Animations"
|
||||
HotKey="{Binding ExportAnimations, Source={x:Static local:Settings.UserSettings.Default}, Mode=TwoWay}" />
|
||||
<controls:HotkeySetting Label="Audio"
|
||||
HotKey="{Binding ExportAudio, Source={x:Static local:Settings.UserSettings.Default}, Mode=TwoWay}" />
|
||||
<controls:HotkeySetting Label="Code"
|
||||
HotKey="{Binding ExportCode, Source={x:Static local:Settings.UserSettings.Default}, Mode=TwoWay}" />
|
||||
</StackPanel>
|
||||
</Grid>
|
||||
<TextBlock Grid.Row="18" Grid.Column="0" Text="Add Audio File" VerticalAlignment="Center" Margin="0 0 0 5" />
|
||||
<controls:HotkeyTextBox Grid.Row="18" Grid.Column="2" Style="{StaticResource TextBoxDefaultStyle}" Margin="0 0 0 5"
|
||||
HotKey="{Binding AddAudio, Source={x:Static local:Settings.UserSettings.Default}, Mode=TwoWay}" />
|
||||
<TextBlock Grid.Row="19" Grid.Column="0" Text="Play / Pause Current Audio" VerticalAlignment="Center" Margin="0 0 0 5" />
|
||||
<controls:HotkeyTextBox Grid.Row="19" Grid.Column="2" Style="{StaticResource TextBoxDefaultStyle}" Margin="0 0 0 5"
|
||||
HotKey="{Binding PlayPauseAudio, Source={x:Static local:Settings.UserSettings.Default}, Mode=TwoWay}" />
|
||||
<TextBlock Grid.Row="20" Grid.Column="0" Text="Previous Audio" VerticalAlignment="Center" Margin="0 0 0 5" />
|
||||
<controls:HotkeyTextBox Grid.Row="20" Grid.Column="2" Style="{StaticResource TextBoxDefaultStyle}" Margin="0 0 0 5"
|
||||
HotKey="{Binding PreviousAudio, Source={x:Static local:Settings.UserSettings.Default}, Mode=TwoWay}" />
|
||||
<TextBlock Grid.Row="21" Grid.Column="0" Text="Next Audio" VerticalAlignment="Center" Margin="0 0 0 5" />
|
||||
<controls:HotkeyTextBox Grid.Row="21" Grid.Column="2" Style="{StaticResource TextBoxDefaultStyle}" Margin="0 0 0 5"
|
||||
HotKey="{Binding NextAudio, Source={x:Static local:Settings.UserSettings.Default}, Mode=TwoWay}" />
|
||||
<TextBlock Grid.Row="22" Grid.Column="0" Text="Remove Selected Audio" VerticalAlignment="Center" Margin="0 0 0 5" />
|
||||
<controls:HotkeyTextBox Grid.Row="22" Grid.Column="2" Style="{StaticResource TextBoxDefaultStyle}" Margin="0 0 0 5"
|
||||
HotKey="{Binding RemoveAudio, Source={x:Static local:Settings.UserSettings.Default}, Mode=TwoWay}" />
|
||||
</Grid>
|
||||
</DataTemplate>
|
||||
<DataTemplate x:Key="UnluacTemplate">
|
||||
|
||||
Reference in New Issue
Block a user