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
153 changed files with 797 additions and 1060 deletions

View File

@ -35,7 +35,7 @@ namespace osu.Game.Beatmaps.Drawables
new PanelBackground(beatmap)
{
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)
FadeOut(300, EasingTypes.OutQuint);
this.FadeOut(300, Easing.OutQuint);
else
FadeIn(250);
this.FadeIn(250);
}
private PanelSelectedState state = PanelSelectedState.NotSelected;

View File

@ -42,7 +42,7 @@ namespace osu.Game.Graphics.Containers
{
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);
}
};
@ -57,7 +57,7 @@ namespace osu.Game.Graphics.Containers
if (parallaxEnabled)
{
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);
}

View File

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

View File

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

View File

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

View File

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

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 EasingTypes easing = EasingTypes.InOutCubic;
private const Easing easing = Easing.InOutCubic;
private float length;
/// <summary>

View File

@ -28,7 +28,7 @@ namespace osu.Game.Graphics.UserInterface
var tabIndex = TabContainer.IndexOf(TabMap[tab]);
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)
{
FadeIn(transition_duration, EasingTypes.OutQuint);
ScaleTo(new Vector2(1f), transition_duration, EasingTypes.OutQuint);
this.FadeIn(transition_duration, Easing.OutQuint);
this.ScaleTo(new Vector2(1f), transition_duration, Easing.OutQuint);
}
else
{
FadeOut(transition_duration, EasingTypes.OutQuint);
ScaleTo(new Vector2(0.8f, 1f), transition_duration, EasingTypes.OutQuint);
this.FadeOut(transition_duration, Easing.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)
{
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();
Delay(click_duration);
Schedule(delegate {
this.Delay(click_duration).Schedule(delegate {
colourContainer.ResizeTo(new Vector2(0.8f, 1f));
spriteText.Spacing = Vector2.Zero;
glowContainer.FadeOut();
@ -111,10 +110,10 @@ namespace osu.Game.Graphics.UserInterface
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);
glowContainer.FadeIn(glow_fade_duration, EasingTypes.Out);
colourContainer.ResizeTo(new Vector2(hover_width, 1f), hover_duration, Easing.OutElastic);
glowContainer.FadeIn(glow_fade_duration, Easing.Out);
base.OnHover(state);
return true;
}
@ -123,9 +122,9 @@ namespace osu.Game.Graphics.UserInterface
{
if (!didClick)
{
colourContainer.ResizeTo(new Vector2(0.8f, 1f), hover_duration, EasingTypes.OutElastic);
spriteText.TransformSpacingTo(Vector2.Zero, hover_duration, EasingTypes.OutElastic);
glowContainer.FadeOut(glow_fade_duration, EasingTypes.Out);
colourContainer.ResizeTo(new Vector2(0.8f, 1f), hover_duration, Easing.OutElastic);
spriteText.TransformSpacingTo(Vector2.Zero, hover_duration, Easing.OutElastic);
glowContainer.FadeOut(glow_fade_duration, Easing.Out);
}
didClick = false;

View File

@ -84,31 +84,31 @@ namespace osu.Game.Graphics.UserInterface
protected override bool OnHover(InputState state)
{
hover.FadeIn(500, EasingTypes.OutQuint);
hover.FadeIn(500, Easing.OutQuint);
return base.OnHover(state);
}
protected override void OnHoverLost(InputState state)
{
hover.FadeOut(500, EasingTypes.OutQuint);
hover.FadeOut(500, Easing.OutQuint);
base.OnHoverLost(state);
}
protected override bool OnClick(InputState state)
{
hover.FlashColour(flashColour, 800, EasingTypes.OutQuint);
hover.FlashColour(flashColour, 800, Easing.OutQuint);
return base.OnClick(state);
}
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);
}
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);
}
}

View File

@ -49,7 +49,7 @@ namespace osu.Game.Graphics.UserInterface
values = value.ToArray();
applyPath();
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();
using (spinner.BeginLoopedSequence())
spinner.RotateTo(360, 2000);
spinner.Spin(2000, RotationDirection.Clockwise);
}
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 =>
{
if (newValue)
fill.FadeIn(200, EasingTypes.OutQuint);
fill.FadeIn(200, Easing.OutQuint);
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)
{
FadeColour(GlowingAccentColour, 500, EasingTypes.OutQuint);
FadeEdgeEffectTo(1, 500, EasingTypes.OutQuint);
this.FadeColour(GlowingAccentColour, 500, Easing.OutQuint);
FadeEdgeEffectTo(1, 500, Easing.OutQuint);
}
else
{
FadeEdgeEffectTo(0, 500);
FadeColour(AccentColour, 500);
this.FadeColour(AccentColour, 500);
}
}
}
@ -95,7 +95,7 @@ namespace osu.Game.Graphics.UserInterface
{
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)
{
Content.ScaleTo(0.9f, 4000, EasingTypes.OutQuint);
Content.ScaleTo(0.9f, 4000, Easing.OutQuint);
return base.OnMouseDown(state, 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);
}
}

View File

@ -39,13 +39,13 @@ namespace osu.Game.Graphics.UserInterface
Background.Colour = colours.ContextMenuGray;
}
protected override void AnimateOpen() => FadeIn(fade_duration, EasingTypes.OutQuint);
protected override void AnimateClose() => FadeOut(fade_duration, EasingTypes.OutQuint);
protected override void AnimateOpen() => this.FadeIn(fade_duration, Easing.OutQuint);
protected override void AnimateClose() => this.FadeOut(fade_duration, Easing.OutQuint);
protected override void UpdateContentHeight()
{
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)
{
sampleHover.Play();
textBold.FadeIn(transition_length, EasingTypes.OutQuint);
text.FadeOut(transition_length, EasingTypes.OutQuint);
textBold.FadeIn(transition_length, Easing.OutQuint);
text.FadeOut(transition_length, Easing.OutQuint);
return base.OnHover(state);
}
protected override void OnHoverLost(InputState state)
{
textBold.FadeOut(transition_length, EasingTypes.OutQuint);
text.FadeIn(transition_length, EasingTypes.OutQuint);
textBold.FadeOut(transition_length, Easing.OutQuint);
text.FadeIn(transition_length, Easing.OutQuint);
base.OnHoverLost(state);
}

View File

@ -19,14 +19,14 @@ namespace osu.Game.Graphics.UserInterface
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()
{
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()
{
base.LoadComplete();
circle.FadeIn(500, EasingTypes.OutQuint);
circle.ResizeTo(new Vector2(0.8f), 500, EasingTypes.OutQuint);
circle.FadeIn(500, Easing.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)
{
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()
{
box.FadeIn(transition_length, EasingTypes.OutQuint);
Text.FadeColour(Color4.White, transition_length, EasingTypes.OutQuint);
box.FadeIn(transition_length, Easing.OutQuint);
Text.FadeColour(Color4.White, transition_length, Easing.OutQuint);
}
private void fadeInactive()
{
box.FadeOut(transition_length, EasingTypes.OutQuint);
Text.FadeColour(AccentColour, transition_length, EasingTypes.OutQuint);
box.FadeOut(transition_length, Easing.OutQuint);
Text.FadeColour(AccentColour, transition_length, Easing.OutQuint);
}
protected override bool OnHover(InputState state)

View File

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

View File

@ -1,9 +1,6 @@
// Copyright (c) 2007-2017 ppy Pty Ltd <contact@ppy.sh>.
// 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;
namespace osu.Game.Graphics.UserInterface
@ -13,8 +10,6 @@ namespace osu.Game.Graphics.UserInterface
/// </summary>
public class PercentageCounter : RollingCounter<double>
{
protected override Type TransformType => typeof(TransformAccuracy);
protected override double RollingDuration => 750;
private float epsilon => 1e-10f;
@ -44,23 +39,5 @@ namespace osu.Game.Graphics.UserInterface
{
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.Containers;
using osu.Framework.Graphics.Sprites;
using osu.Framework.Graphics.Transforms;
using osu.Game.Graphics.Sprites;
using System;
using System.Collections.Generic;
using System.Diagnostics;
using OpenTK.Graphics;
namespace osu.Game.Graphics.UserInterface
{
public abstract class RollingCounter<T> : Container, IHasAccentColour
where T : struct, IEquatable<T>
{
/// <summary>
/// The current value.
/// </summary>
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;
/// <summary>
@ -45,7 +36,7 @@ namespace osu.Game.Graphics.UserInterface
/// <summary>
/// Easing for the counter rollover animation.
/// </summary>
protected virtual EasingTypes RollingEasing => EasingTypes.OutQuint;
protected virtual Easing RollingEasing => Easing.OutQuint;
private T displayedCount;
@ -58,7 +49,8 @@ namespace osu.Game.Graphics.UserInterface
{
return displayedCount;
}
protected set
set
{
if (EqualityComparer<T>.Default.Equals(displayedCount, value))
return;
@ -133,7 +125,7 @@ namespace osu.Game.Graphics.UserInterface
/// </summary>
public virtual void StopRolling()
{
Flush(false, TransformType);
FinishTransforms(false, nameof(DisplayedCount));
DisplayedCount = Current;
}
@ -176,44 +168,15 @@ namespace osu.Game.Graphics.UserInterface
/// implement the rollover animation).
/// </summary>
/// <param name="currentValue">Count value before modification.</param>
/// <param name="newValue">Expected count value after modification-</param>
/// <seealso cref="TransformType"/>
/// <param name="newValue">Expected count value after modification.</param>
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 =
IsRollingProportional
? GetProportionalDuration(currentValue, newValue)
: RollingDuration;
transform.StartTime = TransformStartTime;
transform.EndTime = TransformStartTime + rollingTotalDuration;
transform.EndValue = newValue;
transform.Easing = RollingEasing;
Transforms.Add(transform);
this.TransformTo(nameof(DisplayedCount), newValue, rollingTotalDuration, RollingEasing);
}
}
}

View File

@ -2,18 +2,13 @@
// 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;
namespace osu.Game.Graphics.UserInterface
{
public class ScoreCounter : RollingCounter<double>
{
protected override Type TransformType => typeof(TransformScore);
protected override double RollingDuration => 1000;
protected override EasingTypes RollingEasing => EasingTypes.Out;
protected override Easing RollingEasing => Easing.Out;
public bool UseCommaSeparator;
@ -55,23 +50,5 @@ namespace osu.Game.Graphics.UserInterface
{
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
using System;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Transforms;
using osu.Framework.MathUtils;
namespace osu.Game.Graphics.UserInterface
{
@ -13,8 +10,6 @@ namespace osu.Game.Graphics.UserInterface
/// </summary>
public class SimpleComboCounter : RollingCounter<int>
{
protected override Type TransformType => typeof(TransformCounterCount);
protected override double RollingDuration => 750;
public SimpleComboCounter()
@ -36,23 +31,5 @@ namespace osu.Game.Graphics.UserInterface
{
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 scalingDuration => 1000;
private EasingTypes scalingEasing => EasingTypes.OutElasticHalf;
private Easing scalingEasing => Easing.OutElasticHalf;
private float minStarScale => 0.4f;
private double fadingDuration => 100;
@ -122,7 +122,7 @@ namespace osu.Game.Graphics.UserInterface
if (value <= i)
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)
@ -133,12 +133,8 @@ namespace osu.Game.Graphics.UserInterface
star.ClearTransforms(true);
var delay = (countStars <= newValue ? Math.Max(i - countStars, 0) : Math.Max(countStars - 1 - i, 0)) * animationDelay;
using (BeginDelayedSequence(delay, true))
{
star.FadeTo(i < newValue ? 1.0f : minStarAlpha, fadingDuration);
star.Icon.ScaleTo(getStarScale(i, newValue), scalingDuration, scalingEasing);
}
star.Delay(delay).FadeTo(i < newValue ? 1.0f : minStarAlpha, fadingDuration);
star.Icon.Delay(delay).ScaleTo(getStarScale(i, newValue), scalingDuration, scalingEasing);
i++;
}

View File

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

View File

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

View File

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

View File

@ -81,21 +81,26 @@ namespace osu.Game
Name = @"osu!lazer";
}
private DependencyContainer dependencies;
protected override IReadOnlyDependencyContainer CreateLocalDependencies(IReadOnlyDependencyContainer parent) =>
dependencies = new DependencyContainer(base.CreateLocalDependencies(parent));
[BackgroundDependencyLoader]
private void load()
{
Dependencies.Cache(this);
Dependencies.Cache(LocalConfig);
dependencies.Cache(this);
dependencies.Cache(LocalConfig);
SQLiteConnection connection = Host.Storage.GetDatabase(@"client");
Dependencies.Cache(RulesetDatabase = new RulesetDatabase(Host.Storage, connection));
Dependencies.Cache(BeatmapDatabase = new BeatmapDatabase(Host.Storage, connection, RulesetDatabase, Host));
Dependencies.Cache(ScoreDatabase = new ScoreDatabase(Host.Storage, connection, Host, BeatmapDatabase));
Dependencies.Cache(new OsuColour());
dependencies.Cache(RulesetDatabase = new RulesetDatabase(Host.Storage, connection));
dependencies.Cache(BeatmapDatabase = new BeatmapDatabase(Host.Storage, connection, RulesetDatabase, Host));
dependencies.Cache(ScoreDatabase = new ScoreDatabase(Host.Storage, connection, Host, BeatmapDatabase));
dependencies.Cache(new OsuColour());
//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/osuFont"));
@ -127,7 +132,7 @@ namespace osu.Game
OszArchiveReader.Register();
Dependencies.Cache(API = new APIAccess
dependencies.Cache(API = new APIAccess
{
Username = LocalConfig.Get<string>(OsuSetting.Username),
Token = LocalConfig.Get<string>(OsuSetting.Token)

View File

@ -39,7 +39,7 @@ namespace osu.Game.Overlays.Chat
{
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)
{
if (!channel.Joined.Value)
name.FadeColour(hoverColour, 50, EasingTypes.OutQuint);
name.FadeColour(hoverColour, 50, Easing.OutQuint);
return base.OnHover(state);
}
@ -175,14 +175,14 @@ namespace osu.Game.Overlays.Chat
joinedCheckmark.FadeTo(1f, transition_duration);
topic.FadeTo(0.8f, transition_duration);
topic.FadeColour(Color4.White, transition_duration);
FadeColour(joinedColour, transition_duration);
this.FadeColour(joinedColour, transition_duration);
}
else
{
joinedCheckmark.FadeTo(0f, transition_duration);
topic.FadeTo(1f, 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
{
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,
Direction = FillDirection.Vertical,
LayoutDuration = 200,
LayoutEasing = EasingTypes.OutQuint,
LayoutEasing = Easing.OutQuint,
Spacing = new Vector2(0f, 20f),
Padding = new MarginPadding { Vertical = 20, Left = WIDTH_PADDING },
},
@ -158,10 +158,10 @@ namespace osu.Game.Overlays.Chat
protected override void PopIn()
{
if (Alpha == 0) MoveToY(DrawHeight);
if (Alpha == 0) this.MoveToY(DrawHeight);
FadeIn(transition_duration, EasingTypes.OutQuint);
MoveToY(0, transition_duration, EasingTypes.OutQuint);
this.FadeIn(transition_duration, Easing.OutQuint);
this.MoveToY(0, transition_duration, Easing.OutQuint);
search.HoldFocus = true;
base.PopIn();
@ -169,8 +169,8 @@ namespace osu.Game.Overlays.Chat
protected override void PopOut()
{
FadeOut(transition_duration, EasingTypes.InSine);
MoveToY(DrawHeight, transition_duration, EasingTypes.InSine);
this.FadeOut(transition_duration, Easing.InSine);
this.MoveToY(DrawHeight, transition_duration, Easing.InSine);
search.HoldFocus = false;
base.PopOut();

View File

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

View File

@ -86,30 +86,30 @@ namespace osu.Game.Overlays.Chat
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);
highlightBox.FadeIn(transition_length, EasingTypes.OutQuint);
box.FadeColour(backgroundActive, transition_length, Easing.OutQuint);
highlightBox.FadeIn(transition_length, Easing.OutQuint);
text.FadeOut(transition_length, EasingTypes.OutQuint);
textBold.FadeIn(transition_length, EasingTypes.OutQuint);
text.FadeOut(transition_length, Easing.OutQuint);
textBold.FadeIn(transition_length, Easing.OutQuint);
}
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);
highlightBox.FadeOut(transition_length, EasingTypes.OutQuint);
box.FadeColour(backgroundInactive, transition_length, Easing.OutQuint);
highlightBox.FadeOut(transition_length, Easing.OutQuint);
text.FadeIn(transition_length, EasingTypes.OutQuint);
textBold.FadeOut(transition_length, EasingTypes.OutQuint);
text.FadeIn(transition_length, Easing.OutQuint);
textBold.FadeOut(transition_length, Easing.OutQuint);
}
protected override bool OnHover(InputState state)
{
if (!Active)
box.FadeColour(backgroundHover, transition_length, EasingTypes.OutQuint);
box.FadeColour(backgroundHover, transition_length, Easing.OutQuint);
return true;
}

View File

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

View File

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

View File

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

View File

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

View File

@ -43,7 +43,7 @@ namespace osu.Game.Overlays.Direct
{
base.LoadComplete();
FadeInFromZero(200, EasingTypes.Out);
this.FadeInFromZero(200, Easing.Out);
}
[BackgroundDependencyLoader]
@ -171,25 +171,25 @@ namespace osu.Game.Overlays.Direct
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);
}
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);
}
protected override bool OnHover(InputState state)
{
icon.ScaleTo(1.1f, 500, EasingTypes.OutElastic);
icon.ScaleTo(1.1f, 500, Easing.OutElastic);
return base.OnHover(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,
RelativeSizeAxes = Axes.Both,
FillMode = FillMode.Fill,
OnLoadComplete = d => d.FadeInFromZero(400, EasingTypes.Out),
OnLoadComplete = d => d.FadeInFromZero(400, Easing.Out),
})
{
RelativeSizeAxes = Axes.Both,

View File

@ -169,7 +169,7 @@ namespace osu.Game.Overlays
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;
resultCountsText.Text = pluralize("Artist", ResultAmounts.Artists) + ", " +

View File

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

View File

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

View File

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

View File

@ -35,7 +35,7 @@ namespace osu.Game.Overlays.Mods
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;
// A selected index of -1 means not selected.
@ -67,8 +67,8 @@ namespace osu.Game.Overlays.Mods
if (beforeSelected != Selected)
{
iconsContainer.RotateTo(Selected ? 5f : 0f, 300, EasingTypes.OutElastic);
iconsContainer.ScaleTo(Selected ? 1.1f : 1f, 300, EasingTypes.OutElastic);
iconsContainer.RotateTo(Selected ? 5f : 0f, 300, Easing.OutElastic);
iconsContainer.ScaleTo(Selected ? 1.1f : 1f, 300, Easing.OutElastic);
}
if (modBefore != modAfter)
@ -81,11 +81,13 @@ namespace osu.Game.Overlays.Mods
backgroundIcon.Icon = modAfter.Icon;
using (BeginDelayedSequence(mod_switch_duration, true))
{
foregroundIcon.RotateTo(-rotate_angle * direction);
foregroundIcon.RotateTo(0f, mod_switch_duration, mod_switch_easing);
foregroundIcon
.RotateTo(-rotate_angle * direction)
.RotateTo(0f, mod_switch_duration, mod_switch_easing);
backgroundIcon.RotateTo(rotate_angle * direction);
backgroundIcon.RotateTo(0f, mod_switch_duration, mod_switch_easing);
backgroundIcon
.RotateTo(rotate_angle * direction)
.RotateTo(0f, mod_switch_duration, mod_switch_easing);
Schedule(() => displayMod(modAfter));
}

View File

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

View File

@ -41,7 +41,7 @@ namespace osu.Game.Overlays.Music
if (value == selected) return;
selected = value;
Flush(true);
FinishTransforms(true);
foreach (SpriteText s in titleSprites)
s.FadeColour(Selected ? hoverColour : Color4.White, fade_duration);
}
@ -145,7 +145,7 @@ namespace osu.Game.Overlays.Music
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()
{
LayoutDuration = 200;
LayoutEasing = EasingTypes.OutQuint;
LayoutEasing = Easing.OutQuint;
}
}
}

View File

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

View File

@ -82,7 +82,7 @@ namespace osu.Game.Overlays
protected override bool OnDragEnd(InputState state)
{
dragContainer.MoveTo(Vector2.Zero, 800, EasingTypes.OutElastic);
dragContainer.MoveTo(Vector2.Zero, 800, Easing.OutElastic);
return base.OnDragEnd(state);
}
@ -204,7 +204,7 @@ namespace osu.Game.Overlays
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()
@ -345,13 +345,13 @@ namespace osu.Game.Overlays
{
case TransformDirection.Next:
d.Position = new Vector2(400, 0);
d.MoveToX(0, 500, EasingTypes.OutCubic);
currentBackground.MoveToX(-400, 500, EasingTypes.OutCubic);
d.MoveToX(0, 500, Easing.OutCubic);
currentBackground.MoveToX(-400, 500, Easing.OutCubic);
break;
case TransformDirection.Prev:
d.Position = new Vector2(-400, 0);
d.MoveToX(0, 500, EasingTypes.OutCubic);
currentBackground.MoveToX(400, 500, EasingTypes.OutCubic);
d.MoveToX(0, 500, Easing.OutCubic);
currentBackground.MoveToX(400, 500, Easing.OutCubic);
break;
}
currentBackground.Expire();
@ -368,16 +368,16 @@ namespace osu.Game.Overlays
{
base.PopIn();
FadeIn(transition_length, EasingTypes.OutQuint);
dragContainer.ScaleTo(1, transition_length, EasingTypes.OutElastic);
this.FadeIn(transition_length, Easing.OutQuint);
dragContainer.ScaleTo(1, transition_length, Easing.OutElastic);
}
protected override void PopOut()
{
base.PopOut();
FadeOut(transition_length, EasingTypes.OutQuint);
dragContainer.ScaleTo(0.9f, transition_length, EasingTypes.OutQuint);
this.FadeOut(transition_length, Easing.OutQuint);
dragContainer.ScaleTo(0.9f, transition_length, Easing.OutQuint);
}
private enum TransformDirection

View File

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

View File

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

View File

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

View File

@ -77,11 +77,8 @@ namespace osu.Game.Overlays.Notifications
switch (state)
{
case ProgressNotificationState.Completed:
NotificationContent.MoveToY(-DrawSize.Y / 2, 200, EasingTypes.OutQuint);
FadeTo(0.01f, 200); //don't completely fade out or our scheduled task won't run.
Delay(100);
Schedule(Completed);
NotificationContent.MoveToY(-DrawSize.Y / 2, 200, Easing.OutQuint);
this.FadeOut(200).Finally(d => Completed());
break;
}
}
@ -184,7 +181,7 @@ namespace osu.Game.Overlays.Notifications
if (progress == value) return;
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
{
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;
textLine3.Text = shortcut.ToUpper();
box.FadeIn(500, EasingTypes.OutQuint);
box.ResizeHeightTo(height, 500, EasingTypes.OutQuint);
using (box.BeginDelayedSequence(500))
{
box.FadeOutFromOne(1500, EasingTypes.InQuint);
box.ResizeHeightTo(height_contracted, 1500, EasingTypes.InQuint);
}
box.Animate(
b => b.FadeIn(500, Easing.OutQuint),
b => b.ResizeHeightTo(height, 500, Easing.OutQuint)
).Then(
b => b.FadeOutFromOne(1500, Easing.InQuint),
b => b.ResizeHeightTo(height_contracted, 1500, Easing.InQuint)
);
int optionCount = 0;
int selectedOption = -1;
@ -232,13 +231,13 @@ namespace osu.Game.Overlays
{
if (glowing)
{
fill.FadeColour(glowingColour, transition_speed, EasingTypes.OutQuint);
FadeEdgeEffectTo(glow_strength, transition_speed, EasingTypes.OutQuint);
fill.FadeColour(glowingColour, transition_speed, Easing.OutQuint);
FadeEdgeEffectTo(glow_strength, transition_speed, Easing.OutQuint);
}
else
{
FadeEdgeEffectTo(0, transition_speed, EasingTypes.OutQuint);
fill.FadeColour(idleColour, transition_speed, EasingTypes.OutQuint);
FadeEdgeEffectTo(0, transition_speed, Easing.OutQuint);
fill.FadeColour(idleColour, transition_speed, Easing.OutQuint);
}
}
@ -261,7 +260,7 @@ namespace osu.Game.Overlays
};
updateGlow();
Flush(true);
FinishTransforms(true);
}
}
}

View File

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

View File

@ -138,7 +138,7 @@ namespace osu.Game.Overlays.Profile
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();
BallRelease();
ballShown = true;
@ -158,7 +158,7 @@ namespace osu.Game.Overlays.Profile
float y = GetYPosition(values[i]);
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);
}
}

View File

@ -291,7 +291,7 @@ namespace osu.Game.Overlays.Settings.Sections.General
{
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,
AutoSizeAxes = Axes.Y,
AutoSizeDuration = transition_duration,
AutoSizeEasing = EasingTypes.OutQuint,
AutoSizeEasing = Easing.OutQuint,
Masking = true,
Children = new Drawable[]
@ -66,7 +66,7 @@ namespace osu.Game.Overlays.Settings.Sections.Graphics
letterboxSettings.AutoSizeAxes = isVisible ? Axes.Y : Axes.None;
if (!isVisible)
letterboxSettings.ResizeHeightTo(0, transition_duration, EasingTypes.OutQuint);
letterboxSettings.ResizeHeightTo(0, transition_duration, Easing.OutQuint);
};
letterboxing.TriggerChange();
}

View File

@ -60,7 +60,7 @@ namespace osu.Game.Overlays.Settings
set
{
// 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
{
FadeTo(value ? 1 : 0);
this.FadeTo(value ? 1 : 0);
}
}

View File

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

View File

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

View File

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

View File

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

View File

@ -135,7 +135,7 @@ namespace osu.Game.Overlays.Toolbar
protected override bool OnClick(InputState state)
{
HoverBackground.FlashColour(Color4.White.Opacity(100), 500, EasingTypes.OutQuint);
HoverBackground.FlashColour(Color4.White.Opacity(100), 500, Easing.OutQuint);
return base.OnClick(state);
}

View File

@ -86,7 +86,7 @@ namespace osu.Game.Overlays.Toolbar
public override bool HandleInput => !ruleset.Disabled;
private void disabledChanged(bool isDisabled) => FadeColour(isDisabled ? Color4.Gray : Color4.White, 300);
private void disabledChanged(bool isDisabled) => this.FadeColour(isDisabled ? Color4.Gray : Color4.White, 300);
protected override void Update()
{
@ -115,7 +115,7 @@ namespace osu.Game.Overlays.Toolbar
if (!activeMode.IsValid)
{
modeButtonLine.MoveToX(activeButton.DrawPosition.X, 200, EasingTypes.OutQuint);
modeButtonLine.MoveToX(activeButton.DrawPosition.X, 200, Easing.OutQuint);
activeMode.Validate();
}
}

View File

@ -73,13 +73,13 @@ namespace osu.Game.Overlays
protected override void PopIn()
{
base.PopIn();
FadeEdgeEffectTo(0.5f, APPEAR_DURATION, EasingTypes.In);
FadeEdgeEffectTo(0.5f, APPEAR_DURATION, Easing.In);
}
protected override void PopOut()
{
base.PopOut();
FadeEdgeEffectTo(0, DISAPPEAR_DURATION, EasingTypes.Out);
FadeEdgeEffectTo(0, DISAPPEAR_DURATION, Easing.Out);
}
public void ShowUser(User user, bool fetchOnline = true)

View File

@ -17,8 +17,8 @@ namespace osu.Game.Overlays
protected const float APPEAR_DURATION = 800;
protected const float DISAPPEAR_DURATION = 500;
private const EasingTypes easing_show = EasingTypes.OutSine;
private const EasingTypes easing_hide = EasingTypes.InSine;
private const Easing easing_show = Easing.OutSine;
private const Easing easing_hide = Easing.InSine;
private readonly Wave firstWave;
private readonly Wave secondWave;
@ -137,23 +137,23 @@ namespace osu.Game.Overlays
foreach (var w in wavesContainer.Children)
w.State = Visibility.Visible;
FadeIn(100, EasingTypes.OutQuint);
contentContainer.MoveToY(0, APPEAR_DURATION, EasingTypes.OutQuint);
this.FadeIn(100, Easing.OutQuint);
contentContainer.MoveToY(0, APPEAR_DURATION, Easing.OutQuint);
FadeIn(100, EasingTypes.OutQuint);
this.FadeIn(100, Easing.OutQuint);
}
protected override void PopOut()
{
base.PopOut();
FadeOut(DISAPPEAR_DURATION, EasingTypes.InQuint);
contentContainer.MoveToY(DrawHeight * 2f, DISAPPEAR_DURATION, EasingTypes.In);
this.FadeOut(DISAPPEAR_DURATION, Easing.InQuint);
contentContainer.MoveToY(DrawHeight * 2f, DISAPPEAR_DURATION, Easing.In);
foreach (var w in wavesContainer.Children)
w.State = Visibility.Hidden;
FadeOut(DISAPPEAR_DURATION, EasingTypes.InQuint);
this.FadeOut(DISAPPEAR_DURATION, Easing.InQuint);
}
protected override void UpdateAfterChildren()
@ -210,10 +210,10 @@ namespace osu.Game.Overlays
switch (value)
{
case Visibility.Hidden:
MoveToY(Parent.Parent.DrawSize.Y, DISAPPEAR_DURATION, easing_hide);
this.MoveToY(Parent.Parent.DrawSize.Y, DISAPPEAR_DURATION, easing_hide);
break;
case Visibility.Visible:
MoveToY(FinalPosition, APPEAR_DURATION, easing_show);
this.MoveToY(FinalPosition, APPEAR_DURATION, easing_show);
break;
}
}

View File

@ -64,26 +64,24 @@ namespace osu.Game.Rulesets.Judgements
{
base.LoadComplete();
FadeInFromZero(100, EasingTypes.OutQuint);
this.FadeInFromZero(100, Easing.OutQuint);
switch (Judgement.Result)
{
case HitResult.Miss:
ScaleTo(1.6f);
ScaleTo(1, 100, EasingTypes.In);
this.ScaleTo(1.6f);
this.ScaleTo(1, 100, Easing.In);
MoveToOffset(new Vector2(0, 100), 800, EasingTypes.InQuint);
RotateTo(40, 800, EasingTypes.InQuint);
this.MoveToOffset(new Vector2(0, 100), 800, Easing.InQuint);
this.RotateTo(40, 800, Easing.InQuint);
Delay(600);
FadeOut(200);
this.Delay(600).FadeOut(200);
break;
case HitResult.Hit:
ScaleTo(0.9f);
ScaleTo(1, 500, EasingTypes.OutElastic);
this.ScaleTo(0.9f);
this.ScaleTo(1, 500, Easing.OutElastic);
Delay(100);
FadeOut(400);
this.Delay(100).FadeOut(400);
break;
}

View File

@ -56,29 +56,29 @@ namespace osu.Game.Screens
Content.FadeOut();
Content.MoveToX(x_movement_amount);
Content.FadeIn(transition_length, EasingTypes.InOutQuart);
Content.MoveToX(0, transition_length, EasingTypes.InOutQuart);
Content.FadeIn(transition_length, Easing.InOutQuart);
Content.MoveToX(0, transition_length, Easing.InOutQuart);
base.OnEntering(last);
}
protected override void OnSuspending(Screen next)
{
Content.MoveToX(-x_movement_amount, transition_length, EasingTypes.InOutQuart);
Content.MoveToX(-x_movement_amount, transition_length, Easing.InOutQuart);
base.OnSuspending(next);
}
protected override bool OnExiting(Screen next)
{
Content.FadeOut(transition_length, EasingTypes.OutExpo);
Content.MoveToX(x_movement_amount, transition_length, EasingTypes.OutExpo);
Content.FadeOut(transition_length, Easing.OutExpo);
Content.MoveToX(x_movement_amount, transition_length, Easing.OutExpo);
return base.OnExiting(next);
}
protected override void OnResuming(Screen last)
{
Content.MoveToX(0, transition_length, EasingTypes.OutExpo);
Content.MoveToX(0, transition_length, Easing.OutExpo);
base.OnResuming(last);
}
}

View File

@ -40,7 +40,7 @@ namespace osu.Game.Screens.Backgrounds
if (background != null)
{
newDepth = background.Depth + 1;
background.Flush();
background.FinishTransforms();
background.FadeOut(250);
background.Expire();
}
@ -58,7 +58,7 @@ namespace osu.Game.Screens.Backgrounds
Beatmap = beatmap;
}
public void BlurTo(Vector2 sigma, double duration, EasingTypes easing = EasingTypes.None)
public void BlurTo(Vector2 sigma, double duration, Easing easing = Easing.None)
{
background?.BlurTo(sigma, duration, easing);
blurTarget = sigma;

View File

@ -24,7 +24,7 @@ namespace osu.Game.Screens.Backgrounds
private void display(Background newBackground)
{
current?.FadeOut(800, EasingTypes.OutQuint);
current?.FadeOut(800, Easing.OutQuint);
current?.Expire();
Add(current = newBackground);

View File

@ -7,6 +7,7 @@ using OpenTK.Graphics;
using osu.Framework.Screens;
using osu.Game.Screens.Backgrounds;
using osu.Game.Screens.Select;
using osu.Framework.Graphics;
namespace osu.Game.Screens.Edit
{

View File

@ -128,16 +128,15 @@ namespace osu.Game.Screens.Menu
bool rightward = beatIndex % 2 == 1;
double duration = timingPoint.BeatLength / 2;
icon.RotateTo(rightward ? 10 : -10, duration * 2, EasingTypes.InOutSine);
icon.RotateTo(rightward ? 10 : -10, duration * 2, Easing.InOutSine);
icon.MoveToY(-10, duration, EasingTypes.Out);
icon.ScaleTo(Vector2.One, duration, EasingTypes.Out);
using (icon.BeginDelayedSequence(duration))
{
icon.MoveToY(0, duration, EasingTypes.In);
icon.ScaleTo(new Vector2(1, 0.9f), duration, EasingTypes.In);
}
icon.Animate(
i => i.MoveToY(-10, duration, Easing.Out),
i => i.ScaleTo(1, duration, Easing.Out)
).Then(
i => i.MoveToY(0, duration, Easing.In),
i => i.ScaleTo(new Vector2(1, 0.9f), duration, Easing.In)
);
}
protected override bool OnHover(InputState state)
@ -146,25 +145,25 @@ namespace osu.Game.Screens.Menu
sampleHover?.Play();
box.ScaleTo(new Vector2(1.5f, 1), 500, EasingTypes.OutElastic);
box.ScaleTo(new Vector2(1.5f, 1), 500, Easing.OutElastic);
double duration = TimeUntilNextBeat;
icon.ClearTransforms();
icon.RotateTo(10, duration, EasingTypes.InOutSine);
icon.ScaleTo(new Vector2(1, 0.9f), duration, EasingTypes.Out);
icon.RotateTo(10, duration, Easing.InOutSine);
icon.ScaleTo(new Vector2(1, 0.9f), duration, Easing.Out);
return true;
}
protected override void OnHoverLost(InputState state)
{
icon.ClearTransforms();
icon.RotateTo(0, 500, EasingTypes.Out);
icon.MoveTo(Vector2.Zero, 500, EasingTypes.Out);
icon.ScaleTo(Vector2.One, 200, EasingTypes.Out);
icon.RotateTo(0, 500, Easing.Out);
icon.MoveTo(Vector2.Zero, 500, Easing.Out);
icon.ScaleTo(Vector2.One, 200, Easing.Out);
if (State == ButtonState.Expanded)
box.ScaleTo(new Vector2(1, 1), 500, EasingTypes.OutElastic);
box.ScaleTo(new Vector2(1, 1), 500, Easing.OutElastic);
}
[BackgroundDependencyLoader]
@ -177,13 +176,13 @@ namespace osu.Game.Screens.Menu
protected override bool OnMouseDown(InputState state, MouseDownEventArgs args)
{
boxHoverLayer.FadeTo(0.1f, 1000, EasingTypes.OutQuint);
boxHoverLayer.FadeTo(0.1f, 1000, Easing.OutQuint);
return base.OnMouseDown(state, args);
}
protected override bool OnMouseUp(InputState state, MouseUpEventArgs args)
{
boxHoverLayer.FadeTo(0, 1000, EasingTypes.OutQuint);
boxHoverLayer.FadeTo(0, 1000, Easing.OutQuint);
return base.OnMouseUp(state, args);
}
@ -215,7 +214,7 @@ namespace osu.Game.Screens.Menu
boxHoverLayer.ClearTransforms();
boxHoverLayer.Alpha = 0.9f;
boxHoverLayer.FadeOut(800, EasingTypes.OutExpo);
boxHoverLayer.FadeOut(800, Easing.OutExpo);
}
public override bool HandleInput => state != ButtonState.Exploded && box.Scale.X >= 0.8f;
@ -247,24 +246,24 @@ namespace osu.Game.Screens.Menu
switch (ContractStyle)
{
default:
box.ScaleTo(new Vector2(0, 1), 500, EasingTypes.OutExpo);
FadeOut(500);
box.ScaleTo(new Vector2(0, 1), 500, Easing.OutExpo);
this.FadeOut(500);
break;
case 1:
box.ScaleTo(new Vector2(0, 1), 400, EasingTypes.InSine);
FadeOut(800);
box.ScaleTo(new Vector2(0, 1), 400, Easing.InSine);
this.FadeOut(800);
break;
}
break;
case ButtonState.Expanded:
const int expand_duration = 500;
box.ScaleTo(new Vector2(1, 1), expand_duration, EasingTypes.OutExpo);
FadeIn(expand_duration / 6f);
box.ScaleTo(new Vector2(1, 1), expand_duration, Easing.OutExpo);
this.FadeIn(expand_duration / 6f);
break;
case ButtonState.Exploded:
const int explode_duration = 200;
box.ScaleTo(new Vector2(2, 1), explode_duration, EasingTypes.OutExpo);
FadeOut(explode_duration / 4f * 3);
box.ScaleTo(new Vector2(2, 1), explode_duration, Easing.OutExpo);
this.FadeOut(explode_duration / 4f * 3);
break;
}
}

View File

@ -216,7 +216,7 @@ namespace osu.Game.Screens.Menu
bool fromInitial = lastState == MenuState.Initial;
if (state == MenuState.TopLevel)
buttonArea.Flush(true);
buttonArea.FinishTransforms(true);
using (buttonArea.BeginDelayedSequence(fromInitial ? 150 : 0, true))
{
@ -224,16 +224,13 @@ namespace osu.Game.Screens.Menu
{
case MenuState.Exit:
case MenuState.Initial:
toolbar?.Hide();
buttonAreaBackground.ScaleTo(Vector2.One, 500, EasingTypes.Out);
buttonAreaBackground.ScaleTo(Vector2.One, 500, Easing.Out);
buttonArea.FadeOut(300);
using (osuLogo.BeginDelayedSequence(150))
{
osuLogo.MoveTo(Vector2.Zero, 800, EasingTypes.OutExpo);
osuLogo.ScaleTo(1, 800, EasingTypes.OutExpo);
}
osuLogo.Delay(150)
.Schedule(() => toolbar?.Hide())
.ScaleTo(1, 800, Easing.OutExpo)
.MoveTo(Vector2.Zero, 800, Easing.OutExpo);
foreach (Button b in buttonsTopLevel)
b.State = ButtonState.Contracted;
@ -250,19 +247,20 @@ namespace osu.Game.Screens.Menu
sampleBack?.Play();
break;
case MenuState.TopLevel:
buttonAreaBackground.ScaleTo(Vector2.One, 200, EasingTypes.Out);
buttonAreaBackground.ScaleTo(Vector2.One, 200, Easing.Out);
osuLogo.ClearTransforms();
osuLogo.MoveTo(buttonFlow.DrawPosition, 200, EasingTypes.In);
osuLogo.ScaleTo(0.5f, 200, EasingTypes.In);
buttonArea.FadeIn(300);
var sequence = osuLogo
.ScaleTo(0.5f, 200, Easing.In)
.MoveTo(buttonFlow.DrawPosition, 200, Easing.In);
if (fromInitial && osuLogo.Scale.X > 0.5f)
using (osuLogo.BeginDelayedSequence(200, true))
osuLogo.Impact();
sequence.OnComplete(o =>
{
o.Impact();
toolbar?.Show();
});
Scheduler.AddDelayed(() => toolbar?.Show(), 150);
buttonArea.FadeIn(300);
foreach (Button b in buttonsTopLevel)
b.State = ButtonState.Expanded;
@ -278,7 +276,7 @@ namespace osu.Game.Screens.Menu
b.State = ButtonState.Expanded;
break;
case MenuState.EnteringMode:
buttonAreaBackground.ScaleTo(new Vector2(2, 0), 300, EasingTypes.InSine);
buttonAreaBackground.ScaleTo(new Vector2(2, 0), 300, Easing.InSine);
buttonsTopLevel.ForEach(b => b.ContractStyle = 1);
buttonsPlay.ForEach(b => b.ContractStyle = 1);

View File

@ -98,18 +98,13 @@ namespace osu.Game.Screens.Menu
{
base.OnEntering(last);
Content.FadeInFromZero(500);
icon.Delay(1500).FadeColour(iconColour, 200);
icon.Delay(1500);
icon.FadeColour(iconColour, 200);
Delay(6000, true);
Content.FadeOut(250);
Delay(250);
Schedule(() => Push(intro));
Content
.FadeInFromZero(500)
.Then(5500)
.FadeOut(250)
.Finally(d => Push(intro));
}
}
}

View File

@ -134,8 +134,8 @@ namespace osu.Game.Screens.Menu
logo.ScaleTo(0.4f);
logo.FadeOut();
logo.ScaleTo(1, 4400, EasingTypes.OutQuint);
logo.FadeIn(20000, EasingTypes.OutQuint);
logo.ScaleTo(1, 4400, Easing.OutQuint);
logo.FadeIn(20000, Easing.OutQuint);
}
protected override void OnSuspending(Screen next)

View File

@ -118,10 +118,10 @@ namespace osu.Game.Screens.Menu
buttons.State = MenuState.EnteringMode;
Content.FadeOut(length, EasingTypes.InSine);
Content.MoveTo(new Vector2(-800, 0), length, EasingTypes.InSine);
Content.FadeOut(length, Easing.InSine);
Content.MoveTo(new Vector2(-800, 0), length, Easing.InSine);
sideFlashes.FadeOut(length / 4, EasingTypes.OutQuint);
sideFlashes.FadeOut(length / 4, Easing.OutQuint);
}
protected override void OnResuming(Screen last)
@ -137,10 +137,10 @@ namespace osu.Game.Screens.Menu
buttons.State = MenuState.TopLevel;
Content.FadeIn(length, EasingTypes.OutQuint);
Content.MoveTo(new Vector2(0, 0), length, EasingTypes.OutQuint);
Content.FadeIn(length, Easing.OutQuint);
Content.MoveTo(new Vector2(0, 0), length, Easing.OutQuint);
sideFlashes.FadeIn(length / 4, EasingTypes.InQuint);
sideFlashes.FadeIn(length / 4, Easing.InQuint);
}
protected override bool OnExiting(Screen next)

View File

@ -90,9 +90,9 @@ namespace osu.Game.Screens.Menu
private void flash(Drawable d, double beatLength, bool kiai, TrackAmplitudes amplitudes)
{
d.FadeTo(Math.Max(0, ((d.Equals(leftBox) ? amplitudes.LeftChannel : amplitudes.RightChannel) - amplitude_dead_zone) / (kiai ? kiai_multiplier : alpha_multiplier)), box_fade_in_time);
using (d.BeginDelayedSequence(box_fade_in_time))
d.FadeOut(beatLength, EasingTypes.In);
d.FadeTo(Math.Max(0, ((d.Equals(leftBox) ? amplitudes.LeftChannel : amplitudes.RightChannel) - amplitude_dead_zone) / (kiai ? kiai_multiplier : alpha_multiplier)), box_fade_in_time)
.Then()
.FadeOut(beatLength, Easing.In);
}
}
}

View File

@ -237,34 +237,32 @@ namespace osu.Game.Screens.Menu
if (beatIndex < 0) return;
if (IsHovered)
{
using (BeginDelayedSequence(early_activation))
Schedule(() => sampleBeat.Play());
}
this.Delay(early_activation).Schedule(() => sampleBeat.Play());
logoBeatContainer.ScaleTo(1 - 0.02f * amplitudeAdjust, early_activation, EasingTypes.Out);
using (logoBeatContainer.BeginDelayedSequence(early_activation))
logoBeatContainer.ScaleTo(1, beatLength * 2, EasingTypes.OutQuint);
logoBeatContainer
.ScaleTo(1 - 0.02f * amplitudeAdjust, early_activation, Easing.Out)
.Then()
.ScaleTo(1, beatLength * 2, Easing.OutQuint);
ripple.ClearTransforms();
ripple.ScaleTo(logoAmplitudeContainer.Scale);
ripple.Alpha = 0.15f * amplitudeAdjust;
ripple.ScaleTo(logoAmplitudeContainer.Scale * (1 + 0.04f * amplitudeAdjust), beatLength, EasingTypes.OutQuint);
ripple.FadeOut(beatLength, EasingTypes.OutQuint);
ripple
.ScaleTo(logoAmplitudeContainer.Scale)
.ScaleTo(logoAmplitudeContainer.Scale * (1 + 0.04f * amplitudeAdjust), beatLength, Easing.OutQuint)
.FadeTo(0.15f * amplitudeAdjust).FadeOut(beatLength, Easing.OutQuint);
if (effectPoint.KiaiMode && flashLayer.Alpha < 0.4f)
{
flashLayer.ClearTransforms();
visualizer.ClearTransforms();
flashLayer
.FadeTo(0.2f * amplitudeAdjust, early_activation, Easing.Out)
.Then()
.FadeOut(beatLength);
flashLayer.FadeTo(0.2f * amplitudeAdjust, early_activation, EasingTypes.Out);
visualizer.FadeTo(0.9f * amplitudeAdjust, early_activation, EasingTypes.Out);
using (flashLayer.BeginDelayedSequence(early_activation))
flashLayer.FadeOut(beatLength);
using (visualizer.BeginDelayedSequence(early_activation))
visualizer.FadeTo(0.5f, beatLength);
visualizer.ClearTransforms();
visualizer
.FadeTo(0.9f * amplitudeAdjust, early_activation, Easing.Out)
.Then()
.FadeTo(0.5f, beatLength);
}
}
@ -276,7 +274,7 @@ namespace osu.Game.Screens.Menu
const float velocity_adjust_cutoff = 0.98f;
var maxAmplitude = lastBeatIndex >= 0 ? Beatmap.Value.Track?.CurrentAmplitudes.Maximum ?? 0 : 0;
logoAmplitudeContainer.ScaleTo(1 - Math.Max(0, maxAmplitude - scale_adjust_cutoff) * 0.04f, 75, EasingTypes.OutQuint);
logoAmplitudeContainer.ScaleTo(1 - Math.Max(0, maxAmplitude - scale_adjust_cutoff) * 0.04f, 75, Easing.OutQuint);
if (maxAmplitude > velocity_adjust_cutoff)
triangles.Velocity = 1 + Math.Max(0, maxAmplitude - velocity_adjust_cutoff) * 50;
@ -288,13 +286,13 @@ namespace osu.Game.Screens.Menu
{
if (!Interactive) return false;
logoBounceContainer.ScaleTo(0.9f, 1000, EasingTypes.Out);
logoBounceContainer.ScaleTo(0.9f, 1000, Easing.Out);
return true;
}
protected override bool OnMouseUp(InputState state, MouseUpEventArgs args)
{
logoBounceContainer.ScaleTo(1f, 500, EasingTypes.OutElastic);
logoBounceContainer.ScaleTo(1f, 500, Easing.OutElastic);
return true;
}
@ -306,7 +304,7 @@ namespace osu.Game.Screens.Menu
flashLayer.ClearTransforms();
flashLayer.Alpha = 0.4f;
flashLayer.FadeOut(1500, EasingTypes.OutExpo);
flashLayer.FadeOut(1500, Easing.OutExpo);
Action?.Invoke();
return true;
@ -316,18 +314,18 @@ namespace osu.Game.Screens.Menu
{
if (!Interactive) return false;
logoHoverContainer.ScaleTo(1.1f, 500, EasingTypes.OutElastic);
logoHoverContainer.ScaleTo(1.1f, 500, Easing.OutElastic);
return true;
}
protected override void OnHoverLost(InputState state)
{
logoHoverContainer.ScaleTo(1, 500, EasingTypes.OutElastic);
logoHoverContainer.ScaleTo(1, 500, Easing.OutElastic);
}
public void Impact()
{
impactContainer.FadeOutFromOne(250, EasingTypes.In);
impactContainer.FadeOutFromOne(250, Easing.In);
impactContainer.ScaleTo(0.96f);
impactContainer.ScaleTo(1.12f, 250);
}

View File

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

View File

@ -8,6 +8,7 @@ using osu.Game.Screens.Backgrounds;
using osu.Game.Screens.Play;
using OpenTK.Graphics;
using osu.Game.Screens.Select;
using osu.Framework.Graphics;
namespace osu.Game.Screens.Multiplayer
{

View File

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

View File

@ -5,8 +5,6 @@ using osu.Framework.Configuration;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
using osu.Framework.Graphics.Sprites;
using osu.Framework.Graphics.Transforms;
using osu.Framework.MathUtils;
using osu.Game.Graphics.Sprites;
namespace osu.Game.Screens.Play.HUD
@ -24,7 +22,7 @@ namespace osu.Game.Screens.Play.HUD
protected virtual double PopOutDuration => 150;
protected virtual float PopOutScale => 2.0f;
protected virtual EasingTypes PopOutEasing => EasingTypes.None;
protected virtual Easing PopOutEasing => Easing.None;
protected virtual float PopOutInitialAlpha => 0.75f;
protected virtual double FadeOutDuration => 100;
@ -37,7 +35,7 @@ namespace osu.Game.Screens.Play.HUD
/// <summary>
/// Easing for the counter rollover animation.
/// </summary>
protected EasingTypes RollingEasing => EasingTypes.None;
protected Easing RollingEasing => Easing.None;
protected SpriteText DisplayedCountSpriteText;
@ -130,7 +128,7 @@ namespace osu.Game.Screens.Play.HUD
protected virtual void OnCountRolling(int currentValue, int newValue)
{
transformRoll(new TransformComboRoll(), currentValue, newValue);
transformRoll(currentValue, newValue);
}
protected virtual void OnCountIncrement(int currentValue, int newValue)
@ -170,7 +168,7 @@ namespace osu.Game.Screens.Play.HUD
if (!rolling)
{
Flush(false, typeof(TransformComboRoll));
FinishTransforms(false, nameof(DisplayedCount));
IsRolling = false;
DisplayedCount = prev;
@ -186,40 +184,9 @@ namespace osu.Game.Screens.Play.HUD
}
}
private void transformRoll(TransformComboRoll transform, int currentValue, int newValue)
private void transformRoll(int currentValue, int newValue)
{
Flush(false, typeof(TransformComboRoll));
if (RollingDuration < 1)
{
DisplayedCount = Current;
return;
}
transform.StartTime = Time.Current;
transform.EndTime = Time.Current + getProportionalDuration(currentValue, newValue);
transform.EndValue = newValue;
transform.Easing = RollingEasing;
Transforms.Add(transform);
}
protected class TransformComboRoll : Transform<int, Drawable>
{
public virtual 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) => ((ComboCounter)d).DisplayedCount = CurrentValue;
public override void ReadIntoStartValue(Drawable d) => StartValue = ((ComboCounter)d).DisplayedCount;
this.TransformTo(nameof(DisplayedCount), newValue, getProportionalDuration(currentValue, newValue), RollingEasing);
}
protected abstract void OnDisplayedCountRolling(int currentValue, int newValue);

View File

@ -1,10 +1,7 @@
// Copyright (c) 2007-2017 ppy Pty Ltd <contact@ppy.sh>.
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
using System;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Transforms;
using osu.Framework.MathUtils;
using osu.Game.Graphics.UserInterface;
namespace osu.Game.Screens.Play.HUD
@ -12,44 +9,24 @@ namespace osu.Game.Screens.Play.HUD
/// <summary>
/// Used to display combo with a roll-up animation in results screen.
/// </summary>
public class ComboResultCounter : RollingCounter<ulong>
public class ComboResultCounter : RollingCounter<long>
{
protected override Type TransformType => typeof(TransformComboResult);
protected override double RollingDuration => 500;
protected override EasingTypes RollingEasing => EasingTypes.Out;
protected override Easing RollingEasing => Easing.Out;
protected override double GetProportionalDuration(ulong currentValue, ulong newValue)
protected override double GetProportionalDuration(long currentValue, long newValue)
{
return currentValue > newValue ? currentValue - newValue : newValue - currentValue;
}
protected override string FormatCount(ulong count)
protected override string FormatCount(long count)
{
return $@"{count}x";
}
public override void Increment(ulong amount)
public override void Increment(long amount)
{
Current.Value = Current + amount;
}
protected class TransformComboResult : Transform<ulong, Drawable>
{
public virtual ulong CurrentValue
{
get
{
double time = Time?.Current ?? 0;
if (time < StartTime) return StartValue;
if (time >= EndTime) return EndValue;
return (ulong)Interpolation.ValueAt(time, StartValue, EndValue, StartTime, EndTime, Easing);
}
}
public override void Apply(Drawable d) => ((ComboResultCounter)d).DisplayedCount = CurrentValue;
public override void ReadIntoStartValue(Drawable d) => StartValue = ((ComboResultCounter)d).DisplayedCount;
}
}
}

View File

@ -76,20 +76,20 @@ namespace osu.Game.Screens.Play.HUD
private void appearTransform()
{
if (mods.Value.Any(m => !m.Ranked))
unrankedText.FadeInFromZero(fade_duration, EasingTypes.OutQuint);
unrankedText.FadeInFromZero(fade_duration, Easing.OutQuint);
else
unrankedText.Hide();
iconsContainer.Flush();
iconsContainer.FadeInFromZero(fade_duration, EasingTypes.OutQuint);
iconsContainer.FinishTransforms();
iconsContainer.FadeInFromZero(fade_duration, Easing.OutQuint);
expand();
using (iconsContainer.BeginDelayedSequence(1200))
contract();
}
private void expand() => iconsContainer.TransformSpacingTo(new Vector2(5, 0), 500, EasingTypes.OutQuint);
private void expand() => iconsContainer.TransformSpacingTo(new Vector2(5, 0), 500, Easing.OutQuint);
private void contract() => iconsContainer.TransformSpacingTo(new Vector2(-25, 0), 500, EasingTypes.OutQuint);
private void contract() => iconsContainer.TransformSpacingTo(new Vector2(-25, 0), 500, Easing.OutQuint);
protected override bool OnHover(InputState state)
{

View File

@ -2,6 +2,7 @@
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
using OpenTK;
using osu.Framework.Graphics;
namespace osu.Game.Screens.Play.HUD
{

View File

@ -97,11 +97,11 @@ namespace osu.Game.Screens.Play.HUD
if (judgement.Result == HitResult.Miss)
return;
fill.FadeEdgeEffectTo(Math.Min(1, fill.EdgeEffect.Colour.Linear.A + (1f - base_glow_opacity) / glow_max_hits), 50, EasingTypes.OutQuint);
fill.Delay(glow_fade_delay);
fill.FadeEdgeEffectTo(base_glow_opacity, glow_fade_time, EasingTypes.OutQuint);
fill.FadeEdgeEffectTo(Math.Min(1, fill.EdgeEffect.Colour.Linear.A + (1f - base_glow_opacity) / glow_max_hits), 50, Easing.OutQuint)
.Delay(glow_fade_delay)
.FadeEdgeEffectTo(base_glow_opacity, glow_fade_time, Easing.OutQuint);
}
protected override void SetHealth(float value) => fill.ResizeTo(new Vector2(value, 1), 200, EasingTypes.OutQuint);
protected override void SetHealth(float value) => fill.ResizeTo(new Vector2(value, 1), 200, Easing.OutQuint);
}
}

View File

@ -98,10 +98,7 @@ namespace osu.Game.Screens.Play
// in the case a replay isn't loaded, we want some elements to only appear briefly.
if (!replayLoaded)
{
using (ModDisplay.BeginDelayedSequence(2000))
ModDisplay.FadeOut(200);
}
ModDisplay.Delay(2000).FadeOut(200);
}
protected override bool OnKeyDown(InputState state, KeyDownEventArgs args)

View File

@ -46,7 +46,7 @@ namespace osu.Game.Screens.Play
if (args.Key == Key.Tilde)
{
overlay.FadeIn(activate_delay, EasingTypes.Out);
overlay.FadeIn(activate_delay, Easing.Out);
return true;
}
@ -57,7 +57,7 @@ namespace osu.Game.Screens.Play
{
if (args.Key == Key.Tilde && !fired)
{
overlay.FadeOut(fadeout_delay, EasingTypes.Out);
overlay.FadeOut(fadeout_delay, Easing.Out);
return true;
}

View File

@ -44,7 +44,7 @@ namespace osu.Game.Screens.Play
private void load(OsuConfigManager config)
{
showKeyCounter = config.GetBindable<bool>(OsuSetting.KeyOverlay);
showKeyCounter.ValueChanged += keyCounterVisibility => FadeTo(keyCounterVisibility ? 1 : 0, duration);
showKeyCounter.ValueChanged += keyCounterVisibility => this.FadeTo(keyCounterVisibility ? 1 : 0, duration);
showKeyCounter.TriggerChange();
}

View File

@ -76,8 +76,8 @@ namespace osu.Game.Screens.Play
public override bool HandleInput => State == Visibility.Visible;
protected override void PopIn() => FadeIn(transition_duration, EasingTypes.In);
protected override void PopOut() => FadeOut(transition_duration, EasingTypes.In);
protected override void PopIn() => this.FadeIn(transition_duration, Easing.In);
protected override void PopOut() => this.FadeOut(transition_duration, Easing.In);
// Don't let mouse down events through the overlay or people can click circles while paused.
protected override bool OnMouseDown(InputState state, MouseDownEventArgs args) => true;

View File

@ -56,11 +56,7 @@ namespace osu.Game.Screens.Play
AddInternal(pauseOverlay = new PauseOverlay
{
OnResume = delegate
{
Delay(400);
Schedule(Resume);
},
OnResume = () => this.Delay(400).Schedule(Resume),
OnRetry = () => OnRetry(),
OnQuit = () => OnQuit(),
});

View File

@ -262,29 +262,27 @@ namespace osu.Game.Screens.Play
if (!loadedSuccessfully)
return;
(Background as BackgroundScreenBeatmap)?.BlurTo(Vector2.Zero, 1500, EasingTypes.OutQuint);
Background?.FadeTo(1 - (float)dimLevel, 1500, EasingTypes.OutQuint);
(Background as BackgroundScreenBeatmap)?.BlurTo(Vector2.Zero, 1500, Easing.OutQuint);
Background?.FadeTo(1 - (float)dimLevel, 1500, Easing.OutQuint);
Content.Alpha = 0;
dimLevel.ValueChanged += newDim => Background?.FadeTo(1 - (float)newDim, 800);
Content.ScaleTo(0.7f);
Content
.ScaleTo(0.7f)
.ScaleTo(1, 750, Easing.OutQuint)
.Delay(250)
.FadeIn(250);
using (Content.BeginDelayedSequence(250))
Content.FadeIn(250);
Content.ScaleTo(1, 750, EasingTypes.OutQuint);
using (BeginDelayedSequence(750))
Schedule(() =>
{
if (!pauseContainer.IsPaused)
decoupledClock.Start();
});
this.Delay(750).Schedule(() =>
{
if (!pauseContainer.IsPaused)
decoupledClock.Start();
});
pauseContainer.Alpha = 0;
pauseContainer.FadeIn(750, EasingTypes.OutQuint);
pauseContainer.FadeIn(750, Easing.OutQuint);
}
protected override void OnSuspending(Screen next)
@ -316,7 +314,7 @@ namespace osu.Game.Screens.Play
HitRenderer?.FadeOut(fade_out_duration);
Content.FadeOut(fade_out_duration);
hudOverlay?.ScaleTo(0.7f, fade_out_duration * 3, EasingTypes.In);
hudOverlay?.ScaleTo(0.7f, fade_out_duration * 3, Easing.In);
Background?.FadeTo(1f, fade_out_duration);
}

View File

@ -77,20 +77,18 @@ namespace osu.Game.Screens.Play
RestartRequested = player.RestartRequested,
});
Delay(400);
Schedule(pushWhenLoaded);
this.Delay(400).Schedule(pushWhenLoaded);
}
private void contentIn()
{
Content.ScaleTo(1, 650, EasingTypes.OutQuint);
Content.ScaleTo(1, 650, Easing.OutQuint);
Content.FadeInFromZero(400);
}
private void contentOut()
{
Content.ScaleTo(0.7f, 300, EasingTypes.InQuint);
Content.ScaleTo(0.7f, 300, Easing.InQuint);
Content.FadeOut(250);
}
@ -104,16 +102,9 @@ namespace osu.Game.Screens.Play
contentIn();
Delay(500, true);
logo.MoveToOffset(new Vector2(0, -180), 500, EasingTypes.InOutExpo);
Delay(250, true);
info.FadeIn(500);
Delay(1400, true);
Schedule(pushWhenLoaded);
logo.Delay(500).MoveToOffset(new Vector2(0, -180), 500, Easing.InOutExpo);
info.Delay(750).FadeIn(500);
this.Delay(2150).Schedule(pushWhenLoaded);
}
private void pushWhenLoaded()
@ -123,9 +114,7 @@ namespace osu.Game.Screens.Play
contentOut();
Delay(250);
Schedule(() =>
this.Delay(250).Schedule(() =>
{
if (!IsCurrentScreen) return;
@ -142,8 +131,8 @@ namespace osu.Game.Screens.Play
protected override bool OnExiting(Screen next)
{
Content.ScaleTo(0.7f, 150, EasingTypes.InQuint);
FadeOut(150);
Content.ScaleTo(0.7f, 150, Easing.InQuint);
this.FadeOut(150);
return base.OnExiting(next);
}

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