Don't rely on parent's clock

This commit is contained in:
Dean Herbert 2017-05-19 22:12:09 +09:00
parent aef82acb0d
commit 20156d26f9
2 changed files with 11 additions and 4 deletions

View File

@ -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,
}
},

View File

@ -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;
}
}