/// <summary> /// Changes the game lobby's UI depending on whether the local player is the host. /// </summary> /// <param name="isHost">Determines whether the local player is the host of the game.</param> protected void Refresh(bool isHost) { IsHost = isHost; switched = false; Locked = false; MapPreviewBox.EnableContextMenu = IsHost; btnLaunchGame.Text = IsHost ? "Launch Game" : "I'm Ready"; if (IsHost) { ShowMapList(); btnLockGame.Text = "Lock Game"; btnLockGame.Enabled = true; btnLockGame.Visible = true; foreach (GameLobbyDropDown dd in DropDowns) { dd.InputEnabled = true; } foreach (GameLobbyCheckBox checkBox in CheckBoxes) { checkBox.InputEnabled = true; } GenerateGameID(); } else { HideMapList(); btnLockGame.Enabled = false; btnLockGame.Visible = false; foreach (GameLobbyDropDown dd in DropDowns) { dd.InputEnabled = false; } foreach (GameLobbyCheckBox checkBox in CheckBoxes) { checkBox.InputEnabled = false; } } LoadDefaultMap(); lbChatMessages.Clear(); lbChatMessages.TopIndex = 0; if (SavedGameManager.GetSaveGameCount() > 0) { lbChatMessages.AddItem("Multiplayer saved games from a previous match have been detected. " + "The saved games of the previous match will be deleted if you create new saves during this match.", Color.Yellow, true); } }
/// <summary> /// Changes the game lobby's UI depending on whether the local player is the host. /// </summary> /// <param name="isHost">Determines whether the local player is the host of the game.</param> protected void Refresh(bool isHost) { IsHost = isHost; Locked = false; UpdateMapPreviewBoxEnabledStatus(); //MapPreviewBox.EnableContextMenu = IsHost; btnLaunchGame.Text = IsHost ? "Launch Game" : "I'm Ready"; if (IsHost) { ShowMapList(); btnLockGame.Text = "Lock Game"; btnLockGame.Enabled = true; btnLockGame.Visible = true; chkAutoReady.Disable(); foreach (GameLobbyDropDown dd in DropDowns) { dd.InputEnabled = true; dd.SelectedIndex = dd.UserDefinedIndex; } foreach (GameLobbyCheckBox checkBox in CheckBoxes) { checkBox.AllowChanges = true; checkBox.Checked = checkBox.UserDefinedValue; } GenerateGameID(); } else { HideMapList(); btnLockGame.Enabled = false; btnLockGame.Visible = false; chkAutoReady.GetAttributes(ThemeIni); foreach (GameLobbyDropDown dd in DropDowns) { dd.InputEnabled = false; } foreach (GameLobbyCheckBox checkBox in CheckBoxes) { checkBox.AllowChanges = false; } } LoadDefaultMap(); lbChatMessages.Clear(); lbChatMessages.TopIndex = 0; lbChatMessages.AddItem("Type / to view a list of available chat commands.", Color.Silver, true); if (SavedGameManager.GetSaveGameCount() > 0) { lbChatMessages.AddItem("Multiplayer saved games from a previous match have been detected. " + "The saved games of the previous match will be deleted if you create new saves during this match.", Color.Yellow, true); } }