diff --git a/Novetus/NovetusLauncher/Forms/LauncherForm/LauncherFormShared.cs b/Novetus/NovetusLauncher/Forms/LauncherForm/LauncherFormShared.cs index 73e98df..31e23e7 100644 --- a/Novetus/NovetusLauncher/Forms/LauncherForm/LauncherFormShared.cs +++ b/Novetus/NovetusLauncher/Forms/LauncherForm/LauncherFormShared.cs @@ -295,13 +295,11 @@ namespace NovetusLauncher { switch (GlobalVars.GameOpened) { - case ScriptType.Client: - ShowCloseError("A game is open.", "Game", e); - break; case ScriptType.Server: ShowCloseError("A server is open.", "Server", e); break; default: + ShowCloseError("A game is open.", "Game", e); break; } } @@ -797,6 +795,12 @@ namespace NovetusLauncher if (LocalVars.launcherInitState) return; + if (GlobalVars.GameOpened != ScriptType.None) + { + MessageBox.Show("You must close the currently open client before changing styles.", "Novetus - Client is Open Error", MessageBoxButtons.OK, MessageBoxIcon.Error); + return; + } + switch (StyleSelectorBox.SelectedIndex) { case 0: @@ -1205,12 +1209,6 @@ namespace NovetusLauncher public void ChangeClient() { - if (GlobalVars.GameOpened != ScriptType.None) - { - MessageBox.Show("You must close the currently open client before changing clients.", "Novetus - Client is Open Error", MessageBoxButtons.OK, MessageBoxIcon.Error); - return; - } - if (ClientBox.Items.Count == 0) return; @@ -1230,6 +1228,13 @@ namespace NovetusLauncher return; string ourselectedclient = GlobalVars.UserConfiguration.SelectedClient; + + if (GlobalVars.GameOpened != ScriptType.None && !ourselectedclient.Equals(ClientBox.SelectedItem.ToString())) + { + MessageBox.Show("You must close the currently open client before changing clients.", "Novetus - Client is Open Error", MessageBoxButtons.OK, MessageBoxIcon.Error); + return; + } + GlobalVars.UserConfiguration.SelectedClient = ClientBox.SelectedItem.ToString(); if (!string.IsNullOrWhiteSpace(ourselectedclient)) diff --git a/Novetus/NovetusLauncher/Forms/LauncherForm/Stylish/LauncherFormStylishInterface.xaml.cs b/Novetus/NovetusLauncher/Forms/LauncherForm/Stylish/LauncherFormStylishInterface.xaml.cs index 96d51eb..3f44270 100644 --- a/Novetus/NovetusLauncher/Forms/LauncherForm/Stylish/LauncherFormStylishInterface.xaml.cs +++ b/Novetus/NovetusLauncher/Forms/LauncherForm/Stylish/LauncherFormStylishInterface.xaml.cs @@ -129,12 +129,6 @@ namespace NovetusLauncher if (!IsLoaded) return; - if (GlobalVars.GameOpened != ScriptType.None) - { - System.Windows.Forms.MessageBox.Show("You must close the currently open client before changing clients.", "Novetus - Client is Open Error", MessageBoxButtons.OK, MessageBoxIcon.Error); - return; - } - if (clientListBox.Items.Count == 0) return; @@ -154,8 +148,14 @@ namespace NovetusLauncher return; string ourselectedclient = GlobalVars.UserConfiguration.SelectedClient; - ClientListItem cli = (ClientListItem)clientListBox.SelectedItem ?? null; + + if (GlobalVars.GameOpened != ScriptType.None && !ourselectedclient.Equals(cli.ToString())) + { + System.Windows.Forms.MessageBox.Show("You must close the currently open client before changing clients.", "Novetus - Client is Open Error", MessageBoxButtons.OK, MessageBoxIcon.Error); + return; + } + GlobalVars.UserConfiguration.SelectedClient = (cli != null) ? cli.ToString() : ""; if (!string.IsNullOrWhiteSpace(ourselectedclient))