From b3e36708d66f8a6db7e6ad339bbefc8005197eef Mon Sep 17 00:00:00 2001 From: iAmAsval Date: Mon, 14 Jun 2021 13:43:53 +0200 Subject: [PATCH] go upper folder --- FModel/MainWindow.xaml | 23 ++++++++++++++++--- FModel/ViewModels/Commands/MenuCommand.cs | 12 +++++++++- .../Resources/Controls/AvalonEditor.xaml.cs | 3 ++- FModel/Views/Resources/Controls/Breadcrumb.cs | 7 ------ FModel/Views/Resources/Resources.xaml | 1 + FModel/Views/SearchView.xaml.cs | 3 +++ 6 files changed, 37 insertions(+), 12 deletions(-) delete mode 100644 FModel/Views/Resources/Controls/Breadcrumb.cs diff --git a/FModel/MainWindow.xaml b/FModel/MainWindow.xaml index 3f76aa26..8a6590f6 100644 --- a/FModel/MainWindow.xaml +++ b/FModel/MainWindow.xaml @@ -435,9 +435,26 @@ - - + + + + + + + + + + + + diff --git a/FModel/ViewModels/Commands/MenuCommand.cs b/FModel/ViewModels/Commands/MenuCommand.cs index 237f386c..74fb15cf 100644 --- a/FModel/ViewModels/Commands/MenuCommand.cs +++ b/FModel/ViewModels/Commands/MenuCommand.cs @@ -1,5 +1,7 @@ using System.Diagnostics; +using System.Threading.Tasks; using AdonisUI.Controls; +using FModel.Extensions; using FModel.Framework; using FModel.Settings; using FModel.Views; @@ -13,7 +15,7 @@ namespace FModel.ViewModels.Commands { } - public override void Execute(ApplicationViewModel contextViewModel, object parameter) + public override async void Execute(ApplicationViewModel contextViewModel, object parameter) { switch (parameter) { @@ -59,6 +61,14 @@ namespace FModel.ViewModels.Commands case "ToolBox_Open_Output_Directory": Process.Start(new ProcessStartInfo {FileName = UserSettings.Default.OutputDirectory, UseShellExecute = true}); break; + case TreeItem selectedFolder: + MainWindow.YesWeCats.AssetsListName.ItemsSource = null; + var folder = contextViewModel.CustomDirectories.GoToCommand.JumpTo(selectedFolder.PathAtThisPoint.SubstringBeforeLast('/')); + if (folder == null) return; + + do { await Task.Delay(100); } while (MainWindow.YesWeCats.AssetsListName.Items.Count < folder.AssetsList.Assets.Count); + MainWindow.YesWeCats.LeftTabControl.SelectedIndex = 2; // assets tab + break; } } } diff --git a/FModel/Views/Resources/Controls/AvalonEditor.xaml.cs b/FModel/Views/Resources/Controls/AvalonEditor.xaml.cs index ce634d9a..f85f4b31 100644 --- a/FModel/Views/Resources/Controls/AvalonEditor.xaml.cs +++ b/FModel/Views/Resources/Controls/AvalonEditor.xaml.cs @@ -23,11 +23,12 @@ namespace FModel.Views.Resources.Controls public AvalonEditor() { - CommandBindings.Add(new CommandBinding(NavigationCommands.Search, (s, e) => FindNext(e.Parameter != null))); + CommandBindings.Add(new CommandBinding(NavigationCommands.Search, (_, e) => FindNext(e.Parameter != null))); InitializeComponent(); YesWeEditor = MyAvalonEditor; YesWeSearch = WpfSuckMyDick; + MyAvalonEditor.TextArea.TextView.ElementGenerators.Add(new GamePathElementGenerator()); MyAvalonEditor.TextArea.TextView.ElementGenerators.Add(new HexColorElementGenerator()); } diff --git a/FModel/Views/Resources/Controls/Breadcrumb.cs b/FModel/Views/Resources/Controls/Breadcrumb.cs deleted file mode 100644 index be60d037..00000000 --- a/FModel/Views/Resources/Controls/Breadcrumb.cs +++ /dev/null @@ -1,7 +0,0 @@ -namespace FModel.Views.Resources.Controls -{ - public class Breadcrumb - { - // https://trello.com/c/sUFv5fZM/63-breadcrumb-above-asset-list - } -} \ No newline at end of file diff --git a/FModel/Views/Resources/Resources.xaml b/FModel/Views/Resources/Resources.xaml index 387a134c..a85955f0 100644 --- a/FModel/Views/Resources/Resources.xaml +++ b/FModel/Views/Resources/Resources.xaml @@ -59,6 +59,7 @@ M10 12c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zM6 8c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm0 8c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm12-8c1.1 0 2-.9 2-2s-.9-2-2-2-2 .9-2 2 .9 2 2 2zm-4 8c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm4-4c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm-4-4c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm-4-4c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2z M12,17c-1.1,0-2-0.9-2-2s0.9-2,2-2s2,0.9,2,2S13.1,17,12,17z M17.95,14c-0.52,0-0.94,0.4-0.99,0.92 c-0.2,2.03-1.05,2.68-1.48,3.02C14.68,18.54,14,19,12,19s-2.68-0.46-3.48-1.06c-0.43-0.34-1.28-0.99-1.48-3.02 C6.99,14.4,6.57,14,6.05,14c-0.59,0-1.06,0.51-1,1.09c0.22,2.08,1.07,3.47,2.24,4.41c0.5,0.4,1.1,0.7,1.7,0.9L9,24h6v-3.6 c0.6-0.2,1.2-0.5,1.7-0.9c1.17-0.94,2.03-2.32,2.24-4.41C19.01,14.51,18.53,14,17.95,14z M12,0C5.92,0,1,1.9,1,4.25v3.49 C1,8.55,1.88,9,2.56,8.57C2.7,8.48,2.84,8.39,3,8.31L5,13h2l1.5-6.28C9.6,6.58,10.78,6.5,12,6.5s2.4,0.08,3.5,0.22L17,13h2l2-4.69 c0.16,0.09,0.3,0.17,0.44,0.26C22.12,9,23,8.55,23,7.74V4.25C23,1.9,18.08,0,12,0z M5.88,11.24L4.37,7.69 c0.75-0.28,1.6-0.52,2.53-0.71L5.88,11.24z M18.12,11.24L17.1,6.98c0.93,0.19,1.78,0.43,2.53,0.71L18.12,11.24z M13,9V7.82C14.16,7.4,15,6.3,15,5c0-1.65-1.35-3-3-3S9,3.35,9,5c0,1.3,0.84,2.4,2,2.82V9H9c-0.55,0-1,0.45-1,1v0 c0,0.55,0.45,1,1,1h2v8.92c-2.22-0.33-4.59-1.68-5.55-3.37l1.14-1.14c0.22-0.22,0.19-0.57-0.05-0.75L3.8,12.6 C3.47,12.35,3,12.59,3,13v2c0,3.88,4.92,7,9,7s9-3.12,9-7v-2c0-0.41-0.47-0.65-0.8-0.4l-2.74,2.05c-0.24,0.18-0.27,0.54-0.05,0.75 l1.14,1.14c-0.96,1.69-3.33,3.04-5.55,3.37V11h2c0.55,0,1-0.45,1-1v0c0-0.55-0.45-1-1-1H13z M12,4c0.55,0,1,0.45,1,1s-0.45,1-1,1 s-1-0.45-1-1S11.45,4,12,4z + M19 11H7.83l4.88-4.88c.39-.39.39-1.03 0-1.42-.39-.39-1.02-.39-1.41 0l-6.59 6.59c-.39.39-.39 1.02 0 1.41l6.59 6.59c.39.39 1.02.39 1.41 0 .39-.39.39-1.02 0-1.41L7.83 13H19c.55 0 1-.45 1-1s-.45-1-1-1z