mirror of
https://github.com/ppy/osu
synced 2024-12-27 01:12:45 +00:00
Merge pull request #18108 from bdach/mod-overlay/customisation-auto-show-bug
Close new design's mod customisation area on escape press before exiting
This commit is contained in:
commit
e2895ea145
@ -164,11 +164,19 @@ namespace osu.Game.Tests.Visual.UserInterface
|
||||
AddStep("select mod requiring configuration", () => SelectedMods.Value = new[] { new OsuModDifficultyAdjust() });
|
||||
assertCustomisationToggleState(disabled: false, active: true);
|
||||
|
||||
AddStep("dismiss mod customisation", () =>
|
||||
AddStep("dismiss mod customisation via mouse", () =>
|
||||
{
|
||||
InputManager.MoveMouseTo(modSelectScreen.ChildrenOfType<ShearedToggleButton>().Single());
|
||||
InputManager.Click(MouseButton.Left);
|
||||
});
|
||||
assertCustomisationToggleState(disabled: false, active: false);
|
||||
|
||||
AddStep("reset mods", () => SelectedMods.SetDefault());
|
||||
AddStep("select mod requiring configuration", () => SelectedMods.Value = new[] { new OsuModDifficultyAdjust() });
|
||||
assertCustomisationToggleState(disabled: false, active: true);
|
||||
|
||||
AddStep("dismiss mod customisation via keyboard", () => InputManager.Key(Key.Escape));
|
||||
assertCustomisationToggleState(disabled: false, active: false);
|
||||
|
||||
AddStep("append another mod not requiring config", () => SelectedMods.Value = SelectedMods.Value.Append(new OsuModFlashlight()).ToArray());
|
||||
assertCustomisationToggleState(disabled: false, active: false);
|
||||
|
@ -18,6 +18,7 @@ using osu.Game.Configuration;
|
||||
using osu.Game.Graphics;
|
||||
using osu.Game.Graphics.Containers;
|
||||
using osu.Game.Graphics.UserInterface;
|
||||
using osu.Game.Input.Bindings;
|
||||
using osu.Game.Rulesets.Mods;
|
||||
using osuTK;
|
||||
using osuTK.Input;
|
||||
@ -217,7 +218,7 @@ namespace osu.Game.Overlays.Mods
|
||||
foreach (var mod in SelectedMods.Value)
|
||||
{
|
||||
anyCustomisableMod |= mod.GetSettingsSourceProperties().Any();
|
||||
anyModWithRequiredCustomisationAdded |= !valueChangedEvent.OldValue.Contains(mod) && mod.RequiresConfiguration;
|
||||
anyModWithRequiredCustomisationAdded |= valueChangedEvent.OldValue.All(m => m.GetType() != mod.GetType()) && mod.RequiresConfiguration;
|
||||
}
|
||||
|
||||
if (anyCustomisableMod)
|
||||
@ -315,6 +316,17 @@ namespace osu.Game.Overlays.Mods
|
||||
}
|
||||
}
|
||||
|
||||
public override bool OnPressed(KeyBindingPressEvent<GlobalAction> e)
|
||||
{
|
||||
if (e.Action == GlobalAction.Back && customisationVisible.Value)
|
||||
{
|
||||
customisationVisible.Value = false;
|
||||
return true;
|
||||
}
|
||||
|
||||
return base.OnPressed(e);
|
||||
}
|
||||
|
||||
internal class ColumnScrollContainer : OsuScrollContainer<ColumnFlowContainer>
|
||||
{
|
||||
public ColumnScrollContainer()
|
||||
|
Loading…
Reference in New Issue
Block a user