コード例 #1
0
 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;
     }
 }
コード例 #2
0
 private void OnButtonPressed(Button button)
 {
     ButtonId buttonId = (ButtonId)button.id;
     switch (buttonId)
     {
         case ButtonId.Back:
             Finish();
             break;
     }
 }
コード例 #3
0
 private void CancelButtonDelegate(Button button)
 {
     if (m_delegate != null)
     {
         m_delegate(button);
     }
     else
     {
         OnCancel();
     }
 }
コード例 #4
0
 private void OnButtonPress(Button button)
 {
     ButtonId buttonId = (ButtonId)button.id;
     switch (buttonId)
     {
         case ButtonId.Cancel:
         {
             cancelCallback();
             break;
         }
     }
 }
コード例 #5
0
        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);
 }
コード例 #7
0
 protected virtual void OnConfirmButtonPress(Button button)
 {
     if (confirmButtonDelegate != null)
     {
         confirmButtonDelegate(button);
     }
 }
コード例 #8
0
 private void GameResultScreenButtonDelegate(Button button)
 {
     GameResultScreen.ButtonId buttonId = (GameResultScreen.ButtonId)button.id;
     switch (buttonId)
     {
         case GameResultScreen.ButtonId.Exit:
             Stop(ExitCode.Exit);
             break;
     }
 }
コード例 #9
0
        public void SetConfirmButton(Button button)
        {
            confirmButton = button;

            if (button != null)
            {
                confirmButtonDelegate = button.buttonDelegate;
                button.buttonDelegate = OnConfirmButtonPress;
            }
            else
            {
                confirmButtonDelegate = null;
            }
        }
コード例 #10
0
        public void SetCancelButton(Button button)
        {
            cancelButton = button;

            if (button != null)
            {
                cancelButtonDelegate = button.buttonDelegate;
                button.buttonDelegate = OnCancelButtonPress;
            }
            else
            {
                cancelButtonDelegate = null;
            }
        }
コード例 #11
0
 private void OnSettingsButtonPress(Button button)
 {
 }
コード例 #12
0
        private void OnItemSelected(Button button)
        {
            Hide();

            if (popupDelegate != null)
            {
                selectedIndex = button.id;
                popupDelegate(this);
            }
        }
コード例 #13
0
        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;
            }
        }
コード例 #14
0
 private void OnPauseScreenButtonPress(Button button)
 {
     PauseScreen.ButtonId buttonId = (PauseScreen.ButtonId)button.id;
     switch (buttonId)
     {
         case PauseScreen.ButtonId.Exit:
             Stop(ExitCode.Exit);
             break;
     }
 }
コード例 #15
0
        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;
                }
            }
        }
コード例 #16
0
 protected virtual void OnCancelButtonPress(Button button)
 {
     Finish();
     if (cancelButtonDelegate != null)
     {
         cancelButtonDelegate(button);
     }
 }
コード例 #17
0
 private void PlayersScreenButtonDelegate(Button button)
 {
     PlayersScreen.ButtonId buttonId = (PlayersScreen.ButtonId)button.id;
     switch (buttonId)
     {
         case PlayersScreen.ButtonId.Start:
             Stop(ExitCode.StartGame);
             break;
     }
 }
コード例 #18
0
 private void OnButtonPress(Button button)
 {
     NotifyPopupDelegate(button.id);
 }