mirror of
https://github.com/ppy/osu
synced 2024-12-16 03:45:46 +00:00
Flash back button when keyboard back binding is pressed
This commit is contained in:
parent
d4c9de8596
commit
a716f62a6a
@ -77,8 +77,10 @@ namespace osu.Game.Overlays.Mods
|
||||
private ModSettingsArea modSettingsArea = null!;
|
||||
private ColumnScrollContainer columnScroll = null!;
|
||||
private ColumnFlowContainer columnFlow = null!;
|
||||
private ShearedToggleButton? customisationButton;
|
||||
|
||||
private FillFlowContainer<ShearedButton> footerButtonFlow = null!;
|
||||
private ShearedButton backButton = null!;
|
||||
private ShearedToggleButton? customisationButton;
|
||||
|
||||
[BackgroundDependencyLoader]
|
||||
private void load(OsuColour colours)
|
||||
@ -173,7 +175,7 @@ namespace osu.Game.Overlays.Mods
|
||||
Horizontal = 70
|
||||
},
|
||||
Spacing = new Vector2(10),
|
||||
ChildrenEnumerable = CreateFooterButtons().Prepend(new ShearedButton(BUTTON_WIDTH)
|
||||
ChildrenEnumerable = CreateFooterButtons().Prepend(backButton = new ShearedButton(BUTTON_WIDTH)
|
||||
{
|
||||
Text = CommonStrings.Back,
|
||||
Action = Hide,
|
||||
@ -364,9 +366,12 @@ namespace osu.Game.Overlays.Mods
|
||||
|
||||
public override bool OnPressed(KeyBindingPressEvent<GlobalAction> e)
|
||||
{
|
||||
if (e.Action == GlobalAction.Back && customisationVisible.Value)
|
||||
if (e.Action == GlobalAction.Back)
|
||||
{
|
||||
customisationVisible.Value = false;
|
||||
if (customisationVisible.Value)
|
||||
customisationVisible.Value = false;
|
||||
else
|
||||
backButton.TriggerClick();
|
||||
return true;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user