1
0
mirror of https://github.com/ppy/osu.git synced 2025-01-15 12:02:55 +08:00

Update framework and fix compilation

Most issues were related to BeginLoopedSequence usage and lack of
"this." in front of transform helpers.
This commit is contained in:
Thomas Müller 2017-07-14 19:18:12 +03:00
parent fd58c6e835
commit a5e610a7ba
79 changed files with 220 additions and 247 deletions

@ -1 +1 @@
Subproject commit 991177da4fbed2dd8260c215f2d341ebc858b03e
Subproject commit cb2c9dd8b6213cd8f91cc37892da6335ca3bce10

View File

@ -15,6 +15,7 @@ using osu.Game.Graphics.Sprites;
using osu.Framework.Lists;
using System;
using osu.Framework.Extensions.Color4Extensions;
using osu.Framework.Graphics.Transforms;
namespace osu.Desktop.VisualTests.Tests
{

View File

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

View File

@ -13,6 +13,7 @@ using osu.Framework.MathUtils;
using osu.Framework.Graphics.Shapes;
using osu.Framework.Graphics.Sprites;
using osu.Game.Screens.Play;
using osu.Framework.Graphics.Transforms;
namespace osu.Desktop.VisualTests.Tests
{

View File

@ -8,6 +8,7 @@ using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
using osu.Framework.Graphics.Shapes;
using osu.Framework.Graphics.Sprites;
using osu.Framework.Graphics.Transforms;
using osu.Framework.Graphics.UserInterface;
using osu.Framework.Testing;
using osu.Game.Graphics.Sprites;
@ -196,7 +197,7 @@ namespace osu.Desktop.VisualTests.Tests
protected override void LoadComplete()
{
base.LoadComplete();
FadeInFromZero(250, EasingTypes.OutQuint);
this.FadeInFromZero(250, EasingTypes.OutQuint);
}
protected override void Update()

View File

@ -4,6 +4,7 @@
using OpenTK;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
using osu.Framework.Graphics.Transforms;
using osu.Framework.MathUtils;
using osu.Framework.Testing;
using osu.Framework.Timing;

View File

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

View File

@ -17,7 +17,6 @@ using System.Collections.Generic;
using osu.Game.Rulesets.Objects.Drawables;
using osu.Framework.Input;
using osu.Framework.Graphics.Transforms;
using osu.Framework.MathUtils;
using osu.Game.Rulesets.Mania.Objects.Drawables;
using osu.Game.Rulesets.Timing;
using osu.Framework.Configuration;
@ -235,7 +234,7 @@ namespace osu.Game.Rulesets.Mania.UI
private void transformVisibleTimeRangeTo(double newTimeRange, double duration = 0, EasingTypes easing = EasingTypes.None)
{
TransformTo(newTimeRange, duration, easing, new TransformTimeSpan());
this.TransformTo(newTimeRange, duration, easing, new TransformTimeSpan(this));
}
protected override void Update()
@ -245,22 +244,14 @@ namespace osu.Game.Rulesets.Mania.UI
barLineContainer.Width = columns.Width;
}
private class TransformTimeSpan : Transform<double, Drawable>
private class TransformTimeSpan : TransformDouble<ManiaPlayfield>
{
public double CurrentValue
public TransformTimeSpan(ManiaPlayfield target) : base(target)
{
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;
public override void Apply(ManiaPlayfield d) => d.visibleTimeRange.Value = CurrentValue;
public override void ReadIntoStartValue(ManiaPlayfield d) => StartValue = d.visibleTimeRange.Value;
}
}
}

View File

@ -119,12 +119,12 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables
{
case ArmedState.Idle:
using (BeginDelayedSequence(duration + TIME_PREEMPT))
FadeOut(TIME_FADEOUT);
this.FadeOut(TIME_FADEOUT);
Expire(true);
break;
case ArmedState.Miss:
ApproachCircle.FadeOut(50);
FadeOut(TIME_FADEOUT / 5);
this.FadeOut(TIME_FADEOUT / 5);
Expire();
break;
case ArmedState.Hit:
@ -145,8 +145,8 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables
circle.FadeOut();
number.FadeOut();
FadeOut(800);
ScaleTo(Scale * 1.5f, 400, EasingTypes.OutQuad);
this.FadeOut(800);
this.ScaleTo(Scale * 1.5f, 400, EasingTypes.OutQuad);
}
Expire();

View File

@ -4,6 +4,7 @@
using System.ComponentModel;
using osu.Game.Rulesets.Objects.Drawables;
using osu.Game.Rulesets.Osu.Judgements;
using osu.Framework.Graphics;
namespace osu.Game.Rulesets.Osu.Objects.Drawables
{
@ -44,7 +45,7 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables
protected virtual void UpdatePreemptState()
{
FadeIn(TIME_FADEIN);
this.FadeIn(TIME_FADEIN);
}
protected virtual void UpdateCurrentState(ArmedState state)

View File

@ -163,7 +163,7 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables
body.FadeOut(160);
ball.FadeOut(160);
FadeOut(800);
this.FadeOut(800);
Expire();
}

View File

@ -62,12 +62,12 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables
{
var animIn = Math.Min(150, sliderTick.StartTime - FadeInTime);
ScaleTo(0.5f);
ScaleTo(1.2f, animIn);
FadeIn(animIn);
this.ScaleTo(0.5f);
this.ScaleTo(1.2f, animIn);
this.FadeIn(animIn);
Delay(animIn);
ScaleTo(1, 150, EasingTypes.Out);
this.ScaleTo(1, 150, EasingTypes.Out);
Delay(-animIn);
}
@ -78,15 +78,15 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables
{
case ArmedState.Idle:
Delay(FadeOutTime - sliderTick.StartTime);
FadeOut();
this.FadeOut();
break;
case ArmedState.Miss:
FadeOut(160);
FadeColour(Color4.Red, 80);
this.FadeOut(160);
this.FadeColour(Color4.Red, 80);
break;
case ArmedState.Hit:
FadeOut(120, EasingTypes.OutQuint);
ScaleTo(Scale * 1.5f, 120, EasingTypes.OutQuint);
this.FadeOut(120, EasingTypes.OutQuint);
this.ScaleTo(Scale * 1.5f, 120, EasingTypes.OutQuint);
break;
}
}

View File

@ -200,16 +200,16 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables
{
Delay(spinner.Duration, true);
FadeOut(160);
this.FadeOut(160);
switch (state)
{
case ArmedState.Hit:
ScaleTo(Scale * 1.2f, 320, EasingTypes.Out);
this.ScaleTo(Scale * 1.2f, 320, EasingTypes.Out);
Expire();
break;
case ArmedState.Miss:
ScaleTo(Scale * 0.8f, 320, EasingTypes.In);
this.ScaleTo(Scale * 0.8f, 320, EasingTypes.In);
Expire();
break;
}

View File

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

View File

@ -133,7 +133,7 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables.Pieces
background.FadeTo(tracking_alpha, 250, EasingTypes.OutQuint);
}
RotateTo(currentRotation / 2, validAndTracking ? 500 : 1500, EasingTypes.OutExpo);
this.RotateTo(currentRotation / 2, validAndTracking ? 500 : 1500, EasingTypes.OutExpo);
}
}
}

View File

@ -65,10 +65,10 @@ namespace osu.Game.Rulesets.Taiko.Objects.Drawables
{
base.LoadComplete();
Delay(BarLine.StartTime - Time.Current);
FadeOut(base_fadeout_time * BarLine.ScrollTime / 1000);
this.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()
{

View File

@ -77,10 +77,10 @@ namespace osu.Game.Rulesets.Taiko.Objects.Drawables
Delay(HitObject.HitWindowMiss);
break;
case ArmedState.Miss:
FadeOut(100);
this.FadeOut(100);
break;
case ArmedState.Hit:
FadeOut(600);
this.FadeOut(600);
var flash = circlePiece?.FlashBox;
if (flash != null)
@ -90,16 +90,16 @@ namespace osu.Game.Rulesets.Taiko.Objects.Drawables
}
FadeOut(800);
this.FadeOut(800);
const float gravity_time = 300;
const float gravity_travel_height = 200;
Content.ScaleTo(0.8f, gravity_time * 2, EasingTypes.OutQuad);
MoveToY(-gravity_travel_height, gravity_time, EasingTypes.Out);
this.MoveToY(-gravity_travel_height, gravity_time, EasingTypes.Out);
Delay(gravity_time, true);
MoveToY(gravity_travel_height * 2, gravity_time * 2, EasingTypes.In);
this.MoveToY(gravity_travel_height * 2, gravity_time * 2, EasingTypes.In);
break;
}

View File

@ -198,7 +198,7 @@ namespace osu.Game.Rulesets.Taiko.Objects.Drawables
break;
}
FadeOut(out_transition_time, EasingTypes.Out);
this.FadeOut(out_transition_time, EasingTypes.Out);
Expire();
}

View File

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

View File

@ -62,8 +62,8 @@ namespace osu.Game.Rulesets.Taiko.UI
{
base.LoadComplete();
ScaleTo(3f, 1000, EasingTypes.OutQuint);
FadeOut(500);
this.ScaleTo(3f, 1000, EasingTypes.OutQuint);
this.FadeOut(500);
Expire();
}
@ -73,7 +73,7 @@ namespace osu.Game.Rulesets.Taiko.UI
/// </summary>
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

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

View File

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

View File

@ -83,13 +83,13 @@ namespace osu.Game.Graphics.Cursor
protected override void PopIn()
{
instantMovement |= !IsPresent;
FadeIn(500, EasingTypes.OutQuint);
this.FadeIn(500, EasingTypes.OutQuint);
}
protected override void PopOut()
{
using (BeginDelayedSequence(150))
FadeOut(500, EasingTypes.OutQuint);
this.FadeOut(500, EasingTypes.OutQuint);
}
public override void Move(Vector2 pos)
@ -101,7 +101,7 @@ namespace osu.Game.Graphics.Cursor
}
else
{
MoveTo(pos, 200, EasingTypes.OutQuint);
this.MoveTo(pos, 200, EasingTypes.OutQuint);
}
}
}

View File

@ -27,10 +27,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 TransformContinuation<T> FadeAccent<T>(this T accentedDrawable, Color4 newColour, double duration = 0, EasingTypes easing = EasingTypes.None)
where T : IHasAccentColour
=> accentedDrawable.TransformTo(newColour, duration, easing, new TransformAccent(accentedDrawable));
}
}

View File

@ -2,14 +2,17 @@
// 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>
public class TransformAccent : Transform<Color4, IHasAccentColour>
{
public TransformAccent(IHasAccentColour target) : base(target)
{
}
/// <summary>
/// Current value of the transformed colour in linear colour space.
/// </summary>
@ -25,7 +28,7 @@ namespace osu.Game.Graphics.Transforms
}
}
public override void Apply(Drawable d) => ((IHasAccentColour)d).AccentColour = CurrentValue;
public override void ReadIntoStartValue(Drawable d) => StartValue = ((IHasAccentColour)d).AccentColour;
public override void Apply(IHasAccentColour d) => d.AccentColour = CurrentValue;
public override void ReadIntoStartValue(IHasAccentColour d) => StartValue = d.AccentColour;
}
}

View File

@ -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, EasingTypes.OutQuint);
this.ScaleTo(new Vector2(1f), transition_duration, EasingTypes.OutQuint);
}
else
{
FadeOut(transition_duration, EasingTypes.OutQuint);
ScaleTo(new Vector2(0.8f, 1f), transition_duration, EasingTypes.OutQuint);
this.FadeOut(transition_duration, EasingTypes.OutQuint);
this.ScaleTo(new Vector2(0.8f, 1f), transition_duration, EasingTypes.OutQuint);
}
}
}

View File

@ -34,14 +34,13 @@ namespace osu.Game.Graphics.UserInterface
{
base.LoadComplete();
using (spinner.BeginLoopedSequence())
spinner.RotateTo(360, 2000);
spinner.Spin(2000);
}
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, EasingTypes.OutQuint);
protected override void PopOut() => FadeOut(transition_duration, EasingTypes.OutQuint);
protected override void PopOut() => this.FadeOut(transition_duration, EasingTypes.OutQuint);
}
}

View File

@ -80,13 +80,13 @@ namespace osu.Game.Graphics.UserInterface
if (value)
{
FadeColour(GlowingAccentColour, 500, EasingTypes.OutQuint);
this.FadeColour(GlowingAccentColour, 500, EasingTypes.OutQuint);
FadeEdgeEffectTo(1, 500, EasingTypes.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, EasingTypes.OutQuint);
}
}

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, EasingTypes.OutQuint);
protected override void AnimateClose() => this.FadeOut(fade_duration, EasingTypes.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, EasingTypes.OutQuint);
}
}
}

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, EasingTypes.OutQuint);
protected override void AnimateClose() => FadeOut(300, EasingTypes.OutQuint);
protected override void AnimateClose() => this.FadeOut(300, EasingTypes.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, EasingTypes.OutQuint);
}
}
}

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

View File

@ -9,7 +9,6 @@ using osu.Framework.Graphics.Transforms;
using osu.Game.Graphics.Sprites;
using System;
using System.Collections.Generic;
using System.Diagnostics;
using OpenTK.Graphics;
using osu.Framework.MathUtils;

View File

@ -2,9 +2,6 @@
// 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
{

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
{

View File

@ -173,7 +173,7 @@ namespace osu.Game.Graphics.UserInterface
protected override bool OnHover(InputState state)
{
ResizeTo(SIZE_EXTENDED, transform_time, EasingTypes.OutElastic);
this.ResizeTo(SIZE_EXTENDED, transform_time, EasingTypes.OutElastic);
IconLayer.FadeColour(HoverColour, transform_time, EasingTypes.OutElastic);
bouncingIcon.ScaleTo(1.1f, transform_time, EasingTypes.OutElastic);
@ -183,7 +183,7 @@ namespace osu.Game.Graphics.UserInterface
protected override void OnHoverLost(InputState state)
{
ResizeTo(SIZE_RETRACTED, transform_time, EasingTypes.OutElastic);
this.ResizeTo(SIZE_RETRACTED, transform_time, EasingTypes.OutElastic);
IconLayer.FadeColour(TextLayer.Colour, transform_time, EasingTypes.OutElastic);
bouncingIcon.ScaleTo(1, transform_time, EasingTypes.OutElastic);

View File

@ -93,14 +93,14 @@ 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()

View File

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

@ -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, EasingTypes.OutQuint);
this.MoveToY(0, transition_duration, EasingTypes.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, EasingTypes.InSine);
this.MoveToY(DrawHeight, transition_duration, EasingTypes.InSine);
search.HoldFocus = false;
base.PopOut();

View File

@ -86,7 +86,7 @@ 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, EasingTypes.OutQuint);
box.FadeColour(backgroundActive, transition_length, EasingTypes.OutQuint);
highlightBox.FadeIn(transition_length, EasingTypes.OutQuint);
@ -97,7 +97,7 @@ namespace osu.Game.Overlays.Chat
private void fadeInactive()
{
ResizeTo(new Vector2(Width, 1), transition_length, EasingTypes.OutQuint);
this.ResizeTo(new Vector2(Width, 1), transition_length, EasingTypes.OutQuint);
box.FadeColour(backgroundInactive, transition_length, EasingTypes.OutQuint);
highlightBox.FadeOut(transition_length, EasingTypes.OutQuint);

View File

@ -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, EasingTypes.OutQuint);
this.FadeIn(transition_length, EasingTypes.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, EasingTypes.InSine);
this.FadeOut(transition_length, EasingTypes.InSine);
inputTextBox.HoldFocus = false;
base.PopOut();

View File

@ -45,13 +45,13 @@ namespace osu.Game.Overlays
protected override void PopIn()
{
base.PopIn();
FadeIn(PopupDialog.ENTER_DURATION, EasingTypes.OutQuint);
this.FadeIn(PopupDialog.ENTER_DURATION, EasingTypes.OutQuint);
}
protected override void PopOut()
{
base.PopOut();
FadeOut(PopupDialog.EXIT_DURATION, EasingTypes.InSine);
this.FadeOut(PopupDialog.EXIT_DURATION, EasingTypes.InSine);
}
public DialogOverlay()

View File

@ -41,7 +41,7 @@ namespace osu.Game.Overlays.Direct
{
base.LoadComplete();
FadeInFromZero(200, EasingTypes.Out);
this.FadeInFromZero(200, EasingTypes.Out);
bottomPanel.LayoutDuration = 200;
bottomPanel.LayoutEasing = EasingTypes.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, EasingTypes.Out);
}
[BackgroundDependencyLoader]

View File

@ -75,7 +75,7 @@ namespace osu.Game.Overlays
private void updatePosition(float position, bool easing = true)
{
position = MathHelper.Clamp(position, 0, 1);
Fill.TransformTo(position, easing ? 200 : 0, EasingTypes.OutQuint, new TransformSeek());
Fill.TransformTo(position, easing ? 200 : 0, EasingTypes.OutQuint, new TransformSeek(this));
}
protected override bool OnMouseDown(InputState state, MouseDownEventArgs args)
@ -100,6 +100,10 @@ namespace osu.Game.Overlays
private class TransformSeek : TransformFloat<Drawable>
{
public TransformSeek(Drawable target) : base(target)
{
}
public override void Apply(Drawable d) => d.Width = CurrentValue;
public override void ReadIntoStartValue(Drawable d) => StartValue = d.Width;
}

View File

@ -66,7 +66,7 @@ namespace osu.Game.Overlays
base.PopIn();
settingsSection.Bounding = true;
FadeIn(transition_time, EasingTypes.OutQuint);
this.FadeIn(transition_time, EasingTypes.OutQuint);
InputManager.ChangeFocus(settingsSection);
}
@ -76,7 +76,7 @@ namespace osu.Game.Overlays
base.PopOut();
settingsSection.Bounding = false;
FadeOut(transition_time);
this.FadeOut(transition_time);
}
}
}

View File

@ -194,16 +194,13 @@ 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);
outerSpin.Spin(40000);
using (BeginDelayedSequence(200, true))
{
@ -233,7 +230,7 @@ namespace osu.Game.Overlays
protected override void PopOut()
{
base.PopOut();
FadeOut(200);
this.FadeOut(200);
}
private void dismiss()
@ -295,8 +292,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

@ -154,16 +154,16 @@ namespace osu.Game.Overlays.MedalSplash
medalContainer.ScaleTo(1);
medalContainer.Show();
ScaleTo(scale_when_unlocked, duration, EasingTypes.OutExpo);
MoveToY(MedalOverlay.DISC_SIZE / 2 - 30, duration, EasingTypes.OutExpo);
this.ScaleTo(scale_when_unlocked, duration, EasingTypes.OutExpo);
this.MoveToY(MedalOverlay.DISC_SIZE / 2 - 30, duration, EasingTypes.OutExpo);
unlocked.FadeInFromZero(duration);
break;
case DisplayState.Full:
medalContainer.ScaleTo(1);
medalContainer.Show();
ScaleTo(scale_when_full, duration, EasingTypes.OutExpo);
MoveToY(MedalOverlay.DISC_SIZE / 2 - 60, duration, EasingTypes.OutExpo);
this.ScaleTo(scale_when_full, duration, EasingTypes.OutExpo);
this.MoveToY(MedalOverlay.DISC_SIZE / 2 - 60, duration, EasingTypes.OutExpo);
name.FadeInFromZero(duration + 100);
description.FadeInFromZero(duration * 2);
break;

View File

@ -144,7 +144,7 @@ namespace osu.Game.Overlays.Music
matching = value;
FadeTo(matching ? 1 : 0, 200);
this.FadeTo(matching ? 1 : 0, 200);
}
}
}

View File

@ -105,16 +105,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, EasingTypes.OutQuint);
this.FadeIn(transition_duration, EasingTypes.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, EasingTypes.OutQuint);
this.FadeOut(transition_duration);
}
private void itemSelected(BeatmapSetInfo set)

View File

@ -370,7 +370,7 @@ namespace osu.Game.Overlays
{
base.PopIn();
FadeIn(transition_length, EasingTypes.OutQuint);
this.FadeIn(transition_length, EasingTypes.OutQuint);
dragContainer.ScaleTo(1, transition_length, EasingTypes.OutElastic);
}
@ -378,7 +378,7 @@ namespace osu.Game.Overlays
{
base.PopOut();
FadeOut(transition_length, EasingTypes.OutQuint);
this.FadeOut(transition_length, EasingTypes.OutQuint);
dragContainer.ScaleTo(0.9f, transition_length, EasingTypes.OutQuint);
}

View File

@ -90,8 +90,8 @@ namespace osu.Game.Overlays
base.PopIn();
scrollContainer.MoveToX(0, TRANSITION_LENGTH, EasingTypes.OutQuint);
MoveToX(0, TRANSITION_LENGTH, EasingTypes.OutQuint);
FadeTo(1, TRANSITION_LENGTH / 2);
this.MoveToX(0, TRANSITION_LENGTH, EasingTypes.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, EasingTypes.OutQuint);
this.FadeTo(0, TRANSITION_LENGTH / 2);
}
}
}

View File

@ -135,7 +135,7 @@ 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);
}
@ -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, EasingTypes.In).Then().FadeTo(1, length, EasingTypes.Out)
);
}
}
}

View File

@ -78,7 +78,7 @@ namespace osu.Game.Overlays.Notifications
{
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.
this.FadeTo(0.01f, 200); //don't completely fade out or our scheduled task won't run.
Delay(100);
Schedule(Completed);
@ -196,7 +196,7 @@ namespace osu.Game.Overlays.Notifications
set
{
active = value;
FadeColour(active ? colourActive : colourInactive, 100);
this.FadeColour(active ? colourActive : colourInactive, 100);
}
}

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, EasingTypes.OutQuint);
break;
case ExpandedState.Expanded:
ResizeTo(new Vector2(EXPANDED_WIDTH, Height), 500, EasingTypes.OutQuint);
this.ResizeTo(new Vector2(EXPANDED_WIDTH, Height), 500, EasingTypes.OutQuint);
break;
}
}

View File

@ -127,7 +127,7 @@ namespace osu.Game.Overlays
sectionsContainer.MoveToX(0, TRANSITION_LENGTH, EasingTypes.OutQuint);
sidebar.MoveToX(0, TRANSITION_LENGTH, EasingTypes.OutQuint);
FadeTo(1, TRANSITION_LENGTH / 2);
this.FadeTo(1, TRANSITION_LENGTH / 2);
searchTextBox.HoldFocus = true;
}
@ -138,7 +138,7 @@ namespace osu.Game.Overlays
sectionsContainer.MoveToX(-width, TRANSITION_LENGTH, EasingTypes.OutQuint);
sidebar.MoveToX(-SIDEBAR_WIDTH, TRANSITION_LENGTH, EasingTypes.OutQuint);
FadeTo(0, TRANSITION_LENGTH / 2);
this.FadeTo(0, TRANSITION_LENGTH / 2);
searchTextBox.HoldFocus = false;
if (searchTextBox.HasFocus)

View File

@ -121,16 +121,16 @@ namespace osu.Game.Overlays.Toolbar
protected override void PopIn()
{
MoveToY(0, transition_time, EasingTypes.OutQuint);
FadeIn(transition_time / 2, EasingTypes.OutQuint);
this.MoveToY(0, transition_time, EasingTypes.OutQuint);
this.FadeIn(transition_time / 2, EasingTypes.OutQuint);
}
protected override void PopOut()
{
userArea?.LoginOverlay.Hide();
MoveToY(-DrawSize.Y, transition_time, EasingTypes.OutQuint);
FadeOut(transition_time);
this.MoveToY(-DrawSize.Y, transition_time, EasingTypes.OutQuint);
this.FadeOut(transition_time);
}
}
}

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()
{

View File

@ -137,23 +137,23 @@ namespace osu.Game.Overlays
foreach (var w in wavesContainer.Children)
w.State = Visibility.Visible;
FadeIn(100, EasingTypes.OutQuint);
this.FadeIn(100, EasingTypes.OutQuint);
contentContainer.MoveToY(0, APPEAR_DURATION, EasingTypes.OutQuint);
FadeIn(100, EasingTypes.OutQuint);
this.FadeIn(100, EasingTypes.OutQuint);
}
protected override void PopOut()
{
base.PopOut();
FadeOut(DISAPPEAR_DURATION, EasingTypes.InQuint);
this.FadeOut(DISAPPEAR_DURATION, EasingTypes.InQuint);
contentContainer.MoveToY(DrawHeight * 2f, DISAPPEAR_DURATION, EasingTypes.In);
foreach (var w in wavesContainer.Children)
w.State = Visibility.Hidden;
FadeOut(DISAPPEAR_DURATION, EasingTypes.InQuint);
this.FadeOut(DISAPPEAR_DURATION, EasingTypes.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,26 @@ namespace osu.Game.Rulesets.Judgements
{
base.LoadComplete();
FadeInFromZero(100, EasingTypes.OutQuint);
this.FadeInFromZero(100, EasingTypes.OutQuint);
switch (Judgement.Result)
{
case HitResult.Miss:
ScaleTo(1.6f);
ScaleTo(1, 100, EasingTypes.In);
this.ScaleTo(1.6f);
this.ScaleTo(1, 100, EasingTypes.In);
MoveToOffset(new Vector2(0, 100), 800, EasingTypes.InQuint);
RotateTo(40, 800, EasingTypes.InQuint);
this.MoveToOffset(new Vector2(0, 100), 800, EasingTypes.InQuint);
this.RotateTo(40, 800, EasingTypes.InQuint);
Delay(600);
FadeOut(200);
this.FadeOut(200);
break;
case HitResult.Hit:
ScaleTo(0.9f);
ScaleTo(1, 500, EasingTypes.OutElastic);
this.ScaleTo(0.9f);
this.ScaleTo(1, 500, EasingTypes.OutElastic);
Delay(100);
FadeOut(400);
this.FadeOut(400);
break;
}

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

@ -248,23 +248,23 @@ namespace osu.Game.Screens.Menu
{
default:
box.ScaleTo(new Vector2(0, 1), 500, EasingTypes.OutExpo);
FadeOut(500);
this.FadeOut(500);
break;
case 1:
box.ScaleTo(new Vector2(0, 1), 400, EasingTypes.InSine);
FadeOut(800);
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);
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);
this.FadeOut(explode_duration / 4f * 3);
break;
}
}

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

@ -6,7 +6,6 @@ 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
@ -130,7 +129,7 @@ namespace osu.Game.Screens.Play.HUD
protected virtual void OnCountRolling(int currentValue, int newValue)
{
transformRoll(new TransformComboRoll(), currentValue, newValue);
transformRoll(new TransformComboRoll(this), currentValue, newValue);
}
protected virtual void OnCountIncrement(int currentValue, int newValue)
@ -188,25 +187,17 @@ namespace osu.Game.Screens.Play.HUD
private void transformRoll(TransformComboRoll transform, int currentValue, int newValue)
{
TransformTo(newValue, getProportionalDuration(currentValue, newValue), RollingEasing, new TransformComboRoll());
this.TransformTo(newValue, getProportionalDuration(currentValue, newValue), RollingEasing, new TransformComboRoll(this));
}
protected class TransformComboRoll : Transform<int, Drawable>
protected class TransformComboRoll : TransformInt<ComboCounter>
{
public virtual int CurrentValue
public TransformComboRoll(ComboCounter target) : base(target)
{
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;
public override void Apply(ComboCounter d) => d.DisplayedCount = CurrentValue;
public override void ReadIntoStartValue(ComboCounter d) => StartValue = d.DisplayedCount;
}
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

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

@ -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, EasingTypes.In);
protected override void PopOut() => this.FadeOut(transition_duration, EasingTypes.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

@ -143,7 +143,7 @@ namespace osu.Game.Screens.Play
protected override bool OnExiting(Screen next)
{
Content.ScaleTo(0.7f, 150, EasingTypes.InQuint);
FadeOut(150);
this.FadeOut(150);
return base.OnExiting(next);
}

View File

@ -100,9 +100,9 @@ namespace osu.Game.Screens.Play
return;
}
FadeInFromZero(fade_time);
this.FadeInFromZero(fade_time);
using (BeginAbsoluteSequence(beginFadeTime))
FadeOut(fade_time);
this.FadeOut(fade_time);
button.Action = () => AudioClock?.Seek(startTime - skip_required_cutoff - fade_time);
@ -154,14 +154,14 @@ namespace osu.Game.Screens.Play
{
case Visibility.Visible:
if (lastState == Visibility.Hidden)
FadeIn(500, EasingTypes.OutExpo);
this.FadeIn(500, EasingTypes.OutExpo);
if (!IsHovered)
using (BeginDelayedSequence(1000))
scheduledHide = Schedule(() => State = Visibility.Hidden);
break;
case Visibility.Hidden:
FadeOut(1000, EasingTypes.OutExpo);
this.FadeOut(1000, EasingTypes.OutExpo);
break;
}
}

View File

@ -123,18 +123,18 @@ namespace osu.Game.Screens.Play
private void updateBarVisibility()
{
bar.FadeTo(allowSeeking ? 1 : 0, transition_duration, EasingTypes.In);
MoveTo(new Vector2(0, allowSeeking ? 0 : bottom_bar_height), transition_duration, EasingTypes.In);
this.MoveTo(new Vector2(0, allowSeeking ? 0 : bottom_bar_height), transition_duration, EasingTypes.In);
}
protected override void PopIn()
{
updateBarVisibility();
FadeIn(500, EasingTypes.OutQuint);
this.FadeIn(500, EasingTypes.OutQuint);
}
protected override void PopOut()
{
FadeOut(100);
this.FadeOut(100);
}
protected override void Update()

View File

@ -51,14 +51,14 @@ namespace osu.Game.Screens.Select
protected override void PopIn()
{
MoveToX(0, 800, EasingTypes.OutQuint);
RotateTo(0, 800, EasingTypes.OutQuint);
this.MoveToX(0, 800, EasingTypes.OutQuint);
this.RotateTo(0, 800, EasingTypes.OutQuint);
}
protected override void PopOut()
{
MoveToX(-100, 800, EasingTypes.InQuint);
RotateTo(10, 800, EasingTypes.InQuint);
this.MoveToX(-100, 800, EasingTypes.InQuint);
this.RotateTo(10, 800, EasingTypes.InQuint);
}
public void UpdateBeatmap(WorkingBeatmap beatmap)
@ -84,7 +84,7 @@ namespace osu.Game.Screens.Select
Shear = -Shear,
OnLoadComplete = d =>
{
FadeIn(250);
this.FadeIn(250);
lastContainer?.FadeOut(250);
lastContainer?.Expire();

View File

@ -61,7 +61,7 @@ namespace osu.Game.Screens.Select.Leaderboards
nameLabel.MoveToX(150);
break;
case Visibility.Visible:
FadeIn(200);
this.FadeIn(200);
content.MoveToY(0, 800, EasingTypes.OutQuint);
Delay(100, true);

View File

@ -29,7 +29,7 @@ namespace osu.Game.Screens.Select.Options
{
base.PopIn();
FadeIn(transition_duration, EasingTypes.OutQuint);
this.FadeIn(transition_duration, EasingTypes.OutQuint);
if (buttonsContainer.Position.X == 1 || Alpha == 0)
buttonsContainer.MoveToX(x_position - x_movement);
@ -49,7 +49,7 @@ namespace osu.Game.Screens.Select.Options
buttonsContainer.MoveToX(x_position + x_movement, transition_duration, EasingTypes.InSine);
buttonsContainer.TransformSpacingTo(new Vector2(200f, 0f), transition_duration, EasingTypes.InSine);
FadeOut(transition_duration, EasingTypes.InQuint);
this.FadeOut(transition_duration, EasingTypes.InQuint);
}
public BeatmapOptionsOverlay()

View File

@ -297,7 +297,7 @@ namespace osu.Game.Screens.Tournament
}
}
private void speedTo(float value, double duration = 0, EasingTypes easing = EasingTypes.None) => TransformTo(value, duration, easing, new TransformScrollSpeed());
private void speedTo(float value, double duration = 0, EasingTypes easing = EasingTypes.None) => this.TransformTo(value, duration, easing, new TransformScrollSpeed(this));
private enum ScrollState
{
@ -308,10 +308,14 @@ namespace osu.Game.Screens.Tournament
Scrolling
}
public class TransformScrollSpeed : TransformFloat<Drawable>
public class TransformScrollSpeed : TransformFloat<ScrollingTeamContainer>
{
public override void Apply(Drawable d) => ((ScrollingTeamContainer)d).speed = CurrentValue;
public override void ReadIntoStartValue(Drawable d) => StartValue = ((ScrollingTeamContainer)d).speed;
public TransformScrollSpeed(ScrollingTeamContainer target) : base(target)
{
}
public override void Apply(ScrollingTeamContainer d) => d.speed = CurrentValue;
public override void ReadIntoStartValue(ScrollingTeamContainer d) => StartValue = d.speed;
}
public class ScrollingTeam : Container

View File

@ -183,13 +183,13 @@ namespace osu.Game.Users
{
statusBar.ResizeHeightTo(0f, transition_duration, EasingTypes.OutQuint);
statusBar.FadeOut(transition_duration, EasingTypes.OutQuint);
ResizeHeightTo(height - status_height, transition_duration, EasingTypes.OutQuint);
this.ResizeHeightTo(height - status_height, transition_duration, EasingTypes.OutQuint);
}
else
{
statusBar.ResizeHeightTo(status_height, transition_duration, EasingTypes.OutQuint);
statusBar.FadeIn(transition_duration, EasingTypes.OutQuint);
ResizeHeightTo(height, transition_duration, EasingTypes.OutQuint);
this.ResizeHeightTo(height, transition_duration, EasingTypes.OutQuint);
statusBg.FadeColour(status.GetAppropriateColour(colours), 500, EasingTypes.OutQuint);
statusMessage.Text = status.Message;