Skip to content

Commit

Permalink
feat: add option to set game window title
Browse files Browse the repository at this point in the history
This option would set window title for game detection, which is useful for CN
client which title is "最终幻想XIV".
  • Loading branch information
jim-kirisame committed Sep 28, 2022
1 parent 6541095 commit 9e23c74
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 1 deletion.
8 changes: 7 additions & 1 deletion FFXIVMonReborn/MachinaCaptureWorker.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
15 changes: 15 additions & 0 deletions FFXIVMonReborn/Properties/Settings.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions FFXIVMonReborn/Views/MainWindow.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@
<Separator></Separator>
<MenuItem Header="_Set Repository" Click="SetRepository"/>
<MenuItem Header="_Set Game Path" Click="SetGamePath"/>
<MenuItem Header="_Set Game Window Name" Click="SetGameWindowName"/>
<Separator></Separator>
<MenuItem x:Name="SwitchModeSockets" Header="_Capture mode: Sockets" Click="SwitchModeSockets_OnClick"/>
<MenuItem x:Name="SwitchModePcap" Header="_Capture mode: WinPCap" Click="SwitchModePcap_OnClick"/>
Expand Down
7 changes: 7 additions & 0 deletions FFXIVMonReborn/Views/MainWindow.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down

0 comments on commit 9e23c74

Please sign in to comment.