From 4f69509d6d1639fbfdf8ae72124195e1dc4a9eaf Mon Sep 17 00:00:00 2001 From: Valentin Date: Mon, 24 May 2021 01:33:47 +0200 Subject: [PATCH] fixed custom dir --- CUE4Parse | 2 +- FModel/ViewModels/CUE4ParseViewModel.cs | 22 +++++++++---------- .../Commands/AddEditDirectoryCommand.cs | 3 ++- .../ViewModels/CustomDirectoriesViewModel.cs | 3 +-- FModel/Views/CustomDir.xaml | 2 +- FModel/Views/CustomDir.xaml.cs | 4 ++++ 6 files changed, 20 insertions(+), 16 deletions(-) diff --git a/CUE4Parse b/CUE4Parse index 560e867b..c2535e18 160000 --- a/CUE4Parse +++ b/CUE4Parse @@ -1 +1 @@ -Subproject commit 560e867bef0ef46640bda66458613dd0070a4809 +Subproject commit c2535e18b0dd26c8173c73ba26f58d0c55afc0b8 diff --git a/FModel/ViewModels/CUE4ParseViewModel.cs b/FModel/ViewModels/CUE4ParseViewModel.cs index 857bfa3c..2e168471 100644 --- a/FModel/ViewModels/CUE4ParseViewModel.cs +++ b/FModel/ViewModels/CUE4ParseViewModel.cs @@ -461,6 +461,17 @@ namespace FModel.ViewModels break; } + case "udic": + { + TabControl.SelectedTab.Image = null; + if (Provider.TryCreateReader(fullPath, out var archive)) + { + var header = new FDictionaryHeader(archive); + TabControl.SelectedTab.SetDocumentText(JsonConvert.SerializeObject(header, Formatting.Indented), bulkSave); + } + + break; + } case "png": case "jpg": { @@ -476,17 +487,6 @@ namespace FModel.ViewModels FLogger.AppendWarning(); FLogger.AppendText($"Export '{fullPath.SubstringAfterLast('/')}' and change its extension if you want it to be an installable font file", Constants.WHITE, true); break; - case "udic": - { - TabControl.SelectedTab.Image = null; - if (Provider.TryCreateReader(fullPath, out var archive)) - { - var header = new FDictionaryHeader(archive); - TabControl.SelectedTab.SetDocumentText(JsonConvert.SerializeObject(header, Formatting.Indented), bulkSave); - } - - break; - } case "ushaderbytecode": TabControl.SelectedTab.Image = null; break; diff --git a/FModel/ViewModels/Commands/AddEditDirectoryCommand.cs b/FModel/ViewModels/Commands/AddEditDirectoryCommand.cs index 4f864bcc..f09a3697 100644 --- a/FModel/ViewModels/Commands/AddEditDirectoryCommand.cs +++ b/FModel/ViewModels/Commands/AddEditDirectoryCommand.cs @@ -12,7 +12,8 @@ namespace FModel.ViewModels.Commands public override void Execute(CustomDirectoriesViewModel contextViewModel, object parameter) { - if (parameter is not CustomDirectory customDir) return; + if (parameter is not CustomDirectory customDir) + customDir = new CustomDirectory(); Helper.OpenWindow("Custom Directory", () => { diff --git a/FModel/ViewModels/CustomDirectoriesViewModel.cs b/FModel/ViewModels/CustomDirectoriesViewModel.cs index 25eb840a..c0659bfb 100644 --- a/FModel/ViewModels/CustomDirectoriesViewModel.cs +++ b/FModel/ViewModels/CustomDirectoriesViewModel.cs @@ -105,8 +105,7 @@ namespace FModel.ViewModels Icon = new Image {Source = new BitmapImage(new Uri("/FModel;component/Resources/add_directory.png", UriKind.Relative))}, HorizontalContentAlignment = HorizontalAlignment.Left, VerticalContentAlignment = VerticalAlignment.Center, - Command = AddEditDirectoryCommand, - CommandParameter = new CustomDirectory() + Command = AddEditDirectoryCommand }; yield return new Separator(); diff --git a/FModel/Views/CustomDir.xaml b/FModel/Views/CustomDir.xaml index d2bcc2c0..9f6ff9ad 100644 --- a/FModel/Views/CustomDir.xaml +++ b/FModel/Views/CustomDir.xaml @@ -41,7 +41,7 @@ - + diff --git a/FModel/Views/CustomDir.xaml.cs b/FModel/Views/CustomDir.xaml.cs index 2a5fc545..d27ee2fe 100644 --- a/FModel/Views/CustomDir.xaml.cs +++ b/FModel/Views/CustomDir.xaml.cs @@ -9,6 +9,10 @@ namespace FModel.Views { DataContext = customDir; InitializeComponent(); + + Activate(); + WpfSuckMyDick.Focus(); + WpfSuckMyDick.SelectAll(); } private void OnClick(object sender, RoutedEventArgs e)