1
0
mirror of https://github.com/ppy/osu synced 2025-03-22 19:06:58 +00:00

Merge remote-tracking branch 'refs/remotes/ppy/master' into scrollable_carousel

This commit is contained in:
EVAST9919 2017-07-23 13:27:03 +03:00
commit d9e9ab22db
153 changed files with 797 additions and 1060 deletions
osu-framework
osu.Desktop.VisualTests/Tests
osu.Desktop/Overlays
osu.Game.Rulesets.Mania/UI
osu.Game.Rulesets.Osu
osu.Game.Rulesets.Taiko
osu.Game.Tests/Beatmaps/IO
osu.Game

@ -1 +1 @@
Subproject commit 2d2e2fe698ab32d80d5e856f52c8c398ceb35540 Subproject commit b2d10ab19b74ecd38911f8bdf278b42379da0530

View File

@ -177,9 +177,7 @@ namespace osu.Desktop.VisualTests.Tests
beatsPerMinute.Value = 60000 / timingPoint.BeatLength; beatsPerMinute.Value = 60000 / timingPoint.BeatLength;
adjustedBeatLength.Value = timingPoint.BeatLength; adjustedBeatLength.Value = timingPoint.BeatLength;
flashLayer.ClearTransforms(); flashLayer.FadeOutFromOne(timingPoint.BeatLength);
flashLayer.FadeTo(1);
flashLayer.FadeTo(0, timingPoint.BeatLength);
} }
} }

View File

@ -59,20 +59,13 @@ namespace osu.Desktop.VisualTests.Tests
{ {
base.LoadComplete(); base.LoadComplete();
using (container.BeginLoopedSequence()) // Move box along a square trajectory
{ container.Loop(c => c
container.MoveTo(new Vector2(0, 100), duration); .MoveTo(new Vector2(0, 100), duration).Then()
using (container.BeginDelayedSequence(duration)) .MoveTo(new Vector2(100, 100), duration).Then()
{ .MoveTo(new Vector2(100, 0), duration).Then()
container.MoveTo(new Vector2(100, 100), duration); .MoveTo(Vector2.Zero, duration)
using (container.BeginDelayedSequence(duration)) );
{
container.MoveTo(new Vector2(100, 0), duration);
using (container.BeginDelayedSequence(duration))
container.MoveTo(Vector2.Zero, duration);
}
}
}
} }
private class MyContextMenuContainer : Container, IHasContextMenu private class MyContextMenuContainer : Container, IHasContextMenu
@ -95,10 +88,10 @@ namespace osu.Desktop.VisualTests.Tests
{ {
new OsuContextMenuItem(@"Simple option"), new OsuContextMenuItem(@"Simple option"),
new OsuContextMenuItem(@"Simple very very long option"), new OsuContextMenuItem(@"Simple very very long option"),
new OsuContextMenuItem(@"Change width", MenuItemType.Highlighted) { Action = () => ResizeWidthTo(Width * 2, 100, EasingTypes.OutQuint) }, new OsuContextMenuItem(@"Change width", MenuItemType.Highlighted) { Action = () => this.ResizeWidthTo(Width * 2, 100, Easing.OutQuint) },
new OsuContextMenuItem(@"Change height", MenuItemType.Highlighted) { Action = () => ResizeHeightTo(Height * 2, 100, EasingTypes.OutQuint) }, new OsuContextMenuItem(@"Change height", MenuItemType.Highlighted) { Action = () => this.ResizeHeightTo(Height * 2, 100, Easing.OutQuint) },
new OsuContextMenuItem(@"Change width back", MenuItemType.Destructive) { Action = () => ResizeWidthTo(Width / 2, 100, EasingTypes.OutQuint) }, new OsuContextMenuItem(@"Change width back", MenuItemType.Destructive) { Action = () => this.ResizeWidthTo(Width / 2, 100, Easing.OutQuint) },
new OsuContextMenuItem(@"Change height back", MenuItemType.Destructive) { Action = () => ResizeHeightTo(Height / 2, 100, EasingTypes.OutQuint) }, new OsuContextMenuItem(@"Change height back", MenuItemType.Destructive) { Action = () => this.ResizeHeightTo(Height / 2, 100, Easing.OutQuint) },
}; };
} }
} }

View File

@ -96,7 +96,7 @@ namespace osu.Desktop.VisualTests.Tests
{ {
SelectionBox.ScaleTo( SelectionBox.ScaleTo(
new Vector2(value, 1), new Vector2(value, 1),
300, EasingTypes.OutQuint); 300, Easing.OutQuint);
} }
} }
} }

View File

@ -56,10 +56,7 @@ namespace osu.Desktop.VisualTests.Tests
} }
if (remaining > 0) if (remaining > 0)
{ Scheduler.AddDelayed(() => sendBarrage(remaining - 1), 80);
Delay(80);
Schedule(() => sendBarrage(remaining - 1));
}
} }
protected override void Update() protected override void Update()

View File

@ -196,7 +196,7 @@ namespace osu.Desktop.VisualTests.Tests
protected override void LoadComplete() protected override void LoadComplete()
{ {
base.LoadComplete(); base.LoadComplete();
FadeInFromZero(250, EasingTypes.OutQuint); this.FadeInFromZero(250, Easing.OutQuint);
} }
protected override void Update() protected override void Update()

View File

@ -67,6 +67,8 @@ namespace osu.Desktop.VisualTests.Tests
private void changePlayfieldSize(int step) private void changePlayfieldSize(int step)
{ {
double delay = 0;
// Add new hits // Add new hits
switch (step) switch (step)
{ {
@ -84,7 +86,7 @@ namespace osu.Desktop.VisualTests.Tests
break; break;
case 5: case 5:
addSwell(1000); addSwell(1000);
playfieldContainer.Delay(scroll_time - 100); delay = scroll_time - 100;
break; break;
} }
@ -92,10 +94,10 @@ namespace osu.Desktop.VisualTests.Tests
switch (step) switch (step)
{ {
default: default:
playfieldContainer.ResizeTo(new Vector2(1, rng.Next(25, 400)), 500); playfieldContainer.Delay(delay).ResizeTo(new Vector2(1, rng.Next(25, 400)), 500);
break; break;
case 6: case 6:
playfieldContainer.ResizeTo(new Vector2(1, TaikoPlayfield.DEFAULT_PLAYFIELD_HEIGHT), 500); playfieldContainer.Delay(delay).ResizeTo(new Vector2(1, TaikoPlayfield.DEFAULT_PLAYFIELD_HEIGHT), 500);
break; break;
} }
} }

View File

@ -175,7 +175,7 @@ namespace osu.Desktop.Overlays
protected override void PopIn() protected override void PopIn()
{ {
FadeIn(1000); this.FadeIn(1000);
} }
protected override void PopOut() protected override void PopOut()

View File

@ -206,8 +206,8 @@ namespace osu.Game.Rulesets.Mania.UI
if (args.Key == Key) if (args.Key == Key)
{ {
background.FadeTo(background.Alpha + 0.2f, 50, EasingTypes.OutQuint); background.FadeTo(background.Alpha + 0.2f, 50, Easing.OutQuint);
keyIcon.ScaleTo(1.4f, 50, EasingTypes.OutQuint); keyIcon.ScaleTo(1.4f, 50, Easing.OutQuint);
} }
return false; return false;
@ -217,8 +217,8 @@ namespace osu.Game.Rulesets.Mania.UI
{ {
if (args.Key == Key) if (args.Key == Key)
{ {
background.FadeTo(0.2f, 800, EasingTypes.OutQuart); background.FadeTo(0.2f, 800, Easing.OutQuart);
keyIcon.ScaleTo(1f, 400, EasingTypes.OutQuart); keyIcon.ScaleTo(1f, 400, Easing.OutQuart);
} }
return false; return false;

View File

@ -16,8 +16,6 @@ using System.Linq;
using System.Collections.Generic; using System.Collections.Generic;
using osu.Game.Rulesets.Objects.Drawables; using osu.Game.Rulesets.Objects.Drawables;
using osu.Framework.Input; using osu.Framework.Input;
using osu.Framework.Graphics.Transforms;
using osu.Framework.MathUtils;
using osu.Game.Rulesets.Mania.Objects.Drawables; using osu.Game.Rulesets.Mania.Objects.Drawables;
using osu.Game.Rulesets.Timing; using osu.Game.Rulesets.Timing;
using osu.Framework.Configuration; using osu.Framework.Configuration;
@ -222,10 +220,10 @@ namespace osu.Game.Rulesets.Mania.UI
switch (args.Key) switch (args.Key)
{ {
case Key.Minus: case Key.Minus:
transformVisibleTimeRangeTo(visibleTimeRange + time_span_step, 200, EasingTypes.OutQuint); transformVisibleTimeRangeTo(visibleTimeRange + time_span_step, 200, Easing.OutQuint);
break; break;
case Key.Plus: case Key.Plus:
transformVisibleTimeRangeTo(visibleTimeRange - time_span_step, 200, EasingTypes.OutQuint); transformVisibleTimeRangeTo(visibleTimeRange - time_span_step, 200, Easing.OutQuint);
break; break;
} }
} }
@ -233,9 +231,9 @@ namespace osu.Game.Rulesets.Mania.UI
return false; return false;
} }
private void transformVisibleTimeRangeTo(double newTimeRange, double duration = 0, EasingTypes easing = EasingTypes.None) private void transformVisibleTimeRangeTo(double newTimeRange, double duration = 0, Easing easing = Easing.None)
{ {
TransformTo(newTimeRange, duration, easing, new TransformTimeSpan()); this.TransformTo(nameof(visibleTimeRange), newTimeRange, duration, easing);
} }
protected override void Update() protected override void Update()
@ -244,23 +242,5 @@ namespace osu.Game.Rulesets.Mania.UI
// While masking on effectively only the Y-axis, so we need to set the width of the bar line container manually // While masking on effectively only the Y-axis, so we need to set the width of the bar line container manually
barLineContainer.Width = columns.Width; barLineContainer.Width = columns.Width;
} }
private class TransformTimeSpan : Transform<double, Drawable>
{
public double CurrentValue
{
get
{
double time = Time?.Current ?? 0;
if (time < StartTime) return StartValue;
if (time >= EndTime) return EndValue;
return Interpolation.ValueAt(time, StartValue, EndValue, StartTime, EndTime, Easing);
}
}
public override void Apply(Drawable d) => ((ManiaPlayfield)d).visibleTimeRange.Value = (float)CurrentValue;
public override void ReadIntoStartValue(Drawable d) => StartValue = ((ManiaPlayfield)d).visibleTimeRange.Value;
}
} }
} }

View File

@ -94,12 +94,11 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables.Connections
using (fp.BeginAbsoluteSequence(fadeInTime)) using (fp.BeginAbsoluteSequence(fadeInTime))
{ {
fp.FadeIn(DrawableOsuHitObject.TIME_FADEIN); fp.FadeIn(DrawableOsuHitObject.TIME_FADEIN);
fp.ScaleTo(1, DrawableOsuHitObject.TIME_FADEIN, EasingTypes.Out); fp.ScaleTo(1, DrawableOsuHitObject.TIME_FADEIN, Easing.Out);
fp.MoveTo(pointEndPosition, DrawableOsuHitObject.TIME_FADEIN, EasingTypes.Out); fp.MoveTo(pointEndPosition, DrawableOsuHitObject.TIME_FADEIN, Easing.Out);
fp.Delay(fadeOutTime - fadeInTime); fp.Delay(fadeOutTime - fadeInTime).FadeOut(DrawableOsuHitObject.TIME_FADEIN);
fp.FadeOut(DrawableOsuHitObject.TIME_FADEIN);
} }
fp.Expire(true); fp.Expire(true);

View File

@ -112,29 +112,26 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables
{ {
double duration = ((HitObject as IHasEndTime)?.EndTime ?? HitObject.StartTime) - HitObject.StartTime; double duration = ((HitObject as IHasEndTime)?.EndTime ?? HitObject.StartTime) - HitObject.StartTime;
using (glow.BeginDelayedSequence(duration)) glow.Delay(duration).FadeOut(400);
glow.FadeOut(400);
switch (state) switch (state)
{ {
case ArmedState.Idle: case ArmedState.Idle:
using (BeginDelayedSequence(duration + TIME_PREEMPT)) this.Delay(duration + TIME_PREEMPT).FadeOut(TIME_FADEOUT);
FadeOut(TIME_FADEOUT);
Expire(true); Expire(true);
break; break;
case ArmedState.Miss: case ArmedState.Miss:
ApproachCircle.FadeOut(50); ApproachCircle.FadeOut(50);
FadeOut(TIME_FADEOUT / 5); this.FadeOut(TIME_FADEOUT / 5);
Expire(); Expire();
break; break;
case ArmedState.Hit: case ArmedState.Hit:
ApproachCircle.FadeOut(50); ApproachCircle.FadeOut(50);
const double flash_in = 40; const double flash_in = 40;
flash.FadeTo(0.8f, flash_in)
flash.FadeTo(0.8f, flash_in); .Then()
using (flash.BeginDelayedSequence(flash_in)) .FadeOut(100);
flash.FadeOut(100);
explode.FadeIn(flash_in); explode.FadeIn(flash_in);
@ -145,8 +142,8 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables
circle.FadeOut(); circle.FadeOut();
number.FadeOut(); number.FadeOut();
FadeOut(800); this.FadeOut(800)
ScaleTo(Scale * 1.5f, 400, EasingTypes.OutQuad); .ScaleTo(Scale * 1.5f, 400, Easing.OutQuad);
} }
Expire(); Expire();

View File

@ -4,6 +4,7 @@
using System.ComponentModel; using System.ComponentModel;
using osu.Game.Rulesets.Objects.Drawables; using osu.Game.Rulesets.Objects.Drawables;
using osu.Game.Rulesets.Osu.Judgements; using osu.Game.Rulesets.Osu.Judgements;
using osu.Framework.Graphics;
namespace osu.Game.Rulesets.Osu.Objects.Drawables namespace osu.Game.Rulesets.Osu.Objects.Drawables
{ {
@ -24,7 +25,7 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables
protected sealed override void UpdateState(ArmedState state) protected sealed override void UpdateState(ArmedState state)
{ {
Flush(); FinishTransforms();
using (BeginAbsoluteSequence(HitObject.StartTime - TIME_PREEMPT, true)) using (BeginAbsoluteSequence(HitObject.StartTime - TIME_PREEMPT, true))
{ {
@ -44,7 +45,7 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables
protected virtual void UpdatePreemptState() protected virtual void UpdatePreemptState()
{ {
FadeIn(TIME_FADEIN); this.FadeIn(TIME_FADEIN);
} }
protected virtual void UpdateCurrentState(ArmedState state) protected virtual void UpdateCurrentState(ArmedState state)

View File

@ -18,7 +18,7 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables
protected override void LoadComplete() protected override void LoadComplete()
{ {
if (Judgement.Result != HitResult.Miss) if (Judgement.Result != HitResult.Miss)
JudgementText.TransformSpacingTo(new Vector2(14, 0), 1800, EasingTypes.OutQuint); JudgementText.TransformSpacingTo(new Vector2(14, 0), 1800, Easing.OutQuint);
base.LoadComplete(); base.LoadComplete();
} }

View File

@ -158,14 +158,14 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables
{ {
ball.FadeIn(); ball.FadeIn();
Delay(slider.Duration, true); using (BeginDelayedSequence(slider.Duration, true))
{
body.FadeOut(160); body.FadeOut(160);
ball.FadeOut(160); ball.FadeOut(160);
FadeOut(800); this.FadeOut(800)
.Expire();
Expire(); }
} }
public Drawable ProxiedLayer => initialCircle.ApproachCircle; public Drawable ProxiedLayer => initialCircle.ApproachCircle;

View File

@ -62,14 +62,12 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables
{ {
var animIn = Math.Min(150, sliderTick.StartTime - FadeInTime); var animIn = Math.Min(150, sliderTick.StartTime - FadeInTime);
ScaleTo(0.5f); this.Animate(
ScaleTo(1.2f, animIn); d => d.FadeIn(animIn),
FadeIn(animIn); d => d.ScaleTo(0.5f).ScaleTo(1.2f, animIn)
).Then(
Delay(animIn); d => d.ScaleTo(1, 150, Easing.Out)
ScaleTo(1, 150, EasingTypes.Out); );
Delay(-animIn);
} }
protected override void UpdateCurrentState(ArmedState state) protected override void UpdateCurrentState(ArmedState state)
@ -77,16 +75,15 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables
switch (state) switch (state)
{ {
case ArmedState.Idle: case ArmedState.Idle:
Delay(FadeOutTime - sliderTick.StartTime); this.Delay(FadeOutTime - sliderTick.StartTime).FadeOut();
FadeOut();
break; break;
case ArmedState.Miss: case ArmedState.Miss:
FadeOut(160); this.FadeOut(160)
FadeColour(Color4.Red, 80); .FadeColour(Color4.Red, 80);
break; break;
case ArmedState.Hit: case ArmedState.Hit:
FadeOut(120, EasingTypes.OutQuint); this.FadeOut(120, Easing.OutQuint)
ScaleTo(Scale * 1.5f, 120, EasingTypes.OutQuint); .ScaleTo(Scale * 1.5f, 120, Easing.OutQuint);
break; break;
} }
} }

View File

@ -174,9 +174,9 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables
ticks.Rotation = disc.Rotation; ticks.Rotation = disc.Rotation;
float relativeCircleScale = spinner.Scale * circle.DrawHeight / mainContainer.DrawHeight; float relativeCircleScale = spinner.Scale * circle.DrawHeight / mainContainer.DrawHeight;
disc.ScaleTo(relativeCircleScale + (1 - relativeCircleScale) * Progress, 200, EasingTypes.OutQuint); disc.ScaleTo(relativeCircleScale + (1 - relativeCircleScale) * Progress, 200, Easing.OutQuint);
symbol.RotateTo(disc.Rotation / 2, 500, EasingTypes.OutQuint); symbol.RotateTo(disc.Rotation / 2, 500, Easing.OutQuint);
} }
protected override void UpdatePreemptState() protected override void UpdatePreemptState()
@ -184,35 +184,33 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables
base.UpdatePreemptState(); base.UpdatePreemptState();
circleContainer.ScaleTo(spinner.Scale * 0.3f); circleContainer.ScaleTo(spinner.Scale * 0.3f);
circleContainer.ScaleTo(spinner.Scale, TIME_PREEMPT / 1.4f, EasingTypes.OutQuint); circleContainer.ScaleTo(spinner.Scale, TIME_PREEMPT / 1.4f, Easing.OutQuint);
disc.RotateTo(-720); disc.RotateTo(-720);
symbol.RotateTo(-720); symbol.RotateTo(-720);
mainContainer.ScaleTo(0); mainContainer
mainContainer.ScaleTo(spinner.Scale * circle.DrawHeight / DrawHeight * 1.4f, TIME_PREEMPT - 150, EasingTypes.OutQuint); .ScaleTo(0)
.ScaleTo(spinner.Scale * circle.DrawHeight / DrawHeight * 1.4f, TIME_PREEMPT - 150, Easing.OutQuint)
mainContainer.Delay(TIME_PREEMPT - 150); .Then()
mainContainer.ScaleTo(1, 500, EasingTypes.OutQuint); .ScaleTo(1, 500, Easing.OutQuint);
} }
protected override void UpdateCurrentState(ArmedState state) protected override void UpdateCurrentState(ArmedState state)
{ {
Delay(spinner.Duration, true); var sequence = this.Delay(spinner.Duration).FadeOut(160);
FadeOut(160);
switch (state) switch (state)
{ {
case ArmedState.Hit: case ArmedState.Hit:
ScaleTo(Scale * 1.2f, 320, EasingTypes.Out); sequence.ScaleTo(Scale * 1.2f, 320, Easing.Out);
Expire();
break; break;
case ArmedState.Miss: case ArmedState.Miss:
ScaleTo(Scale * 0.8f, 320, EasingTypes.In); sequence.ScaleTo(Scale * 0.8f, 320, Easing.In);
Expire();
break; break;
} }
Expire();
} }
} }
} }

View File

@ -106,8 +106,8 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables.Pieces
tracking = value; tracking = value;
follow.ScaleTo(tracking ? 2.8f : 1, 300, EasingTypes.OutQuint); follow.ScaleTo(tracking ? 2.8f : 1, 300, Easing.OutQuint);
follow.FadeTo(tracking ? 0.2f : 0, 300, EasingTypes.OutQuint); follow.FadeTo(tracking ? 0.2f : 0, 300, Easing.OutQuint);
} }
} }

View File

@ -37,8 +37,7 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables.Pieces
protected override void LoadComplete() protected override void LoadComplete()
{ {
base.LoadComplete(); base.LoadComplete();
using (icon.BeginLoopedSequence()) icon.Spin(1000, RotationDirection.Clockwise);
icon.RotateTo(360, 1000);
} }
public void UpdateProgress(double progress, int repeat) public void UpdateProgress(double progress, int repeat)

View File

@ -4,7 +4,6 @@
using System; using System;
using osu.Framework.Graphics; using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers; using osu.Framework.Graphics.Containers;
using osu.Framework.Graphics.Transforms;
using osu.Framework.Input; using osu.Framework.Input;
using osu.Game.Graphics; using osu.Game.Graphics;
using OpenTK; using OpenTK;
@ -127,13 +126,14 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables.Pieces
if (Complete && updateCompleteTick()) if (Complete && updateCompleteTick())
{ {
background.Flush(flushType: typeof(TransformAlpha)); background.FinishTransforms(false, nameof(Alpha));
background.FadeTo(tracking_alpha + 0.2f, 60, EasingTypes.OutExpo); background
background.Delay(60); .FadeTo(tracking_alpha + 0.2f, 60, Easing.OutExpo)
background.FadeTo(tracking_alpha, 250, EasingTypes.OutQuint); .Then()
.FadeTo(tracking_alpha, 250, Easing.OutQuint);
} }
RotateTo(currentRotation / 2, validAndTracking ? 500 : 1500, EasingTypes.OutExpo); this.RotateTo(currentRotation / 2, validAndTracking ? 500 : 1500, Easing.OutExpo);
} }
} }
} }

View File

@ -36,7 +36,7 @@ namespace osu.Game.Rulesets.Osu.Replays
/// <summary> /// <summary>
/// What easing to use when moving between hitobjects /// What easing to use when moving between hitobjects
/// </summary> /// </summary>
private EasingTypes preferredEasing => DelayedMovements ? EasingTypes.InOutCubic : EasingTypes.Out; private Easing preferredEasing => DelayedMovements ? Easing.InOutCubic : Easing.Out;
#endregion #endregion
@ -110,7 +110,7 @@ namespace osu.Game.Rulesets.Osu.Replays
{ {
// Default values for circles/sliders // Default values for circles/sliders
Vector2 startPosition = h.StackedPosition; Vector2 startPosition = h.StackedPosition;
EasingTypes easing = preferredEasing; Easing easing = preferredEasing;
float spinnerDirection = -1; float spinnerDirection = -1;
// The startPosition for the slider should not be its .Position, but the point on the circle whose tangent crosses the current cursor position // The startPosition for the slider should not be its .Position, but the point on the circle whose tangent crosses the current cursor position
@ -125,7 +125,7 @@ namespace osu.Game.Rulesets.Osu.Replays
if (spinCentreOffset.Length > SPIN_RADIUS) if (spinCentreOffset.Length > SPIN_RADIUS)
{ {
// If moving in from the outside, don't ease out (default eases out). This means auto will "start" spinning immediately after moving into position. // If moving in from the outside, don't ease out (default eases out). This means auto will "start" spinning immediately after moving into position.
easing = EasingTypes.In; easing = Easing.In;
} }
} }
@ -190,7 +190,7 @@ namespace osu.Game.Rulesets.Osu.Replays
} }
} }
private void moveToHitObject(double targetTime, Vector2 targetPos, double hitObjectRadius, EasingTypes easing) private void moveToHitObject(double targetTime, Vector2 targetPos, double hitObjectRadius, Easing easing)
{ {
ReplayFrame lastFrame = Frames[Frames.Count - 1]; ReplayFrame lastFrame = Frames[Frames.Count - 1];

View File

@ -64,11 +64,10 @@ namespace osu.Game.Rulesets.Taiko.Objects.Drawables
protected override void LoadComplete() protected override void LoadComplete()
{ {
base.LoadComplete(); base.LoadComplete();
Delay(BarLine.StartTime - Time.Current); this.Delay(BarLine.StartTime - Time.Current).FadeOut(base_fadeout_time * BarLine.ScrollTime / 1000);
FadeOut(base_fadeout_time * BarLine.ScrollTime / 1000);
} }
private void updateScrollPosition(double time) => MoveToX((float)((BarLine.StartTime - time) / BarLine.ScrollTime)); private void updateScrollPosition(double time) => this.MoveToX((float)((BarLine.StartTime - time) / BarLine.ScrollTime));
protected override void Update() protected override void Update()
{ {

View File

@ -41,7 +41,7 @@ namespace osu.Game.Rulesets.Taiko.Objects.Drawables
switch (state) switch (state)
{ {
case ArmedState.Hit: case ArmedState.Hit:
Content.ScaleTo(0, 100, EasingTypes.OutQuint); Content.ScaleTo(0, 100, Easing.OutQuint);
break; break;
} }
} }

View File

@ -65,23 +65,21 @@ namespace osu.Game.Rulesets.Taiko.Objects.Drawables
protected override void UpdateState(ArmedState state) protected override void UpdateState(ArmedState state)
{ {
Delay(HitObject.StartTime - Time.Current + Judgement.TimeOffset, true);
var circlePiece = MainPiece as CirclePiece; var circlePiece = MainPiece as CirclePiece;
circlePiece?.FlashBox.FinishTransforms();
circlePiece?.FlashBox.Flush(); using (BeginDelayedSequence(HitObject.StartTime - Time.Current + Judgement.TimeOffset, true))
{
switch (State) switch (State)
{ {
case ArmedState.Idle: case ArmedState.Idle:
Delay(HitObject.HitWindowMiss); this.Delay(HitObject.HitWindowMiss).Expire();
break; break;
case ArmedState.Miss: case ArmedState.Miss:
FadeOut(100); this.FadeOut(100)
.Expire();
break; break;
case ArmedState.Hit: case ArmedState.Hit:
FadeOut(600);
var flash = circlePiece?.FlashBox; var flash = circlePiece?.FlashBox;
if (flash != null) if (flash != null)
{ {
@ -89,21 +87,20 @@ namespace osu.Game.Rulesets.Taiko.Objects.Drawables
flash.FadeOut(300); flash.FadeOut(300);
} }
FadeOut(800);
const float gravity_time = 300; const float gravity_time = 300;
const float gravity_travel_height = 200; const float gravity_travel_height = 200;
Content.ScaleTo(0.8f, gravity_time * 2, EasingTypes.OutQuad); Content.ScaleTo(0.8f, gravity_time * 2, Easing.OutQuad);
MoveToY(-gravity_travel_height, gravity_time, EasingTypes.Out); this.FadeOut(800)
Delay(gravity_time, true); .MoveToY(-gravity_travel_height, gravity_time, Easing.Out)
MoveToY(gravity_travel_height * 2, gravity_time * 2, EasingTypes.In); .Then()
break; .MoveToY(gravity_travel_height * 2, gravity_time * 2, Easing.In);
}
Expire(); Expire();
break;
}
}
} }
} }
} }

View File

@ -147,13 +147,14 @@ namespace osu.Game.Rulesets.Taiko.Objects.Drawables
var completion = (float)userHits / HitObject.RequiredHits; var completion = (float)userHits / HitObject.RequiredHits;
expandingRing.FadeTo(expandingRing.Alpha + MathHelper.Clamp(completion / 16, 0.1f, 0.6f), 50); expandingRing
using (expandingRing.BeginDelayedSequence(50)) .FadeTo(expandingRing.Alpha + MathHelper.Clamp(completion / 16, 0.1f, 0.6f), 50)
expandingRing.FadeTo(completion / 8, 2000, EasingTypes.OutQuint); .Then()
.FadeTo(completion / 8, 2000, Easing.OutQuint);
symbol.RotateTo((float)(completion * HitObject.Duration / 8), 4000, EasingTypes.OutQuint); symbol.RotateTo((float)(completion * HitObject.Duration / 8), 4000, Easing.OutQuint);
expandingRing.ScaleTo(1f + Math.Min(target_ring_scale - 1f, (target_ring_scale - 1f) * completion * 1.3f), 260, EasingTypes.OutQuint); expandingRing.ScaleTo(1f + Math.Min(target_ring_scale - 1f, (target_ring_scale - 1f) * completion * 1.3f), 260, Easing.OutQuint);
if (userHits == HitObject.RequiredHits) if (userHits == HitObject.RequiredHits)
{ {
@ -180,26 +181,21 @@ namespace osu.Game.Rulesets.Taiko.Objects.Drawables
protected override void UpdateState(ArmedState state) protected override void UpdateState(ArmedState state)
{ {
const float preempt = 100; const float preempt = 100;
Delay(HitObject.StartTime - Time.Current - preempt, true);
targetRing.ScaleTo(target_ring_scale, preempt * 4, EasingTypes.OutQuint);
Delay(preempt, true);
Delay(Judgement.TimeOffset + HitObject.Duration, true);
const float out_transition_time = 300; const float out_transition_time = 300;
double untilStartTime = HitObject.StartTime - Time.Current;
double untilJudgement = untilStartTime + Judgement.TimeOffset + HitObject.Duration;
targetRing.Delay(untilStartTime - preempt).ScaleTo(target_ring_scale, preempt * 4, Easing.OutQuint);
this.Delay(untilJudgement).FadeOut(out_transition_time, Easing.Out);
switch (state) switch (state)
{ {
case ArmedState.Hit: case ArmedState.Hit:
bodyContainer.ScaleTo(1.4f, out_transition_time); bodyContainer.Delay(untilJudgement).ScaleTo(1.4f, out_transition_time);
break; break;
} }
FadeOut(out_transition_time, EasingTypes.Out);
Expire(); Expire();
} }

View File

@ -166,9 +166,10 @@ namespace osu.Game.Rulesets.Taiko.Objects.Drawables.Pieces
double duration = timingPoint.BeatLength * 2; double duration = timingPoint.BeatLength * 2;
background.FadeEdgeEffectTo(1, pre_beat_transition_time, EasingTypes.OutQuint); background
using (background.BeginDelayedSequence(pre_beat_transition_time)) .FadeEdgeEffectTo(1, pre_beat_transition_time, Easing.OutQuint)
background.FadeEdgeEffectTo(edge_alpha_kiai, duration, EasingTypes.OutQuint); .Then()
.FadeEdgeEffectTo(edge_alpha_kiai, duration, Easing.OutQuint);
} }
} }
} }

View File

@ -6,6 +6,7 @@ using osu.Game.Rulesets.Objects.Drawables;
using osu.Framework.Allocation; using osu.Framework.Allocation;
using osu.Game.Graphics; using osu.Game.Graphics;
using osu.Game.Rulesets.Judgements; using osu.Game.Rulesets.Judgements;
using osu.Framework.Graphics;
namespace osu.Game.Rulesets.Taiko.UI namespace osu.Game.Rulesets.Taiko.UI
{ {
@ -47,7 +48,7 @@ namespace osu.Game.Rulesets.Taiko.UI
switch (Judgement.Result) switch (Judgement.Result)
{ {
case HitResult.Hit: case HitResult.Hit:
MoveToY(-100, 500); this.MoveToY(-100, 500);
break; break;
} }

View File

@ -62,8 +62,8 @@ namespace osu.Game.Rulesets.Taiko.UI
{ {
base.LoadComplete(); base.LoadComplete();
ScaleTo(3f, 1000, EasingTypes.OutQuint); this.ScaleTo(3f, 1000, Easing.OutQuint);
FadeOut(500); this.FadeOut(500);
Expire(); Expire();
} }
@ -73,7 +73,7 @@ namespace osu.Game.Rulesets.Taiko.UI
/// </summary> /// </summary>
public void VisualiseSecondHit() public void VisualiseSecondHit()
{ {
ResizeTo(new Vector2(TaikoPlayfield.HIT_TARGET_OFFSET + TaikoHitObject.DEFAULT_STRONG_CIRCLE_DIAMETER), 50); this.ResizeTo(new Vector2(TaikoPlayfield.HIT_TARGET_OFFSET + TaikoHitObject.DEFAULT_STRONG_CIRCLE_DIAMETER), 50);
} }
} }
} }

View File

@ -149,15 +149,17 @@ namespace osu.Game.Rulesets.Taiko.UI
const float down_time = 40; const float down_time = 40;
const float up_time = 1000; const float up_time = 1000;
back.ScaleTo(target.Scale.X - scale_amount, down_time, EasingTypes.OutQuint); back.ScaleTo(target.Scale.X - scale_amount, down_time, Easing.OutQuint)
back.Delay(down_time); .Then()
back.ScaleTo(1, up_time, EasingTypes.OutQuint); .ScaleTo(1, up_time, Easing.OutQuint);
target.ScaleTo(target.Scale.X - scale_amount, down_time, EasingTypes.OutQuint); target.Animate(
target.FadeTo(Math.Min(target.Alpha + alpha_amount, 1), down_time, EasingTypes.OutQuint); t => t.ScaleTo(target.Scale.X - scale_amount, down_time, Easing.OutQuint),
target.Delay(down_time); t => t.FadeTo(Math.Min(target.Alpha + alpha_amount, 1), down_time, Easing.OutQuint)
target.ScaleTo(1, up_time, EasingTypes.OutQuint); ).Then(
target.FadeOut(up_time, EasingTypes.OutQuint); t => t.ScaleTo(1, up_time, Easing.OutQuint),
t => t.FadeOut(up_time, Easing.OutQuint)
);
} }
return false; return false;

View File

@ -59,8 +59,8 @@ namespace osu.Game.Rulesets.Taiko.UI
{ {
base.LoadComplete(); base.LoadComplete();
ScaleTo(new Vector2(1, 3f), 500, EasingTypes.OutQuint); this.ScaleTo(new Vector2(1, 3f), 500, Easing.OutQuint);
FadeOut(250); this.FadeOut(250);
Expire(); Expire();
} }

View File

@ -12,6 +12,7 @@ using osu.Framework.Desktop.Platform;
using osu.Framework.Platform; using osu.Framework.Platform;
using osu.Game.Database; using osu.Game.Database;
using osu.Game.IPC; using osu.Game.IPC;
using osu.Framework.Allocation;
namespace osu.Game.Tests.Beatmaps.IO namespace osu.Game.Tests.Beatmaps.IO
{ {
@ -26,15 +27,15 @@ namespace osu.Game.Tests.Beatmaps.IO
//unfortunately for the time being we need to reference osu.Framework.Desktop for a game host here. //unfortunately for the time being we need to reference osu.Framework.Desktop for a game host here.
using (HeadlessGameHost host = new HeadlessGameHost()) using (HeadlessGameHost host = new HeadlessGameHost())
{ {
loadOsu(host); var osu = loadOsu(host);
var temp = prepareTempCopy(osz_path); var temp = prepareTempCopy(osz_path);
Assert.IsTrue(File.Exists(temp)); Assert.IsTrue(File.Exists(temp));
host.Dependencies.Get<BeatmapDatabase>().Import(temp); osu.Dependencies.Get<BeatmapDatabase>().Import(temp);
ensureLoaded(host); ensureLoaded(osu);
Assert.IsFalse(File.Exists(temp)); Assert.IsFalse(File.Exists(temp));
} }
@ -49,7 +50,7 @@ namespace osu.Game.Tests.Beatmaps.IO
Assert.IsTrue(host.IsPrimaryInstance); Assert.IsTrue(host.IsPrimaryInstance);
Assert.IsTrue(!client.IsPrimaryInstance); Assert.IsTrue(!client.IsPrimaryInstance);
loadOsu(host); var osu = loadOsu(host);
var temp = prepareTempCopy(osz_path); var temp = prepareTempCopy(osz_path);
@ -59,7 +60,7 @@ namespace osu.Game.Tests.Beatmaps.IO
if (!importer.ImportAsync(temp).Wait(10000)) if (!importer.ImportAsync(temp).Wait(10000))
Assert.Fail(@"IPC took too long to send"); Assert.Fail(@"IPC took too long to send");
ensureLoaded(host); ensureLoaded(osu);
Assert.IsFalse(File.Exists(temp)); Assert.IsFalse(File.Exists(temp));
} }
@ -71,16 +72,16 @@ namespace osu.Game.Tests.Beatmaps.IO
//unfortunately for the time being we need to reference osu.Framework.Desktop for a game host here. //unfortunately for the time being we need to reference osu.Framework.Desktop for a game host here.
using (HeadlessGameHost host = new HeadlessGameHost()) using (HeadlessGameHost host = new HeadlessGameHost())
{ {
loadOsu(host); var osu = loadOsu(host);
var temp = prepareTempCopy(osz_path); var temp = prepareTempCopy(osz_path);
Assert.IsTrue(File.Exists(temp), "Temporary file copy never substantiated"); Assert.IsTrue(File.Exists(temp), "Temporary file copy never substantiated");
using (File.OpenRead(temp)) using (File.OpenRead(temp))
host.Dependencies.Get<BeatmapDatabase>().Import(temp); osu.Dependencies.Get<BeatmapDatabase>().Import(temp);
ensureLoaded(host); ensureLoaded(osu);
File.Delete(temp); File.Delete(temp);
@ -103,19 +104,19 @@ namespace osu.Game.Tests.Beatmaps.IO
Thread.Sleep(1); Thread.Sleep(1);
//reset beatmap database (sqlite and storage backing) //reset beatmap database (sqlite and storage backing)
host.Dependencies.Get<RulesetDatabase>().Reset(); osu.Dependencies.Get<RulesetDatabase>().Reset();
host.Dependencies.Get<BeatmapDatabase>().Reset(); osu.Dependencies.Get<BeatmapDatabase>().Reset();
return osu; return osu;
} }
private void ensureLoaded(GameHost host, int timeout = 60000) private void ensureLoaded(OsuGameBase osu, int timeout = 60000)
{ {
IEnumerable<BeatmapSetInfo> resultSets = null; IEnumerable<BeatmapSetInfo> resultSets = null;
Action waitAction = () => Action waitAction = () =>
{ {
while (!(resultSets = host.Dependencies.Get<BeatmapDatabase>() while (!(resultSets = osu.Dependencies.Get<BeatmapDatabase>()
.Query<BeatmapSetInfo>().Where(s => s.OnlineBeatmapSetID == 241526)).Any()) .Query<BeatmapSetInfo>().Where(s => s.OnlineBeatmapSetID == 241526)).Any())
Thread.Sleep(50); Thread.Sleep(50);
}; };
@ -132,7 +133,7 @@ namespace osu.Game.Tests.Beatmaps.IO
//if we don't re-check here, the set will be inserted but the beatmaps won't be present yet. //if we don't re-check here, the set will be inserted but the beatmaps won't be present yet.
waitAction = () => waitAction = () =>
{ {
while ((resultBeatmaps = host.Dependencies.Get<BeatmapDatabase>() while ((resultBeatmaps = osu.Dependencies.Get<BeatmapDatabase>()
.GetAllWithChildren<BeatmapInfo>(s => s.OnlineBeatmapSetID == 241526 && s.BaseDifficultyID > 0)).Count() != 12) .GetAllWithChildren<BeatmapInfo>(s => s.OnlineBeatmapSetID == 241526 && s.BaseDifficultyID > 0)).Count() != 12)
Thread.Sleep(50); Thread.Sleep(50);
}; };
@ -140,7 +141,7 @@ namespace osu.Game.Tests.Beatmaps.IO
Assert.IsTrue(waitAction.BeginInvoke(null, null).AsyncWaitHandle.WaitOne(timeout), Assert.IsTrue(waitAction.BeginInvoke(null, null).AsyncWaitHandle.WaitOne(timeout),
@"Beatmaps did not import to the database in allocated time"); @"Beatmaps did not import to the database in allocated time");
var set = host.Dependencies.Get<BeatmapDatabase>().GetChildren(resultSets.First()); var set = osu.Dependencies.Get<BeatmapDatabase>().GetChildren(resultSets.First());
Assert.IsTrue(set.Beatmaps.Count == resultBeatmaps.Count(), Assert.IsTrue(set.Beatmaps.Count == resultBeatmaps.Count(),
$@"Incorrect database beatmap count post-import ({resultBeatmaps.Count()} but should be {set.Beatmaps.Count})."); $@"Incorrect database beatmap count post-import ({resultBeatmaps.Count()} but should be {set.Beatmaps.Count}).");
@ -150,16 +151,16 @@ namespace osu.Game.Tests.Beatmaps.IO
Assert.IsTrue(set.Beatmaps.Count > 0); Assert.IsTrue(set.Beatmaps.Count > 0);
var beatmap = host.Dependencies.Get<BeatmapDatabase>().GetWorkingBeatmap(set.Beatmaps.First(b => b.RulesetID == 0))?.Beatmap; var beatmap = osu.Dependencies.Get<BeatmapDatabase>().GetWorkingBeatmap(set.Beatmaps.First(b => b.RulesetID == 0))?.Beatmap;
Assert.IsTrue(beatmap?.HitObjects.Count > 0); Assert.IsTrue(beatmap?.HitObjects.Count > 0);
beatmap = host.Dependencies.Get<BeatmapDatabase>().GetWorkingBeatmap(set.Beatmaps.First(b => b.RulesetID == 1))?.Beatmap; beatmap = osu.Dependencies.Get<BeatmapDatabase>().GetWorkingBeatmap(set.Beatmaps.First(b => b.RulesetID == 1))?.Beatmap;
Assert.IsTrue(beatmap?.HitObjects.Count > 0); Assert.IsTrue(beatmap?.HitObjects.Count > 0);
beatmap = host.Dependencies.Get<BeatmapDatabase>().GetWorkingBeatmap(set.Beatmaps.First(b => b.RulesetID == 2))?.Beatmap; beatmap = osu.Dependencies.Get<BeatmapDatabase>().GetWorkingBeatmap(set.Beatmaps.First(b => b.RulesetID == 2))?.Beatmap;
Assert.IsTrue(beatmap?.HitObjects.Count > 0); Assert.IsTrue(beatmap?.HitObjects.Count > 0);
beatmap = host.Dependencies.Get<BeatmapDatabase>().GetWorkingBeatmap(set.Beatmaps.First(b => b.RulesetID == 3))?.Beatmap; beatmap = osu.Dependencies.Get<BeatmapDatabase>().GetWorkingBeatmap(set.Beatmaps.First(b => b.RulesetID == 3))?.Beatmap;
Assert.IsTrue(beatmap?.HitObjects.Count > 0); Assert.IsTrue(beatmap?.HitObjects.Count > 0);
} }
} }

View File

@ -35,7 +35,7 @@ namespace osu.Game.Beatmaps.Drawables
new PanelBackground(beatmap) new PanelBackground(beatmap)
{ {
RelativeSizeAxes = Axes.Both, RelativeSizeAxes = Axes.Both,
OnLoadComplete = d => d.FadeInFromZero(400, EasingTypes.Out), OnLoadComplete = d => d.FadeInFromZero(400, Easing.Out),
} }
) )
{ {

View File

@ -64,9 +64,9 @@ namespace osu.Game.Beatmaps.Drawables
} }
if (state == PanelSelectedState.Hidden) if (state == PanelSelectedState.Hidden)
FadeOut(300, EasingTypes.OutQuint); this.FadeOut(300, Easing.OutQuint);
else else
FadeIn(250); this.FadeIn(250);
} }
private PanelSelectedState state = PanelSelectedState.NotSelected; private PanelSelectedState state = PanelSelectedState.NotSelected;

View File

@ -42,7 +42,7 @@ namespace osu.Game.Graphics.Containers
{ {
if (!parallaxEnabled) if (!parallaxEnabled)
{ {
content.MoveTo(Vector2.Zero, firstUpdate ? 0 : 1000, EasingTypes.OutQuint); content.MoveTo(Vector2.Zero, firstUpdate ? 0 : 1000, Easing.OutQuint);
content.Scale = new Vector2(1 + ParallaxAmount); content.Scale = new Vector2(1 + ParallaxAmount);
} }
}; };
@ -57,7 +57,7 @@ namespace osu.Game.Graphics.Containers
if (parallaxEnabled) if (parallaxEnabled)
{ {
Vector2 offset = input.CurrentState.Mouse == null ? Vector2.Zero : ToLocalSpace(input.CurrentState.Mouse.NativeState.Position) - DrawSize / 2; Vector2 offset = input.CurrentState.Mouse == null ? Vector2.Zero : ToLocalSpace(input.CurrentState.Mouse.NativeState.Position) - DrawSize / 2;
content.MoveTo(offset * ParallaxAmount, firstUpdate ? 0 : 1000, EasingTypes.OutQuint); content.MoveTo(offset * ParallaxAmount, firstUpdate ? 0 : 1000, Easing.OutQuint);
content.Scale = new Vector2(1 + ParallaxAmount); content.Scale = new Vector2(1 + ParallaxAmount);
} }

View File

@ -29,14 +29,14 @@ namespace osu.Game.Graphics.Cursor
protected override bool OnMouseDown(InputState state, MouseDownEventArgs args) protected override bool OnMouseDown(InputState state, MouseDownEventArgs args)
{ {
ActiveCursor.Scale = new Vector2(1); ActiveCursor.Scale = new Vector2(1);
ActiveCursor.ScaleTo(1.2f, 100, EasingTypes.OutQuad); ActiveCursor.ScaleTo(1.2f, 100, Easing.OutQuad);
return base.OnMouseDown(state, args); return base.OnMouseDown(state, args);
} }
protected override bool OnMouseUp(InputState state, MouseUpEventArgs args) protected override bool OnMouseUp(InputState state, MouseUpEventArgs args)
{ {
if (!state.Mouse.HasMainButtonPressed) if (!state.Mouse.HasMainButtonPressed)
ActiveCursor.ScaleTo(1, 200, EasingTypes.OutQuad); ActiveCursor.ScaleTo(1, 200, Easing.OutQuad);
return base.OnMouseUp(state, args); return base.OnMouseUp(state, args);
} }

View File

@ -34,7 +34,7 @@ namespace osu.Game.Graphics.Cursor
if (diff > 180) diff -= 360; if (diff > 180) diff -= 360;
degrees = ActiveCursor.Rotation + diff; degrees = ActiveCursor.Rotation + diff;
ActiveCursor.RotateTo(degrees, 600, EasingTypes.OutQuint); ActiveCursor.RotateTo(degrees, 600, Easing.OutQuint);
} }
return base.OnMouseMove(state); return base.OnMouseMove(state);
@ -49,10 +49,10 @@ namespace osu.Game.Graphics.Cursor
protected override bool OnMouseDown(InputState state, MouseDownEventArgs args) protected override bool OnMouseDown(InputState state, MouseDownEventArgs args)
{ {
ActiveCursor.Scale = new Vector2(1); ActiveCursor.Scale = new Vector2(1);
ActiveCursor.ScaleTo(0.90f, 800, EasingTypes.OutQuint); ActiveCursor.ScaleTo(0.90f, 800, Easing.OutQuint);
((Cursor)ActiveCursor).AdditiveLayer.Alpha = 0; ((Cursor)ActiveCursor).AdditiveLayer.Alpha = 0;
((Cursor)ActiveCursor).AdditiveLayer.FadeInFromZero(800, EasingTypes.OutQuint); ((Cursor)ActiveCursor).AdditiveLayer.FadeInFromZero(800, Easing.OutQuint);
return base.OnMouseDown(state, args); return base.OnMouseDown(state, args);
} }
@ -62,9 +62,9 @@ namespace osu.Game.Graphics.Cursor
{ {
dragging = false; dragging = false;
((Cursor)ActiveCursor).AdditiveLayer.FadeOut(500, EasingTypes.OutQuint); ((Cursor)ActiveCursor).AdditiveLayer.FadeOut(500, Easing.OutQuint);
ActiveCursor.RotateTo(0, 600 * (1 + Math.Abs(ActiveCursor.Rotation / 720)), EasingTypes.OutElasticHalf); ActiveCursor.RotateTo(0, 600 * (1 + Math.Abs(ActiveCursor.Rotation / 720)), Easing.OutElasticHalf);
ActiveCursor.ScaleTo(1, 500, EasingTypes.OutElastic); ActiveCursor.ScaleTo(1, 500, Easing.OutElastic);
} }
return base.OnMouseUp(state, args); return base.OnMouseUp(state, args);
@ -72,21 +72,21 @@ namespace osu.Game.Graphics.Cursor
protected override bool OnClick(InputState state) protected override bool OnClick(InputState state)
{ {
((Cursor)ActiveCursor).AdditiveLayer.FadeOutFromOne(500, EasingTypes.OutQuint); ((Cursor)ActiveCursor).AdditiveLayer.FadeOutFromOne(500, Easing.OutQuint);
return base.OnClick(state); return base.OnClick(state);
} }
protected override void PopIn() protected override void PopIn()
{ {
ActiveCursor.FadeTo(1, 250, EasingTypes.OutQuint); ActiveCursor.FadeTo(1, 250, Easing.OutQuint);
ActiveCursor.ScaleTo(1, 400, EasingTypes.OutQuint); ActiveCursor.ScaleTo(1, 400, Easing.OutQuint);
} }
protected override void PopOut() protected override void PopOut()
{ {
ActiveCursor.FadeTo(0, 900, EasingTypes.OutQuint); ActiveCursor.FadeTo(0, 900, Easing.OutQuint);
ActiveCursor.ScaleTo(0, 500, EasingTypes.In); ActiveCursor.ScaleTo(0, 500, Easing.In);
} }
public class Cursor : Container public class Cursor : Container

View File

@ -37,7 +37,7 @@ namespace osu.Game.Graphics.Cursor
if (IsPresent) if (IsPresent)
{ {
AutoSizeDuration = 250; AutoSizeDuration = 250;
background.FlashColour(OsuColour.Gray(0.4f), 1000, EasingTypes.OutQuint); background.FlashColour(OsuColour.Gray(0.4f), 1000, Easing.OutQuint);
} }
else else
AutoSizeDuration = 0; AutoSizeDuration = 0;
@ -48,7 +48,7 @@ namespace osu.Game.Graphics.Cursor
public OsuTooltip() public OsuTooltip()
{ {
AutoSizeEasing = EasingTypes.OutQuint; AutoSizeEasing = Easing.OutQuint;
CornerRadius = 5; CornerRadius = 5;
Masking = true; Masking = true;
@ -83,16 +83,10 @@ namespace osu.Game.Graphics.Cursor
protected override void PopIn() protected override void PopIn()
{ {
instantMovement |= !IsPresent; instantMovement |= !IsPresent;
this.FadeIn(500, Easing.OutQuint);
ClearTransforms();
FadeIn(500, EasingTypes.OutQuint);
} }
protected override void PopOut() protected override void PopOut() => this.Delay(150).FadeOut(500, Easing.OutQuint);
{
using (BeginDelayedSequence(150))
FadeOut(500, EasingTypes.OutQuint);
}
public override void Move(Vector2 pos) public override void Move(Vector2 pos)
{ {
@ -103,7 +97,7 @@ namespace osu.Game.Graphics.Cursor
} }
else else
{ {
MoveTo(pos, 200, EasingTypes.OutQuint); this.MoveTo(pos, 200, Easing.OutQuint);
} }
} }
} }

View File

@ -4,7 +4,6 @@
using OpenTK.Graphics; using OpenTK.Graphics;
using osu.Framework.Graphics; using osu.Framework.Graphics;
using osu.Framework.Graphics.Transforms; using osu.Framework.Graphics.Transforms;
using osu.Game.Graphics.Transforms;
namespace osu.Game.Graphics namespace osu.Game.Graphics
{ {
@ -27,10 +26,8 @@ namespace osu.Game.Graphics
/// <param name="newColour">The new accent colour.</param> /// <param name="newColour">The new accent colour.</param>
/// <param name="duration">The tween duration.</param> /// <param name="duration">The tween duration.</param>
/// <param name="easing">The tween easing.</param> /// <param name="easing">The tween easing.</param>
public static void FadeAccent<T>(this T accentedDrawable, Color4 newColour, double duration = 0, EasingTypes easing = EasingTypes.None) public static TransformSequence<T> FadeAccent<T>(this T accentedDrawable, Color4 newColour, double duration = 0, Easing easing = Easing.None)
where T : Transformable<Drawable>, IHasAccentColour where T : IHasAccentColour
{ => accentedDrawable.TransformTo(nameof(accentedDrawable.AccentColour), newColour, duration, easing);
accentedDrawable.TransformTo(newColour, duration, easing, new TransformAccent());
}
} }
} }

View File

@ -1,31 +0,0 @@
// Copyright (c) 2007-2017 ppy Pty Ltd <contact@ppy.sh>.
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
using OpenTK.Graphics;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Transforms;
using osu.Framework.MathUtils;
namespace osu.Game.Graphics.Transforms
{
public class TransformAccent : Transform<Color4, Drawable>
{
/// <summary>
/// Current value of the transformed colour in linear colour space.
/// </summary>
public virtual Color4 CurrentValue
{
get
{
double time = Time?.Current ?? 0;
if (time < StartTime) return StartValue;
if (time >= EndTime) return EndValue;
return Interpolation.ValueAt(time, StartValue, EndValue, StartTime, EndTime, Easing);
}
}
public override void Apply(Drawable d) => ((IHasAccentColour)d).AccentColour = CurrentValue;
public override void ReadIntoStartValue(Drawable d) => StartValue = ((IHasAccentColour)d).AccentColour;
}
}

View File

@ -17,7 +17,7 @@ namespace osu.Game.Graphics.UserInterface
private const int resize_duration = 250; private const int resize_duration = 250;
private const EasingTypes easing = EasingTypes.InOutCubic; private const Easing easing = Easing.InOutCubic;
private float length; private float length;
/// <summary> /// <summary>

View File

@ -28,7 +28,7 @@ namespace osu.Game.Graphics.UserInterface
var tabIndex = TabContainer.IndexOf(TabMap[tab]); var tabIndex = TabContainer.IndexOf(TabMap[tab]);
t.State = tIndex < tabIndex ? Visibility.Hidden : Visibility.Visible; t.State = tIndex < tabIndex ? Visibility.Hidden : Visibility.Visible;
t.Chevron.FadeTo(tIndex <= tabIndex ? 0f : 1f, 500, EasingTypes.OutQuint); t.Chevron.FadeTo(tIndex <= tabIndex ? 0f : 1f, 500, Easing.OutQuint);
} }
}; };
} }
@ -54,13 +54,13 @@ namespace osu.Game.Graphics.UserInterface
if (State == Visibility.Visible) if (State == Visibility.Visible)
{ {
FadeIn(transition_duration, EasingTypes.OutQuint); this.FadeIn(transition_duration, Easing.OutQuint);
ScaleTo(new Vector2(1f), transition_duration, EasingTypes.OutQuint); this.ScaleTo(new Vector2(1f), transition_duration, Easing.OutQuint);
} }
else else
{ {
FadeOut(transition_duration, EasingTypes.OutQuint); this.FadeOut(transition_duration, Easing.OutQuint);
ScaleTo(new Vector2(0.8f, 1f), transition_duration, EasingTypes.OutQuint); this.ScaleTo(new Vector2(0.8f, 1f), transition_duration, Easing.OutQuint);
} }
} }
} }

View File

@ -96,11 +96,10 @@ namespace osu.Game.Graphics.UserInterface
protected override bool OnClick(Framework.Input.InputState state) protected override bool OnClick(Framework.Input.InputState state)
{ {
didClick = true; didClick = true;
colourContainer.ResizeTo(new Vector2(1.5f, 1f), click_duration, EasingTypes.In); colourContainer.ResizeTo(new Vector2(1.5f, 1f), click_duration, Easing.In);
flash(); flash();
Delay(click_duration); this.Delay(click_duration).Schedule(delegate {
Schedule(delegate {
colourContainer.ResizeTo(new Vector2(0.8f, 1f)); colourContainer.ResizeTo(new Vector2(0.8f, 1f));
spriteText.Spacing = Vector2.Zero; spriteText.Spacing = Vector2.Zero;
glowContainer.FadeOut(); glowContainer.FadeOut();
@ -111,10 +110,10 @@ namespace osu.Game.Graphics.UserInterface
protected override bool OnHover(Framework.Input.InputState state) protected override bool OnHover(Framework.Input.InputState state)
{ {
spriteText.TransformSpacingTo(hoverSpacing, hover_duration, EasingTypes.OutElastic); spriteText.TransformSpacingTo(hoverSpacing, hover_duration, Easing.OutElastic);
colourContainer.ResizeTo(new Vector2(hover_width, 1f), hover_duration, EasingTypes.OutElastic); colourContainer.ResizeTo(new Vector2(hover_width, 1f), hover_duration, Easing.OutElastic);
glowContainer.FadeIn(glow_fade_duration, EasingTypes.Out); glowContainer.FadeIn(glow_fade_duration, Easing.Out);
base.OnHover(state); base.OnHover(state);
return true; return true;
} }
@ -123,9 +122,9 @@ namespace osu.Game.Graphics.UserInterface
{ {
if (!didClick) if (!didClick)
{ {
colourContainer.ResizeTo(new Vector2(0.8f, 1f), hover_duration, EasingTypes.OutElastic); colourContainer.ResizeTo(new Vector2(0.8f, 1f), hover_duration, Easing.OutElastic);
spriteText.TransformSpacingTo(Vector2.Zero, hover_duration, EasingTypes.OutElastic); spriteText.TransformSpacingTo(Vector2.Zero, hover_duration, Easing.OutElastic);
glowContainer.FadeOut(glow_fade_duration, EasingTypes.Out); glowContainer.FadeOut(glow_fade_duration, Easing.Out);
} }
didClick = false; didClick = false;

View File

@ -84,31 +84,31 @@ namespace osu.Game.Graphics.UserInterface
protected override bool OnHover(InputState state) protected override bool OnHover(InputState state)
{ {
hover.FadeIn(500, EasingTypes.OutQuint); hover.FadeIn(500, Easing.OutQuint);
return base.OnHover(state); return base.OnHover(state);
} }
protected override void OnHoverLost(InputState state) protected override void OnHoverLost(InputState state)
{ {
hover.FadeOut(500, EasingTypes.OutQuint); hover.FadeOut(500, Easing.OutQuint);
base.OnHoverLost(state); base.OnHoverLost(state);
} }
protected override bool OnClick(InputState state) protected override bool OnClick(InputState state)
{ {
hover.FlashColour(flashColour, 800, EasingTypes.OutQuint); hover.FlashColour(flashColour, 800, Easing.OutQuint);
return base.OnClick(state); return base.OnClick(state);
} }
protected override bool OnMouseDown(InputState state, MouseDownEventArgs args) protected override bool OnMouseDown(InputState state, MouseDownEventArgs args)
{ {
content.ScaleTo(0.75f, 2000, EasingTypes.OutQuint); content.ScaleTo(0.75f, 2000, Easing.OutQuint);
return base.OnMouseDown(state, args); return base.OnMouseDown(state, args);
} }
protected override bool OnMouseUp(InputState state, MouseUpEventArgs args) protected override bool OnMouseUp(InputState state, MouseUpEventArgs args)
{ {
content.ScaleTo(1, 1000, EasingTypes.OutElastic); content.ScaleTo(1, 1000, Easing.OutElastic);
return base.OnMouseUp(state, args); return base.OnMouseUp(state, args);
} }
} }

View File

@ -49,7 +49,7 @@ namespace osu.Game.Graphics.UserInterface
values = value.ToArray(); values = value.ToArray();
applyPath(); applyPath();
maskingContainer.Width = 0; maskingContainer.Width = 0;
maskingContainer.ResizeWidthTo(1, transform_duration, EasingTypes.OutQuint); maskingContainer.ResizeWidthTo(1, transform_duration, Easing.OutQuint);
} }
} }

View File

@ -34,14 +34,13 @@ namespace osu.Game.Graphics.UserInterface
{ {
base.LoadComplete(); base.LoadComplete();
using (spinner.BeginLoopedSequence()) spinner.Spin(2000, RotationDirection.Clockwise);
spinner.RotateTo(360, 2000);
} }
private const float transition_duration = 500; private const float transition_duration = 500;
protected override void PopIn() => FadeIn(transition_duration * 5, EasingTypes.OutQuint); protected override void PopIn() => this.FadeIn(transition_duration * 5, Easing.OutQuint);
protected override void PopOut() => FadeOut(transition_duration, EasingTypes.OutQuint); protected override void PopOut() => this.FadeOut(transition_duration, Easing.OutQuint);
} }
} }

View File

@ -43,9 +43,9 @@ namespace osu.Game.Graphics.UserInterface
Current.ValueChanged += newValue => Current.ValueChanged += newValue =>
{ {
if (newValue) if (newValue)
fill.FadeIn(200, EasingTypes.OutQuint); fill.FadeIn(200, Easing.OutQuint);
else else
fill.FadeTo(0.01f, 200, EasingTypes.OutQuint); //todo: remove once we figure why containers aren't drawing at all times fill.FadeTo(0.01f, 200, Easing.OutQuint); //todo: remove once we figure why containers aren't drawing at all times
}; };
} }
@ -80,13 +80,13 @@ namespace osu.Game.Graphics.UserInterface
if (value) if (value)
{ {
FadeColour(GlowingAccentColour, 500, EasingTypes.OutQuint); this.FadeColour(GlowingAccentColour, 500, Easing.OutQuint);
FadeEdgeEffectTo(1, 500, EasingTypes.OutQuint); FadeEdgeEffectTo(1, 500, Easing.OutQuint);
} }
else else
{ {
FadeEdgeEffectTo(0, 500); FadeEdgeEffectTo(0, 500);
FadeColour(AccentColour, 500); this.FadeColour(AccentColour, 500);
} }
} }
} }
@ -95,7 +95,7 @@ namespace osu.Game.Graphics.UserInterface
{ {
set set
{ {
ResizeTo(new Vector2(value ? EXPANDED_SIZE : COLLAPSED_SIZE, 12), 500, EasingTypes.OutQuint); this.ResizeTo(new Vector2(value ? EXPANDED_SIZE : COLLAPSED_SIZE, 12), 500, Easing.OutQuint);
} }
} }

View File

@ -91,13 +91,13 @@ namespace osu.Game.Graphics.UserInterface
protected override bool OnMouseDown(InputState state, MouseDownEventArgs args) protected override bool OnMouseDown(InputState state, MouseDownEventArgs args)
{ {
Content.ScaleTo(0.9f, 4000, EasingTypes.OutQuint); Content.ScaleTo(0.9f, 4000, Easing.OutQuint);
return base.OnMouseDown(state, args); return base.OnMouseDown(state, args);
} }
protected override bool OnMouseUp(InputState state, MouseUpEventArgs args) protected override bool OnMouseUp(InputState state, MouseUpEventArgs args)
{ {
Content.ScaleTo(1, 1000, EasingTypes.OutElastic); Content.ScaleTo(1, 1000, Easing.OutElastic);
return base.OnMouseUp(state, args); return base.OnMouseUp(state, args);
} }
} }

View File

@ -39,13 +39,13 @@ namespace osu.Game.Graphics.UserInterface
Background.Colour = colours.ContextMenuGray; Background.Colour = colours.ContextMenuGray;
} }
protected override void AnimateOpen() => FadeIn(fade_duration, EasingTypes.OutQuint); protected override void AnimateOpen() => this.FadeIn(fade_duration, Easing.OutQuint);
protected override void AnimateClose() => FadeOut(fade_duration, EasingTypes.OutQuint); protected override void AnimateClose() => this.FadeOut(fade_duration, Easing.OutQuint);
protected override void UpdateContentHeight() protected override void UpdateContentHeight()
{ {
var actualHeight = (RelativeSizeAxes & Axes.Y) > 0 ? 1 : ContentHeight; var actualHeight = (RelativeSizeAxes & Axes.Y) > 0 ? 1 : ContentHeight;
ResizeTo(new Vector2(1, State == MenuState.Opened ? actualHeight : 0), 300, EasingTypes.OutQuint); this.ResizeTo(new Vector2(1, State == MenuState.Opened ? actualHeight : 0), 300, Easing.OutQuint);
} }
} }
} }

View File

@ -93,15 +93,15 @@ namespace osu.Game.Graphics.UserInterface
protected override bool OnHover(InputState state) protected override bool OnHover(InputState state)
{ {
sampleHover.Play(); sampleHover.Play();
textBold.FadeIn(transition_length, EasingTypes.OutQuint); textBold.FadeIn(transition_length, Easing.OutQuint);
text.FadeOut(transition_length, EasingTypes.OutQuint); text.FadeOut(transition_length, Easing.OutQuint);
return base.OnHover(state); return base.OnHover(state);
} }
protected override void OnHoverLost(InputState state) protected override void OnHoverLost(InputState state)
{ {
textBold.FadeOut(transition_length, EasingTypes.OutQuint); textBold.FadeOut(transition_length, Easing.OutQuint);
text.FadeIn(transition_length, EasingTypes.OutQuint); text.FadeIn(transition_length, Easing.OutQuint);
base.OnHoverLost(state); base.OnHoverLost(state);
} }

View File

@ -19,14 +19,14 @@ namespace osu.Game.Graphics.UserInterface
ItemsContainer.Padding = new MarginPadding(5); ItemsContainer.Padding = new MarginPadding(5);
} }
protected override void AnimateOpen() => FadeIn(300, EasingTypes.OutQuint); protected override void AnimateOpen() => this.FadeIn(300, Easing.OutQuint);
protected override void AnimateClose() => FadeOut(300, EasingTypes.OutQuint); protected override void AnimateClose() => this.FadeOut(300, Easing.OutQuint);
protected override void UpdateContentHeight() protected override void UpdateContentHeight()
{ {
var actualHeight = (RelativeSizeAxes & Axes.Y) > 0 ? 1 : ContentHeight; var actualHeight = (RelativeSizeAxes & Axes.Y) > 0 ? 1 : ContentHeight;
ResizeTo(new Vector2(1, State == MenuState.Opened ? actualHeight : 0), 300, EasingTypes.OutQuint); this.ResizeTo(new Vector2(1, State == MenuState.Opened ? actualHeight : 0), 300, Easing.OutQuint);
} }
} }
} }

View File

@ -47,8 +47,8 @@ namespace osu.Game.Graphics.UserInterface
protected override void LoadComplete() protected override void LoadComplete()
{ {
base.LoadComplete(); base.LoadComplete();
circle.FadeIn(500, EasingTypes.OutQuint); circle.FadeIn(500, Easing.OutQuint);
circle.ResizeTo(new Vector2(0.8f), 500, EasingTypes.OutQuint); circle.ResizeTo(new Vector2(0.8f), 500, Easing.OutQuint);
} }
} }
} }

View File

@ -166,7 +166,7 @@ namespace osu.Game.Graphics.UserInterface
protected override void UpdateValue(float value) protected override void UpdateValue(float value)
{ {
Nub.MoveToX(RangePadding + UsableWidth * value, 250, EasingTypes.OutQuint); Nub.MoveToX(RangePadding + UsableWidth * value, 250, Easing.OutQuint);
} }
} }
} }

View File

@ -77,14 +77,14 @@ namespace osu.Game.Graphics.UserInterface
private void fadeActive() private void fadeActive()
{ {
box.FadeIn(transition_length, EasingTypes.OutQuint); box.FadeIn(transition_length, Easing.OutQuint);
Text.FadeColour(Color4.White, transition_length, EasingTypes.OutQuint); Text.FadeColour(Color4.White, transition_length, Easing.OutQuint);
} }
private void fadeInactive() private void fadeInactive()
{ {
box.FadeOut(transition_length, EasingTypes.OutQuint); box.FadeOut(transition_length, Easing.OutQuint);
Text.FadeColour(AccentColour, transition_length, EasingTypes.OutQuint); Text.FadeColour(AccentColour, transition_length, Easing.OutQuint);
} }
protected override bool OnHover(InputState state) protected override bool OnHover(InputState state)

View File

@ -49,14 +49,14 @@ namespace osu.Game.Graphics.UserInterface
private void fadeIn() private void fadeIn()
{ {
box.FadeIn(transition_length, EasingTypes.OutQuint); box.FadeIn(transition_length, Easing.OutQuint);
text.FadeColour(Color4.White, transition_length, EasingTypes.OutQuint); text.FadeColour(Color4.White, transition_length, Easing.OutQuint);
} }
private void fadeOut() private void fadeOut()
{ {
box.FadeOut(transition_length, EasingTypes.OutQuint); box.FadeOut(transition_length, Easing.OutQuint);
text.FadeColour(AccentColour, transition_length, EasingTypes.OutQuint); text.FadeColour(AccentColour, transition_length, Easing.OutQuint);
} }
protected override bool OnHover(InputState state) protected override bool OnHover(InputState state)

View File

@ -1,9 +1,6 @@
// Copyright (c) 2007-2017 ppy Pty Ltd <contact@ppy.sh>. // Copyright (c) 2007-2017 ppy Pty Ltd <contact@ppy.sh>.
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
using osu.Framework.Graphics;
using osu.Framework.Graphics.Transforms;
using osu.Framework.MathUtils;
using System; using System;
namespace osu.Game.Graphics.UserInterface namespace osu.Game.Graphics.UserInterface
@ -13,8 +10,6 @@ namespace osu.Game.Graphics.UserInterface
/// </summary> /// </summary>
public class PercentageCounter : RollingCounter<double> public class PercentageCounter : RollingCounter<double>
{ {
protected override Type TransformType => typeof(TransformAccuracy);
protected override double RollingDuration => 750; protected override double RollingDuration => 750;
private float epsilon => 1e-10f; private float epsilon => 1e-10f;
@ -44,23 +39,5 @@ namespace osu.Game.Graphics.UserInterface
{ {
Current.Value = Current + amount; Current.Value = Current + amount;
} }
protected class TransformAccuracy : Transform<double, Drawable>
{
public virtual double CurrentValue
{
get
{
double time = Time?.Current ?? 0;
if (time < StartTime) return StartValue;
if (time >= EndTime) return EndValue;
return Interpolation.ValueAt(time, (float)StartValue, (float)EndValue, StartTime, EndTime, Easing);
}
}
public override void Apply(Drawable d) => ((PercentageCounter)d).DisplayedCount = CurrentValue;
public override void ReadIntoStartValue(Drawable d) => StartValue = ((PercentageCounter)d).DisplayedCount;
}
} }
} }

View File

@ -5,30 +5,21 @@ using osu.Framework.Configuration;
using osu.Framework.Graphics; using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers; using osu.Framework.Graphics.Containers;
using osu.Framework.Graphics.Sprites; using osu.Framework.Graphics.Sprites;
using osu.Framework.Graphics.Transforms;
using osu.Game.Graphics.Sprites; using osu.Game.Graphics.Sprites;
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Diagnostics;
using OpenTK.Graphics; using OpenTK.Graphics;
namespace osu.Game.Graphics.UserInterface namespace osu.Game.Graphics.UserInterface
{ {
public abstract class RollingCounter<T> : Container, IHasAccentColour public abstract class RollingCounter<T> : Container, IHasAccentColour
where T : struct, IEquatable<T>
{ {
/// <summary> /// <summary>
/// The current value. /// The current value.
/// </summary> /// </summary>
public Bindable<T> Current = new Bindable<T>(); public Bindable<T> Current = new Bindable<T>();
/// <summary>
/// Type of the Transform to use.
/// </summary>
/// <remarks>
/// Must be a subclass of Transform(T)
/// </remarks>
protected virtual Type TransformType => typeof(Transform<T, Drawable>);
protected SpriteText DisplayedCountSpriteText; protected SpriteText DisplayedCountSpriteText;
/// <summary> /// <summary>
@ -45,7 +36,7 @@ namespace osu.Game.Graphics.UserInterface
/// <summary> /// <summary>
/// Easing for the counter rollover animation. /// Easing for the counter rollover animation.
/// </summary> /// </summary>
protected virtual EasingTypes RollingEasing => EasingTypes.OutQuint; protected virtual Easing RollingEasing => Easing.OutQuint;
private T displayedCount; private T displayedCount;
@ -58,7 +49,8 @@ namespace osu.Game.Graphics.UserInterface
{ {
return displayedCount; return displayedCount;
} }
protected set
set
{ {
if (EqualityComparer<T>.Default.Equals(displayedCount, value)) if (EqualityComparer<T>.Default.Equals(displayedCount, value))
return; return;
@ -133,7 +125,7 @@ namespace osu.Game.Graphics.UserInterface
/// </summary> /// </summary>
public virtual void StopRolling() public virtual void StopRolling()
{ {
Flush(false, TransformType); FinishTransforms(false, nameof(DisplayedCount));
DisplayedCount = Current; DisplayedCount = Current;
} }
@ -176,44 +168,15 @@ namespace osu.Game.Graphics.UserInterface
/// implement the rollover animation). /// implement the rollover animation).
/// </summary> /// </summary>
/// <param name="currentValue">Count value before modification.</param> /// <param name="currentValue">Count value before modification.</param>
/// <param name="newValue">Expected count value after modification-</param> /// <param name="newValue">Expected count value after modification.</param>
/// <seealso cref="TransformType"/>
protected virtual void TransformCount(T currentValue, T newValue) protected virtual void TransformCount(T currentValue, T newValue)
{ {
Debug.Assert(
typeof(Transform<T, Drawable>).IsAssignableFrom(TransformType),
@"transformType should be a subclass of Transform<T>."
);
TransformCount((Transform<T, Drawable>)Activator.CreateInstance(TransformType), currentValue, newValue);
}
/// <summary>
/// Intended to be used by TransformCount(T currentValue, T newValue).
/// </summary>
protected void TransformCount(Transform<T, Drawable> transform, T currentValue, T newValue)
{
Type type = transform.GetType();
Flush(false, type);
if (RollingDuration < 1)
{
DisplayedCount = Current;
return;
}
double rollingTotalDuration = double rollingTotalDuration =
IsRollingProportional IsRollingProportional
? GetProportionalDuration(currentValue, newValue) ? GetProportionalDuration(currentValue, newValue)
: RollingDuration; : RollingDuration;
transform.StartTime = TransformStartTime; this.TransformTo(nameof(DisplayedCount), newValue, rollingTotalDuration, RollingEasing);
transform.EndTime = TransformStartTime + rollingTotalDuration;
transform.EndValue = newValue;
transform.Easing = RollingEasing;
Transforms.Add(transform);
} }
} }
} }

View File

@ -2,18 +2,13 @@
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
using osu.Framework.Graphics; using osu.Framework.Graphics;
using osu.Framework.Graphics.Transforms;
using osu.Framework.MathUtils;
using System;
namespace osu.Game.Graphics.UserInterface namespace osu.Game.Graphics.UserInterface
{ {
public class ScoreCounter : RollingCounter<double> public class ScoreCounter : RollingCounter<double>
{ {
protected override Type TransformType => typeof(TransformScore);
protected override double RollingDuration => 1000; protected override double RollingDuration => 1000;
protected override EasingTypes RollingEasing => EasingTypes.Out; protected override Easing RollingEasing => Easing.Out;
public bool UseCommaSeparator; public bool UseCommaSeparator;
@ -55,23 +50,5 @@ namespace osu.Game.Graphics.UserInterface
{ {
Current.Value = Current + amount; Current.Value = Current + amount;
} }
protected class TransformScore : Transform<double, Drawable>
{
public virtual double CurrentValue
{
get
{
double time = Time?.Current ?? 0;
if (time < StartTime) return StartValue;
if (time >= EndTime) return EndValue;
return Interpolation.ValueAt(time, (float)StartValue, (float)EndValue, StartTime, EndTime, Easing);
}
}
public override void Apply(Drawable d) => ((ScoreCounter)d).DisplayedCount = CurrentValue;
public override void ReadIntoStartValue(Drawable d) => StartValue = ((ScoreCounter)d).DisplayedCount;
}
} }
} }

View File

@ -2,9 +2,6 @@
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
using System; using System;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Transforms;
using osu.Framework.MathUtils;
namespace osu.Game.Graphics.UserInterface namespace osu.Game.Graphics.UserInterface
{ {
@ -13,8 +10,6 @@ namespace osu.Game.Graphics.UserInterface
/// </summary> /// </summary>
public class SimpleComboCounter : RollingCounter<int> public class SimpleComboCounter : RollingCounter<int>
{ {
protected override Type TransformType => typeof(TransformCounterCount);
protected override double RollingDuration => 750; protected override double RollingDuration => 750;
public SimpleComboCounter() public SimpleComboCounter()
@ -36,23 +31,5 @@ namespace osu.Game.Graphics.UserInterface
{ {
Current.Value = Current + amount; Current.Value = Current + amount;
} }
private class TransformCounterCount : Transform<int, Drawable>
{
public int CurrentValue
{
get
{
double time = Time?.Current ?? 0;
if (time < StartTime) return StartValue;
if (time >= EndTime) return EndValue;
return (int)Interpolation.ValueAt(time, StartValue, EndValue, StartTime, EndTime, Easing);
}
}
public override void Apply(Drawable d) => ((SimpleComboCounter)d).DisplayedCount = CurrentValue;
public override void ReadIntoStartValue(Drawable d) => StartValue = ((SimpleComboCounter)d).DisplayedCount;
}
} }
} }

View File

@ -24,7 +24,7 @@ namespace osu.Game.Graphics.UserInterface
private double animationDelay => 80; private double animationDelay => 80;
private double scalingDuration => 1000; private double scalingDuration => 1000;
private EasingTypes scalingEasing => EasingTypes.OutElasticHalf; private Easing scalingEasing => Easing.OutElasticHalf;
private float minStarScale => 0.4f; private float minStarScale => 0.4f;
private double fadingDuration => 100; private double fadingDuration => 100;
@ -122,7 +122,7 @@ namespace osu.Game.Graphics.UserInterface
if (value <= i) if (value <= i)
return minStarScale; return minStarScale;
return i + 1 <= value ? 1.0f : (float)Interpolation.ValueAt(value, minStarScale, 1.0f, i, i + 1); return i + 1 <= value ? 1.0f : Interpolation.ValueAt(value, minStarScale, 1.0f, i, i + 1);
} }
private void transformCount(float newValue) private void transformCount(float newValue)
@ -133,12 +133,8 @@ namespace osu.Game.Graphics.UserInterface
star.ClearTransforms(true); star.ClearTransforms(true);
var delay = (countStars <= newValue ? Math.Max(i - countStars, 0) : Math.Max(countStars - 1 - i, 0)) * animationDelay; var delay = (countStars <= newValue ? Math.Max(i - countStars, 0) : Math.Max(countStars - 1 - i, 0)) * animationDelay;
star.Delay(delay).FadeTo(i < newValue ? 1.0f : minStarAlpha, fadingDuration);
using (BeginDelayedSequence(delay, true)) star.Icon.Delay(delay).ScaleTo(getStarScale(i, newValue), scalingDuration, scalingEasing);
{
star.FadeTo(i < newValue ? 1.0f : minStarAlpha, fadingDuration);
star.Icon.ScaleTo(getStarScale(i, newValue), scalingDuration, scalingEasing);
}
i++; i++;
} }

View File

@ -173,20 +173,20 @@ namespace osu.Game.Graphics.UserInterface
protected override bool OnHover(InputState state) protected override bool OnHover(InputState state)
{ {
ResizeTo(SIZE_EXTENDED, transform_time, EasingTypes.OutElastic); this.ResizeTo(SIZE_EXTENDED, transform_time, Easing.OutElastic);
IconLayer.FadeColour(HoverColour, transform_time, EasingTypes.OutElastic); IconLayer.FadeColour(HoverColour, transform_time, Easing.OutElastic);
bouncingIcon.ScaleTo(1.1f, transform_time, EasingTypes.OutElastic); bouncingIcon.ScaleTo(1.1f, transform_time, Easing.OutElastic);
return true; return true;
} }
protected override void OnHoverLost(InputState state) protected override void OnHoverLost(InputState state)
{ {
ResizeTo(SIZE_RETRACTED, transform_time, EasingTypes.OutElastic); this.ResizeTo(SIZE_RETRACTED, transform_time, Easing.OutElastic);
IconLayer.FadeColour(TextLayer.Colour, transform_time, EasingTypes.OutElastic); IconLayer.FadeColour(TextLayer.Colour, transform_time, Easing.OutElastic);
bouncingIcon.ScaleTo(1, transform_time, EasingTypes.OutElastic); bouncingIcon.ScaleTo(1, transform_time, Easing.OutElastic);
} }
protected override bool OnMouseDown(InputState state, MouseDownEventArgs args) protected override bool OnMouseDown(InputState state, MouseDownEventArgs args)
@ -205,7 +205,7 @@ namespace osu.Game.Graphics.UserInterface
Add(flash); Add(flash);
flash.Alpha = 1; flash.Alpha = 1;
flash.FadeOut(500, EasingTypes.OutQuint); flash.FadeOut(500, Easing.OutQuint);
flash.Expire(); flash.Expire();
return base.OnClick(state); return base.OnClick(state);
@ -245,9 +245,9 @@ namespace osu.Game.Graphics.UserInterface
if (beatIndex < 0) return; if (beatIndex < 0) return;
icon.ScaleTo(1 - 0.1f * amplitudeAdjust, beat_in_time, EasingTypes.Out); icon.ScaleTo(1 - 0.1f * amplitudeAdjust, beat_in_time, Easing.Out)
using (icon.BeginDelayedSequence(beat_in_time)) .Then()
icon.ScaleTo(1, beatLength * 2, EasingTypes.OutQuint); .ScaleTo(1, beatLength * 2, Easing.OutQuint);
} }
} }
} }

View File

@ -93,21 +93,20 @@ namespace osu.Game.Graphics.UserInterface.Volume
protected override void PopIn() protected override void PopIn()
{ {
ClearTransforms(); ClearTransforms();
FadeIn(100); this.FadeIn(100);
schedulePopOut(); schedulePopOut();
} }
protected override void PopOut() protected override void PopOut()
{ {
FadeOut(100); this.FadeOut(100);
} }
private void schedulePopOut() private void schedulePopOut()
{ {
popOutDelegate?.Cancel(); popOutDelegate?.Cancel();
Delay(1000); this.Delay(1000).Schedule(Hide, out popOutDelegate);
popOutDelegate = Schedule(Hide);
} }
} }
} }

View File

@ -82,6 +82,6 @@ namespace osu.Game.Graphics.UserInterface.Volume
return true; return true;
} }
private void updateFill() => meterFill.ScaleTo(new Vector2(1, (float)Volume), 300, EasingTypes.OutQuint); private void updateFill() => meterFill.ScaleTo(new Vector2(1, (float)Volume), 300, Easing.OutQuint);
} }
} }

View File

@ -80,6 +80,11 @@ namespace osu.Game
public void ToggleDirect() => direct.ToggleVisibility(); public void ToggleDirect() => direct.ToggleVisibility();
private DependencyContainer dependencies;
protected override IReadOnlyDependencyContainer CreateLocalDependencies(IReadOnlyDependencyContainer parent) =>
dependencies = new DependencyContainer(base.CreateLocalDependencies(parent));
[BackgroundDependencyLoader] [BackgroundDependencyLoader]
private void load(FrameworkConfigManager frameworkConfig) private void load(FrameworkConfigManager frameworkConfig)
{ {
@ -97,7 +102,7 @@ namespace osu.Game
Task.Run(() => BeatmapDatabase.Import(paths.ToArray())); Task.Run(() => BeatmapDatabase.Import(paths.ToArray()));
} }
Dependencies.Cache(this); dependencies.Cache(this);
configRuleset = LocalConfig.GetBindable<int>(OsuSetting.Ruleset); configRuleset = LocalConfig.GetBindable<int>(OsuSetting.Ruleset);
Ruleset.Value = RulesetDatabase.GetRuleset(configRuleset.Value); Ruleset.Value = RulesetDatabase.GetRuleset(configRuleset.Value);
@ -121,8 +126,7 @@ namespace osu.Game
if (!menu.IsCurrentScreen) if (!menu.IsCurrentScreen)
{ {
menu.MakeCurrent(); menu.MakeCurrent();
Delay(500); this.Delay(500).Schedule(() => LoadScore(s), out scoreLoad);
scoreLoad = Schedule(() => LoadScore(s));
return; return;
} }
@ -207,13 +211,13 @@ namespace osu.Game
}); });
}; };
Dependencies.Cache(settings); dependencies.Cache(settings);
Dependencies.Cache(social); dependencies.Cache(social);
Dependencies.Cache(chat); dependencies.Cache(chat);
Dependencies.Cache(userProfile); dependencies.Cache(userProfile);
Dependencies.Cache(musicController); dependencies.Cache(musicController);
Dependencies.Cache(notificationManager); dependencies.Cache(notificationManager);
Dependencies.Cache(dialogOverlay); dependencies.Cache(dialogOverlay);
// ensure both overlays aren't presented at the same time // ensure both overlays aren't presented at the same time
chat.StateChanged += (container, state) => social.State = state == Visibility.Visible ? Visibility.Hidden : social.State; chat.StateChanged += (container, state) => social.State = state == Visibility.Visible ? Visibility.Hidden : social.State;
@ -230,10 +234,10 @@ namespace osu.Game
switch (settings.State) switch (settings.State)
{ {
case Visibility.Hidden: case Visibility.Hidden:
intro.MoveToX(0, SettingsOverlay.TRANSITION_LENGTH, EasingTypes.OutQuint); intro.MoveToX(0, SettingsOverlay.TRANSITION_LENGTH, Easing.OutQuint);
break; break;
case Visibility.Visible: case Visibility.Visible:
intro.MoveToX(SettingsOverlay.SIDEBAR_WIDTH / 2, SettingsOverlay.TRANSITION_LENGTH, EasingTypes.OutQuint); intro.MoveToX(SettingsOverlay.SIDEBAR_WIDTH / 2, SettingsOverlay.TRANSITION_LENGTH, Easing.OutQuint);
break; break;
} }
}; };

View File

@ -81,21 +81,26 @@ namespace osu.Game
Name = @"osu!lazer"; Name = @"osu!lazer";
} }
private DependencyContainer dependencies;
protected override IReadOnlyDependencyContainer CreateLocalDependencies(IReadOnlyDependencyContainer parent) =>
dependencies = new DependencyContainer(base.CreateLocalDependencies(parent));
[BackgroundDependencyLoader] [BackgroundDependencyLoader]
private void load() private void load()
{ {
Dependencies.Cache(this); dependencies.Cache(this);
Dependencies.Cache(LocalConfig); dependencies.Cache(LocalConfig);
SQLiteConnection connection = Host.Storage.GetDatabase(@"client"); SQLiteConnection connection = Host.Storage.GetDatabase(@"client");
Dependencies.Cache(RulesetDatabase = new RulesetDatabase(Host.Storage, connection)); dependencies.Cache(RulesetDatabase = new RulesetDatabase(Host.Storage, connection));
Dependencies.Cache(BeatmapDatabase = new BeatmapDatabase(Host.Storage, connection, RulesetDatabase, Host)); dependencies.Cache(BeatmapDatabase = new BeatmapDatabase(Host.Storage, connection, RulesetDatabase, Host));
Dependencies.Cache(ScoreDatabase = new ScoreDatabase(Host.Storage, connection, Host, BeatmapDatabase)); dependencies.Cache(ScoreDatabase = new ScoreDatabase(Host.Storage, connection, Host, BeatmapDatabase));
Dependencies.Cache(new OsuColour()); dependencies.Cache(new OsuColour());
//this completely overrides the framework default. will need to change once we make a proper FontStore. //this completely overrides the framework default. will need to change once we make a proper FontStore.
Dependencies.Cache(Fonts = new FontStore { ScaleAdjust = 100 }, true); dependencies.Cache(Fonts = new FontStore { ScaleAdjust = 100 }, true);
Fonts.AddStore(new GlyphStore(Resources, @"Fonts/FontAwesome")); Fonts.AddStore(new GlyphStore(Resources, @"Fonts/FontAwesome"));
Fonts.AddStore(new GlyphStore(Resources, @"Fonts/osuFont")); Fonts.AddStore(new GlyphStore(Resources, @"Fonts/osuFont"));
@ -127,7 +132,7 @@ namespace osu.Game
OszArchiveReader.Register(); OszArchiveReader.Register();
Dependencies.Cache(API = new APIAccess dependencies.Cache(API = new APIAccess
{ {
Username = LocalConfig.Get<string>(OsuSetting.Username), Username = LocalConfig.Get<string>(OsuSetting.Username),
Token = LocalConfig.Get<string>(OsuSetting.Token) Token = LocalConfig.Get<string>(OsuSetting.Token)

View File

@ -39,7 +39,7 @@ namespace osu.Game.Overlays.Chat
{ {
set set
{ {
FadeTo(value ? 1f : 0f, 100); this.FadeTo(value ? 1f : 0f, 100);
} }
} }
@ -156,7 +156,7 @@ namespace osu.Game.Overlays.Chat
protected override bool OnHover(InputState state) protected override bool OnHover(InputState state)
{ {
if (!channel.Joined.Value) if (!channel.Joined.Value)
name.FadeColour(hoverColour, 50, EasingTypes.OutQuint); name.FadeColour(hoverColour, 50, Easing.OutQuint);
return base.OnHover(state); return base.OnHover(state);
} }
@ -175,14 +175,14 @@ namespace osu.Game.Overlays.Chat
joinedCheckmark.FadeTo(1f, transition_duration); joinedCheckmark.FadeTo(1f, transition_duration);
topic.FadeTo(0.8f, transition_duration); topic.FadeTo(0.8f, transition_duration);
topic.FadeColour(Color4.White, transition_duration); topic.FadeColour(Color4.White, transition_duration);
FadeColour(joinedColour, transition_duration); this.FadeColour(joinedColour, transition_duration);
} }
else else
{ {
joinedCheckmark.FadeTo(0f, transition_duration); joinedCheckmark.FadeTo(0f, transition_duration);
topic.FadeTo(1f, transition_duration); topic.FadeTo(1f, transition_duration);
topic.FadeColour(topicColour, transition_duration); topic.FadeColour(topicColour, transition_duration);
FadeColour(Color4.White, transition_duration); this.FadeColour(Color4.White, transition_duration);
} }
} }
} }

View File

@ -23,7 +23,7 @@ namespace osu.Game.Overlays.Chat
{ {
set set
{ {
FadeTo(value ? 1f : 0f, 100); this.FadeTo(value ? 1f : 0f, 100);
} }
} }

View File

@ -92,7 +92,7 @@ namespace osu.Game.Overlays.Chat
AutoSizeAxes = Axes.Y, AutoSizeAxes = Axes.Y,
Direction = FillDirection.Vertical, Direction = FillDirection.Vertical,
LayoutDuration = 200, LayoutDuration = 200,
LayoutEasing = EasingTypes.OutQuint, LayoutEasing = Easing.OutQuint,
Spacing = new Vector2(0f, 20f), Spacing = new Vector2(0f, 20f),
Padding = new MarginPadding { Vertical = 20, Left = WIDTH_PADDING }, Padding = new MarginPadding { Vertical = 20, Left = WIDTH_PADDING },
}, },
@ -158,10 +158,10 @@ namespace osu.Game.Overlays.Chat
protected override void PopIn() protected override void PopIn()
{ {
if (Alpha == 0) MoveToY(DrawHeight); if (Alpha == 0) this.MoveToY(DrawHeight);
FadeIn(transition_duration, EasingTypes.OutQuint); this.FadeIn(transition_duration, Easing.OutQuint);
MoveToY(0, transition_duration, EasingTypes.OutQuint); this.MoveToY(0, transition_duration, Easing.OutQuint);
search.HoldFocus = true; search.HoldFocus = true;
base.PopIn(); base.PopIn();
@ -169,8 +169,8 @@ namespace osu.Game.Overlays.Chat
protected override void PopOut() protected override void PopOut()
{ {
FadeOut(transition_duration, EasingTypes.InSine); this.FadeOut(transition_duration, Easing.InSine);
MoveToY(DrawHeight, transition_duration, EasingTypes.InSine); this.MoveToY(DrawHeight, transition_duration, Easing.InSine);
search.HoldFocus = false; search.HoldFocus = false;
base.PopOut(); base.PopOut();

View File

@ -78,7 +78,7 @@ namespace osu.Game.Overlays.Chat
Padding = new MarginPadding { Left = padding, Right = padding }; Padding = new MarginPadding { Left = padding, Right = padding };
} }
[BackgroundDependencyLoader] [BackgroundDependencyLoader(true)]
private void load(OsuColour colours, UserProfileOverlay profile) private void load(OsuColour colours, UserProfileOverlay profile)
{ {
customUsernameColour = colours.ChatBlue; customUsernameColour = colours.ChatBlue;

View File

@ -86,30 +86,30 @@ namespace osu.Game.Overlays.Chat
private void fadeActive() private void fadeActive()
{ {
ResizeTo(new Vector2(Width, 1.1f), transition_length, EasingTypes.OutQuint); this.ResizeTo(new Vector2(Width, 1.1f), transition_length, Easing.OutQuint);
box.FadeColour(backgroundActive, transition_length, EasingTypes.OutQuint); box.FadeColour(backgroundActive, transition_length, Easing.OutQuint);
highlightBox.FadeIn(transition_length, EasingTypes.OutQuint); highlightBox.FadeIn(transition_length, Easing.OutQuint);
text.FadeOut(transition_length, EasingTypes.OutQuint); text.FadeOut(transition_length, Easing.OutQuint);
textBold.FadeIn(transition_length, EasingTypes.OutQuint); textBold.FadeIn(transition_length, Easing.OutQuint);
} }
private void fadeInactive() private void fadeInactive()
{ {
ResizeTo(new Vector2(Width, 1), transition_length, EasingTypes.OutQuint); this.ResizeTo(new Vector2(Width, 1), transition_length, Easing.OutQuint);
box.FadeColour(backgroundInactive, transition_length, EasingTypes.OutQuint); box.FadeColour(backgroundInactive, transition_length, Easing.OutQuint);
highlightBox.FadeOut(transition_length, EasingTypes.OutQuint); highlightBox.FadeOut(transition_length, Easing.OutQuint);
text.FadeIn(transition_length, EasingTypes.OutQuint); text.FadeIn(transition_length, Easing.OutQuint);
textBold.FadeOut(transition_length, EasingTypes.OutQuint); textBold.FadeOut(transition_length, Easing.OutQuint);
} }
protected override bool OnHover(InputState state) protected override bool OnHover(InputState state)
{ {
if (!Active) if (!Active)
box.FadeColour(backgroundHover, transition_length, EasingTypes.OutQuint); box.FadeColour(backgroundHover, transition_length, Easing.OutQuint);
return true; return true;
} }

View File

@ -177,8 +177,8 @@ namespace osu.Game.Overlays
inputTextBox.HoldFocus = false; inputTextBox.HoldFocus = false;
if (1f - chatHeight.Value < channel_selection_min_height) if (1f - chatHeight.Value < channel_selection_min_height)
{ {
chatContainer.ResizeHeightTo(1f - channel_selection_min_height, 800, EasingTypes.OutQuint); chatContainer.ResizeHeightTo(1f - channel_selection_min_height, 800, Easing.OutQuint);
channelSelectionContainer.ResizeHeightTo(channel_selection_min_height, 800, EasingTypes.OutQuint); channelSelectionContainer.ResizeHeightTo(channel_selection_min_height, 800, Easing.OutQuint);
channelSelection.Show(); channelSelection.Show();
chatHeight.Value = 1f - channel_selection_min_height; chatHeight.Value = 1f - channel_selection_min_height;
} }
@ -235,8 +235,8 @@ namespace osu.Game.Overlays
protected override void PopIn() protected override void PopIn()
{ {
MoveToY(0, transition_length, EasingTypes.OutQuint); this.MoveToY(0, transition_length, Easing.OutQuint);
FadeIn(transition_length, EasingTypes.OutQuint); this.FadeIn(transition_length, Easing.OutQuint);
inputTextBox.HoldFocus = true; inputTextBox.HoldFocus = true;
base.PopIn(); base.PopIn();
@ -244,8 +244,8 @@ namespace osu.Game.Overlays
protected override void PopOut() protected override void PopOut()
{ {
MoveToY(Height, transition_length, EasingTypes.InSine); this.MoveToY(Height, transition_length, Easing.InSine);
FadeOut(transition_length, EasingTypes.InSine); this.FadeOut(transition_length, Easing.InSine);
inputTextBox.HoldFocus = false; inputTextBox.HoldFocus = false;
base.PopOut(); base.PopOut();
@ -328,7 +328,7 @@ namespace osu.Game.Overlays
var loaded = loadedChannels.Find(d => d.Channel == value); var loaded = loadedChannels.Find(d => d.Channel == value);
if (loaded == null) if (loaded == null)
{ {
currentChannelContainer.FadeOut(500, EasingTypes.OutQuint); currentChannelContainer.FadeOut(500, Easing.OutQuint);
loading.Show(); loading.Show();
loaded = new DrawableChannel(currentChannel); loaded = new DrawableChannel(currentChannel);
@ -340,7 +340,7 @@ namespace osu.Game.Overlays
currentChannelContainer.Clear(false); currentChannelContainer.Clear(false);
currentChannelContainer.Add(loaded); currentChannelContainer.Add(loaded);
currentChannelContainer.FadeIn(500, EasingTypes.OutQuint); currentChannelContainer.FadeIn(500, Easing.OutQuint);
}); });
} }
else else

View File

@ -115,17 +115,17 @@ namespace osu.Game.Overlays.Dialog
ring.ResizeTo(ringMinifiedSize); ring.ResizeTo(ringMinifiedSize);
} }
content.FadeIn(ENTER_DURATION, EasingTypes.OutQuint); content.FadeIn(ENTER_DURATION, Easing.OutQuint);
ring.ResizeTo(ringSize, ENTER_DURATION, EasingTypes.OutQuint); ring.ResizeTo(ringSize, ENTER_DURATION, Easing.OutQuint);
buttonsContainer.TransformSpacingTo(Vector2.Zero, ENTER_DURATION, EasingTypes.OutQuint); buttonsContainer.TransformSpacingTo(Vector2.Zero, ENTER_DURATION, Easing.OutQuint);
buttonsContainer.MoveToY(0, ENTER_DURATION, EasingTypes.OutQuint); buttonsContainer.MoveToY(0, ENTER_DURATION, Easing.OutQuint);
} }
protected override void PopOut() protected override void PopOut()
{ {
base.PopOut(); base.PopOut();
content.FadeOut(EXIT_DURATION, EasingTypes.InSine); content.FadeOut(EXIT_DURATION, Easing.InSine);
} }
public PopupDialog() public PopupDialog()

View File

@ -35,8 +35,7 @@ namespace osu.Game.Overlays
if (v != Visibility.Hidden) return; if (v != Visibility.Hidden) return;
//handle the dialog being dismissed. //handle the dialog being dismissed.
dialog.Delay(PopupDialog.EXIT_DURATION); dialog.Delay(PopupDialog.EXIT_DURATION).Expire();
dialog.Expire();
if (dialog == currentDialog) if (dialog == currentDialog)
State = Visibility.Hidden; State = Visibility.Hidden;
@ -45,13 +44,13 @@ namespace osu.Game.Overlays
protected override void PopIn() protected override void PopIn()
{ {
base.PopIn(); base.PopIn();
FadeIn(PopupDialog.ENTER_DURATION, EasingTypes.OutQuint); this.FadeIn(PopupDialog.ENTER_DURATION, Easing.OutQuint);
} }
protected override void PopOut() protected override void PopOut()
{ {
base.PopOut(); base.PopOut();
FadeOut(PopupDialog.EXIT_DURATION, EasingTypes.InSine); this.FadeOut(PopupDialog.EXIT_DURATION, Easing.InSine);
} }
public DialogOverlay() public DialogOverlay()

View File

@ -41,9 +41,9 @@ namespace osu.Game.Overlays.Direct
{ {
base.LoadComplete(); base.LoadComplete();
FadeInFromZero(200, EasingTypes.Out); this.FadeInFromZero(200, Easing.Out);
bottomPanel.LayoutDuration = 200; bottomPanel.LayoutDuration = 200;
bottomPanel.LayoutEasing = EasingTypes.Out; bottomPanel.LayoutEasing = Easing.Out;
bottomPanel.Origin = Anchor.BottomLeft; bottomPanel.Origin = Anchor.BottomLeft;
} }

View File

@ -43,7 +43,7 @@ namespace osu.Game.Overlays.Direct
{ {
base.LoadComplete(); base.LoadComplete();
FadeInFromZero(200, EasingTypes.Out); this.FadeInFromZero(200, Easing.Out);
} }
[BackgroundDependencyLoader] [BackgroundDependencyLoader]
@ -171,25 +171,25 @@ namespace osu.Game.Overlays.Direct
protected override bool OnMouseDown(InputState state, MouseDownEventArgs args) protected override bool OnMouseDown(InputState state, MouseDownEventArgs args)
{ {
icon.ScaleTo(0.9f, 1000, EasingTypes.Out); icon.ScaleTo(0.9f, 1000, Easing.Out);
return base.OnMouseDown(state, args); return base.OnMouseDown(state, args);
} }
protected override bool OnMouseUp(InputState state, MouseUpEventArgs args) protected override bool OnMouseUp(InputState state, MouseUpEventArgs args)
{ {
icon.ScaleTo(1f, 500, EasingTypes.OutElastic); icon.ScaleTo(1f, 500, Easing.OutElastic);
return base.OnMouseUp(state, args); return base.OnMouseUp(state, args);
} }
protected override bool OnHover(InputState state) protected override bool OnHover(InputState state)
{ {
icon.ScaleTo(1.1f, 500, EasingTypes.OutElastic); icon.ScaleTo(1.1f, 500, Easing.OutElastic);
return base.OnHover(state); return base.OnHover(state);
} }
protected override void OnHoverLost(InputState state) protected override void OnHoverLost(InputState state)
{ {
icon.ScaleTo(1f, 500, EasingTypes.OutElastic); icon.ScaleTo(1f, 500, Easing.OutElastic);
} }
} }
} }

View File

@ -38,7 +38,7 @@ namespace osu.Game.Overlays.Direct
Origin = Anchor.Centre, Origin = Anchor.Centre,
RelativeSizeAxes = Axes.Both, RelativeSizeAxes = Axes.Both,
FillMode = FillMode.Fill, FillMode = FillMode.Fill,
OnLoadComplete = d => d.FadeInFromZero(400, EasingTypes.Out), OnLoadComplete = d => d.FadeInFromZero(400, Easing.Out),
}) })
{ {
RelativeSizeAxes = Axes.Both, RelativeSizeAxes = Axes.Both,

View File

@ -169,7 +169,7 @@ namespace osu.Game.Overlays
private void updateResultCounts() private void updateResultCounts()
{ {
resultCountsContainer.FadeTo(ResultAmounts == null ? 0f : 1f, 200, EasingTypes.OutQuint); resultCountsContainer.FadeTo(ResultAmounts == null ? 0f : 1f, 200, Easing.OutQuint);
if (ResultAmounts == null) return; if (ResultAmounts == null) return;
resultCountsText.Text = pluralize("Artist", ResultAmounts.Artists) + ", " + resultCountsText.Text = pluralize("Artist", ResultAmounts.Artists) + ", " +

View File

@ -40,7 +40,7 @@ namespace osu.Game.Overlays
AutoSizeAxes = Axes.Y, AutoSizeAxes = Axes.Y,
Masking = true, Masking = true,
AutoSizeDuration = transition_time, AutoSizeDuration = transition_time,
AutoSizeEasing = EasingTypes.OutQuint, AutoSizeEasing = Easing.OutQuint,
Children = new Drawable[] Children = new Drawable[]
{ {
settingsSection = new LoginSettings settingsSection = new LoginSettings
@ -67,7 +67,7 @@ namespace osu.Game.Overlays
base.PopIn(); base.PopIn();
settingsSection.Bounding = true; settingsSection.Bounding = true;
FadeIn(transition_time, EasingTypes.OutQuint); this.FadeIn(transition_time, Easing.OutQuint);
InputManager.ChangeFocus(settingsSection); InputManager.ChangeFocus(settingsSection);
} }
@ -77,7 +77,7 @@ namespace osu.Game.Overlays
base.PopOut(); base.PopOut();
settingsSection.Bounding = false; settingsSection.Bounding = false;
FadeOut(transition_time); this.FadeOut(transition_time);
} }
} }
} }

View File

@ -194,38 +194,43 @@ namespace osu.Game.Overlays
{ {
base.PopIn(); base.PopIn();
FadeIn(200); this.FadeIn(200);
background.FlashColour(Color4.White.Opacity(0.25f), 400); background.FlashColour(Color4.White.Opacity(0.25f), 400);
getSample.Play(); getSample.Play();
using (innerSpin.BeginLoopedSequence()) innerSpin.Spin(20000, RotationDirection.Clockwise);
innerSpin.RotateTo(360, 20000); outerSpin.Spin(40000, RotationDirection.Clockwise);
using (outerSpin.BeginLoopedSequence())
outerSpin.RotateTo(360, 40000);
using (BeginDelayedSequence(200, true)) using (BeginDelayedSequence(200, true))
{ {
disc.FadeIn(initial_duration); disc.FadeIn(initial_duration)
.ScaleTo(1f, initial_duration * 2, Easing.OutElastic);
particleContainer.FadeIn(initial_duration); particleContainer.FadeIn(initial_duration);
outerSpin.FadeTo(0.1f, initial_duration * 2); outerSpin.FadeTo(0.1f, initial_duration * 2);
disc.ScaleTo(1f, initial_duration * 2, EasingTypes.OutElastic);
using (BeginDelayedSequence(initial_duration + 200, true)) using (BeginDelayedSequence(initial_duration + 200, true))
{ {
backgroundStrip.FadeIn(step_duration); backgroundStrip.FadeIn(step_duration);
leftStrip.ResizeWidthTo(1f, step_duration, EasingTypes.OutQuint); leftStrip.ResizeWidthTo(1f, step_duration, Easing.OutQuint);
rightStrip.ResizeWidthTo(1f, step_duration, EasingTypes.OutQuint); rightStrip.ResizeWidthTo(1f, step_duration, Easing.OutQuint);
Schedule(() => { if (drawableMedal.State != DisplayState.Full) drawableMedal.State = DisplayState.Icon; });
using (BeginDelayedSequence(step_duration, true)) this.Animate().Schedule(() =>
{ {
Schedule(() => { if (drawableMedal.State != DisplayState.Full) drawableMedal.State = DisplayState.MedalUnlocked; }); if (drawableMedal.State != DisplayState.Full)
drawableMedal.State = DisplayState.Icon;
using (BeginDelayedSequence(step_duration, true)) })
Schedule(() => { if (drawableMedal.State != DisplayState.Full) drawableMedal.State = DisplayState.Full; }); .Delay(step_duration).Schedule(() =>
} {
if (drawableMedal.State != DisplayState.Full)
drawableMedal.State = DisplayState.MedalUnlocked;
})
.Delay(step_duration).Schedule(() =>
{
if (drawableMedal.State != DisplayState.Full)
drawableMedal.State = DisplayState.Full;
});
} }
} }
} }
@ -233,7 +238,7 @@ namespace osu.Game.Overlays
protected override void PopOut() protected override void PopOut()
{ {
base.PopOut(); base.PopOut();
FadeOut(200); this.FadeOut(200);
} }
private void dismiss() private void dismiss()
@ -242,7 +247,7 @@ namespace osu.Game.Overlays
{ {
// if we haven't yet, play out the animation fully // if we haven't yet, play out the animation fully
drawableMedal.State = DisplayState.Full; drawableMedal.State = DisplayState.Full;
Flush(true); FinishTransforms(true);
return; return;
} }
@ -295,8 +300,8 @@ namespace osu.Game.Overlays
Radius = 5, Radius = 5,
}; };
MoveTo(positionForOffset(DISC_SIZE / 2 + 200), 500); this.MoveTo(positionForOffset(DISC_SIZE / 2 + 200), 500);
FadeOut(500); this.FadeOut(500);
Expire(); Expire();
} }
} }

View File

@ -147,23 +147,26 @@ namespace osu.Game.Overlays.MedalSplash
medalContainer.ScaleTo(0); medalContainer.ScaleTo(0);
break; break;
case DisplayState.Icon: case DisplayState.Icon:
medalContainer.ScaleTo(1, duration, EasingTypes.OutElastic); medalContainer
medalContainer.FadeIn(duration); .FadeIn(duration)
.ScaleTo(1, duration, Easing.OutElastic);
break; break;
case DisplayState.MedalUnlocked: case DisplayState.MedalUnlocked:
medalContainer.ScaleTo(1); medalContainer
medalContainer.Show(); .FadeTo(1)
.ScaleTo(1);
ScaleTo(scale_when_unlocked, duration, EasingTypes.OutExpo); this.ScaleTo(scale_when_unlocked, duration, Easing.OutExpo);
MoveToY(MedalOverlay.DISC_SIZE / 2 - 30, duration, EasingTypes.OutExpo); this.MoveToY(MedalOverlay.DISC_SIZE / 2 - 30, duration, Easing.OutExpo);
unlocked.FadeInFromZero(duration); unlocked.FadeInFromZero(duration);
break; break;
case DisplayState.Full: case DisplayState.Full:
medalContainer.ScaleTo(1); medalContainer
medalContainer.Show(); .FadeTo(1)
.ScaleTo(1);
ScaleTo(scale_when_full, duration, EasingTypes.OutExpo); this.ScaleTo(scale_when_full, duration, Easing.OutExpo);
MoveToY(MedalOverlay.DISC_SIZE / 2 - 60, duration, EasingTypes.OutExpo); this.MoveToY(MedalOverlay.DISC_SIZE / 2 - 60, duration, Easing.OutExpo);
name.FadeInFromZero(duration + 100); name.FadeInFromZero(duration + 100);
description.FadeInFromZero(duration * 2); description.FadeInFromZero(duration * 2);
break; break;

View File

@ -35,7 +35,7 @@ namespace osu.Game.Overlays.Mods
public string TooltipText => (SelectedMod?.Description ?? Mods.FirstOrDefault()?.Description) ?? string.Empty; public string TooltipText => (SelectedMod?.Description ?? Mods.FirstOrDefault()?.Description) ?? string.Empty;
private const EasingTypes mod_switch_easing = EasingTypes.InOutSine; private const Easing mod_switch_easing = Easing.InOutSine;
private const double mod_switch_duration = 120; private const double mod_switch_duration = 120;
// A selected index of -1 means not selected. // A selected index of -1 means not selected.
@ -67,8 +67,8 @@ namespace osu.Game.Overlays.Mods
if (beforeSelected != Selected) if (beforeSelected != Selected)
{ {
iconsContainer.RotateTo(Selected ? 5f : 0f, 300, EasingTypes.OutElastic); iconsContainer.RotateTo(Selected ? 5f : 0f, 300, Easing.OutElastic);
iconsContainer.ScaleTo(Selected ? 1.1f : 1f, 300, EasingTypes.OutElastic); iconsContainer.ScaleTo(Selected ? 1.1f : 1f, 300, Easing.OutElastic);
} }
if (modBefore != modAfter) if (modBefore != modAfter)
@ -81,11 +81,13 @@ namespace osu.Game.Overlays.Mods
backgroundIcon.Icon = modAfter.Icon; backgroundIcon.Icon = modAfter.Icon;
using (BeginDelayedSequence(mod_switch_duration, true)) using (BeginDelayedSequence(mod_switch_duration, true))
{ {
foregroundIcon.RotateTo(-rotate_angle * direction); foregroundIcon
foregroundIcon.RotateTo(0f, mod_switch_duration, mod_switch_easing); .RotateTo(-rotate_angle * direction)
.RotateTo(0f, mod_switch_duration, mod_switch_easing);
backgroundIcon.RotateTo(rotate_angle * direction); backgroundIcon
backgroundIcon.RotateTo(0f, mod_switch_duration, mod_switch_easing); .RotateTo(rotate_angle * direction)
.RotateTo(0f, mod_switch_duration, mod_switch_easing);
Schedule(() => displayMod(modAfter)); Schedule(() => displayMod(modAfter));
} }

View File

@ -66,14 +66,14 @@ namespace osu.Game.Overlays.Mods
{ {
base.PopOut(); base.PopOut();
rankedMultiplerContainer.MoveToX(rankedMultiplerContainer.DrawSize.X, APPEAR_DURATION, EasingTypes.InSine); rankedMultiplerContainer.MoveToX(rankedMultiplerContainer.DrawSize.X, APPEAR_DURATION, Easing.InSine);
rankedMultiplerContainer.FadeOut(APPEAR_DURATION, EasingTypes.InSine); rankedMultiplerContainer.FadeOut(APPEAR_DURATION, Easing.InSine);
foreach (ModSection section in modSectionsContainer.Children) foreach (ModSection section in modSectionsContainer.Children)
{ {
section.ButtonsContainer.TransformSpacingTo(new Vector2(100f, 0f), APPEAR_DURATION, EasingTypes.InSine); section.ButtonsContainer.TransformSpacingTo(new Vector2(100f, 0f), APPEAR_DURATION, Easing.InSine);
section.ButtonsContainer.MoveToX(100f, APPEAR_DURATION, EasingTypes.InSine); section.ButtonsContainer.MoveToX(100f, APPEAR_DURATION, Easing.InSine);
section.ButtonsContainer.FadeOut(APPEAR_DURATION, EasingTypes.InSine); section.ButtonsContainer.FadeOut(APPEAR_DURATION, Easing.InSine);
} }
} }
@ -81,14 +81,14 @@ namespace osu.Game.Overlays.Mods
{ {
base.PopIn(); base.PopIn();
rankedMultiplerContainer.MoveToX(0, ranked_multiplier_duration, EasingTypes.OutQuint); rankedMultiplerContainer.MoveToX(0, ranked_multiplier_duration, Easing.OutQuint);
rankedMultiplerContainer.FadeIn(ranked_multiplier_duration, EasingTypes.OutQuint); rankedMultiplerContainer.FadeIn(ranked_multiplier_duration, Easing.OutQuint);
foreach (ModSection section in modSectionsContainer.Children) foreach (ModSection section in modSectionsContainer.Children)
{ {
section.ButtonsContainer.TransformSpacingTo(new Vector2(50f, 0f), button_duration, EasingTypes.OutQuint); section.ButtonsContainer.TransformSpacingTo(new Vector2(50f, 0f), button_duration, Easing.OutQuint);
section.ButtonsContainer.MoveToX(0, button_duration, EasingTypes.OutQuint); section.ButtonsContainer.MoveToX(0, button_duration, Easing.OutQuint);
section.ButtonsContainer.FadeIn(button_duration, EasingTypes.OutQuint); section.ButtonsContainer.FadeIn(button_duration, Easing.OutQuint);
} }
} }

View File

@ -41,7 +41,7 @@ namespace osu.Game.Overlays.Music
if (value == selected) return; if (value == selected) return;
selected = value; selected = value;
Flush(true); FinishTransforms(true);
foreach (SpriteText s in titleSprites) foreach (SpriteText s in titleSprites)
s.FadeColour(Selected ? hoverColour : Color4.White, fade_duration); s.FadeColour(Selected ? hoverColour : Color4.White, fade_duration);
} }
@ -145,7 +145,7 @@ namespace osu.Game.Overlays.Music
matching = value; matching = value;
FadeTo(matching ? 1 : 0, 200); this.FadeTo(matching ? 1 : 0, 200);
} }
} }
} }

View File

@ -90,7 +90,7 @@ namespace osu.Game.Overlays.Music
public ItemSearchContainer() public ItemSearchContainer()
{ {
LayoutDuration = 200; LayoutDuration = 200;
LayoutEasing = EasingTypes.OutQuint; LayoutEasing = Easing.OutQuint;
} }
} }
} }

View File

@ -101,16 +101,16 @@ namespace osu.Game.Overlays.Music
filter.Search.HoldFocus = true; filter.Search.HoldFocus = true;
Schedule(() => inputManager.ChangeFocus(filter.Search)); Schedule(() => inputManager.ChangeFocus(filter.Search));
ResizeTo(new Vector2(1, playlist_height), transition_duration, EasingTypes.OutQuint); this.ResizeTo(new Vector2(1, playlist_height), transition_duration, Easing.OutQuint);
FadeIn(transition_duration, EasingTypes.OutQuint); this.FadeIn(transition_duration, Easing.OutQuint);
} }
protected override void PopOut() protected override void PopOut()
{ {
filter.Search.HoldFocus = false; filter.Search.HoldFocus = false;
ResizeTo(new Vector2(1, 0), transition_duration, EasingTypes.OutQuint); this.ResizeTo(new Vector2(1, 0), transition_duration, Easing.OutQuint);
FadeOut(transition_duration); this.FadeOut(transition_duration);
} }
private void itemSelected(BeatmapSetInfo set) private void itemSelected(BeatmapSetInfo set)

View File

@ -82,7 +82,7 @@ namespace osu.Game.Overlays
protected override bool OnDragEnd(InputState state) protected override bool OnDragEnd(InputState state)
{ {
dragContainer.MoveTo(Vector2.Zero, 800, EasingTypes.OutElastic); dragContainer.MoveTo(Vector2.Zero, 800, Easing.OutElastic);
return base.OnDragEnd(state); return base.OnDragEnd(state);
} }
@ -204,7 +204,7 @@ namespace osu.Game.Overlays
beatmapBacking.BindTo(game.Beatmap); beatmapBacking.BindTo(game.Beatmap);
playlist.StateChanged += (c, s) => playlistButton.FadeColour(s == Visibility.Visible ? colours.Yellow : Color4.White, 200, EasingTypes.OutQuint); playlist.StateChanged += (c, s) => playlistButton.FadeColour(s == Visibility.Visible ? colours.Yellow : Color4.White, 200, Easing.OutQuint);
} }
protected override void LoadComplete() protected override void LoadComplete()
@ -345,13 +345,13 @@ namespace osu.Game.Overlays
{ {
case TransformDirection.Next: case TransformDirection.Next:
d.Position = new Vector2(400, 0); d.Position = new Vector2(400, 0);
d.MoveToX(0, 500, EasingTypes.OutCubic); d.MoveToX(0, 500, Easing.OutCubic);
currentBackground.MoveToX(-400, 500, EasingTypes.OutCubic); currentBackground.MoveToX(-400, 500, Easing.OutCubic);
break; break;
case TransformDirection.Prev: case TransformDirection.Prev:
d.Position = new Vector2(-400, 0); d.Position = new Vector2(-400, 0);
d.MoveToX(0, 500, EasingTypes.OutCubic); d.MoveToX(0, 500, Easing.OutCubic);
currentBackground.MoveToX(400, 500, EasingTypes.OutCubic); currentBackground.MoveToX(400, 500, Easing.OutCubic);
break; break;
} }
currentBackground.Expire(); currentBackground.Expire();
@ -368,16 +368,16 @@ namespace osu.Game.Overlays
{ {
base.PopIn(); base.PopIn();
FadeIn(transition_length, EasingTypes.OutQuint); this.FadeIn(transition_length, Easing.OutQuint);
dragContainer.ScaleTo(1, transition_length, EasingTypes.OutElastic); dragContainer.ScaleTo(1, transition_length, Easing.OutElastic);
} }
protected override void PopOut() protected override void PopOut()
{ {
base.PopOut(); base.PopOut();
FadeOut(transition_length, EasingTypes.OutQuint); this.FadeOut(transition_length, Easing.OutQuint);
dragContainer.ScaleTo(0.9f, transition_length, EasingTypes.OutQuint); dragContainer.ScaleTo(0.9f, transition_length, Easing.OutQuint);
} }
private enum TransformDirection private enum TransformDirection

View File

@ -89,9 +89,9 @@ namespace osu.Game.Overlays
{ {
base.PopIn(); base.PopIn();
scrollContainer.MoveToX(0, TRANSITION_LENGTH, EasingTypes.OutQuint); scrollContainer.MoveToX(0, TRANSITION_LENGTH, Easing.OutQuint);
MoveToX(0, TRANSITION_LENGTH, EasingTypes.OutQuint); this.MoveToX(0, TRANSITION_LENGTH, Easing.OutQuint);
FadeTo(1, TRANSITION_LENGTH / 2); this.FadeTo(1, TRANSITION_LENGTH / 2);
} }
private void markAllRead() private void markAllRead()
@ -105,8 +105,8 @@ namespace osu.Game.Overlays
markAllRead(); markAllRead();
MoveToX(width, TRANSITION_LENGTH, EasingTypes.OutQuint); this.MoveToX(width, TRANSITION_LENGTH, Easing.OutQuint);
FadeTo(0, TRANSITION_LENGTH / 2); this.FadeTo(0, TRANSITION_LENGTH / 2);
} }
} }
} }

View File

@ -135,9 +135,9 @@ namespace osu.Game.Overlays.Notifications
protected override void LoadComplete() protected override void LoadComplete()
{ {
base.LoadComplete(); base.LoadComplete();
FadeInFromZero(200); this.FadeInFromZero(200);
NotificationContent.MoveToX(DrawSize.X); NotificationContent.MoveToX(DrawSize.X);
NotificationContent.MoveToX(0, 500, EasingTypes.OutQuint); NotificationContent.MoveToX(0, 500, Easing.OutQuint);
} }
private bool wasClosed; private bool wasClosed;
@ -148,7 +148,7 @@ namespace osu.Game.Overlays.Notifications
wasClosed = true; wasClosed = true;
Closed?.Invoke(); Closed?.Invoke();
FadeOut(100); this.FadeOut(100);
Expire(); Expire();
} }
@ -181,13 +181,13 @@ namespace osu.Game.Overlays.Notifications
protected override bool OnHover(InputState state) protected override bool OnHover(InputState state)
{ {
FadeColour(hoverColour, 200); this.FadeColour(hoverColour, 200);
return base.OnHover(state); return base.OnHover(state);
} }
protected override void OnHoverLost(InputState state) protected override void OnHoverLost(InputState state)
{ {
FadeColour(OsuColour.Gray(0.2f), 200); this.FadeColour(OsuColour.Gray(0.2f), 200);
base.OnHoverLost(state); base.OnHoverLost(state);
} }
} }
@ -212,12 +212,9 @@ namespace osu.Game.Overlays.Notifications
if (pulsate) if (pulsate)
{ {
const float length = 1000; const float length = 1000;
using (pulsateLayer.BeginLoopedSequence(length / 2)) pulsateLayer.Loop(length / 2,
{ p => p.FadeTo(0.4f, length, Easing.In).Then().FadeTo(1, length, Easing.Out)
pulsateLayer.FadeTo(0.4f, length, EasingTypes.In); );
using (pulsateLayer.BeginDelayedSequence(length))
pulsateLayer.FadeTo(1, length, EasingTypes.Out);
}
} }
} }
} }

View File

@ -114,7 +114,7 @@ namespace osu.Game.Overlays.Notifications
AutoSizeAxes = Axes.Y, AutoSizeAxes = Axes.Y,
RelativeSizeAxes = Axes.X, RelativeSizeAxes = Axes.X,
LayoutDuration = 150, LayoutDuration = 150,
LayoutEasing = EasingTypes.OutQuart, LayoutEasing = Easing.OutQuart,
Spacing = new Vector2(3), Spacing = new Vector2(3),
} }
}); });

View File

@ -77,11 +77,8 @@ namespace osu.Game.Overlays.Notifications
switch (state) switch (state)
{ {
case ProgressNotificationState.Completed: case ProgressNotificationState.Completed:
NotificationContent.MoveToY(-DrawSize.Y / 2, 200, EasingTypes.OutQuint); NotificationContent.MoveToY(-DrawSize.Y / 2, 200, Easing.OutQuint);
FadeTo(0.01f, 200); //don't completely fade out or our scheduled task won't run. this.FadeOut(200).Finally(d => Completed());
Delay(100);
Schedule(Completed);
break; break;
} }
} }
@ -184,7 +181,7 @@ namespace osu.Game.Overlays.Notifications
if (progress == value) return; if (progress == value) return;
progress = value; progress = value;
box.ResizeTo(new Vector2(progress, 1), 100, EasingTypes.OutQuad); box.ResizeTo(new Vector2(progress, 1), 100, Easing.OutQuad);
} }
} }
@ -196,7 +193,7 @@ namespace osu.Game.Overlays.Notifications
set set
{ {
active = value; active = value;
FadeColour(active ? colourActive : colourInactive, 100); this.FadeColour(active ? colourActive : colourInactive, 100);
} }
} }

View File

@ -154,14 +154,13 @@ namespace osu.Game.Overlays
textLine2.Text = settingValue; textLine2.Text = settingValue;
textLine3.Text = shortcut.ToUpper(); textLine3.Text = shortcut.ToUpper();
box.FadeIn(500, EasingTypes.OutQuint); box.Animate(
box.ResizeHeightTo(height, 500, EasingTypes.OutQuint); b => b.FadeIn(500, Easing.OutQuint),
b => b.ResizeHeightTo(height, 500, Easing.OutQuint)
using (box.BeginDelayedSequence(500)) ).Then(
{ b => b.FadeOutFromOne(1500, Easing.InQuint),
box.FadeOutFromOne(1500, EasingTypes.InQuint); b => b.ResizeHeightTo(height_contracted, 1500, Easing.InQuint)
box.ResizeHeightTo(height_contracted, 1500, EasingTypes.InQuint); );
}
int optionCount = 0; int optionCount = 0;
int selectedOption = -1; int selectedOption = -1;
@ -232,13 +231,13 @@ namespace osu.Game.Overlays
{ {
if (glowing) if (glowing)
{ {
fill.FadeColour(glowingColour, transition_speed, EasingTypes.OutQuint); fill.FadeColour(glowingColour, transition_speed, Easing.OutQuint);
FadeEdgeEffectTo(glow_strength, transition_speed, EasingTypes.OutQuint); FadeEdgeEffectTo(glow_strength, transition_speed, Easing.OutQuint);
} }
else else
{ {
FadeEdgeEffectTo(0, transition_speed, EasingTypes.OutQuint); FadeEdgeEffectTo(0, transition_speed, Easing.OutQuint);
fill.FadeColour(idleColour, transition_speed, EasingTypes.OutQuint); fill.FadeColour(idleColour, transition_speed, Easing.OutQuint);
} }
} }
@ -261,7 +260,7 @@ namespace osu.Game.Overlays
}; };
updateGlow(); updateGlow();
Flush(true); FinishTransforms(true);
} }
} }
} }

View File

@ -517,13 +517,13 @@ namespace osu.Game.Overlays.Profile
protected override bool OnHover(InputState state) protected override bool OnHover(InputState state)
{ {
FadeColour(hoverColour, 500, EasingTypes.OutQuint); this.FadeColour(hoverColour, 500, Easing.OutQuint);
return base.OnHover(state); return base.OnHover(state);
} }
protected override void OnHoverLost(InputState state) protected override void OnHoverLost(InputState state)
{ {
FadeColour(Color4.White, 500, EasingTypes.OutQuint); this.FadeColour(Color4.White, 500, Easing.OutQuint);
base.OnHoverLost(state); base.OnHoverLost(state);
} }

View File

@ -138,7 +138,7 @@ namespace osu.Game.Overlays.Profile
public void ResetBall() public void ResetBall()
{ {
ball.MoveTo(new Vector2(1, GetYPosition(Values.Last())), ballShown ? transform_duration : 0, EasingTypes.OutQuint); ball.MoveTo(new Vector2(1, GetYPosition(Values.Last())), ballShown ? transform_duration : 0, Easing.OutQuint);
ball.Show(); ball.Show();
BallRelease(); BallRelease();
ballShown = true; ballShown = true;
@ -158,7 +158,7 @@ namespace osu.Game.Overlays.Profile
float y = GetYPosition(values[i]); float y = GetYPosition(values[i]);
if (Math.Abs(y * DrawHeight - position.Y) <= 8f) if (Math.Abs(y * DrawHeight - position.Y) <= 8f)
{ {
ball.MoveTo(new Vector2(index / (float)(count - 1), y), transform_duration, EasingTypes.OutQuint); ball.MoveTo(new Vector2(index / (float)(count - 1), y), transform_duration, Easing.OutQuint);
BallMove(i); BallMove(i);
} }
} }

View File

@ -291,7 +291,7 @@ namespace osu.Game.Overlays.Settings.Sections.General
{ {
set set
{ {
statusIcon.FadeColour(value, 500, EasingTypes.OutQuint); statusIcon.FadeColour(value, 500, Easing.OutQuint);
} }
} }

View File

@ -41,7 +41,7 @@ namespace osu.Game.Overlays.Settings.Sections.Graphics
RelativeSizeAxes = Axes.X, RelativeSizeAxes = Axes.X,
AutoSizeAxes = Axes.Y, AutoSizeAxes = Axes.Y,
AutoSizeDuration = transition_duration, AutoSizeDuration = transition_duration,
AutoSizeEasing = EasingTypes.OutQuint, AutoSizeEasing = Easing.OutQuint,
Masking = true, Masking = true,
Children = new Drawable[] Children = new Drawable[]
@ -66,7 +66,7 @@ namespace osu.Game.Overlays.Settings.Sections.Graphics
letterboxSettings.AutoSizeAxes = isVisible ? Axes.Y : Axes.None; letterboxSettings.AutoSizeAxes = isVisible ? Axes.Y : Axes.None;
if (!isVisible) if (!isVisible)
letterboxSettings.ResizeHeightTo(0, transition_duration, EasingTypes.OutQuint); letterboxSettings.ResizeHeightTo(0, transition_duration, Easing.OutQuint);
}; };
letterboxing.TriggerChange(); letterboxing.TriggerChange();
} }

View File

@ -60,7 +60,7 @@ namespace osu.Game.Overlays.Settings
set set
{ {
// probably needs a better transition. // probably needs a better transition.
FadeTo(value ? 1 : 0); this.FadeTo(value ? 1 : 0);
} }
} }

View File

@ -29,7 +29,7 @@ namespace osu.Game.Overlays.Settings
{ {
set set
{ {
FadeTo(value ? 1 : 0); this.FadeTo(value ? 1 : 0);
} }
} }

View File

@ -24,7 +24,7 @@ namespace osu.Game.Overlays.Settings
{ {
set set
{ {
FadeTo(value ? 1 : 0); this.FadeTo(value ? 1 : 0);
} }
} }

View File

@ -94,10 +94,10 @@ namespace osu.Game.Overlays.Settings
switch (state) switch (state)
{ {
default: default:
ResizeTo(new Vector2(DEFAULT_WIDTH, Height), 500, EasingTypes.OutQuint); this.ResizeTo(new Vector2(DEFAULT_WIDTH, Height), 500, Easing.OutQuint);
break; break;
case ExpandedState.Expanded: case ExpandedState.Expanded:
ResizeTo(new Vector2(EXPANDED_WIDTH, Height), 500, EasingTypes.OutQuint); this.ResizeTo(new Vector2(EXPANDED_WIDTH, Height), 500, Easing.OutQuint);
break; break;
} }
} }

View File

@ -125,9 +125,9 @@ namespace osu.Game.Overlays
{ {
base.PopIn(); base.PopIn();
sectionsContainer.MoveToX(0, TRANSITION_LENGTH, EasingTypes.OutQuint); sectionsContainer.MoveToX(0, TRANSITION_LENGTH, Easing.OutQuint);
sidebar.MoveToX(0, TRANSITION_LENGTH, EasingTypes.OutQuint); sidebar.MoveToX(0, TRANSITION_LENGTH, Easing.OutQuint);
FadeTo(1, TRANSITION_LENGTH / 2); this.FadeTo(1, TRANSITION_LENGTH / 2);
searchTextBox.HoldFocus = true; searchTextBox.HoldFocus = true;
} }
@ -136,9 +136,9 @@ namespace osu.Game.Overlays
{ {
base.PopOut(); base.PopOut();
sectionsContainer.MoveToX(-width, TRANSITION_LENGTH, EasingTypes.OutQuint); sectionsContainer.MoveToX(-width, TRANSITION_LENGTH, Easing.OutQuint);
sidebar.MoveToX(-SIDEBAR_WIDTH, TRANSITION_LENGTH, EasingTypes.OutQuint); sidebar.MoveToX(-SIDEBAR_WIDTH, TRANSITION_LENGTH, Easing.OutQuint);
FadeTo(0, TRANSITION_LENGTH / 2); this.FadeTo(0, TRANSITION_LENGTH / 2);
searchTextBox.HoldFocus = false; searchTextBox.HoldFocus = false;
if (searchTextBox.HasFocus) if (searchTextBox.HasFocus)

View File

@ -107,30 +107,30 @@ namespace osu.Game.Overlays.Toolbar
protected override bool OnHover(InputState state) protected override bool OnHover(InputState state)
{ {
solidBackground.FadeTo(alpha_hovering, transition_time, EasingTypes.OutQuint); solidBackground.FadeTo(alpha_hovering, transition_time, Easing.OutQuint);
gradientBackground.FadeIn(transition_time, EasingTypes.OutQuint); gradientBackground.FadeIn(transition_time, Easing.OutQuint);
return true; return true;
} }
protected override void OnHoverLost(InputState state) protected override void OnHoverLost(InputState state)
{ {
solidBackground.FadeTo(alpha_normal, transition_time, EasingTypes.OutQuint); solidBackground.FadeTo(alpha_normal, transition_time, Easing.OutQuint);
gradientBackground.FadeOut(transition_time, EasingTypes.OutQuint); gradientBackground.FadeOut(transition_time, Easing.OutQuint);
} }
} }
protected override void PopIn() protected override void PopIn()
{ {
MoveToY(0, transition_time, EasingTypes.OutQuint); this.MoveToY(0, transition_time, Easing.OutQuint);
FadeIn(transition_time / 2, EasingTypes.OutQuint); this.FadeIn(transition_time / 2, Easing.OutQuint);
} }
protected override void PopOut() protected override void PopOut()
{ {
userArea?.LoginOverlay.Hide(); userArea?.LoginOverlay.Hide();
MoveToY(-DrawSize.Y, transition_time, EasingTypes.OutQuint); this.MoveToY(-DrawSize.Y, transition_time, Easing.OutQuint);
FadeOut(transition_time); this.FadeOut(transition_time);
} }
} }
} }

Some files were not shown because too many files have changed in this diff Show More