private void MainMenuScreenButtonDelegate(Button button) { MainMenuScreen.ButtonId buttonId = (MainMenuScreen.ButtonId)button.id; switch (buttonId) { case MainMenuScreen.ButtonId.Play: Stop(ExitCode.SingleStart); break; case MainMenuScreen.ButtonId.Multiplayer: Stop(ExitCode.MultiplayerStart); break; case MainMenuScreen.ButtonId.DebugStartServer: Stop(ExitCode.DebugServerStart); break; case MainMenuScreen.ButtonId.DebugStartClient: Stop(ExitCode.DebugClientStart); break; case MainMenuScreen.ButtonId.Settings: StartNextScreen(new SettingsScreen(OnSettingsButtonPress)); break; case MainMenuScreen.ButtonId.Exit: Stop(ExitCode.Quit); break; case MainMenuScreen.ButtonId.Test: TestSomething(); break; } }
private void OnButtonPressed(Button button) { ButtonId buttonId = (ButtonId)button.id; switch (buttonId) { case ButtonId.Back: Finish(); break; } }
private void CancelButtonDelegate(Button button) { if (m_delegate != null) { m_delegate(button); } else { OnCancel(); } }
private void OnButtonPress(Button button) { ButtonId buttonId = (ButtonId)button.id; switch (buttonId) { case ButtonId.Cancel: { cancelCallback(); break; } } }
private void OnButtonPressed(Button button) { MultiplayerScreen.ButtonId buttonId = (MultiplayerScreen.ButtonId)button.id; switch (buttonId) { case MultiplayerScreen.ButtonId.Back: { Stop(ExitCode.Cancel); break; } case MultiplayerScreen.ButtonId.Create: { StopDiscovery(false); String hostName = CVars.sv_hostname.value; Scheme scheme = Application.Assets().LoadAsset<Scheme>("Content\\maps\\x.sch"); serverInfo = new ServerInfo(hostName); serverInfo.scheme = scheme; StartLobbyScreen(serverInfo, true); StartServer(); break; } case MultiplayerScreen.ButtonId.Join: { ServerInfo info = button.data as ServerInfo; Debug.Assert(info != null); serverInfo = info; StartClient(info.endPoint); break; } case MultiplayerScreen.ButtonId.Refresh: { StopDiscovery(false); StartDiscovery(); break; } } }
////////////////////////////////////////////////////////////////////////////// private void OnCancelButtonPressed(Button button) { StopPeer(); Stop(ExitCode.Cancel); }
protected virtual void OnConfirmButtonPress(Button button) { if (confirmButtonDelegate != null) { confirmButtonDelegate(button); } }
private void GameResultScreenButtonDelegate(Button button) { GameResultScreen.ButtonId buttonId = (GameResultScreen.ButtonId)button.id; switch (buttonId) { case GameResultScreen.ButtonId.Exit: Stop(ExitCode.Exit); break; } }
public void SetConfirmButton(Button button) { confirmButton = button; if (button != null) { confirmButtonDelegate = button.buttonDelegate; button.buttonDelegate = OnConfirmButtonPress; } else { confirmButtonDelegate = null; } }
public void SetCancelButton(Button button) { cancelButton = button; if (button != null) { cancelButtonDelegate = button.buttonDelegate; button.buttonDelegate = OnCancelButtonPress; } else { cancelButtonDelegate = null; } }
private void OnSettingsButtonPress(Button button) { }
private void OnItemSelected(Button button) { Hide(); if (popupDelegate != null) { selectedIndex = button.id; popupDelegate(this); } }
private void RoundResultScreenButtonDelegate(Button button) { RoundResultScreen.ButtonId buttonId = (RoundResultScreen.ButtonId)button.id; RoundResultScreen resultScreen = CurrentScreen() as RoundResultScreen; Debug.Assert(resultScreen != null); switch (buttonId) { case RoundResultScreen.ButtonId.Continue: RoundResultScreenAccepted(resultScreen); break; case RoundResultScreen.ButtonId.Exit: RoundResultScreenDismissed(resultScreen); break; } }
private void OnPauseScreenButtonPress(Button button) { PauseScreen.ButtonId buttonId = (PauseScreen.ButtonId)button.id; switch (buttonId) { case PauseScreen.ButtonId.Exit: Stop(ExitCode.Exit); break; } }
private void OnLobbyScreenButtonPressed(Button button) { MultiplayerLobbyScreen.ButtonId buttonId = (MultiplayerLobbyScreen.ButtonId)button.id; switch (buttonId) { case MultiplayerLobbyScreen.ButtonId.Start: { break; } case MultiplayerLobbyScreen.ButtonId.Back: { StopPeer(); break; } } }
protected virtual void OnCancelButtonPress(Button button) { Finish(); if (cancelButtonDelegate != null) { cancelButtonDelegate(button); } }
private void PlayersScreenButtonDelegate(Button button) { PlayersScreen.ButtonId buttonId = (PlayersScreen.ButtonId)button.id; switch (buttonId) { case PlayersScreen.ButtonId.Start: Stop(ExitCode.StartGame); break; } }
private void OnButtonPress(Button button) { NotifyPopupDelegate(button.id); }