diff --git a/OpenKh.Tools.ModsManager/Services/ConfigurationService.cs b/OpenKh.Tools.ModsManager/Services/ConfigurationService.cs index 42ac15b43..308703d7b 100644 --- a/OpenKh.Tools.ModsManager/Services/ConfigurationService.cs +++ b/OpenKh.Tools.ModsManager/Services/ConfigurationService.cs @@ -40,6 +40,7 @@ private class Config public bool PanaceaInstalled { get; internal set; } public bool ShowConsole { get; internal set; } = false; public bool DebugLog { get; internal set; } = false; + public bool SoundDebug { get; internal set; } = false; public bool EnableCache { get; internal set; } = true; public bool QuickMenu { get; internal set; } = false; public bool DevView { get; internal set; } = false; @@ -316,6 +317,15 @@ public static bool DebugLog _config.Save(ConfigPath); } } + public static bool SoundDebug + { + get => _config.SoundDebug; + set + { + _config.SoundDebug = value; + _config.Save(ConfigPath); + } + } public static bool EnableCache { get => _config.EnableCache; diff --git a/OpenKh.Tools.ModsManager/ViewModels/MainViewModel.cs b/OpenKh.Tools.ModsManager/ViewModels/MainViewModel.cs index a65c4543a..2ebbbccf0 100644 --- a/OpenKh.Tools.ModsManager/ViewModels/MainViewModel.cs +++ b/OpenKh.Tools.ModsManager/ViewModels/MainViewModel.cs @@ -41,6 +41,7 @@ public class MainViewModel : BaseNotifyPropertyChanged, IChangeModEnableState private bool _panaceaInstalled; private bool _panaceaConsoleEnabled; private bool _panaceaDebugLogEnabled; + private bool _panaceaSoundDebugEnabled; private bool _panaceaCacheEnabled; private bool _panaceaQuickMenuEnabled; private bool _devView; @@ -142,10 +143,24 @@ public bool PanaceaDebugLogEnabled { _panaceaDebugLogEnabled = value; ConfigurationService.DebugLog = _panaceaDebugLogEnabled; + if (_panaceaSoundDebugEnabled) + PanaceaSoundDebugEnabled = false; OnPropertyChanged(nameof(PanaceaDebugLogEnabled)); UpdatePanaceaSettings(); } } + public bool PanaceaSoundDebugEnabled + { + get => _panaceaSoundDebugEnabled; + set + { + _panaceaSoundDebugEnabled = value; + ConfigurationService.SoundDebug = _panaceaSoundDebugEnabled; + OnPropertyChanged(nameof(PanaceaSoundDebugEnabled)); + UpdatePanaceaSettings(); + } + + } public bool PanaceaCacheEnabled { get => _panaceaCacheEnabled; @@ -299,6 +314,7 @@ public MainViewModel() DevView = ConfigurationService.DevView; _panaceaConsoleEnabled = ConfigurationService.ShowConsole; _panaceaDebugLogEnabled = ConfigurationService.DebugLog; + _panaceaSoundDebugEnabled = ConfigurationService.SoundDebug; _panaceaCacheEnabled = ConfigurationService.EnableCache; _panaceaQuickMenuEnabled = ConfigurationService.QuickMenu; } @@ -1274,7 +1290,8 @@ public void UpdatePanaceaSettings() } } textToWrite += $"\r\nshow_console={_panaceaConsoleEnabled}\r\n" + - $"debug_log={_panaceaDebugLogEnabled}\r\nenable_cache={_panaceaCacheEnabled}\r\nquick_menu={_panaceaQuickMenuEnabled}"; + $"debug_log={_panaceaDebugLogEnabled}\r\nsound_debug={_panaceaSoundDebugEnabled}\r\n" + + $"enable_cache={_panaceaCacheEnabled}\r\nquick_menu={_panaceaQuickMenuEnabled}"; File.WriteAllText(panaceaSettings, textToWrite); } else if (ConfigurationService.PcReleaseLocationKH3D != null) @@ -1291,7 +1308,8 @@ public void UpdatePanaceaSettings() } } textToWrite += $"\r\nshow_console={_panaceaConsoleEnabled}\r\n" + - $"debug_log={_panaceaDebugLogEnabled}\r\nenable_cache={_panaceaCacheEnabled}\r\nquick_menu={_panaceaQuickMenuEnabled}"; + $"debug_log={_panaceaDebugLogEnabled}\r\nsound_debug={_panaceaSoundDebugEnabled}\r\n" + + $"enable_cache={_panaceaCacheEnabled}\r\nquick_menu={_panaceaQuickMenuEnabled}"; File.WriteAllText(panaceaSettings, textToWrite); } } diff --git a/OpenKh.Tools.ModsManager/Views/MainWindow.xaml b/OpenKh.Tools.ModsManager/Views/MainWindow.xaml index 4cc6e2522..c4a5bff6f 100644 --- a/OpenKh.Tools.ModsManager/Views/MainWindow.xaml +++ b/OpenKh.Tools.ModsManager/Views/MainWindow.xaml @@ -91,6 +91,7 @@ +