mirror of
https://github.com/osukey/osukey.git
synced 2025-07-01 00:09:55 +09:00
Restructure everything to fix free mod overlay issue
This commit is contained in:
@ -179,7 +179,7 @@ namespace osu.Game.Tests.Visual.UserInterface
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void TestClassicKeyboardSelection()
|
||||
public void TestClassicKeyboardExclusiveSelection()
|
||||
{
|
||||
AddStep("set classic hotkey mode", () => configManager.SetValue(OsuSetting.ModSelectHotkeyStyle, ModSelectHotkeyStyle.Classic));
|
||||
|
||||
@ -188,7 +188,7 @@ namespace osu.Game.Tests.Visual.UserInterface
|
||||
{
|
||||
RelativeSizeAxes = Axes.Both,
|
||||
Padding = new MarginPadding(30),
|
||||
Child = column = new ModColumn(ModType.DifficultyIncrease, true)
|
||||
Child = column = new ModColumn(ModType.DifficultyIncrease, false)
|
||||
{
|
||||
Anchor = Anchor.Centre,
|
||||
Origin = Anchor.Centre,
|
||||
@ -228,6 +228,53 @@ namespace osu.Game.Tests.Visual.UserInterface
|
||||
AddAssert("no change", () => this.ChildrenOfType<ModPanel>().Single(panel => panel.Active.Value).Mod.Acronym == "NC");
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void TestClassicKeyboardIncompatibleSelection()
|
||||
{
|
||||
AddStep("set classic hotkey mode", () => configManager.SetValue(OsuSetting.ModSelectHotkeyStyle, ModSelectHotkeyStyle.Classic));
|
||||
|
||||
ModColumn column = null!;
|
||||
AddStep("create content", () => Child = new Container
|
||||
{
|
||||
RelativeSizeAxes = Axes.Both,
|
||||
Padding = new MarginPadding(30),
|
||||
Child = column = new ModColumn(ModType.DifficultyIncrease, true)
|
||||
{
|
||||
Anchor = Anchor.Centre,
|
||||
Origin = Anchor.Centre,
|
||||
AvailableMods = getExampleModsFor(ModType.DifficultyIncrease)
|
||||
}
|
||||
});
|
||||
|
||||
AddUntilStep("wait for panel load", () => column.IsLoaded && column.ItemsLoaded);
|
||||
|
||||
AddStep("press A", () => InputManager.Key(Key.A));
|
||||
AddAssert("HR panel selected", () => this.ChildrenOfType<ModPanel>().Single(panel => panel.Mod.Acronym == "HR").Active.Value);
|
||||
|
||||
AddStep("press A again", () => InputManager.Key(Key.A));
|
||||
AddAssert("HR panel deselected", () => !this.ChildrenOfType<ModPanel>().Single(panel => panel.Mod.Acronym == "HR").Active.Value);
|
||||
|
||||
AddStep("press D", () => InputManager.Key(Key.D));
|
||||
AddAssert("DT panel selected", () => this.ChildrenOfType<ModPanel>().Single(panel => panel.Mod.Acronym == "DT").Active.Value);
|
||||
AddAssert("NC panel selected", () => this.ChildrenOfType<ModPanel>().Single(panel => panel.Mod.Acronym == "NC").Active.Value);
|
||||
|
||||
AddStep("press D again", () => InputManager.Key(Key.D));
|
||||
AddAssert("DT panel deselected", () => !this.ChildrenOfType<ModPanel>().Single(panel => panel.Mod.Acronym == "DT").Active.Value);
|
||||
AddAssert("NC panel deselected", () => !this.ChildrenOfType<ModPanel>().Single(panel => panel.Mod.Acronym == "NC").Active.Value);
|
||||
|
||||
AddStep("press Shift-D", () =>
|
||||
{
|
||||
InputManager.PressKey(Key.ShiftLeft);
|
||||
InputManager.Key(Key.D);
|
||||
InputManager.ReleaseKey(Key.ShiftLeft);
|
||||
});
|
||||
AddAssert("DT panel selected", () => this.ChildrenOfType<ModPanel>().Single(panel => panel.Mod.Acronym == "DT").Active.Value);
|
||||
AddAssert("NC panel selected", () => this.ChildrenOfType<ModPanel>().Single(panel => panel.Mod.Acronym == "NC").Active.Value);
|
||||
|
||||
AddStep("press J", () => InputManager.Key(Key.J));
|
||||
AddAssert("no change", () => this.ChildrenOfType<ModPanel>().Count(panel => panel.Active.Value) == 2);
|
||||
}
|
||||
|
||||
private void setFilter(Func<Mod, bool>? filter)
|
||||
{
|
||||
foreach (var modState in this.ChildrenOfType<ModColumn>().Single().AvailableMods)
|
||||
@ -238,8 +285,8 @@ namespace osu.Game.Tests.Visual.UserInterface
|
||||
{
|
||||
public new bool SelectionAnimationRunning => base.SelectionAnimationRunning;
|
||||
|
||||
public TestModColumn(ModType modType, bool allowBulkSelection)
|
||||
: base(modType, allowBulkSelection)
|
||||
public TestModColumn(ModType modType, bool allowIncompatibleSelection)
|
||||
: base(modType, allowIncompatibleSelection)
|
||||
{
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user