Remove local implementation of bindable in OsuCheckbox

This commit is contained in:
Dean Herbert
2019-06-17 19:37:24 +09:00
parent b940255972
commit 26d5c2d85a
4 changed files with 5 additions and 17 deletions

View File

@ -4,7 +4,6 @@
using osu.Framework.Allocation; using osu.Framework.Allocation;
using osu.Framework.Audio; using osu.Framework.Audio;
using osu.Framework.Audio.Sample; using osu.Framework.Audio.Sample;
using osu.Framework.Bindables;
using osu.Framework.Graphics; using osu.Framework.Graphics;
using osu.Framework.Graphics.UserInterface; using osu.Framework.Graphics.UserInterface;
using osu.Framework.Input.Events; using osu.Framework.Input.Events;
@ -15,17 +14,6 @@ namespace osu.Game.Graphics.UserInterface
{ {
public class OsuCheckbox : Checkbox public class OsuCheckbox : Checkbox
{ {
private Bindable<bool> bindable;
public Bindable<bool> Bindable
{
set
{
bindable = value;
Current.BindTo(bindable);
}
}
public Color4 CheckedColor { get; set; } = Color4.Cyan; public Color4 CheckedColor { get; set; } = Color4.Cyan;
public Color4 UncheckedColor { get; set; } = Color4.White; public Color4 UncheckedColor { get; set; } = Color4.White;
public int FadeDuration { get; set; } public int FadeDuration { get; set; }

View File

@ -20,7 +20,7 @@ namespace osu.Game.Screens.Play.PlayerSettings
new PlayerCheckbox new PlayerCheckbox
{ {
LabelText = "Show floating comments", LabelText = "Show floating comments",
Bindable = config.GetBindable<bool>(OsuSetting.FloatingComments) Current = config.GetBindable<bool>(OsuSetting.FloatingComments)
}, },
new FocusedTextBox new FocusedTextBox
{ {

View File

@ -25,6 +25,6 @@ namespace osu.Game.Screens.Play.PlayerSettings
} }
[BackgroundDependencyLoader] [BackgroundDependencyLoader]
private void load(OsuConfigManager config) => mouseButtonsCheckbox.Bindable = config.GetBindable<bool>(OsuSetting.MouseDisableButtons); private void load(OsuConfigManager config) => mouseButtonsCheckbox.Current = config.GetBindable<bool>(OsuSetting.MouseDisableButtons);
} }
} }

View File

@ -47,9 +47,9 @@ namespace osu.Game.Screens.Play.PlayerSettings
{ {
dimSliderBar.Bindable = config.GetBindable<double>(OsuSetting.DimLevel); dimSliderBar.Bindable = config.GetBindable<double>(OsuSetting.DimLevel);
blurSliderBar.Bindable = config.GetBindable<double>(OsuSetting.BlurLevel); blurSliderBar.Bindable = config.GetBindable<double>(OsuSetting.BlurLevel);
showStoryboardToggle.Bindable = config.GetBindable<bool>(OsuSetting.ShowStoryboard); showStoryboardToggle.Current = config.GetBindable<bool>(OsuSetting.ShowStoryboard);
beatmapSkinsToggle.Bindable = config.GetBindable<bool>(OsuSetting.BeatmapSkins); beatmapSkinsToggle.Current = config.GetBindable<bool>(OsuSetting.BeatmapSkins);
beatmapHitsoundsToggle.Bindable = config.GetBindable<bool>(OsuSetting.BeatmapHitsounds); beatmapHitsoundsToggle.Current = config.GetBindable<bool>(OsuSetting.BeatmapHitsounds);
} }
} }
} }