コード例 #1
0
        private void SetInfoBarControls()
        {
            //Settings button
            TopStatusBarInstance.MenuButtonInstanceClick        += OnMenuButtonClick;
            TopStatusBarInstance.PauseButtonInstanceClick       += OnPauseButtonClick;
            TopStatusBarInstance.PlayButtonInstanceClick        += OnPlayButtonClick;
            TopStatusBarInstance.FastForwardButtonInstanceClick += OnFastForwardButtonClick;

            MenuWindowInstance.AssignEventToCloseButton(OnMenuCloseButtonClick);
            MenuWindowInstance.AssignEventToButton1((window) =>
                                                    ConfirmationWindowInstance.Confirm("Quit level and lose current progress?", () =>
            {
                AnalyticsManager.FlushDeferredEvents();
                LoadingScreen.TransitionToScreen(typeof(MapScreen));
            })
                                                    );
            MenuWindowInstance.ButtonType2State = ButtonFrameRuntime.ButtonType.Restart;
            MenuWindowInstance.AssignEventToButton2((window) =>
                                                    ConfirmationWindowInstance.Confirm("Restart level and lose current progress?", () =>
            {
                RestartLevel(window);
            })
                                                    );

            if (CurrentLevel.MapName != "Chapter1")
            {
                //MenuWindowInstance.ButtonType3State = ButtonFrameRuntime.ButtonType.History;
                //MenuWindowInstance.AssignEventToButton3(window =>
                //{
                //    ChatHistoryInstance.PopulateWithAllChatHistory();
                //    ChatHistoryInstance.Visible = true;
                //    ChatHistoryInstance.CloseButtonClick = (sender, args) => ChatHistoryInstance.Visible = false;
                //});
            }
        }
コード例 #2
0
 private void OnMenuButtonClick(IWindow window)
 {
     MenuWindowInstance.RefreshOptions();
     MenuWindowInstance.Visible  = true;
     ScreenShadeInstance.Visible = true;
     if (!IsPaused)
     {
         PauseThisScreen();
     }
     TopStatusBarInstance.PauseForMenu(IsPaused);
 }
コード例 #3
0
        private void ShowMenu(IWindow window)
        {
            if (TowerSelectionBoxInstance.Visible)
            {
                return;
            }

            MenuWindowInstance.RefreshOptions();

            MapScreenGumInstance.ShowMenuAnimation.Play(this);
            //this.Call(() =>MenuWindowInstance.RefreshOptions()).After(MapScreenGumInstance.ShowMenuAnimation.Length + 0.001f);
        }
コード例 #4
0
        private void HandleKeyboardInput()
        {
            if (TowerSelectionBoxInstance.Visible)
            {
                return;
            }

            if (InputManager.Keyboard.KeyPushed(Keys.Escape))
            {
                if (MenuWindowInstance.Visible)
                {
                    MenuWindowInstance.SimulateCloseButtonClick();
                }
                else
                {
                    ShowMenu(null);
                }
            }
        }