fix some GameOpened bugs
This commit is contained in:
parent
cb60ed7773
commit
d68a48d78b
|
|
@ -295,13 +295,11 @@ namespace NovetusLauncher
|
||||||
{
|
{
|
||||||
switch (GlobalVars.GameOpened)
|
switch (GlobalVars.GameOpened)
|
||||||
{
|
{
|
||||||
case ScriptType.Client:
|
|
||||||
ShowCloseError("A game is open.", "Game", e);
|
|
||||||
break;
|
|
||||||
case ScriptType.Server:
|
case ScriptType.Server:
|
||||||
ShowCloseError("A server is open.", "Server", e);
|
ShowCloseError("A server is open.", "Server", e);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
|
ShowCloseError("A game is open.", "Game", e);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -797,6 +795,12 @@ namespace NovetusLauncher
|
||||||
if (LocalVars.launcherInitState)
|
if (LocalVars.launcherInitState)
|
||||||
return;
|
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)
|
switch (StyleSelectorBox.SelectedIndex)
|
||||||
{
|
{
|
||||||
case 0:
|
case 0:
|
||||||
|
|
@ -1205,12 +1209,6 @@ namespace NovetusLauncher
|
||||||
|
|
||||||
public void ChangeClient()
|
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)
|
if (ClientBox.Items.Count == 0)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
|
@ -1230,6 +1228,13 @@ namespace NovetusLauncher
|
||||||
return;
|
return;
|
||||||
|
|
||||||
string ourselectedclient = GlobalVars.UserConfiguration.SelectedClient;
|
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();
|
GlobalVars.UserConfiguration.SelectedClient = ClientBox.SelectedItem.ToString();
|
||||||
|
|
||||||
if (!string.IsNullOrWhiteSpace(ourselectedclient))
|
if (!string.IsNullOrWhiteSpace(ourselectedclient))
|
||||||
|
|
|
||||||
|
|
@ -129,12 +129,6 @@ namespace NovetusLauncher
|
||||||
if (!IsLoaded)
|
if (!IsLoaded)
|
||||||
return;
|
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)
|
if (clientListBox.Items.Count == 0)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
|
@ -154,8 +148,14 @@ namespace NovetusLauncher
|
||||||
return;
|
return;
|
||||||
|
|
||||||
string ourselectedclient = GlobalVars.UserConfiguration.SelectedClient;
|
string ourselectedclient = GlobalVars.UserConfiguration.SelectedClient;
|
||||||
|
|
||||||
ClientListItem cli = (ClientListItem)clientListBox.SelectedItem ?? null;
|
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() : "";
|
GlobalVars.UserConfiguration.SelectedClient = (cli != null) ? cli.ToString() : "";
|
||||||
|
|
||||||
if (!string.IsNullOrWhiteSpace(ourselectedclient))
|
if (!string.IsNullOrWhiteSpace(ourselectedclient))
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue