New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Skip button redesign & refactor #801

Merged
merged 6 commits into from May 19, 2017
Jump to file or symbol
Failed to load files and symbols.
+11 −4
Diff settings

Always

Just for now

Viewing a subset of changes. View all

Don't rely on parent's clock

  • Loading branch information...
peppy committed May 19, 2017
commit 20156d26f9e2a3fe9e5bbeffa32b976dde42c348
@@ -160,13 +160,13 @@ private void load(AudioManager audio, BeatmapDatabase beatmaps, OsuConfigManager
},
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 @@ protected override bool OnMouseMove(InputState state)
[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 @@ private void load(OsuColour colours)
{
button = new Button
{
Clock = baseClock,
Anchor = Anchor.Centre,
Origin = Anchor.Centre,
},
@@ -109,7 +115,7 @@ protected override void LoadComplete()
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 @@ protected override bool OnMouseUp(InputState state, MouseUpEventArgs args)
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;
}
}
ProTip! Use n and p to navigate between commits in a pull request.