/// <summary> /// Change settings of selected label. /// </summary> /// <param name="i_Sender">Key pressed.</param> protected override void changeSettings(Keys i_Sender) { if (ScreenMode.HasFlag(eScreenMode.Running)) { int changeDirection = 10; if (i_Sender.Equals(Keys.PageDown)) { changeDirection = -10; } switch (m_menuCollection.Selected) { case 0: m_gameSettings.MusicState = 1 - m_gameSettings.MusicState; break; case 1: m_gameSettings.BackgroundMusicVolume += changeDirection; break; case 2: m_gameSettings.SoundEffectsVolume += changeDirection; m_gameSettings_MusicVolumeChanged(); break; } if (m_menuCollection.Selected != 3) { playSound(); } } }
/// <summary> /// Change the setting of the selected label. /// </summary> /// <param name="i_Sender"></param> protected override void changeSettings(Keys i_Sender) { if (ScreenMode.HasFlag(eScreenMode.Running)) { switch (m_menuCollection.Selected) { case 0: m_gameSettings.WindowResizing = 1 - m_gameSettings.WindowResizing; m_menuCollection.GetMenuLabelAt(0).ChangeText(string.Format("Allow Window Resizing: {0}", m_gameSettings.WindowResizing)); break; case 1: m_gameSettings.FullScreen = 1 - m_gameSettings.FullScreen; m_menuCollection.GetMenuLabelAt(1).ChangeText(string.Format("Full Screen Mode: {0}", m_gameSettings.FullScreen)); break; case 2: m_gameSettings.MouseVisibilty = 1 - m_gameSettings.MouseVisibilty; m_menuCollection.GetMenuLabelAt(2).ChangeText(string.Format("Mouse Visability: {0}", m_gameSettings.MouseVisibilty)); break; } if (m_menuCollection.Selected != 3) { playSound(); } } }
/// <summary> /// Selected label were chosed. /// </summary> /// <param name="i_GameTime"></param> private void selectionChosed(GameTime i_GameTime) { if (ScreenMode.HasFlag(eScreenMode.Running)) { switch (m_menuCollection.Selected) { case 0: DisplaySettingsScreen displaySettings = new DisplaySettingsScreen(ScreensManager); ScreensManager.MoveTo(displaySettings); break; case 2: SoundSettingsScreen soundSettings = new SoundSettingsScreen(ScreensManager); ScreensManager.MoveTo(soundSettings); break; case 3: GameScreen startGame = StageScreen.GetStages(ScreensManager); ScreensManager.MoveTo(startGame); break; case 4: Close(); break; } if (m_menuCollection.Selected != 1) { playSound(); } } }
/// <summary> /// Selected change to be smaller by one. (cycly) /// </summary> private void selectedDecrease(GameTime i_GameTime) { if (ScreenMode.HasFlag(eScreenMode.Running)) { m_menuCollection.Selected = (m_menuCollection.Count + m_menuCollection.Selected - 1) % m_menuCollection.Count; playSound(); } }
/// <summary> /// Closing the screen. /// </summary> /// <param name="i_GameTime"></param> private void done(GameTime i_GameTime) { if (ScreenMode.HasFlag(eScreenMode.Running)) { if (m_menuCollection.Selected == 3) { playSound(); Close(); } } }
/// <summary> /// Toggle players amount Enum. /// </summary> /// <param name="i__GameTime"></param> private void togglePlayersAmount(GameTime i__GameTime) { if (ScreenMode.HasFlag(eScreenMode.Running)) { if (m_menuCollection.Selected == 1) { ScreensManager.GameSettings.PlayersAmount = 3 - ScreensManager.GameSettings.PlayersAmount; m_menuCollection.GetMenuLabelAt(1).ChangeText(string.Format("Players: {0}", ScreensManager.GameSettings.PlayersAmount.ToString())); playSound(); } } }