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

Remove secondaryText and related code from FooterButtonRandom

This commit is contained in:
Jack Boswell (boswelja) 2020-06-08 15:05:53 +12:00
parent c331575cd0
commit bddd2b72ba

View File

@ -17,22 +17,9 @@ namespace osu.Game.Screens.Select
public Action NextRandom { get; set; } public Action NextRandom { get; set; }
public Action PreviousRandom { get; set; } public Action PreviousRandom { get; set; }
private readonly SpriteText secondaryText;
private bool rewindSearch; private bool rewindSearch;
public FooterButtonRandom() public FooterButtonRandom() { }
{
TextContainer.Add(secondaryText = new OsuSpriteText
{
Anchor = Anchor.Centre,
Origin = Anchor.Centre,
Text = @"rewind",
Alpha = 0,
});
// force both text sprites to always be present to avoid width flickering while they're being swapped out
SpriteText.AlwaysPresent = secondaryText.AlwaysPresent = true;
}
[BackgroundDependencyLoader] [BackgroundDependencyLoader]
private void load(OsuColour colours) private void load(OsuColour colours)
@ -53,20 +40,6 @@ namespace osu.Game.Screens.Select
}; };
} }
private void updateText()
{
if (rewindSearch)
{
SpriteText.FadeOut(120, Easing.InQuad);
secondaryText.FadeIn(120, Easing.InQuad);
}
else
{
SpriteText.FadeIn(120, Easing.InQuad);
secondaryText.FadeOut(120, Easing.InQuad);
}
}
public override bool OnPressed(GlobalAction action) public override bool OnPressed(GlobalAction action)
{ {
rewindSearch = action == GlobalAction.SelectPreviousRandom; rewindSearch = action == GlobalAction.SelectPreviousRandom;
@ -76,7 +49,6 @@ namespace osu.Game.Screens.Select
return false; return false;
} }
updateText();
Click(); Click();
return true; return true;
} }
@ -86,7 +58,6 @@ namespace osu.Game.Screens.Select
if (action == GlobalAction.SelectPreviousRandom) if (action == GlobalAction.SelectPreviousRandom)
{ {
rewindSearch = false; rewindSearch = false;
updateText();
} }
} }
} }