From 9e23c740b8272971c6c93f9f7e04fdf1d59aa228 Mon Sep 17 00:00:00 2001 From: Jim Jiang Date: Wed, 28 Sep 2022 16:58:33 +0800 Subject: [PATCH] feat: add option to set game window title MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This option would set window title for game detection, which is useful for CN client which title is "最终幻想XIV". --- FFXIVMonReborn/MachinaCaptureWorker.cs | 8 +++++++- FFXIVMonReborn/Properties/Settings.Designer.cs | 15 +++++++++++++++ FFXIVMonReborn/Views/MainWindow.xaml | 1 + FFXIVMonReborn/Views/MainWindow.xaml.cs | 7 +++++++ 4 files changed, 30 insertions(+), 1 deletion(-) diff --git a/FFXIVMonReborn/MachinaCaptureWorker.cs b/FFXIVMonReborn/MachinaCaptureWorker.cs index 56ce185..9fb0d8d 100644 --- a/FFXIVMonReborn/MachinaCaptureWorker.cs +++ b/FFXIVMonReborn/MachinaCaptureWorker.cs @@ -144,7 +144,13 @@ public void Run() // GamePath points to sqpack monitor.OodlePath = GetOodlePath(); - + + // Set game window name for CN/KO client. + if (!string.IsNullOrWhiteSpace(Settings.Default.GameWindowName)) + { + monitor.WindowName = Settings.Default.GameWindowName; + } + monitor.Start(); while (!_shouldStop) diff --git a/FFXIVMonReborn/Properties/Settings.Designer.cs b/FFXIVMonReborn/Properties/Settings.Designer.cs index b5fed96..93f7d19 100644 --- a/FFXIVMonReborn/Properties/Settings.Designer.cs +++ b/FFXIVMonReborn/Properties/Settings.Designer.cs @@ -47,6 +47,21 @@ public string GamePath { } } + [global::System.Configuration.UserScopedSettingAttribute()] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Configuration.DefaultSettingValueAttribute("")] + public string GameWindowName + { + get + { + return ((string)(this["GameWindowName"])); + } + set + { + this["GameWindowName"] = value; + } + } + [global::System.Configuration.UserScopedSettingAttribute()] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.Configuration.DefaultSettingValueAttribute("255, 198, 95")] diff --git a/FFXIVMonReborn/Views/MainWindow.xaml b/FFXIVMonReborn/Views/MainWindow.xaml index afa74e0..4d8bb21 100644 --- a/FFXIVMonReborn/Views/MainWindow.xaml +++ b/FFXIVMonReborn/Views/MainWindow.xaml @@ -77,6 +77,7 @@ + diff --git a/FFXIVMonReborn/Views/MainWindow.xaml.cs b/FFXIVMonReborn/Views/MainWindow.xaml.cs index 6ba6e36..fa026b0 100644 --- a/FFXIVMonReborn/Views/MainWindow.xaml.cs +++ b/FFXIVMonReborn/Views/MainWindow.xaml.cs @@ -560,6 +560,13 @@ public void SetGamePath(object sender, RoutedEventArgs e) MessageBoxImage.Asterisk); } + public void SetGameWindowName(object sender, RoutedEventArgs e) + { + string name = Interaction.InputBox("Enter the window name of the game.\nYou should restart capture after change.", "FFXIVMon Reborn", Properties.Settings.Default.GameWindowName); + Properties.Settings.Default.GameWindowName = name; + Properties.Settings.Default.Save(); + } + private void LoadFFXIVReplayRelay(object sender, RoutedEventArgs e) { ((XivMonTab)MainTabControl.SelectedContent).LoadFfxivReplay();