mirror of
https://github.com/ppy/osu.git
synced 2024-11-11 18:27:26 +08:00
Fix test failures
This commit is contained in:
parent
46d055604a
commit
347373a3ba
@ -31,6 +31,7 @@ namespace osu.Game.Tests.Visual.UserInterface
|
||||
|
||||
AddStep("open", modSelect.Show);
|
||||
AddAssert("button disabled", () => !modSelect.CustomiseButton.Enabled.Value);
|
||||
AddUntilStep("wait for button load", () => modSelect.ButtonsLoaded);
|
||||
AddStep("select mod", () => modSelect.SelectMod(testMod));
|
||||
AddAssert("button enabled", () => modSelect.CustomiseButton.Enabled.Value);
|
||||
AddStep("open Customisation", () => modSelect.CustomiseButton.Click());
|
||||
@ -43,6 +44,8 @@ namespace osu.Game.Tests.Visual.UserInterface
|
||||
public new Container ModSettingsContainer => base.ModSettingsContainer;
|
||||
public new TriangleButton CustomiseButton => base.CustomiseButton;
|
||||
|
||||
public bool ButtonsLoaded => ModSectionsContainer.Children.All(c => c.ModIconsLoaded);
|
||||
|
||||
public void SelectMod(Mod mod) =>
|
||||
ModSectionsContainer.Children.Single(s => s.ModType == mod.Type)
|
||||
.ButtonsContainer.OfType<ModButton>().Single(b => b.Mods.Any(m => m.GetType() == mod.GetType())).SelectNext(1);
|
||||
|
@ -57,6 +57,15 @@ namespace osu.Game.Overlays.Mods
|
||||
}).ToArray();
|
||||
|
||||
modsLoadCts?.Cancel();
|
||||
|
||||
if (modContainers.Length == 0)
|
||||
{
|
||||
ModIconsLoaded = true;
|
||||
headerLabel.Hide();
|
||||
Hide();
|
||||
return;
|
||||
}
|
||||
|
||||
ModIconsLoaded = false;
|
||||
|
||||
LoadComponentsAsync(modContainers, c =>
|
||||
@ -67,18 +76,9 @@ namespace osu.Game.Overlays.Mods
|
||||
|
||||
buttons = modContainers.OfType<ModButton>().ToArray();
|
||||
|
||||
if (value.Any())
|
||||
{
|
||||
headerLabel.FadeIn(200);
|
||||
this.FadeIn(200);
|
||||
}
|
||||
else
|
||||
{
|
||||
// transition here looks weird as mods instantly disappear.
|
||||
headerLabel.Hide();
|
||||
Hide();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private ModButton[] buttons = { };
|
||||
|
Loading…
Reference in New Issue
Block a user