mirror of
https://github.com/osukey/osukey.git
synced 2025-05-09 23:57:18 +09: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);
|
AddStep("open", modSelect.Show);
|
||||||
AddAssert("button disabled", () => !modSelect.CustomiseButton.Enabled.Value);
|
AddAssert("button disabled", () => !modSelect.CustomiseButton.Enabled.Value);
|
||||||
|
AddUntilStep("wait for button load", () => modSelect.ButtonsLoaded);
|
||||||
AddStep("select mod", () => modSelect.SelectMod(testMod));
|
AddStep("select mod", () => modSelect.SelectMod(testMod));
|
||||||
AddAssert("button enabled", () => modSelect.CustomiseButton.Enabled.Value);
|
AddAssert("button enabled", () => modSelect.CustomiseButton.Enabled.Value);
|
||||||
AddStep("open Customisation", () => modSelect.CustomiseButton.Click());
|
AddStep("open Customisation", () => modSelect.CustomiseButton.Click());
|
||||||
@ -43,6 +44,8 @@ namespace osu.Game.Tests.Visual.UserInterface
|
|||||||
public new Container ModSettingsContainer => base.ModSettingsContainer;
|
public new Container ModSettingsContainer => base.ModSettingsContainer;
|
||||||
public new TriangleButton CustomiseButton => base.CustomiseButton;
|
public new TriangleButton CustomiseButton => base.CustomiseButton;
|
||||||
|
|
||||||
|
public bool ButtonsLoaded => ModSectionsContainer.Children.All(c => c.ModIconsLoaded);
|
||||||
|
|
||||||
public void SelectMod(Mod mod) =>
|
public void SelectMod(Mod mod) =>
|
||||||
ModSectionsContainer.Children.Single(s => s.ModType == mod.Type)
|
ModSectionsContainer.Children.Single(s => s.ModType == mod.Type)
|
||||||
.ButtonsContainer.OfType<ModButton>().Single(b => b.Mods.Any(m => m.GetType() == mod.GetType())).SelectNext(1);
|
.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();
|
}).ToArray();
|
||||||
|
|
||||||
modsLoadCts?.Cancel();
|
modsLoadCts?.Cancel();
|
||||||
|
|
||||||
|
if (modContainers.Length == 0)
|
||||||
|
{
|
||||||
|
ModIconsLoaded = true;
|
||||||
|
headerLabel.Hide();
|
||||||
|
Hide();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
ModIconsLoaded = false;
|
ModIconsLoaded = false;
|
||||||
|
|
||||||
LoadComponentsAsync(modContainers, c =>
|
LoadComponentsAsync(modContainers, c =>
|
||||||
@ -67,17 +76,8 @@ namespace osu.Game.Overlays.Mods
|
|||||||
|
|
||||||
buttons = modContainers.OfType<ModButton>().ToArray();
|
buttons = modContainers.OfType<ModButton>().ToArray();
|
||||||
|
|
||||||
if (value.Any())
|
headerLabel.FadeIn(200);
|
||||||
{
|
this.FadeIn(200);
|
||||||
headerLabel.FadeIn(200);
|
|
||||||
this.FadeIn(200);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
// transition here looks weird as mods instantly disappear.
|
|
||||||
headerLabel.Hide();
|
|
||||||
Hide();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user