Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rename new mod select classes to "mod overlay" nomenclature #18215

Merged
merged 2 commits into from May 11, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Expand Up @@ -19,7 +19,7 @@ namespace osu.Game.Tests.Visual.Multiplayer
{
public class TestSceneFreeModSelectScreen : MultiplayerTestScene
{
private FreeModSelectScreen freeModSelectScreen;
private FreeModSelectOverlay freeModSelectOverlay;
private readonly Bindable<Dictionary<ModType, IReadOnlyList<Mod>>> availableMods = new Bindable<Dictionary<ModType, IReadOnlyList<Mod>>>();

[BackgroundDependencyLoader]
Expand All @@ -40,8 +40,8 @@ public void TestFreeModSelect()

AddToggleStep("toggle visibility", visible =>
{
if (freeModSelectScreen != null)
freeModSelectScreen.State.Value = visible ? Visibility.Visible : Visibility.Hidden;
if (freeModSelectOverlay != null)
freeModSelectOverlay.State.Value = visible ? Visibility.Visible : Visibility.Hidden;
});
}

Expand All @@ -50,7 +50,7 @@ public void TestCustomisationNotAvailable()
{
createFreeModSelect();

AddStep("select difficulty adjust", () => freeModSelectScreen.SelectedMods.Value = new[] { new OsuModDifficultyAdjust() });
AddStep("select difficulty adjust", () => freeModSelectOverlay.SelectedMods.Value = new[] { new OsuModDifficultyAdjust() });
AddWaitStep("wait some", 3);
AddAssert("customisation area not expanded", () => this.ChildrenOfType<ModSettingsArea>().Single().Height == 0);
}
Expand All @@ -72,18 +72,18 @@ public void TestSelectDeselectAll()
InputManager.MoveMouseTo(this.ChildrenOfType<ShearedButton>().Last());
InputManager.Click(MouseButton.Left);
});
AddUntilStep("all mods deselected", () => !freeModSelectScreen.SelectedMods.Value.Any());
AddUntilStep("all mods deselected", () => !freeModSelectOverlay.SelectedMods.Value.Any());
}

private void createFreeModSelect()
{
AddStep("create free mod select screen", () => Child = freeModSelectScreen = new FreeModSelectScreen
AddStep("create free mod select screen", () => Child = freeModSelectOverlay = new FreeModSelectOverlay
{
State = { Value = Visibility.Visible }
});
AddUntilStep("all column content loaded",
() => freeModSelectScreen.ChildrenOfType<ModColumn>().Any()
&& freeModSelectScreen.ChildrenOfType<ModColumn>().All(column => column.IsLoaded && column.ItemsLoaded));
() => freeModSelectOverlay.ChildrenOfType<ModColumn>().Any()
&& freeModSelectOverlay.ChildrenOfType<ModColumn>().All(column => column.IsLoaded && column.ItemsLoaded));
}

private bool assertAllAvailableModsSelected()
Expand All @@ -95,7 +95,7 @@ private bool assertAllAvailableModsSelected()

foreach (var availableMod in allAvailableMods)
{
if (freeModSelectScreen.SelectedMods.Value.All(selectedMod => selectedMod.GetType() != availableMod.GetType()))
if (freeModSelectOverlay.SelectedMods.Value.All(selectedMod => selectedMod.GetType() != availableMod.GetType()))
return false;
}

Expand Down
2 changes: 1 addition & 1 deletion osu.Game.Tests/Visual/Multiplayer/TestSceneMultiplayer.cs
Expand Up @@ -627,7 +627,7 @@ public void TestLeaveNavigation()

AddStep("invoke on back button", () => multiplayerComponents.OnBackButton());

AddAssert("mod overlay is hidden", () => this.ChildrenOfType<UserModSelectScreen>().Single().State.Value == Visibility.Hidden);
AddAssert("mod overlay is hidden", () => this.ChildrenOfType<UserModSelectOverlay>().Single().State.Value == Visibility.Hidden);

AddAssert("dialog overlay is hidden", () => DialogOverlay.State.Value == Visibility.Hidden);

Expand Down
Expand Up @@ -132,7 +132,7 @@ public void TestAllowedModDeselectedWhenRequired(Type allowedMod, Type requiredM
private void assertHasFreeModButton(Type type, bool hasButton = true)
{
AddAssert($"{type.ReadableName()} {(hasButton ? "displayed" : "not displayed")} in freemod overlay",
() => this.ChildrenOfType<FreeModSelectScreen>()
() => this.ChildrenOfType<FreeModSelectOverlay>()
.Single()
.ChildrenOfType<ModPanel>()
.Where(panel => !panel.Filtered.Value)
Expand Down
Expand Up @@ -172,7 +172,7 @@ public void TestFreeModSelectionHasAllowedMods()
AddUntilStep("mod select contents loaded",
() => this.ChildrenOfType<ModColumn>().Any() && this.ChildrenOfType<ModColumn>().All(col => col.IsLoaded && col.ItemsLoaded));
AddUntilStep("mod select contains only double time mod",
() => this.ChildrenOfType<UserModSelectScreen>()
() => this.ChildrenOfType<UserModSelectOverlay>()
.SingleOrDefault()?
.ChildrenOfType<ModPanel>()
.SingleOrDefault(panel => !panel.Filtered.Value)?.Mod is OsuModDoubleTime);
Expand Down
Expand Up @@ -568,7 +568,7 @@ private void exitViaBackButtonAndConfirm()

public class TestPlaySongSelect : PlaySongSelect
{
public ModSelectScreen ModSelectOverlay => ModSelect;
public ModSelectOverlay ModSelectOverlay => ModSelect;

public BeatmapOptionsOverlay BeatmapOptionsOverlay => BeatmapOptions;

Expand Down
Expand Up @@ -1008,7 +1008,7 @@ private class TestSongSelect : PlaySongSelect
public WorkingBeatmap CurrentBeatmap => Beatmap.Value;
public IWorkingBeatmap CurrentBeatmapDetailsBeatmap => BeatmapDetails.Beatmap;
public new BeatmapCarousel Carousel => base.Carousel;
public new ModSelectScreen ModSelect => base.ModSelect;
public new ModSelectOverlay ModSelect => base.ModSelect;

public new void PresentScore(ScoreInfo score) => base.PresentScore(score);

Expand Down