mirror of
https://github.com/ppy/osu.git
synced 2024-12-13 08:32:57 +08:00
Fix the initial state of VolumeControl being wrong.
This commit is contained in:
parent
bdb72d7b82
commit
065b193b15
@ -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();
|
||||
|
Loading…
Reference in New Issue
Block a user