Example #1
0
        private void AddAudioOptions()
        {
            var colX        = XPos(0.75f);
            var iconYOffset = 14;
            var margin      = 10;
            var iconWidth   = 48;

            Add(UiLabels.Option("Audio", new Vector2(colX, Height(0))));

            Add(UiButtons.SmallIcon("Icons/MinusGreen", new Vector2(colX, Height(1) + iconYOffset), () =>
            {
                CurrentOptions.Update((x) => x.SoundVolume = Math.Max(x.SoundVolume - 0.1f, 0));
                _soundVolume.Text = GetSoundVolumeText();
            }));
            _soundVolume = VolumeLabel(GetSoundVolumeText(), new Vector2(colX + iconWidth + margin, Height(1)), Color.White);
            Add(_soundVolume);
            Add(UiButtons.SmallIcon("Icons/PlusGreen", new Vector2(colX + 240 + iconWidth + margin * 2, Height(1) + iconYOffset), () =>
            {
                CurrentOptions.Update((x) => x.SoundVolume = Math.Min(x.SoundVolume + 0.1f, 1));
                _soundVolume.Text = GetSoundVolumeText();
            }));

            Add(UiButtons.SmallIcon("Icons/MinusGreen", new Vector2(colX, Height(2) + iconYOffset), () =>
            {
                CurrentOptions.Update((x) => x.MusicVolume = Math.Max(x.MusicVolume - 0.1f, 0));
                _musicVolume.Text = GetMusicVolumeText();
            }));
            _musicVolume = VolumeLabel(GetMusicVolumeText(), new Vector2(colX + iconWidth + margin, Height(2)), Color.White);
            Add(_musicVolume);
            Add(UiButtons.SmallIcon("Icons/PlusGreen", new Vector2(colX + 240 + iconWidth + margin * 2, Height(2) + iconYOffset), () =>
            {
                CurrentOptions.Update((x) => x.MusicVolume = Math.Min(x.MusicVolume + 0.1f, 1));
                _musicVolume.Text = GetMusicVolumeText();
            }));
        }
Example #2
0
        private void AddGameplayOptions()
        {
            var colX = XPos(0.25f);

            Add(UiLabels.Option("Gameplay", new Vector2(colX, Height(0))));
            Add(UiButtons.Menu("Text: Slow", new Vector2(colX, Height(1)), () => CurrentOptions.Update(x => x.MillisPerTextCharacter    = 45)));
            Add(UiButtons.Menu("Text: Normal", new Vector2(colX, Height(2)), () => CurrentOptions.Update(x => x.MillisPerTextCharacter  = 30)));
            Add(UiButtons.Menu("Text: Fast", new Vector2(colX, Height(3)), () => CurrentOptions.Update(x => x.MillisPerTextCharacter    = 15)));
            Add(UiButtons.Menu("Text: Instant", new Vector2(colX, Height(4)), () => CurrentOptions.Update(x => x.MillisPerTextCharacter = 0)));

            _tutorialsToggle = UiButtons.Menu(GetTutorialText(), new Vector2(colX, Height(6)), ToggleTutorials);
            Add(_tutorialsToggle);
        }
Example #3
0
        private void AddResetControls()
        {
            var rowY = UI.OfScreenHeight(0.8f);

            Add(UiLabels.Option("Resets", new Vector2(XPos(0.5f), Height(0, rowY))));
            Add(UiButtons.Menu("Reset Options", new Vector2(XPos(0.50f), Height(1, rowY)), () =>
            {
                CurrentOptions.UpdateDisplay(x => CurrentOptions.Reset());
                _tutorialsToggle.Text = GetTutorialText();
                _soundVolume.Text     = GetSoundVolumeText();
                _musicVolume.Text     = GetMusicVolumeText();
            }));
        }
Example #4
0
        private void AddDisplayOptions()
        {
            var colX = XPos(0.50f);

            Add(UiLabels.Option("Display", new Vector2(colX, Height(0))));
            Add(UiButtons.Menu("Toggle FullScreen", new Vector2(colX, Height(1)), () => CurrentOptions.UpdateDisplay(x => x.IsFullscreen = !x.IsFullscreen)));

            Add(UiButtons.Menu("960x540", new Vector2(colX, Height(3)), () => CurrentOptions.UpdateDisplay(x => x.Scale = 0.5f),
                               () => !CurrentOptions.IsFullscreen));
            Add(UiButtons.Menu("1440x810", new Vector2(colX, Height(4)), () => CurrentOptions.UpdateDisplay(x => x.Scale = 0.75f),
                               () => !CurrentOptions.IsFullscreen));
            Add(UiButtons.Menu("1920x1080", new Vector2(colX, Height(5)), () => CurrentOptions.UpdateDisplay(x => x.Scale = 1),
                               () => !CurrentOptions.IsFullscreen));
        }