Skip to content

Commit

Permalink
Merge pull request ppy#18215 from bdach/mod-overlay/rename-new
Browse files Browse the repository at this point in the history
Rename new mod select classes to "mod overlay" nomenclature
  • Loading branch information
peppy authored May 11, 2022
2 parents dd316be + 5325925 commit c61d0ff
Show file tree
Hide file tree
Showing 14 changed files with 76 additions and 76 deletions.
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Loading

0 comments on commit c61d0ff

Please sign in to comment.