mirror of
https://github.com/ppy/osu.git
synced 2025-01-15 14:53:01 +08:00
Don't switch FooterButtonRandon Action on pressed.
Instead, create a new Action that invokes either NextRandom or PreviousRandom, depending on rewindSearch
This commit is contained in:
parent
978380a7fb
commit
0e155c8eb9
@ -40,6 +40,17 @@ namespace osu.Game.Screens.Select
|
||||
SelectedColour = colours.Green;
|
||||
DeselectedColour = SelectedColour.Opacity(0.5f);
|
||||
Text = @"random";
|
||||
Action = () =>
|
||||
{
|
||||
if (rewindSearch)
|
||||
{
|
||||
PreviousRandom.Invoke();
|
||||
}
|
||||
else
|
||||
{
|
||||
NextRandom.Invoke();
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
private void updateText()
|
||||
@ -58,24 +69,15 @@ namespace osu.Game.Screens.Select
|
||||
|
||||
public override bool OnPressed(GlobalAction action)
|
||||
{
|
||||
switch (action)
|
||||
rewindSearch = action == GlobalAction.SelectPreviousRandom;
|
||||
if (action != GlobalAction.SelectNextRandom && !rewindSearch)
|
||||
{
|
||||
case GlobalAction.SelectPreviousRandom:
|
||||
rewindSearch = true;
|
||||
Action = PreviousRandom;
|
||||
updateText();
|
||||
Click();
|
||||
return true;
|
||||
|
||||
case GlobalAction.SelectNextRandom:
|
||||
Action = NextRandom;
|
||||
updateText();
|
||||
Click();
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
updateText();
|
||||
Click();
|
||||
return true;
|
||||
}
|
||||
|
||||
public override void OnReleased(GlobalAction action)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user