Пример #1
0
        private void createNumOfPlayersMenuItem(int i_NumberOfPlayers)
        {
            MultipleSelectionMenuItem multipleSelectionCreatedItem;

            multipleSelectionCreatedItem = new MultipleSelectionMenuItem(Game, this, "Number Of Players");
            multipleSelectionCreatedItem.AddOption("One", () => { setNumOfPlayers(1); }, i_NumberOfPlayers == 1);
            multipleSelectionCreatedItem.AddOption("Two", () => { setNumOfPlayers(2); }, i_NumberOfPlayers == 2);
            AddItem(multipleSelectionCreatedItem, true);
        }
Пример #2
0
        private void createToggleSoundMenuItem(bool i_IsMuted)
        {
            MultipleSelectionMenuItem multipleSelectionCreatedItem;

            multipleSelectionCreatedItem = new MultipleSelectionMenuItem(Game, this, "Toggle Sound");
            multipleSelectionCreatedItem.AddOption("On", () => { mute(!i_IsMuted); }, !i_IsMuted);
            multipleSelectionCreatedItem.AddOption("Off", () => { mute(i_IsMuted); }, i_IsMuted);
            AddItem(multipleSelectionCreatedItem, true);
        }
        private void createFullScreenMenuItem(bool i_IsFullScreen)
        {
            MultipleSelectionMenuItem multipleSelectionCreatedItem;

            multipleSelectionCreatedItem = new MultipleSelectionMenuItem(Game, this, "Full Screen Mode");
            multipleSelectionCreatedItem.AddOption("Off", toggleFullScreen, !i_IsFullScreen);
            multipleSelectionCreatedItem.AddOption("On", toggleFullScreen, i_IsFullScreen);
            AddItem(multipleSelectionCreatedItem, false);
        }
        private void createWindowResizingMenuItem(bool i_AllowUserResizing)
        {
            MultipleSelectionMenuItem multipleSelectionCreatedItem;

            multipleSelectionCreatedItem = new MultipleSelectionMenuItem(Game, this, "Allow Window Resizing");
            multipleSelectionCreatedItem.AddOption("Allow", () => { this.Game.Window.AllowUserResizing = true; }, i_AllowUserResizing);
            multipleSelectionCreatedItem.AddOption("Do not allow", () => { this.Game.Window.AllowUserResizing = false; }, !i_AllowUserResizing);
            AddItem(multipleSelectionCreatedItem, false);
        }
        private void createMouseVisibilityMenuItem(bool i_IsMouseVisible)
        {
            MultipleSelectionMenuItem multipleSelectionCreatedItem;

            multipleSelectionCreatedItem = new MultipleSelectionMenuItem(Game, this, "Mouse Visibility");
            multipleSelectionCreatedItem.AddOption("Visible", () => { this.Game.IsMouseVisible = true; }, i_IsMouseVisible);
            multipleSelectionCreatedItem.AddOption("Not Visible", () => { this.Game.IsMouseVisible = false; }, !i_IsMouseVisible);

            AddItem(multipleSelectionCreatedItem, true);
        }
Пример #6
0
        private void createSoundEffectsVolumeMenuItem()
        {
            int volume = Convert.ToInt32(m_SoundSettings.GetEffectsVolume() * 100);

            MultipleSelectionMenuItem multipleSelectionCreatedItem;

            multipleSelectionCreatedItem = new MultipleSelectionMenuItem(Game, this, "Sounds Effect Music Volume");
            multipleSelectionCreatedItem.AddOption("0", () => { setSoundEffectVolume(0); }, 0 <= volume && volume > 5);
            multipleSelectionCreatedItem.AddOption("10", () => { setSoundEffectVolume(10); }, 5 <= volume && volume > 15);
            multipleSelectionCreatedItem.AddOption("20", () => { setSoundEffectVolume(20); }, 15 <= volume && volume > 25);
            multipleSelectionCreatedItem.AddOption("30", () => { setSoundEffectVolume(30); }, 25 <= volume && volume > 35);
            multipleSelectionCreatedItem.AddOption("40", () => { setSoundEffectVolume(40); }, 35 <= volume && volume > 45);
            multipleSelectionCreatedItem.AddOption("50", () => { setSoundEffectVolume(50); }, 45 <= volume && volume > 55);
            multipleSelectionCreatedItem.AddOption("60", () => { setSoundEffectVolume(60); }, 55 <= volume && volume > 65);
            multipleSelectionCreatedItem.AddOption("70", () => { setSoundEffectVolume(70); }, 65 <= volume && volume > 75);
            multipleSelectionCreatedItem.AddOption("80", () => { setSoundEffectVolume(80); }, 75 <= volume && volume > 85);
            multipleSelectionCreatedItem.AddOption("90", () => { setSoundEffectVolume(90); }, 85 <= volume && volume > 95);
            multipleSelectionCreatedItem.AddOption("100", () => { setSoundEffectVolume(100); }, 95 <= volume && volume > 100);

            AddItem(multipleSelectionCreatedItem, false);
        }