コード例 #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();
            }));
        }
コード例 #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);
        }
コード例 #3
0
        public void Update(TimeSpan delta)
        {
            _timeFakeLoading += delta;
#if !DEBUG
            if (_timeFakeLoading.TotalMilliseconds >= CurrentOptions.FakeLoadMilliseconds)
#endif
            if (_isLoaded)
            {
                CurrentOptions.Update(o => o.FakeLoadMilliseconds
                                          -= Rng.Int(CurrentOptions.FakeLoadMilliseconds / 20, CurrentOptions.FakeLoadMilliseconds / 10));
                Scene.NavigateTo(CurrentGameState.CurrentLocation);
            }
        }
コード例 #4
0
 private void ToggleTutorials()
 {
     CurrentOptions.Update(x => x.TutorialsEnabled = !x.TutorialsEnabled);
     _tutorialsToggle.Text = GetTutorialText();
 }