From 60f19d73f9c0d36d1dad7e5881cc15457184368a Mon Sep 17 00:00:00 2001 From: shananas Date: Sun, 12 Jan 2025 22:23:12 -0500 Subject: [PATCH 1/3] Move `panacea_settings.txt` creation into the Install/Remove Panacea Methods instead of clicking finish on the Mod Mnaggaer Wizard --- .../ViewModels/MainViewModel.cs | 24 +------------------ .../ViewModels/SetupWizardViewModel.cs | 22 +++++++++++++++++ 2 files changed, 23 insertions(+), 23 deletions(-) diff --git a/OpenKh.Tools.ModsManager/ViewModels/MainViewModel.cs b/OpenKh.Tools.ModsManager/ViewModels/MainViewModel.cs index c29f9366a..4b665d09d 100644 --- a/OpenKh.Tools.ModsManager/ViewModels/MainViewModel.cs +++ b/OpenKh.Tools.ModsManager/ViewModels/MainViewModel.cs @@ -492,29 +492,7 @@ await ModsService.InstallMod(name, isZipFile, isLuaFile, progress => ConfigurationService.PcReleaseLocationKH3D = dialog.ConfigPcReleaseLocationKH3D; ConfigurationService.RegionId = dialog.ConfigRegionId; ConfigurationService.PanaceaInstalled = dialog.ConfigPanaceaInstalled; - ConfigurationService.WizardVersionNumber = _wizardVersionNumber; - - const int EpicGamesPC = 2; - if (ConfigurationService.GameEdition == EpicGamesPC && - Directory.Exists(ConfigurationService.PcReleaseLocation)) - { - File.WriteAllLines(Path.Combine(ConfigurationService.PcReleaseLocation, "panacea_settings.txt"), - new string[] - { - $"mod_path={ConfigurationService.GameModPath}", - $"show_console={false}", - }); - } - if (ConfigurationService.GameEdition == EpicGamesPC && - Directory.Exists(ConfigurationService.PcReleaseLocationKH3D)) - { - File.WriteAllLines(Path.Combine(ConfigurationService.PcReleaseLocationKH3D, "panacea_settings.txt"), - new string[] - { - $"mod_path={ConfigurationService.GameModPath}", - $"show_console={false}", - }); - } + ConfigurationService.WizardVersionNumber = _wizardVersionNumber; if (ConfigurationService.GameEdition == 2) { PC = true; diff --git a/OpenKh.Tools.ModsManager/ViewModels/SetupWizardViewModel.cs b/OpenKh.Tools.ModsManager/ViewModels/SetupWizardViewModel.cs index 043033989..c554255bc 100644 --- a/OpenKh.Tools.ModsManager/ViewModels/SetupWizardViewModel.cs +++ b/OpenKh.Tools.ModsManager/ViewModels/SetupWizardViewModel.cs @@ -888,6 +888,24 @@ public SetupWizardViewModel() File.Copy(PanaceaSourceLocation, PanaceaAlternateLocation, true); File.Delete(PanaceaDestinationLocation); } + if (Directory.Exists(ConfigurationService.PcReleaseLocation)) + { + File.WriteAllLines(Path.Combine(ConfigurationService.PcReleaseLocation, "panacea_settings.txt"), + new string[] + { + $"mod_path={ConfigurationService.GameModPath}", + $"show_console={false}", + }); + } + if (Directory.Exists(ConfigurationService.PcReleaseLocationKH3D)) + { + File.WriteAllLines(Path.Combine(ConfigurationService.PcReleaseLocationKH3D, "panacea_settings.txt"), + new string[] + { + $"mod_path={ConfigurationService.GameModPath}", + $"show_console={false}", + }); + } try { File.Copy(Path.Combine(AppContext.BaseDirectory, "avcodec-vgmstream-59.dll"), Path.Combine(PanaceaDependenciesLocation, "avcodec-vgmstream-59.dll"), true); @@ -926,6 +944,8 @@ public SetupWizardViewModel() File.Delete(Path.Combine(PanaceaDependenciesLocation, "libspeex-1.dll")); File.Delete(Path.Combine(PanaceaDependenciesLocation, "libvorbis.dll")); File.Delete(Path.Combine(PanaceaDependenciesLocation, "swresample-vgmstream-4.dll")); + File.Delete(Path.Combine(ConfigurationService.PcReleaseLocation, "panacea_settings.txt")); + File.Delete(Path.Combine(ConfigurationService.PcReleaseLocationKH3D, "panacea_settings.txt")); PanaceaInstalled = false; return; } @@ -978,6 +998,8 @@ public SetupWizardViewModel() File.Delete(Path.Combine(PanaceaDependenciesLocation, "libspeex-1.dll")); File.Delete(Path.Combine(PanaceaDependenciesLocation, "libvorbis.dll")); File.Delete(Path.Combine(PanaceaDependenciesLocation, "swresample-vgmstream-4.dll")); + File.Delete(Path.Combine(ConfigurationService.PcReleaseLocation, "panacea_settings.txt")); + File.Delete(Path.Combine(ConfigurationService.PcReleaseLocationKH3D, "panacea_settings.txt")); } OnPropertyChanged(nameof(IsLastPanaceaVersionInstalled)); OnPropertyChanged(nameof(PanaceaInstalledVisibility)); From 71888016d7cb2b00c58f10fe9abec9e59e96f9be Mon Sep 17 00:00:00 2001 From: shananas Date: Mon, 13 Jan 2025 02:53:31 -0500 Subject: [PATCH 2/3] Fix incorrect warnings When doing an internal copy if said file was missing it would incorrectly state the `assetFile.name` was missing whe in reality the `assetFile.Source[0].Name` was missing --- OpenKh.Patcher/PatcherProcessor.cs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/OpenKh.Patcher/PatcherProcessor.cs b/OpenKh.Patcher/PatcherProcessor.cs index e84a34dd7..199f6bbb1 100644 --- a/OpenKh.Patcher/PatcherProcessor.cs +++ b/OpenKh.Patcher/PatcherProcessor.cs @@ -291,22 +291,22 @@ public void Patch( { if (Language != "jp") { - if (!context.GetOriginalAssetPath(name).Contains(".a.fm") && !context.GetOriginalAssetPath(name).Contains("/jp/")) + if (!context.GetOriginalAssetPath(assetFile.Source[0].Name).Contains(".a.fm") && !context.GetOriginalAssetPath(assetFile.Source[0].Name).Contains("/jp/")) { - Log.Warn("File not found: " + context.GetOriginalAssetPath(name) + " Skipping. \nPlease check your game extraction."); + Log.Warn("File not found: " + context.GetOriginalAssetPath(assetFile.Source[0].Name) + " Skipping. \nPlease check your game extraction."); } } else { - if (!globalFilePaths.Any(x => context.GetOriginalAssetPath(name).Contains(x))) + if (!globalFilePaths.Any(x => context.GetOriginalAssetPath(assetFile.Source[0].Name).Contains(x))) { - Log.Warn("File not found: " + context.GetOriginalAssetPath(name) + " Skipping. \nPlease check your game extraction."); + Log.Warn("File not found: " + context.GetOriginalAssetPath(assetFile.Source[0].Name) + " Skipping. \nPlease check your game extraction."); } } } else { - Log.Warn("File not found: " + context.GetOriginalAssetPath(name) + " Skipping. \nPlease check your game extraction."); + Log.Warn("File not found: " + context.GetOriginalAssetPath(assetFile.Source[0].Name) + " Skipping. \nPlease check your game extraction."); } } else From 3c33554c8193daf7bb39fa5e55cfb511310893a0 Mon Sep 17 00:00:00 2001 From: shananas Date: Mon, 13 Jan 2025 03:14:24 -0500 Subject: [PATCH 3/3] Make default postion middle of a 1920 x 1080 screen Numbers are low enough it wont be off the screen for anyone but also wont be in the top right as the default. Still saves where you moved it to and will load it there in the future --- OpenKh.Tools.ModsManager/App.config | 4 ++-- OpenKh.Tools.ModsManager/WinSettings.Designer.cs | 8 ++++---- OpenKh.Tools.ModsManager/WinSettings.settings | 4 ++-- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/OpenKh.Tools.ModsManager/App.config b/OpenKh.Tools.ModsManager/App.config index afdeab31d..263404723 100644 --- a/OpenKh.Tools.ModsManager/App.config +++ b/OpenKh.Tools.ModsManager/App.config @@ -8,7 +8,7 @@ - 0 + 320 660 @@ -17,7 +17,7 @@ 450 - 0 + 640 False diff --git a/OpenKh.Tools.ModsManager/WinSettings.Designer.cs b/OpenKh.Tools.ModsManager/WinSettings.Designer.cs index 275f3b433..60a46a1e8 100644 --- a/OpenKh.Tools.ModsManager/WinSettings.Designer.cs +++ b/OpenKh.Tools.ModsManager/WinSettings.Designer.cs @@ -1,4 +1,4 @@ -//------------------------------------------------------------------------------ +//------------------------------------------------------------------------------ // // This code was generated by a tool. // Runtime Version:4.0.30319.42000 @@ -12,7 +12,7 @@ namespace OpenKh.Tools.ModsManager { [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "17.7.0.0")] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "17.12.0.0")] internal sealed partial class WinSettings : global::System.Configuration.ApplicationSettingsBase { private static WinSettings defaultInstance = ((WinSettings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new WinSettings()))); @@ -25,7 +25,7 @@ public static WinSettings Default { [global::System.Configuration.UserScopedSettingAttribute()] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.Configuration.DefaultSettingValueAttribute("0")] + [global::System.Configuration.DefaultSettingValueAttribute("320")] public double Top { get { return ((double)(this["Top"])); @@ -61,7 +61,7 @@ public double Height { [global::System.Configuration.UserScopedSettingAttribute()] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.Configuration.DefaultSettingValueAttribute("0")] + [global::System.Configuration.DefaultSettingValueAttribute("640")] public double Left { get { return ((double)(this["Left"])); diff --git a/OpenKh.Tools.ModsManager/WinSettings.settings b/OpenKh.Tools.ModsManager/WinSettings.settings index a351c2b32..69ad13e11 100644 --- a/OpenKh.Tools.ModsManager/WinSettings.settings +++ b/OpenKh.Tools.ModsManager/WinSettings.settings @@ -3,7 +3,7 @@ - 0 + 320 660 @@ -12,7 +12,7 @@ 450 - 0 + 640 False