mirror of
https://github.com/ppy/osu
synced 2025-01-31 10:22:02 +00:00
Don't rely on parent's clock
This commit is contained in:
parent
aef82acb0d
commit
20156d26f9
@ -160,13 +160,13 @@ namespace osu.Game.Screens.Play
|
||||
},
|
||||
Children = new Drawable[]
|
||||
{
|
||||
new SkipButton(firstObjectTime) { AudioClock = decoupledClock },
|
||||
new Container
|
||||
{
|
||||
RelativeSizeAxes = Axes.Both,
|
||||
Clock = offsetClock,
|
||||
Children = new Drawable[]
|
||||
{
|
||||
new SkipButton(firstObjectTime) { AudioClock = decoupledClock, Depth = 1 },
|
||||
HitRenderer,
|
||||
}
|
||||
},
|
||||
|
@ -54,6 +54,11 @@ namespace osu.Game.Screens.Play
|
||||
[BackgroundDependencyLoader]
|
||||
private void load(OsuColour colours)
|
||||
{
|
||||
var baseClock = Clock;
|
||||
|
||||
if (AudioClock != null)
|
||||
Clock = new FramedClock(AudioClock);
|
||||
|
||||
Children = new Drawable[]
|
||||
{
|
||||
fadeContainer = new FadeContainer
|
||||
@ -63,6 +68,7 @@ namespace osu.Game.Screens.Play
|
||||
{
|
||||
button = new Button
|
||||
{
|
||||
Clock = baseClock,
|
||||
Anchor = Anchor.Centre,
|
||||
Origin = Anchor.Centre,
|
||||
},
|
||||
@ -109,7 +115,7 @@ namespace osu.Game.Screens.Play
|
||||
protected override void Update()
|
||||
{
|
||||
base.Update();
|
||||
remainingTimeBox.Width = (float)Math.Max(0, 1 - (Time.Current - displayTime) / (beginFadeTime - displayTime));
|
||||
remainingTimeBox.ResizeWidthTo((float)Math.Max(0, 1 - (Time.Current - displayTime) / (beginFadeTime - displayTime)), 120, EasingTypes.OutQuint);
|
||||
}
|
||||
|
||||
protected override bool OnKeyDown(InputState state, KeyDownEventArgs args)
|
||||
@ -273,9 +279,10 @@ namespace osu.Game.Screens.Play
|
||||
|
||||
protected override bool OnClick(InputState state)
|
||||
{
|
||||
box.FlashColour(Color4.White, 500, EasingTypes.OutQuint);
|
||||
|
||||
Action?.Invoke();
|
||||
|
||||
box.FlashColour(Color4.White, 500, EasingTypes.OutQuint);
|
||||
aspect.ScaleTo(1.2f, 2000, EasingTypes.OutQuint);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user