1
0
mirror of https://github.com/ppy/osu.git synced 2026-06-03 06:09:54 +08:00

Fix the initial state of VolumeControl being wrong.

This commit is contained in:
Dean Herbert
2016-10-07 03:27:24 +09:00
Unverified
parent bdb72d7b82
commit 065b193b15
+10 -2
View File
@@ -34,6 +34,7 @@ namespace osu.Game
Origin = Anchor.BottomRight,
Position = new Vector2(10, 10),
Size = new Vector2(40, 180),
Alpha = 0,
Children = new Drawable[]
{
new Box
@@ -66,6 +67,8 @@ namespace osu.Game
}
}
};
updateFill();
}
protected override bool OnWheelDown(InputState state)
@@ -73,7 +76,7 @@ namespace osu.Game
appear();
VolumeGlobal.Value -= 0.05f;
meterFill.ScaleTo(new Vector2(1, (float)VolumeGlobal.Value), 300, EasingTypes.OutQuint);
updateFill();
return base.OnWheelDown(state);
}
@@ -83,11 +86,16 @@ namespace osu.Game
appear();
VolumeGlobal.Value += 0.05f;
meterFill.ScaleTo(new Vector2(1, (float)VolumeGlobal.Value), 300, EasingTypes.OutQuint);
updateFill();
return base.OnWheelUp(state);
}
private void updateFill()
{
meterFill.ScaleTo(new Vector2(1, (float)VolumeGlobal.Value), 300, EasingTypes.OutQuint);
}
private void appear()
{
meterContainer.ClearTransformations();