1
0
mirror of https://github.com/ppy/osu.git synced 2024-11-11 08:27:49 +08:00

Add back "rewind" text, showing temporarily after a rewind occurs

This commit is contained in:
Dean Herbert 2021-04-07 18:29:45 +09:00
parent b4c6894d13
commit 0f2c03d54b
2 changed files with 24 additions and 0 deletions

View File

@ -106,6 +106,7 @@ namespace osu.Game.Screens.Select
AutoSizeAxes = Axes.Both,
Child = SpriteText = new OsuSpriteText
{
AlwaysPresent = true,
Anchor = Anchor.Centre,
Origin = Anchor.Centre,
}

View File

@ -4,8 +4,11 @@
using System;
using osu.Framework.Allocation;
using osu.Framework.Extensions.Color4Extensions;
using osu.Framework.Graphics;
using osu.Game.Graphics;
using osu.Game.Graphics.Sprites;
using osu.Game.Input.Bindings;
using osuTK;
namespace osu.Game.Screens.Select
{
@ -22,10 +25,30 @@ namespace osu.Game.Screens.Select
SelectedColour = colours.Green;
DeselectedColour = SelectedColour.Opacity(0.5f);
Text = @"random";
Action = () =>
{
if (rewindSearch)
{
const double fade_time = 500;
OsuSpriteText rewindSpriteText;
TextContainer.Add(rewindSpriteText = new OsuSpriteText
{
Alpha = 0,
Text = @"rewind",
AlwaysPresent = true, // make sure the button is sized large enough to always show this
Anchor = Anchor.Centre,
Origin = Anchor.Centre,
});
rewindSpriteText.FadeOutFromOne(fade_time, Easing.In);
rewindSpriteText.MoveTo(Vector2.Zero).MoveTo(new Vector2(0, 10), fade_time, Easing.In);
rewindSpriteText.Expire();
SpriteText.FadeInFromZero(fade_time, Easing.In);
PreviousRandom.Invoke();
}
else