mirror of
https://github.com/osukey/osukey.git
synced 2025-08-03 14:46:38 +09:00
Merge branch 'master' into fixes
This commit is contained in:
@ -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>
|
||||
|
@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -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;
|
||||
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -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);
|
||||
}
|
||||
|
||||
|
@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -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)
|
||||
|
@ -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)
|
||||
|
@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -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;
|
||||
}
|
||||
}
|
||||
}
|
@ -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++;
|
||||
}
|
||||
|
@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -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);
|
||||
}
|
||||
}
|
||||
}
|
@ -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);
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user