示例#1
0
 private void BackToMainMenu(HUDListEntity.ListEntry item)
 {
     if (IsPaused)
     {
         this.TransitionOutAndSwitchScene(new MainMenuScene(Game));
     }
 }
示例#2
0
 private void BackToJoinScreen(HUDListEntity.ListEntry item)
 {
     if (IsPaused)
     {
         this.TransitionOutAndSwitchScene(new JoinScene(Game));
     }
 }
示例#3
0
 private void Rematch(HUDListEntity.ListEntry obj)
 {
     if (this.Game.CurrentGameMode.GameMode == GameMode.BigHerd)
     {
         this.TransitionOutAndSwitchScene(new BasicGameScene(this.Game));
     }
     else if (this.Game.CurrentGameMode.GameMode == GameMode.Waves)
     {
         this.TransitionOutAndSwitchScene(new RightToLeftGameScene(this.Game));
     }
 }
示例#4
0
 private void OnNewGame(HUDListEntity.ListEntry item)
 {
     if (Settings <GameSettings> .Value.ShowTutorial)
     {
         this.TransitionOutAndSwitchScene(new TutorialScene(Game, false));
     }
     else
     {
         this.TransitionOutAndSwitchScene(new GameModeScene(Game));
     }
 }
示例#5
0
        private void OnMasterVolume(HUDListEntity.ListEntry obj)
        {
            Settings <GameSettings> .Value.MasterVolume += 0.1f;

            if (Settings <GameSettings> .Value.MasterVolume > 1.05)
            {
                Settings <GameSettings> .Value.MasterVolume = 0f;
            }

            Settings <GameSettings> .Value.MasterVolume = MathHelper.Clamp(Settings <GameSettings> .Value.MasterVolume, 0, 1);
            Game.EngineComponents.Get <AudioManager>().LoadVolumeSettings();

            obj.Caption = $"Master: {GetPercentage(Settings<GameSettings>.Value.MasterVolume)}%";
        }
示例#6
0
        private void TogglePause(HUDListEntity.ListEntry item)
        {
            if (isInPauseAnimation || IsTransitioning)
            {
                return;
            }
            isInPauseAnimation = true;

            if (IsPaused)
            {
                Dispatcher.AddAnimation(Animation.Get(1, 0, 0.2f, false, (value) =>
                {
                    // [FOREACH PERFORMANCE] Should not allocate garbage
                    pauseOverlayComponents.ForEach(c => c.Opacity = value * 0.7f);
                    // [FOREACH PERFORMANCE] Should not allocate garbage
                    pauseTextOverlayComponents.ForEach(c => c.Opacity = value);
                }, EasingFunctions.CubicIn)).Then(() =>
                {
                    isInPauseAnimation    = false;
                    pauseMenuList.Enabled = false;
                    Game.EngineComponents.Get <AudioManager>().PlaySong("Audio\\gamePlay");
                    Unpause();
                });
            }
            else
            {
                Dispatcher.AddAnimation(Animation.Get(0, 1, 0.2f, false, (value) =>
                {
                    // [FOREACH PERFORMANCE] Should not allocate garbage (but capturing does)
                    pauseOverlayComponents.ForEach(c => c.Opacity = value * 0.7f);
                    // [FOREACH PERFORMANCE] Should not allocate garbage (but capturing does)
                    pauseTextOverlayComponents.ForEach(c => c.Opacity = value);
                }, EasingFunctions.CubicIn)).Then(() =>
                {
                    isInPauseAnimation    = false;
                    pauseMenuList.Enabled = true;
                    Game.EngineComponents.Get <AudioManager>().PlaySong("Audio\\elevator_music");
                    Pause();
                });
            }
        }
示例#7
0
 private void Rejoin(HUDListEntity.ListEntry obj)
 {
     this.TransitionOutAndSwitchScene(new JoinScene(Game));
 }
示例#8
0
 private void BackToMainMenu(HUDListEntity.ListEntry obj)
 {
     this.TransitionOutAndSwitchScene(new MainMenuScene(Game));
 }
示例#9
0
 private void OnGoToTutorial(HUDListEntity.ListEntry obj)
 {
     this.TransitionOutAndSwitchScene(new TutorialScene(Game, true));
 }
示例#10
0
 private void OnExit(HUDListEntity.ListEntry item)
 {
     Game.Exit();
 }
示例#11
0
        private void SaveAndBack(HUDListEntity.ListEntry item)
        {
            Settings <GameSettings> .Save();

            GoToMenuState(MenuState.MainMenu);
        }
示例#12
0
 private void OnNewGame(HUDListEntity.ListEntry item)
 {
     this.TransitionOutAndSwitchScene(new JoinScene(Game));
 }