diff --git a/osu-framework b/osu-framework index 7cad7cf48b..12fbf2b94a 160000 --- a/osu-framework +++ b/osu-framework @@ -1 +1 @@ -Subproject commit 7cad7cf48b2ae9f16cac503d46bd0ea801e7561f +Subproject commit 12fbf2b94af0ddef9daf0fab11c05288dee054a7 diff --git a/osu.Game.Modes.Osu/Objects/Drawables/Pieces/SliderBody.cs b/osu.Game.Modes.Osu/Objects/Drawables/Pieces/SliderBody.cs index 7f7d558294..e75441c812 100644 --- a/osu.Game.Modes.Osu/Objects/Drawables/Pieces/SliderBody.cs +++ b/osu.Game.Modes.Osu/Objects/Drawables/Pieces/SliderBody.cs @@ -79,8 +79,8 @@ namespace osu.Game.Modes.Osu.Objects.Drawables.Pieces [BackgroundDependencyLoader] private void load(OsuConfigManager config) { - snakingIn = config.GetBindable(OsuConfig.SnakingInSliders); - snakingOut = config.GetBindable(OsuConfig.SnakingOutSliders); + snakingIn = config.GetWeldedBindable(OsuConfig.SnakingInSliders); + snakingOut = config.GetWeldedBindable(OsuConfig.SnakingOutSliders); int textureWidth = (int)PathWidth * 2; diff --git a/osu.Game/Beatmaps/Drawables/BeatmapSetHeader.cs b/osu.Game/Beatmaps/Drawables/BeatmapSetHeader.cs index 8681259272..8c9e135d49 100644 --- a/osu.Game/Beatmaps/Drawables/BeatmapSetHeader.cs +++ b/osu.Game/Beatmaps/Drawables/BeatmapSetHeader.cs @@ -79,7 +79,7 @@ namespace osu.Game.Beatmaps.Drawables { this.config = config; - preferUnicode = config.GetBindable(OsuConfig.ShowUnicode); + preferUnicode = config.GetWeldedBindable(OsuConfig.ShowUnicode); preferUnicode.ValueChanged += preferUnicode_changed; preferUnicode_changed(preferUnicode, null); } diff --git a/osu.Game/Graphics/Containers/ParallaxContainer.cs b/osu.Game/Graphics/Containers/ParallaxContainer.cs index 1908bd0aa2..f180100fb0 100644 --- a/osu.Game/Graphics/Containers/ParallaxContainer.cs +++ b/osu.Game/Graphics/Containers/ParallaxContainer.cs @@ -40,7 +40,7 @@ namespace osu.Game.Graphics.Containers private void load(UserInputManager input, OsuConfigManager config) { this.input = input; - parallaxEnabled = config.GetBindable(OsuConfig.MenuParallax); + parallaxEnabled = config.GetWeldedBindable(OsuConfig.MenuParallax); parallaxEnabled.ValueChanged += delegate { if (!parallaxEnabled) diff --git a/osu.Game/Graphics/Cursor/OsuCursorContainer.cs b/osu.Game/Graphics/Cursor/OsuCursorContainer.cs index 8011359db9..07caa2055e 100644 --- a/osu.Game/Graphics/Cursor/OsuCursorContainer.cs +++ b/osu.Game/Graphics/Cursor/OsuCursorContainer.cs @@ -43,7 +43,7 @@ namespace osu.Game.Graphics.Cursor class OsuCursor : Container { private Container cursorContainer; - private BindableDouble cursorScale; + private Bindable cursorScale; public OsuCursor() { @@ -54,7 +54,7 @@ namespace osu.Game.Graphics.Cursor [BackgroundDependencyLoader] private void load(TextureStore textures, OsuConfigManager config) { - cursorScale = (BindableDouble)config.GetBindable(OsuConfig.CursorSize); + cursorScale = config.GetWeldedBindable(OsuConfig.CursorSize); Children = new Drawable[] { diff --git a/osu.Game/OsuGame.cs b/osu.Game/OsuGame.cs index b8a8fe0618..daa4f38c15 100644 --- a/osu.Game/OsuGame.cs +++ b/osu.Game/OsuGame.cs @@ -87,7 +87,7 @@ namespace osu.Game Dependencies.Cache(this); - PlayMode = LocalConfig.GetBindable(OsuConfig.PlayMode); + PlayMode = LocalConfig.GetWeldedBindable(OsuConfig.PlayMode); } protected async void ImportBeatmapsAsync(IEnumerable paths) diff --git a/osu.Game/Overlays/MusicController.cs b/osu.Game/Overlays/MusicController.cs index 661cbe06a4..c39856f3b6 100644 --- a/osu.Game/Overlays/MusicController.cs +++ b/osu.Game/Overlays/MusicController.cs @@ -211,7 +211,7 @@ namespace osu.Game.Overlays this.beatmaps = beatmaps; trackManager = osuGame.Audio.Track; - preferUnicode = config.GetBindable(OsuConfig.ShowUnicode); + preferUnicode = config.GetWeldedBindable(OsuConfig.ShowUnicode); preferUnicode.ValueChanged += preferUnicode_changed; beatmapSource = osuGame.Beatmap ?? new Bindable(); diff --git a/osu.Game/Overlays/Options/Sections/Audio/OffsetOptions.cs b/osu.Game/Overlays/Options/Sections/Audio/OffsetOptions.cs index 2602565c29..83072d7c97 100644 --- a/osu.Game/Overlays/Options/Sections/Audio/OffsetOptions.cs +++ b/osu.Game/Overlays/Options/Sections/Audio/OffsetOptions.cs @@ -21,7 +21,7 @@ namespace osu.Game.Overlays.Options.Sections.Audio new OptionSlider { LabelText = "Universal Offset", - Bindable = (BindableInt)config.GetBindable(OsuConfig.Offset) + Bindable = (BindableInt)config.GetWeldedBindable(OsuConfig.Offset) }, new OsuButton { diff --git a/osu.Game/Overlays/Options/Sections/Audio/VolumeOptions.cs b/osu.Game/Overlays/Options/Sections/Audio/VolumeOptions.cs index d8e8964b17..510a02a40d 100644 --- a/osu.Game/Overlays/Options/Sections/Audio/VolumeOptions.cs +++ b/osu.Game/Overlays/Options/Sections/Audio/VolumeOptions.cs @@ -24,7 +24,7 @@ namespace osu.Game.Overlays.Options.Sections.Audio new OsuCheckbox { LabelText = "Ignore beatmap hitsounds", - Bindable = config.GetBindable(OsuConfig.IgnoreBeatmapSamples) + Bindable = config.GetWeldedBindable(OsuConfig.IgnoreBeatmapSamples) } }; } diff --git a/osu.Game/Overlays/Options/Sections/Debug/GCOptions.cs b/osu.Game/Overlays/Options/Sections/Debug/GCOptions.cs index 2f04bfe88b..26b3023f47 100644 --- a/osu.Game/Overlays/Options/Sections/Debug/GCOptions.cs +++ b/osu.Game/Overlays/Options/Sections/Debug/GCOptions.cs @@ -23,7 +23,7 @@ namespace osu.Game.Overlays.Options.Sections.Debug new OptionEnumDropDown { LabelText = "Active mode", - Bindable = config.GetBindable(FrameworkDebugConfig.ActiveGCMode) + Bindable = config.GetWeldedBindable(FrameworkDebugConfig.ActiveGCMode) }, new OsuButton { diff --git a/osu.Game/Overlays/Options/Sections/EditorSection.cs b/osu.Game/Overlays/Options/Sections/EditorSection.cs index 513d89c601..b81a248901 100644 --- a/osu.Game/Overlays/Options/Sections/EditorSection.cs +++ b/osu.Game/Overlays/Options/Sections/EditorSection.cs @@ -24,32 +24,32 @@ namespace osu.Game.Overlays.Options.Sections new OsuCheckbox { LabelText = "Background video", - Bindable = config.GetBindable(OsuConfig.VideoEditor) + Bindable = config.GetWeldedBindable(OsuConfig.VideoEditor) }, new OsuCheckbox { LabelText = "Always use default skin", - Bindable = config.GetBindable(OsuConfig.EditorDefaultSkin) + Bindable = config.GetWeldedBindable(OsuConfig.EditorDefaultSkin) }, new OsuCheckbox { LabelText = "Snaking sliders", - Bindable = config.GetBindable(OsuConfig.EditorSnakingSliders) + Bindable = config.GetWeldedBindable(OsuConfig.EditorSnakingSliders) }, new OsuCheckbox { LabelText = "Hit animations", - Bindable = config.GetBindable(OsuConfig.EditorHitAnimations) + Bindable = config.GetWeldedBindable(OsuConfig.EditorHitAnimations) }, new OsuCheckbox { LabelText = "Follow points", - Bindable = config.GetBindable(OsuConfig.EditorFollowPoints) + Bindable = config.GetWeldedBindable(OsuConfig.EditorFollowPoints) }, new OsuCheckbox { LabelText = "Stacking", - Bindable = config.GetBindable(OsuConfig.EditorStacking) + Bindable = config.GetWeldedBindable(OsuConfig.EditorStacking) }, }; } diff --git a/osu.Game/Overlays/Options/Sections/Gameplay/GeneralOptions.cs b/osu.Game/Overlays/Options/Sections/Gameplay/GeneralOptions.cs index 1c28f6247d..505e8efc5b 100644 --- a/osu.Game/Overlays/Options/Sections/Gameplay/GeneralOptions.cs +++ b/osu.Game/Overlays/Options/Sections/Gameplay/GeneralOptions.cs @@ -21,42 +21,42 @@ namespace osu.Game.Overlays.Options.Sections.Gameplay new OptionSlider { LabelText = "Background dim", - Bindable = (BindableInt)config.GetBindable(OsuConfig.DimLevel) + Bindable = (BindableInt)config.GetWeldedBindable(OsuConfig.DimLevel) }, new OptionEnumDropDown { LabelText = "Progress display", - Bindable = config.GetBindable(OsuConfig.ProgressBarType) + Bindable = config.GetWeldedBindable(OsuConfig.ProgressBarType) }, new OptionEnumDropDown { LabelText = "Score meter type", - Bindable = config.GetBindable(OsuConfig.ScoreMeter) + Bindable = config.GetWeldedBindable(OsuConfig.ScoreMeter) }, new OptionSlider { LabelText = "Score meter size", - Bindable = (BindableDouble)config.GetBindable(OsuConfig.ScoreMeterScale) + Bindable = (BindableDouble)config.GetWeldedBindable(OsuConfig.ScoreMeterScale) }, new OsuCheckbox { LabelText = "Always show key overlay", - Bindable = config.GetBindable(OsuConfig.KeyOverlay) + Bindable = config.GetWeldedBindable(OsuConfig.KeyOverlay) }, new OsuCheckbox { LabelText = "Show approach circle on first \"Hidden\" object", - Bindable = config.GetBindable(OsuConfig.HiddenShowFirstApproach) + Bindable = config.GetWeldedBindable(OsuConfig.HiddenShowFirstApproach) }, new OsuCheckbox { LabelText = "Scale osu!mania scroll speed with BPM", - Bindable = config.GetBindable(OsuConfig.ManiaSpeedBPMScale) + Bindable = config.GetWeldedBindable(OsuConfig.ManiaSpeedBPMScale) }, new OsuCheckbox { LabelText = "Remember osu!mania scroll speed per beatmap", - Bindable = config.GetBindable(OsuConfig.UsePerBeatmapManiaSpeed) + Bindable = config.GetWeldedBindable(OsuConfig.UsePerBeatmapManiaSpeed) }, }; } diff --git a/osu.Game/Overlays/Options/Sections/Gameplay/SongSelectOptions.cs b/osu.Game/Overlays/Options/Sections/Gameplay/SongSelectOptions.cs index be38a9847a..d78916b223 100644 --- a/osu.Game/Overlays/Options/Sections/Gameplay/SongSelectOptions.cs +++ b/osu.Game/Overlays/Options/Sections/Gameplay/SongSelectOptions.cs @@ -20,12 +20,12 @@ namespace osu.Game.Overlays.Options.Sections.Gameplay new OptionSlider { LabelText = "Display beatmaps from", - Bindable = (BindableDouble)config.GetBindable(OsuConfig.DisplayStarsMinimum) + Bindable = (BindableDouble)config.GetWeldedBindable(OsuConfig.DisplayStarsMinimum) }, new OptionSlider { LabelText = "up to", - Bindable = (BindableDouble)config.GetBindable(OsuConfig.DisplayStarsMaximum) + Bindable = (BindableDouble)config.GetWeldedBindable(OsuConfig.DisplayStarsMaximum) }, }; } diff --git a/osu.Game/Overlays/Options/Sections/General/LanguageOptions.cs b/osu.Game/Overlays/Options/Sections/General/LanguageOptions.cs index dc29b56f44..c45395ad68 100644 --- a/osu.Game/Overlays/Options/Sections/General/LanguageOptions.cs +++ b/osu.Game/Overlays/Options/Sections/General/LanguageOptions.cs @@ -21,12 +21,12 @@ namespace osu.Game.Overlays.Options.Sections.General new OsuCheckbox { LabelText = "Prefer metadata in original language", - Bindable = config.GetBindable(OsuConfig.ShowUnicode) + Bindable = config.GetWeldedBindable(OsuConfig.ShowUnicode) }, new OsuCheckbox { LabelText = "Use alternative font for chat display", - Bindable = config.GetBindable(OsuConfig.AlternativeChatFont) + Bindable = config.GetWeldedBindable(OsuConfig.AlternativeChatFont) }, }; } diff --git a/osu.Game/Overlays/Options/Sections/General/LoginOptions.cs b/osu.Game/Overlays/Options/Sections/General/LoginOptions.cs index 34f42aac43..16f316c25e 100644 --- a/osu.Game/Overlays/Options/Sections/General/LoginOptions.cs +++ b/osu.Game/Overlays/Options/Sections/General/LoginOptions.cs @@ -122,12 +122,12 @@ namespace osu.Game.Overlays.Options.Sections.General new OsuCheckbox { LabelText = "Remember username", - Bindable = config.GetBindable(OsuConfig.SaveUsername), + Bindable = config.GetWeldedBindable(OsuConfig.SaveUsername), }, new OsuCheckbox { LabelText = "Stay logged in", - Bindable = config.GetBindable(OsuConfig.SavePassword), + Bindable = config.GetWeldedBindable(OsuConfig.SavePassword), }, new OsuButton { diff --git a/osu.Game/Overlays/Options/Sections/General/UpdateOptions.cs b/osu.Game/Overlays/Options/Sections/General/UpdateOptions.cs index c45dc9cbd4..74feb73462 100644 --- a/osu.Game/Overlays/Options/Sections/General/UpdateOptions.cs +++ b/osu.Game/Overlays/Options/Sections/General/UpdateOptions.cs @@ -21,7 +21,7 @@ namespace osu.Game.Overlays.Options.Sections.General new OptionEnumDropDown { LabelText = "Release stream", - Bindable = config.GetBindable(OsuConfig.ReleaseStream), + Bindable = config.GetWeldedBindable(OsuConfig.ReleaseStream), }, new OptionLabel { Text = "Your osu! is up to date" }, // TODO: map this to reality new OsuButton diff --git a/osu.Game/Overlays/Options/Sections/Graphics/DetailOptions.cs b/osu.Game/Overlays/Options/Sections/Graphics/DetailOptions.cs index e66d097094..d9649cdf65 100644 --- a/osu.Game/Overlays/Options/Sections/Graphics/DetailOptions.cs +++ b/osu.Game/Overlays/Options/Sections/Graphics/DetailOptions.cs @@ -20,47 +20,47 @@ namespace osu.Game.Overlays.Options.Sections.Graphics new OsuCheckbox { LabelText = "Snaking in sliders", - Bindable = config.GetBindable(OsuConfig.SnakingInSliders) + Bindable = config.GetWeldedBindable(OsuConfig.SnakingInSliders) }, new OsuCheckbox { LabelText = "Snaking out sliders", - Bindable = config.GetBindable(OsuConfig.SnakingOutSliders) + Bindable = config.GetWeldedBindable(OsuConfig.SnakingOutSliders) }, new OsuCheckbox { LabelText = "Background video", - Bindable = config.GetBindable(OsuConfig.Video) + Bindable = config.GetWeldedBindable(OsuConfig.Video) }, new OsuCheckbox { LabelText = "Storyboards", - Bindable = config.GetBindable(OsuConfig.ShowStoryboard) + Bindable = config.GetWeldedBindable(OsuConfig.ShowStoryboard) }, new OsuCheckbox { LabelText = "Combo bursts", - Bindable = config.GetBindable(OsuConfig.ComboBurst) + Bindable = config.GetWeldedBindable(OsuConfig.ComboBurst) }, new OsuCheckbox { LabelText = "Hit lighting", - Bindable = config.GetBindable(OsuConfig.HitLighting) + Bindable = config.GetWeldedBindable(OsuConfig.HitLighting) }, new OsuCheckbox { LabelText = "Shaders", - Bindable = config.GetBindable(OsuConfig.Bloom) + Bindable = config.GetWeldedBindable(OsuConfig.Bloom) }, new OsuCheckbox { LabelText = "Softening filter", - Bindable = config.GetBindable(OsuConfig.BloomSoftening) + Bindable = config.GetWeldedBindable(OsuConfig.BloomSoftening) }, new OptionEnumDropDown { LabelText = "Screenshot", - Bindable = config.GetBindable(OsuConfig.ScreenshotFormat) + Bindable = config.GetWeldedBindable(OsuConfig.ScreenshotFormat) } }; } diff --git a/osu.Game/Overlays/Options/Sections/Graphics/LayoutOptions.cs b/osu.Game/Overlays/Options/Sections/Graphics/LayoutOptions.cs index a3dbb9c76f..66dbb3c75e 100644 --- a/osu.Game/Overlays/Options/Sections/Graphics/LayoutOptions.cs +++ b/osu.Game/Overlays/Options/Sections/Graphics/LayoutOptions.cs @@ -21,22 +21,22 @@ namespace osu.Game.Overlays.Options.Sections.Graphics new OptionEnumDropDown { LabelText = "Screen mode", - Bindable = config.GetBindable(FrameworkConfig.WindowMode), + Bindable = config.GetWeldedBindable(FrameworkConfig.WindowMode), }, new OsuCheckbox { LabelText = "Letterboxing", - Bindable = config.GetBindable(FrameworkConfig.Letterboxing), + Bindable = config.GetWeldedBindable(FrameworkConfig.Letterboxing), }, new OptionSlider { LabelText = "Horizontal position", - Bindable = (BindableInt)config.GetBindable(FrameworkConfig.LetterboxPositionX) + Bindable = (BindableInt)config.GetWeldedBindable(FrameworkConfig.LetterboxPositionX) }, new OptionSlider { LabelText = "Vertical position", - Bindable = (BindableInt)config.GetBindable(FrameworkConfig.LetterboxPositionY) + Bindable = (BindableInt)config.GetWeldedBindable(FrameworkConfig.LetterboxPositionY) }, }; } diff --git a/osu.Game/Overlays/Options/Sections/Graphics/MainMenuOptions.cs b/osu.Game/Overlays/Options/Sections/Graphics/MainMenuOptions.cs index c5000d8547..6520dfc394 100644 --- a/osu.Game/Overlays/Options/Sections/Graphics/MainMenuOptions.cs +++ b/osu.Game/Overlays/Options/Sections/Graphics/MainMenuOptions.cs @@ -19,27 +19,27 @@ namespace osu.Game.Overlays.Options.Sections.Graphics new OsuCheckbox { LabelText = "Snow", - Bindable = config.GetBindable(OsuConfig.MenuSnow) + Bindable = config.GetWeldedBindable(OsuConfig.MenuSnow) }, new OsuCheckbox { LabelText = "Parallax", - Bindable = config.GetBindable(OsuConfig.MenuParallax) + Bindable = config.GetWeldedBindable(OsuConfig.MenuParallax) }, new OsuCheckbox { LabelText = "Menu tips", - Bindable = config.GetBindable(OsuConfig.ShowMenuTips) + Bindable = config.GetWeldedBindable(OsuConfig.ShowMenuTips) }, new OsuCheckbox { LabelText = "Interface voices", - Bindable = config.GetBindable(OsuConfig.MenuVoice) + Bindable = config.GetWeldedBindable(OsuConfig.MenuVoice) }, new OsuCheckbox { LabelText = "osu! music theme", - Bindable = config.GetBindable(OsuConfig.MenuMusic) + Bindable = config.GetWeldedBindable(OsuConfig.MenuMusic) }, }; } diff --git a/osu.Game/Overlays/Options/Sections/Graphics/RendererOptions.cs b/osu.Game/Overlays/Options/Sections/Graphics/RendererOptions.cs index b98337f1e6..f478d40a3f 100644 --- a/osu.Game/Overlays/Options/Sections/Graphics/RendererOptions.cs +++ b/osu.Game/Overlays/Options/Sections/Graphics/RendererOptions.cs @@ -23,22 +23,22 @@ namespace osu.Game.Overlays.Options.Sections.Graphics new OptionEnumDropDown { LabelText = "Frame limiter", - Bindable = config.GetBindable(FrameworkConfig.FrameSync) + Bindable = config.GetWeldedBindable(FrameworkConfig.FrameSync) }, new OsuCheckbox { LabelText = "Show FPS counter", - Bindable = osuConfig.GetBindable(OsuConfig.FpsCounter), + Bindable = osuConfig.GetWeldedBindable(OsuConfig.FpsCounter), }, new OsuCheckbox { LabelText = "Reduce dropped frames", - Bindable = osuConfig.GetBindable(OsuConfig.ForceFrameFlush), + Bindable = osuConfig.GetWeldedBindable(OsuConfig.ForceFrameFlush), }, new OsuCheckbox { LabelText = "Detect performance issues", - Bindable = osuConfig.GetBindable(OsuConfig.DetectPerformanceIssues), + Bindable = osuConfig.GetWeldedBindable(OsuConfig.DetectPerformanceIssues), }, }; } diff --git a/osu.Game/Overlays/Options/Sections/Graphics/SongSelectGraphicsOptions.cs b/osu.Game/Overlays/Options/Sections/Graphics/SongSelectGraphicsOptions.cs index d4855a1619..083606f141 100644 --- a/osu.Game/Overlays/Options/Sections/Graphics/SongSelectGraphicsOptions.cs +++ b/osu.Game/Overlays/Options/Sections/Graphics/SongSelectGraphicsOptions.cs @@ -19,7 +19,7 @@ namespace osu.Game.Overlays.Options.Sections.Graphics new OsuCheckbox { LabelText = "Show thumbnails", - Bindable = config.GetBindable(OsuConfig.SongSelectThumbnails) + Bindable = config.GetWeldedBindable(OsuConfig.SongSelectThumbnails) } }; } diff --git a/osu.Game/Overlays/Options/Sections/Input/MouseOptions.cs b/osu.Game/Overlays/Options/Sections/Input/MouseOptions.cs index ef1dd755b7..4a6d1fb79e 100644 --- a/osu.Game/Overlays/Options/Sections/Input/MouseOptions.cs +++ b/osu.Game/Overlays/Options/Sections/Input/MouseOptions.cs @@ -21,37 +21,37 @@ namespace osu.Game.Overlays.Options.Sections.Input new OptionSlider { LabelText = "Sensitivity", - Bindable = (BindableDouble)config.GetBindable(OsuConfig.MouseSpeed), + Bindable = (BindableDouble)config.GetWeldedBindable(OsuConfig.MouseSpeed), }, new OsuCheckbox { LabelText = "Raw input", - Bindable = config.GetBindable(OsuConfig.RawInput) + Bindable = config.GetWeldedBindable(OsuConfig.RawInput) }, new OsuCheckbox { LabelText = "Map absolute raw input to the osu! window", - Bindable = config.GetBindable(OsuConfig.AbsoluteToOsuWindow) + Bindable = config.GetWeldedBindable(OsuConfig.AbsoluteToOsuWindow) }, new OptionEnumDropDown { LabelText = "Confine mouse cursor", - Bindable = config.GetBindable(OsuConfig.ConfineMouse), + Bindable = config.GetWeldedBindable(OsuConfig.ConfineMouse), }, new OsuCheckbox { LabelText = "Disable mouse wheel in play mode", - Bindable = config.GetBindable(OsuConfig.MouseDisableWheel) + Bindable = config.GetWeldedBindable(OsuConfig.MouseDisableWheel) }, new OsuCheckbox { LabelText = "Disable mouse buttons in play mode", - Bindable = config.GetBindable(OsuConfig.MouseDisableButtons) + Bindable = config.GetWeldedBindable(OsuConfig.MouseDisableButtons) }, new OsuCheckbox { LabelText = "Cursor ripples", - Bindable = config.GetBindable(OsuConfig.CursorRipple) + Bindable = config.GetWeldedBindable(OsuConfig.CursorRipple) }, }; } diff --git a/osu.Game/Overlays/Options/Sections/Input/OtherInputOptions.cs b/osu.Game/Overlays/Options/Sections/Input/OtherInputOptions.cs index 9323f7514b..dd3e0f81f9 100644 --- a/osu.Game/Overlays/Options/Sections/Input/OtherInputOptions.cs +++ b/osu.Game/Overlays/Options/Sections/Input/OtherInputOptions.cs @@ -20,12 +20,12 @@ namespace osu.Game.Overlays.Options.Sections.Input new OsuCheckbox { LabelText = "OS TabletPC support", - Bindable = config.GetBindable(OsuConfig.Tablet) + Bindable = config.GetWeldedBindable(OsuConfig.Tablet) }, new OsuCheckbox { LabelText = "Wiimote/TaTaCon Drum Support", - Bindable = config.GetBindable(OsuConfig.Wiimote) + Bindable = config.GetWeldedBindable(OsuConfig.Wiimote) }, }; } diff --git a/osu.Game/Overlays/Options/Sections/Online/InGameChatOptions.cs b/osu.Game/Overlays/Options/Sections/Online/InGameChatOptions.cs index 9a477f40c7..7d240aa97d 100644 --- a/osu.Game/Overlays/Options/Sections/Online/InGameChatOptions.cs +++ b/osu.Game/Overlays/Options/Sections/Online/InGameChatOptions.cs @@ -20,32 +20,32 @@ namespace osu.Game.Overlays.Options.Sections.Online new OsuCheckbox { LabelText = "Filter offensive words", - Bindable = config.GetBindable(OsuConfig.ChatFilter) + Bindable = config.GetWeldedBindable(OsuConfig.ChatFilter) }, new OsuCheckbox { LabelText = "Filter foreign characters", - Bindable = config.GetBindable(OsuConfig.ChatRemoveForeign) + Bindable = config.GetWeldedBindable(OsuConfig.ChatRemoveForeign) }, new OsuCheckbox { LabelText = "Log private messages", - Bindable = config.GetBindable(OsuConfig.LogPrivateMessages) + Bindable = config.GetWeldedBindable(OsuConfig.LogPrivateMessages) }, new OsuCheckbox { LabelText = "Block private messages from non-friends", - Bindable = config.GetBindable(OsuConfig.BlockNonFriendPM) + Bindable = config.GetWeldedBindable(OsuConfig.BlockNonFriendPM) }, new OptionLabel { Text = "Chat ignore list (space-seperated list)" }, new OptionTextBox { RelativeSizeAxes = Axes.X, - Bindable = config.GetBindable(OsuConfig.IgnoreList) + Bindable = config.GetWeldedBindable(OsuConfig.IgnoreList) }, new OptionLabel { Text = "Chat highlight words (space-seperated list)" }, new OptionTextBox { RelativeSizeAxes = Axes.X, - Bindable = config.GetBindable(OsuConfig.HighlightWords) + Bindable = config.GetWeldedBindable(OsuConfig.HighlightWords) }, }; } diff --git a/osu.Game/Overlays/Options/Sections/Online/IntegrationOptions.cs b/osu.Game/Overlays/Options/Sections/Online/IntegrationOptions.cs index d4298ee43c..d8c3715fb9 100644 --- a/osu.Game/Overlays/Options/Sections/Online/IntegrationOptions.cs +++ b/osu.Game/Overlays/Options/Sections/Online/IntegrationOptions.cs @@ -20,22 +20,22 @@ namespace osu.Game.Overlays.Options.Sections.Online new OsuCheckbox { LabelText = "Integrate with Yahoo! status display", - Bindable = config.GetBindable(OsuConfig.YahooIntegration) + Bindable = config.GetWeldedBindable(OsuConfig.YahooIntegration) }, new OsuCheckbox { LabelText = "Integrate with MSN Live status display", - Bindable = config.GetBindable(OsuConfig.MsnIntegration) + Bindable = config.GetWeldedBindable(OsuConfig.MsnIntegration) }, new OsuCheckbox { LabelText = "Automatically start osu!direct downloads", - Bindable = config.GetBindable(OsuConfig.AutomaticDownload) + Bindable = config.GetWeldedBindable(OsuConfig.AutomaticDownload) }, new OsuCheckbox { LabelText = "Prefer no-video downloads", - Bindable = config.GetBindable(OsuConfig.AutomaticDownloadNoVideo) + Bindable = config.GetWeldedBindable(OsuConfig.AutomaticDownloadNoVideo) }, }; } diff --git a/osu.Game/Overlays/Options/Sections/Online/NotificationsOptions.cs b/osu.Game/Overlays/Options/Sections/Online/NotificationsOptions.cs index 4614210e9f..39ae381e5d 100644 --- a/osu.Game/Overlays/Options/Sections/Online/NotificationsOptions.cs +++ b/osu.Game/Overlays/Options/Sections/Online/NotificationsOptions.cs @@ -20,32 +20,32 @@ namespace osu.Game.Overlays.Options.Sections.Online new OsuCheckbox { LabelText = "Enable chat ticker", - Bindable = config.GetBindable(OsuConfig.Ticker) + Bindable = config.GetWeldedBindable(OsuConfig.Ticker) }, new OsuCheckbox { LabelText = "Show a notification popup when someone says your name", - Bindable = config.GetBindable(OsuConfig.ChatHighlightName) + Bindable = config.GetWeldedBindable(OsuConfig.ChatHighlightName) }, new OsuCheckbox { LabelText = "Show chat message notifications", - Bindable = config.GetBindable(OsuConfig.ChatMessageNotification) + Bindable = config.GetWeldedBindable(OsuConfig.ChatMessageNotification) }, new OsuCheckbox { LabelText = "Play a sound when someone says your name", - Bindable = config.GetBindable(OsuConfig.ChatAudibleHighlight) + Bindable = config.GetWeldedBindable(OsuConfig.ChatAudibleHighlight) }, new OsuCheckbox { LabelText = "Show notification popups instantly during gameplay", - Bindable = config.GetBindable(OsuConfig.PopupDuringGameplay) + Bindable = config.GetWeldedBindable(OsuConfig.PopupDuringGameplay) }, new OsuCheckbox { LabelText = "Show notification popups when friends change status", - Bindable = config.GetBindable(OsuConfig.NotifyFriends) + Bindable = config.GetWeldedBindable(OsuConfig.NotifyFriends) }, }; } diff --git a/osu.Game/Overlays/Options/Sections/Online/PrivacyOptions.cs b/osu.Game/Overlays/Options/Sections/Online/PrivacyOptions.cs index fb2adbb2ac..a79bc4f542 100644 --- a/osu.Game/Overlays/Options/Sections/Online/PrivacyOptions.cs +++ b/osu.Game/Overlays/Options/Sections/Online/PrivacyOptions.cs @@ -20,12 +20,12 @@ namespace osu.Game.Overlays.Options.Sections.Online new OsuCheckbox { LabelText = "Share your city location with others", - Bindable = config.GetBindable(OsuConfig.DisplayCityLocation) + Bindable = config.GetWeldedBindable(OsuConfig.DisplayCityLocation) }, new OsuCheckbox { LabelText = "Allow multiplayer game invites from all users", - Bindable = config.GetBindable(OsuConfig.AllowPublicInvites) + Bindable = config.GetWeldedBindable(OsuConfig.AllowPublicInvites) }, }; } diff --git a/osu.Game/Overlays/Options/Sections/SkinSection.cs b/osu.Game/Overlays/Options/Sections/SkinSection.cs index 56dd9ca318..f7968b8f66 100644 --- a/osu.Game/Overlays/Options/Sections/SkinSection.cs +++ b/osu.Game/Overlays/Options/Sections/SkinSection.cs @@ -42,32 +42,32 @@ namespace osu.Game.Overlays.Options.Sections new OsuCheckbox { LabelText = "Ignore all beatmap skins", - Bindable = config.GetBindable(OsuConfig.IgnoreBeatmapSkins) + Bindable = config.GetWeldedBindable(OsuConfig.IgnoreBeatmapSkins) }, new OsuCheckbox { LabelText = "Use skin's sound samples", - Bindable = config.GetBindable(OsuConfig.SkinSamples) + Bindable = config.GetWeldedBindable(OsuConfig.SkinSamples) }, new OsuCheckbox { LabelText = "Use Taiko skin for Taiko mode", - Bindable = config.GetBindable(OsuConfig.UseTaikoSkin) + Bindable = config.GetWeldedBindable(OsuConfig.UseTaikoSkin) }, new OsuCheckbox { LabelText = "Always use skin cursor", - Bindable = config.GetBindable(OsuConfig.UseSkinCursor) + Bindable = config.GetWeldedBindable(OsuConfig.UseSkinCursor) }, new OptionSlider { LabelText = "Cursor size", - Bindable = (BindableDouble)config.GetBindable(OsuConfig.CursorSize) + Bindable = (BindableDouble)config.GetWeldedBindable(OsuConfig.CursorSize) }, new OsuCheckbox { LabelText = "Automatic cursor size", - Bindable = config.GetBindable(OsuConfig.AutomaticCursorSizing) + Bindable = config.GetWeldedBindable(OsuConfig.AutomaticCursorSizing) }, }; } diff --git a/osu.Game/Screens/OsuGameScreen.cs b/osu.Game/Screens/OsuGameScreen.cs index 7aa3d5a5d0..70bf70ad1d 100644 --- a/osu.Game/Screens/OsuGameScreen.cs +++ b/osu.Game/Screens/OsuGameScreen.cs @@ -24,43 +24,20 @@ namespace osu.Game.Screens protected new OsuGameBase Game => base.Game as OsuGameBase; - private bool boundToBeatmap; - private Bindable beatmap; + private readonly Bindable beatmap = new Bindable(); public WorkingBeatmap Beatmap { get { - bindBeatmap(); return beatmap.Value; } set { - bindBeatmap(); beatmap.Value = value; } } - private void bindBeatmap() - { - if (beatmap == null) - beatmap = new Bindable(); - - if (!boundToBeatmap) - { - beatmap.ValueChanged += beatmap_ValueChanged; - boundToBeatmap = true; - } - } - - protected override void Dispose(bool isDisposing) - { - if (boundToBeatmap) - beatmap.ValueChanged -= beatmap_ValueChanged; - - base.Dispose(isDisposing); - } - private void beatmap_ValueChanged(object sender, EventArgs e) { OnBeatmapChanged(beatmap.Value); @@ -69,19 +46,8 @@ namespace osu.Game.Screens [BackgroundDependencyLoader(permitNulls: true)] private void load(OsuGameBase game) { - if (beatmap == null) - beatmap = game?.Beatmap; - } - - public override bool Push(Screen screen) - { - OsuScreen nextOsu = screen as OsuScreen; - if (nextOsu != null) - { - nextOsu.beatmap = beatmap; - } - - return base.Push(screen); + beatmap.Weld(game?.Beatmap); + beatmap.ValueChanged += beatmap_ValueChanged; } protected virtual void OnBeatmapChanged(WorkingBeatmap beatmap) diff --git a/osu.Game/Screens/Play/Player.cs b/osu.Game/Screens/Play/Player.cs index b552601458..b94a130bdc 100644 --- a/osu.Game/Screens/Play/Player.cs +++ b/osu.Game/Screens/Play/Player.cs @@ -71,7 +71,7 @@ namespace osu.Game.Screens.Play [BackgroundDependencyLoader] private void load(AudioManager audio, BeatmapDatabase beatmaps, OsuGameBase game, OsuConfigManager config) { - dimLevel = config.GetBindable(OsuConfig.DimLevel); + dimLevel = config.GetWeldedBindable(OsuConfig.DimLevel); try { if (Beatmap == null) diff --git a/osu.Game/Screens/Play/PlayerInputManager.cs b/osu.Game/Screens/Play/PlayerInputManager.cs index 181cd68da9..3bafc3935a 100644 --- a/osu.Game/Screens/Play/PlayerInputManager.cs +++ b/osu.Game/Screens/Play/PlayerInputManager.cs @@ -25,7 +25,7 @@ namespace osu.Game.Screens.Play [BackgroundDependencyLoader] private void load(OsuConfigManager config) { - mouseDisabled = config.GetBindable(OsuConfig.MouseDisableButtons) + mouseDisabled = config.GetWeldedBindable(OsuConfig.MouseDisableButtons) ?? new Bindable(false); }