Beispiel #1
0
        private void load(OsuConfigManager config, SkinManager skins)
        {
            FlowContent.Spacing = new Vector2(0, 5);
            Children            = new Drawable[]
            {
                skinDropdown = new SettingsDropdown <int>(),
                new SettingsSlider <double, SizeSlider>
                {
                    LabelText    = "Menu cursor size",
                    Bindable     = config.GetBindable <double>(OsuSetting.MenuCursorSize),
                    KeyboardStep = 0.1f
                },
                new SettingsSlider <double, SizeSlider>
                {
                    LabelText    = "Gameplay cursor size",
                    Bindable     = config.GetBindable <double>(OsuSetting.GameplayCursorSize),
                    KeyboardStep = 0.1f
                },
                new SettingsCheckbox
                {
                    LabelText = "Adjust gameplay cursor size based on current beatmap",
                    Bindable  = config.GetBindable <bool>(OsuSetting.AutoCursorSize)
                },
            };

            void reloadSkins() => skinDropdown.Items = skins.GetAllUsableSkins().Select(s => new KeyValuePair <string, int>(s.ToString(), s.ID));

            skins.ItemAdded   += _ => reloadSkins();
            skins.ItemRemoved += _ => reloadSkins();

            reloadSkins();

            skinDropdown.Bindable = config.GetBindable <int>(OsuSetting.Skin);
        }
Beispiel #2
0
        private void load(OsuConfigManager config, SkinManager skins)
        {
            this.skins = skins;

            FlowContent.Spacing = new Vector2(0, 5);
            Children            = new Drawable[]
            {
                skinDropdown = new SkinSettingsDropdown(),
                new SettingsSlider <float, SizeSlider>
                {
                    LabelText    = "Menu cursor size",
                    Bindable     = config.GetBindable <float>(OsuSetting.MenuCursorSize),
                    KeyboardStep = 0.01f
                },
                new SettingsSlider <float, SizeSlider>
                {
                    LabelText    = "Gameplay cursor size",
                    Bindable     = config.GetBindable <float>(OsuSetting.GameplayCursorSize),
                    KeyboardStep = 0.01f
                },
                new SettingsCheckbox
                {
                    LabelText = "Adjust gameplay cursor size based on current beatmap",
                    Bindable  = config.GetBindable <bool>(OsuSetting.AutoCursorSize)
                },
                new SettingsCheckbox
                {
                    LabelText = "Beatmap skins",
                    Bindable  = config.GetBindable <bool>(OsuSetting.BeatmapSkins)
                },
                new SettingsCheckbox
                {
                    LabelText = "Beatmap hitsounds",
                    Bindable  = config.GetBindable <bool>(OsuSetting.BeatmapHitsounds)
                },
                new SettingsCheckbox
                {
                    LabelText = "Use combo colour as tint for slider ball",
                    Bindable  = config.GetBindable <bool>(OsuSetting.ColourSliderBalls)
                },
            };

            skins.ItemAdded   += itemAdded;
            skins.ItemRemoved += itemRemoved;

            config.BindWith(OsuSetting.Skin, configBindable);

            skinDropdown.Bindable = dropdownBindable;
            skinDropdown.Items    = skins.GetAllUsableSkins().ToArray();

            // Todo: This should not be necessary when OsuConfigManager is databased
            if (skinDropdown.Items.All(s => s.ID != configBindable.Value))
            {
                configBindable.Value = 0;
            }

            configBindable.BindValueChanged(id => dropdownBindable.Value   = skinDropdown.Items.Single(s => s.ID == id.NewValue), true);
            dropdownBindable.BindValueChanged(skin => configBindable.Value = skin.NewValue.ID);
        }
Beispiel #3
0
        private void load(OsuConfigManager config, SkinManager skins)
        {
            this.skins = skins;

            FlowContent.Spacing = new Vector2(0, 5);
            Children            = new Drawable[]
            {
                skinDropdown = new SettingsDropdown <int>(),
                new SettingsSlider <double, SizeSlider>
                {
                    LabelText    = "Menu cursor size",
                    Bindable     = config.GetBindable <double>(OsuSetting.MenuCursorSize),
                    KeyboardStep = 0.01f
                },
                new SettingsSlider <double, SizeSlider>
                {
                    LabelText    = "Gameplay cursor size",
                    Bindable     = config.GetBindable <double>(OsuSetting.GameplayCursorSize),
                    KeyboardStep = 0.01f
                },
                new SettingsCheckbox
                {
                    LabelText = "Adjust gameplay cursor size based on current beatmap",
                    Bindable  = config.GetBindable <bool>(OsuSetting.AutoCursorSize)
                },
            };

            skins.ItemAdded   += itemAdded;
            skins.ItemRemoved += itemRemoved;

            skinDropdown.Entries = skins.GetAllUsableSkins().Select(s => new KeyValuePair <string, int>(s.ToString(), s.ID));

            var skinBindable = config.GetBindable <int>(OsuSetting.Skin);

            // Todo: This should not be necessary when OsuConfigManager is databased
            if (skinDropdown.Entries.All(s => s.Value != skinBindable.Value))
            {
                skinBindable.Value = 0;
            }

            skinDropdown.Bindable = skinBindable;
        }