From 139fe873f3d3833325a90d400926100595fef70f Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Tue, 29 Nov 2016 18:35:40 +0900 Subject: [PATCH 1/3] Remove silly weld weld weld. --- .../UserInterface/Volume/VolumeControl.cs | 27 +++++++------------ 1 file changed, 10 insertions(+), 17 deletions(-) diff --git a/osu.Game/Graphics/UserInterface/Volume/VolumeControl.cs b/osu.Game/Graphics/UserInterface/Volume/VolumeControl.cs index c94eb40c17..13accc4914 100644 --- a/osu.Game/Graphics/UserInterface/Volume/VolumeControl.cs +++ b/osu.Game/Graphics/UserInterface/Volume/VolumeControl.cs @@ -14,10 +14,6 @@ namespace osu.Game.Graphics.UserInterface.Volume { internal class VolumeControl : OverlayContainer { - private BindableDouble volumeGlobal = new BindableDouble(); - private BindableDouble volumeSample = new BindableDouble(); - private BindableDouble volumeTrack = new BindableDouble(); - private VolumeMeter volumeMeterMaster; private void volumeChanged(object sender, EventArgs e) @@ -55,21 +51,18 @@ namespace osu.Game.Graphics.UserInterface.Volume { base.LoadComplete(); - volumeGlobal.ValueChanged += volumeChanged; - volumeSample.ValueChanged += volumeChanged; - volumeTrack.ValueChanged += volumeChanged; - - volumeMeterMaster.Bindable.Weld(volumeGlobal); - volumeMeterEffect.Bindable.Weld(volumeSample); - volumeMeterMusic.Bindable.Weld(volumeTrack); + volumeMeterMaster.Bindable.ValueChanged += volumeChanged; + volumeMeterEffect.Bindable.ValueChanged += volumeChanged; + volumeMeterMusic.Bindable.ValueChanged += volumeChanged; } protected override void Dispose(bool isDisposing) { - volumeGlobal.ValueChanged -= volumeChanged; - volumeSample.ValueChanged -= volumeChanged; - volumeTrack.ValueChanged -= volumeChanged; base.Dispose(isDisposing); + + volumeMeterMaster.Bindable.ValueChanged -= volumeChanged; + volumeMeterEffect.Bindable.ValueChanged -= volumeChanged; + volumeMeterMusic.Bindable.ValueChanged -= volumeChanged; } public void Adjust(InputState state) @@ -86,9 +79,9 @@ namespace osu.Game.Graphics.UserInterface.Volume [BackgroundDependencyLoader] private void load(AudioManager audio) { - volumeGlobal.Weld(audio.Volume); - volumeSample.Weld(audio.VolumeSample); - volumeTrack.Weld(audio.VolumeTrack); + volumeMeterMaster.Bindable.Weld(audio.Volume); + volumeMeterEffect.Bindable.Weld(audio.VolumeSample); + volumeMeterMusic.Bindable.Weld(audio.VolumeTrack); } ScheduledDelegate popOutDelegate; From fa80cc84f83e4af868e61dc666dd144f6be1c63d Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Tue, 29 Nov 2016 18:35:59 +0900 Subject: [PATCH 2/3] Fix volume control fill being incorrect on first display. --- osu.Game/Graphics/UserInterface/Volume/VolumeMeter.cs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/osu.Game/Graphics/UserInterface/Volume/VolumeMeter.cs b/osu.Game/Graphics/UserInterface/Volume/VolumeMeter.cs index 230066cf9b..4416a1da80 100644 --- a/osu.Game/Graphics/UserInterface/Volume/VolumeMeter.cs +++ b/osu.Game/Graphics/UserInterface/Volume/VolumeMeter.cs @@ -41,6 +41,7 @@ namespace osu.Game.Graphics.UserInterface.Volume meterFill = new Box { Colour = Color4.White, + Scale = new Vector2(1, 0), RelativeSizeAxes = Axes.Both, Origin = Anchor.BottomCentre, Anchor = Anchor.BottomCentre @@ -54,6 +55,8 @@ namespace osu.Game.Graphics.UserInterface.Volume Origin = Anchor.TopCentre } }; + + Bindable.ValueChanged += delegate { updateFill(); }; } protected override void LoadComplete() @@ -68,7 +71,6 @@ namespace osu.Game.Graphics.UserInterface.Volume private set { Bindable.Value = value; - updateFill(); } } From fbf35c904d503ff4b9be4317f0b7bc74bbbee373 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Tue, 29 Nov 2016 18:49:03 +0900 Subject: [PATCH 3/3] Fix Config regression with DI. --- osu.Game/OsuGameBase.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu.Game/OsuGameBase.cs b/osu.Game/OsuGameBase.cs index 2f3e5025b7..f58e868e1c 100644 --- a/osu.Game/OsuGameBase.cs +++ b/osu.Game/OsuGameBase.cs @@ -41,7 +41,7 @@ namespace osu.Game private void load() { Dependencies.Cache(this); - Dependencies.Cache(new OsuConfigManager(Host.Storage)); + Dependencies.Cache(Config); Dependencies.Cache(new BeatmapDatabase(Host.Storage, Host)); //this completely overrides the framework default. will need to change once we make a proper FontStore.