mirror of
https://github.com/ppy/osu.git
synced 2025-01-07 22:22:59 +08:00
Merge pull request #18215 from bdach/mod-overlay/rename-new
Rename new mod select classes to "mod overlay" nomenclature
This commit is contained in:
commit
c61d0ff80a
@ -19,7 +19,7 @@ namespace osu.Game.Tests.Visual.Multiplayer
|
|||||||
{
|
{
|
||||||
public class TestSceneFreeModSelectScreen : MultiplayerTestScene
|
public class TestSceneFreeModSelectScreen : MultiplayerTestScene
|
||||||
{
|
{
|
||||||
private FreeModSelectScreen freeModSelectScreen;
|
private FreeModSelectOverlay freeModSelectOverlay;
|
||||||
private readonly Bindable<Dictionary<ModType, IReadOnlyList<Mod>>> availableMods = new Bindable<Dictionary<ModType, IReadOnlyList<Mod>>>();
|
private readonly Bindable<Dictionary<ModType, IReadOnlyList<Mod>>> availableMods = new Bindable<Dictionary<ModType, IReadOnlyList<Mod>>>();
|
||||||
|
|
||||||
[BackgroundDependencyLoader]
|
[BackgroundDependencyLoader]
|
||||||
@ -40,8 +40,8 @@ namespace osu.Game.Tests.Visual.Multiplayer
|
|||||||
|
|
||||||
AddToggleStep("toggle visibility", visible =>
|
AddToggleStep("toggle visibility", visible =>
|
||||||
{
|
{
|
||||||
if (freeModSelectScreen != null)
|
if (freeModSelectOverlay != null)
|
||||||
freeModSelectScreen.State.Value = visible ? Visibility.Visible : Visibility.Hidden;
|
freeModSelectOverlay.State.Value = visible ? Visibility.Visible : Visibility.Hidden;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -50,7 +50,7 @@ namespace osu.Game.Tests.Visual.Multiplayer
|
|||||||
{
|
{
|
||||||
createFreeModSelect();
|
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);
|
AddWaitStep("wait some", 3);
|
||||||
AddAssert("customisation area not expanded", () => this.ChildrenOfType<ModSettingsArea>().Single().Height == 0);
|
AddAssert("customisation area not expanded", () => this.ChildrenOfType<ModSettingsArea>().Single().Height == 0);
|
||||||
}
|
}
|
||||||
@ -72,18 +72,18 @@ namespace osu.Game.Tests.Visual.Multiplayer
|
|||||||
InputManager.MoveMouseTo(this.ChildrenOfType<ShearedButton>().Last());
|
InputManager.MoveMouseTo(this.ChildrenOfType<ShearedButton>().Last());
|
||||||
InputManager.Click(MouseButton.Left);
|
InputManager.Click(MouseButton.Left);
|
||||||
});
|
});
|
||||||
AddUntilStep("all mods deselected", () => !freeModSelectScreen.SelectedMods.Value.Any());
|
AddUntilStep("all mods deselected", () => !freeModSelectOverlay.SelectedMods.Value.Any());
|
||||||
}
|
}
|
||||||
|
|
||||||
private void createFreeModSelect()
|
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 }
|
State = { Value = Visibility.Visible }
|
||||||
});
|
});
|
||||||
AddUntilStep("all column content loaded",
|
AddUntilStep("all column content loaded",
|
||||||
() => freeModSelectScreen.ChildrenOfType<ModColumn>().Any()
|
() => freeModSelectOverlay.ChildrenOfType<ModColumn>().Any()
|
||||||
&& freeModSelectScreen.ChildrenOfType<ModColumn>().All(column => column.IsLoaded && column.ItemsLoaded));
|
&& freeModSelectOverlay.ChildrenOfType<ModColumn>().All(column => column.IsLoaded && column.ItemsLoaded));
|
||||||
}
|
}
|
||||||
|
|
||||||
private bool assertAllAvailableModsSelected()
|
private bool assertAllAvailableModsSelected()
|
||||||
@ -95,7 +95,7 @@ namespace osu.Game.Tests.Visual.Multiplayer
|
|||||||
|
|
||||||
foreach (var availableMod in allAvailableMods)
|
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;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -627,7 +627,7 @@ namespace osu.Game.Tests.Visual.Multiplayer
|
|||||||
|
|
||||||
AddStep("invoke on back button", () => multiplayerComponents.OnBackButton());
|
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);
|
AddAssert("dialog overlay is hidden", () => DialogOverlay.State.Value == Visibility.Hidden);
|
||||||
|
|
||||||
|
@ -132,7 +132,7 @@ namespace osu.Game.Tests.Visual.Multiplayer
|
|||||||
private void assertHasFreeModButton(Type type, bool hasButton = true)
|
private void assertHasFreeModButton(Type type, bool hasButton = true)
|
||||||
{
|
{
|
||||||
AddAssert($"{type.ReadableName()} {(hasButton ? "displayed" : "not displayed")} in freemod overlay",
|
AddAssert($"{type.ReadableName()} {(hasButton ? "displayed" : "not displayed")} in freemod overlay",
|
||||||
() => this.ChildrenOfType<FreeModSelectScreen>()
|
() => this.ChildrenOfType<FreeModSelectOverlay>()
|
||||||
.Single()
|
.Single()
|
||||||
.ChildrenOfType<ModPanel>()
|
.ChildrenOfType<ModPanel>()
|
||||||
.Where(panel => !panel.Filtered.Value)
|
.Where(panel => !panel.Filtered.Value)
|
||||||
|
@ -172,7 +172,7 @@ namespace osu.Game.Tests.Visual.Multiplayer
|
|||||||
AddUntilStep("mod select contents loaded",
|
AddUntilStep("mod select contents loaded",
|
||||||
() => this.ChildrenOfType<ModColumn>().Any() && this.ChildrenOfType<ModColumn>().All(col => col.IsLoaded && col.ItemsLoaded));
|
() => this.ChildrenOfType<ModColumn>().Any() && this.ChildrenOfType<ModColumn>().All(col => col.IsLoaded && col.ItemsLoaded));
|
||||||
AddUntilStep("mod select contains only double time mod",
|
AddUntilStep("mod select contains only double time mod",
|
||||||
() => this.ChildrenOfType<UserModSelectScreen>()
|
() => this.ChildrenOfType<UserModSelectOverlay>()
|
||||||
.SingleOrDefault()?
|
.SingleOrDefault()?
|
||||||
.ChildrenOfType<ModPanel>()
|
.ChildrenOfType<ModPanel>()
|
||||||
.SingleOrDefault(panel => !panel.Filtered.Value)?.Mod is OsuModDoubleTime);
|
.SingleOrDefault(panel => !panel.Filtered.Value)?.Mod is OsuModDoubleTime);
|
||||||
|
@ -568,7 +568,7 @@ namespace osu.Game.Tests.Visual.Navigation
|
|||||||
|
|
||||||
public class TestPlaySongSelect : PlaySongSelect
|
public class TestPlaySongSelect : PlaySongSelect
|
||||||
{
|
{
|
||||||
public ModSelectScreen ModSelectOverlay => ModSelect;
|
public ModSelectOverlay ModSelectOverlay => ModSelect;
|
||||||
|
|
||||||
public BeatmapOptionsOverlay BeatmapOptionsOverlay => BeatmapOptions;
|
public BeatmapOptionsOverlay BeatmapOptionsOverlay => BeatmapOptions;
|
||||||
|
|
||||||
|
@ -1008,7 +1008,7 @@ namespace osu.Game.Tests.Visual.SongSelect
|
|||||||
public WorkingBeatmap CurrentBeatmap => Beatmap.Value;
|
public WorkingBeatmap CurrentBeatmap => Beatmap.Value;
|
||||||
public IWorkingBeatmap CurrentBeatmapDetailsBeatmap => BeatmapDetails.Beatmap;
|
public IWorkingBeatmap CurrentBeatmapDetailsBeatmap => BeatmapDetails.Beatmap;
|
||||||
public new BeatmapCarousel Carousel => base.Carousel;
|
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);
|
public new void PresentScore(ScoreInfo score) => base.PresentScore(score);
|
||||||
|
|
||||||
|
@ -29,7 +29,7 @@ namespace osu.Game.Tests.Visual.UserInterface
|
|||||||
[Resolved]
|
[Resolved]
|
||||||
private RulesetStore rulesetStore { get; set; }
|
private RulesetStore rulesetStore { get; set; }
|
||||||
|
|
||||||
private UserModSelectScreen modSelectScreen;
|
private UserModSelectOverlay modSelectOverlay;
|
||||||
|
|
||||||
[SetUpSteps]
|
[SetUpSteps]
|
||||||
public void SetUpSteps()
|
public void SetUpSteps()
|
||||||
@ -41,7 +41,7 @@ namespace osu.Game.Tests.Visual.UserInterface
|
|||||||
|
|
||||||
private void createScreen()
|
private void createScreen()
|
||||||
{
|
{
|
||||||
AddStep("create screen", () => Child = modSelectScreen = new UserModSelectScreen
|
AddStep("create screen", () => Child = modSelectOverlay = new UserModSelectOverlay
|
||||||
{
|
{
|
||||||
RelativeSizeAxes = Axes.Both,
|
RelativeSizeAxes = Axes.Both,
|
||||||
State = { Value = Visibility.Visible },
|
State = { Value = Visibility.Visible },
|
||||||
@ -54,7 +54,7 @@ namespace osu.Game.Tests.Visual.UserInterface
|
|||||||
public void TestStateChange()
|
public void TestStateChange()
|
||||||
{
|
{
|
||||||
createScreen();
|
createScreen();
|
||||||
AddStep("toggle state", () => modSelectScreen.ToggleVisibility());
|
AddStep("toggle state", () => modSelectOverlay.ToggleVisibility());
|
||||||
}
|
}
|
||||||
|
|
||||||
[Test]
|
[Test]
|
||||||
@ -62,14 +62,14 @@ namespace osu.Game.Tests.Visual.UserInterface
|
|||||||
{
|
{
|
||||||
AddStep("set mods", () => SelectedMods.Value = new Mod[] { new OsuModAlternate(), new OsuModDaycore() });
|
AddStep("set mods", () => SelectedMods.Value = new Mod[] { new OsuModAlternate(), new OsuModDaycore() });
|
||||||
createScreen();
|
createScreen();
|
||||||
AddUntilStep("two panels active", () => modSelectScreen.ChildrenOfType<ModPanel>().Count(panel => panel.Active.Value) == 2);
|
AddUntilStep("two panels active", () => modSelectOverlay.ChildrenOfType<ModPanel>().Count(panel => panel.Active.Value) == 2);
|
||||||
AddAssert("mod multiplier correct", () =>
|
AddAssert("mod multiplier correct", () =>
|
||||||
{
|
{
|
||||||
double multiplier = SelectedMods.Value.Aggregate(1d, (m, mod) => m * mod.ScoreMultiplier);
|
double multiplier = SelectedMods.Value.Aggregate(1d, (m, mod) => m * mod.ScoreMultiplier);
|
||||||
return Precision.AlmostEquals(multiplier, modSelectScreen.ChildrenOfType<DifficultyMultiplierDisplay>().Single().Current.Value);
|
return Precision.AlmostEquals(multiplier, modSelectOverlay.ChildrenOfType<DifficultyMultiplierDisplay>().Single().Current.Value);
|
||||||
});
|
});
|
||||||
assertCustomisationToggleState(disabled: false, active: false);
|
assertCustomisationToggleState(disabled: false, active: false);
|
||||||
AddAssert("setting items created", () => modSelectScreen.ChildrenOfType<ISettingsItem>().Any());
|
AddAssert("setting items created", () => modSelectOverlay.ChildrenOfType<ISettingsItem>().Any());
|
||||||
}
|
}
|
||||||
|
|
||||||
[Test]
|
[Test]
|
||||||
@ -77,14 +77,14 @@ namespace osu.Game.Tests.Visual.UserInterface
|
|||||||
{
|
{
|
||||||
createScreen();
|
createScreen();
|
||||||
AddStep("set mods", () => SelectedMods.Value = new Mod[] { new OsuModAlternate(), new OsuModDaycore() });
|
AddStep("set mods", () => SelectedMods.Value = new Mod[] { new OsuModAlternate(), new OsuModDaycore() });
|
||||||
AddUntilStep("two panels active", () => modSelectScreen.ChildrenOfType<ModPanel>().Count(panel => panel.Active.Value) == 2);
|
AddUntilStep("two panels active", () => modSelectOverlay.ChildrenOfType<ModPanel>().Count(panel => panel.Active.Value) == 2);
|
||||||
AddAssert("mod multiplier correct", () =>
|
AddAssert("mod multiplier correct", () =>
|
||||||
{
|
{
|
||||||
double multiplier = SelectedMods.Value.Aggregate(1d, (m, mod) => m * mod.ScoreMultiplier);
|
double multiplier = SelectedMods.Value.Aggregate(1d, (m, mod) => m * mod.ScoreMultiplier);
|
||||||
return Precision.AlmostEquals(multiplier, modSelectScreen.ChildrenOfType<DifficultyMultiplierDisplay>().Single().Current.Value);
|
return Precision.AlmostEquals(multiplier, modSelectOverlay.ChildrenOfType<DifficultyMultiplierDisplay>().Single().Current.Value);
|
||||||
});
|
});
|
||||||
assertCustomisationToggleState(disabled: false, active: false);
|
assertCustomisationToggleState(disabled: false, active: false);
|
||||||
AddAssert("setting items created", () => modSelectScreen.ChildrenOfType<ISettingsItem>().Any());
|
AddAssert("setting items created", () => modSelectOverlay.ChildrenOfType<ISettingsItem>().Any());
|
||||||
}
|
}
|
||||||
|
|
||||||
[Test]
|
[Test]
|
||||||
@ -139,7 +139,7 @@ namespace osu.Game.Tests.Visual.UserInterface
|
|||||||
AddAssert("last column dimmed", () => !this.ChildrenOfType<ModColumn>().Last().Active.Value);
|
AddAssert("last column dimmed", () => !this.ChildrenOfType<ModColumn>().Last().Active.Value);
|
||||||
AddStep("request scroll to last column", () =>
|
AddStep("request scroll to last column", () =>
|
||||||
{
|
{
|
||||||
var lastDimContainer = this.ChildrenOfType<ModSelectScreen.ColumnDimContainer>().Last();
|
var lastDimContainer = this.ChildrenOfType<ModSelectOverlay.ColumnDimContainer>().Last();
|
||||||
lastColumn = lastDimContainer.Column;
|
lastColumn = lastDimContainer.Column;
|
||||||
lastDimContainer.RequestScroll?.Invoke(lastDimContainer);
|
lastDimContainer.RequestScroll?.Invoke(lastDimContainer);
|
||||||
});
|
});
|
||||||
@ -167,7 +167,7 @@ namespace osu.Game.Tests.Visual.UserInterface
|
|||||||
|
|
||||||
AddStep("dismiss mod customisation via toggle", () =>
|
AddStep("dismiss mod customisation via toggle", () =>
|
||||||
{
|
{
|
||||||
InputManager.MoveMouseTo(modSelectScreen.ChildrenOfType<ShearedToggleButton>().Single());
|
InputManager.MoveMouseTo(modSelectOverlay.ChildrenOfType<ShearedToggleButton>().Single());
|
||||||
InputManager.Click(MouseButton.Left);
|
InputManager.Click(MouseButton.Left);
|
||||||
});
|
});
|
||||||
assertCustomisationToggleState(disabled: false, active: false);
|
assertCustomisationToggleState(disabled: false, active: false);
|
||||||
@ -205,14 +205,14 @@ namespace osu.Game.Tests.Visual.UserInterface
|
|||||||
AddStep("move mouse to dimmed area", () =>
|
AddStep("move mouse to dimmed area", () =>
|
||||||
{
|
{
|
||||||
InputManager.MoveMouseTo(new Vector2(
|
InputManager.MoveMouseTo(new Vector2(
|
||||||
modSelectScreen.ScreenSpaceDrawQuad.TopLeft.X,
|
modSelectOverlay.ScreenSpaceDrawQuad.TopLeft.X,
|
||||||
(modSelectScreen.ScreenSpaceDrawQuad.TopLeft.Y + modSelectScreen.ScreenSpaceDrawQuad.BottomLeft.Y) / 2));
|
(modSelectOverlay.ScreenSpaceDrawQuad.TopLeft.Y + modSelectOverlay.ScreenSpaceDrawQuad.BottomLeft.Y) / 2));
|
||||||
});
|
});
|
||||||
AddStep("click", () => InputManager.Click(MouseButton.Left));
|
AddStep("click", () => InputManager.Click(MouseButton.Left));
|
||||||
assertCustomisationToggleState(disabled: false, active: false);
|
assertCustomisationToggleState(disabled: false, active: false);
|
||||||
|
|
||||||
AddStep("move mouse to first mod panel", () => InputManager.MoveMouseTo(modSelectScreen.ChildrenOfType<ModPanel>().First()));
|
AddStep("move mouse to first mod panel", () => InputManager.MoveMouseTo(modSelectOverlay.ChildrenOfType<ModPanel>().First()));
|
||||||
AddAssert("first mod panel is hovered", () => modSelectScreen.ChildrenOfType<ModPanel>().First().IsHovered);
|
AddAssert("first mod panel is hovered", () => modSelectOverlay.ChildrenOfType<ModPanel>().First().IsHovered);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@ -222,12 +222,12 @@ namespace osu.Game.Tests.Visual.UserInterface
|
|||||||
public void TestSettingsNotCrossPolluting()
|
public void TestSettingsNotCrossPolluting()
|
||||||
{
|
{
|
||||||
Bindable<IReadOnlyList<Mod>> selectedMods2 = null;
|
Bindable<IReadOnlyList<Mod>> selectedMods2 = null;
|
||||||
ModSelectScreen modSelectScreen2 = null;
|
ModSelectOverlay modSelectScreen2 = null;
|
||||||
|
|
||||||
createScreen();
|
createScreen();
|
||||||
AddStep("select diff adjust", () => SelectedMods.Value = new Mod[] { new OsuModDifficultyAdjust() });
|
AddStep("select diff adjust", () => SelectedMods.Value = new Mod[] { new OsuModDifficultyAdjust() });
|
||||||
|
|
||||||
AddStep("set setting", () => modSelectScreen.ChildrenOfType<SettingsSlider<float>>().First().Current.Value = 8);
|
AddStep("set setting", () => modSelectOverlay.ChildrenOfType<SettingsSlider<float>>().First().Current.Value = 8);
|
||||||
|
|
||||||
AddAssert("ensure setting is propagated", () => SelectedMods.Value.OfType<OsuModDifficultyAdjust>().Single().CircleSize.Value == 8);
|
AddAssert("ensure setting is propagated", () => SelectedMods.Value.OfType<OsuModDifficultyAdjust>().Single().CircleSize.Value == 8);
|
||||||
|
|
||||||
@ -235,7 +235,7 @@ namespace osu.Game.Tests.Visual.UserInterface
|
|||||||
|
|
||||||
AddStep("create second overlay", () =>
|
AddStep("create second overlay", () =>
|
||||||
{
|
{
|
||||||
Add(modSelectScreen2 = new UserModSelectScreen().With(d =>
|
Add(modSelectScreen2 = new UserModSelectOverlay().With(d =>
|
||||||
{
|
{
|
||||||
d.Origin = Anchor.TopCentre;
|
d.Origin = Anchor.TopCentre;
|
||||||
d.Anchor = Anchor.TopCentre;
|
d.Anchor = Anchor.TopCentre;
|
||||||
@ -276,20 +276,20 @@ namespace osu.Game.Tests.Visual.UserInterface
|
|||||||
|
|
||||||
AddStep("Select all fun mods", () =>
|
AddStep("Select all fun mods", () =>
|
||||||
{
|
{
|
||||||
modSelectScreen.ChildrenOfType<ModColumn>()
|
modSelectOverlay.ChildrenOfType<ModColumn>()
|
||||||
.Single(c => c.ModType == ModType.DifficultyIncrease)
|
.Single(c => c.ModType == ModType.DifficultyIncrease)
|
||||||
.SelectAll();
|
.SelectAll();
|
||||||
});
|
});
|
||||||
|
|
||||||
AddUntilStep("many mods selected", () => SelectedMods.Value.Count >= 5);
|
AddUntilStep("many mods selected", () => SelectedMods.Value.Count >= 5);
|
||||||
|
|
||||||
AddStep("trigger deselect and close overlay", () =>
|
AddStep("trigger deselect and close overlay", () =>
|
||||||
{
|
{
|
||||||
modSelectScreen.ChildrenOfType<ModColumn>()
|
modSelectOverlay.ChildrenOfType<ModColumn>()
|
||||||
.Single(c => c.ModType == ModType.DifficultyIncrease)
|
.Single(c => c.ModType == ModType.DifficultyIncrease)
|
||||||
.DeselectAll();
|
.DeselectAll();
|
||||||
|
|
||||||
modSelectScreen.Hide();
|
modSelectOverlay.Hide();
|
||||||
});
|
});
|
||||||
|
|
||||||
AddAssert("all mods deselected", () => SelectedMods.Value.Count == 0);
|
AddAssert("all mods deselected", () => SelectedMods.Value.Count == 0);
|
||||||
@ -378,15 +378,15 @@ namespace osu.Game.Tests.Visual.UserInterface
|
|||||||
createScreen();
|
createScreen();
|
||||||
changeRuleset(0);
|
changeRuleset(0);
|
||||||
|
|
||||||
AddAssert("double time visible", () => modSelectScreen.ChildrenOfType<ModPanel>().Where(panel => panel.Mod is OsuModDoubleTime).Any(panel => !panel.Filtered.Value));
|
AddAssert("double time visible", () => modSelectOverlay.ChildrenOfType<ModPanel>().Where(panel => panel.Mod is OsuModDoubleTime).Any(panel => !panel.Filtered.Value));
|
||||||
|
|
||||||
AddStep("make double time invalid", () => modSelectScreen.IsValidMod = m => !(m is OsuModDoubleTime));
|
AddStep("make double time invalid", () => modSelectOverlay.IsValidMod = m => !(m is OsuModDoubleTime));
|
||||||
AddUntilStep("double time not visible", () => modSelectScreen.ChildrenOfType<ModPanel>().Where(panel => panel.Mod is OsuModDoubleTime).All(panel => panel.Filtered.Value));
|
AddUntilStep("double time not visible", () => modSelectOverlay.ChildrenOfType<ModPanel>().Where(panel => panel.Mod is OsuModDoubleTime).All(panel => panel.Filtered.Value));
|
||||||
AddAssert("nightcore still visible", () => modSelectScreen.ChildrenOfType<ModPanel>().Where(panel => panel.Mod is OsuModNightcore).Any(panel => !panel.Filtered.Value));
|
AddAssert("nightcore still visible", () => modSelectOverlay.ChildrenOfType<ModPanel>().Where(panel => panel.Mod is OsuModNightcore).Any(panel => !panel.Filtered.Value));
|
||||||
|
|
||||||
AddStep("make double time valid again", () => modSelectScreen.IsValidMod = m => true);
|
AddStep("make double time valid again", () => modSelectOverlay.IsValidMod = m => true);
|
||||||
AddUntilStep("double time visible", () => modSelectScreen.ChildrenOfType<ModPanel>().Where(panel => panel.Mod is OsuModDoubleTime).Any(panel => !panel.Filtered.Value));
|
AddUntilStep("double time visible", () => modSelectOverlay.ChildrenOfType<ModPanel>().Where(panel => panel.Mod is OsuModDoubleTime).Any(panel => !panel.Filtered.Value));
|
||||||
AddAssert("nightcore still visible", () => modSelectScreen.ChildrenOfType<ModPanel>().Where(b => b.Mod is OsuModNightcore).Any(panel => !panel.Filtered.Value));
|
AddAssert("nightcore still visible", () => modSelectOverlay.ChildrenOfType<ModPanel>().Where(b => b.Mod is OsuModNightcore).Any(panel => !panel.Filtered.Value));
|
||||||
}
|
}
|
||||||
|
|
||||||
[Test]
|
[Test]
|
||||||
@ -396,10 +396,10 @@ namespace osu.Game.Tests.Visual.UserInterface
|
|||||||
changeRuleset(0);
|
changeRuleset(0);
|
||||||
|
|
||||||
AddStep("select DT + HD", () => SelectedMods.Value = new Mod[] { new OsuModDoubleTime(), new OsuModHidden() });
|
AddStep("select DT + HD", () => SelectedMods.Value = new Mod[] { new OsuModDoubleTime(), new OsuModHidden() });
|
||||||
AddAssert("DT + HD selected", () => modSelectScreen.ChildrenOfType<ModPanel>().Count(panel => panel.Active.Value) == 2);
|
AddAssert("DT + HD selected", () => modSelectOverlay.ChildrenOfType<ModPanel>().Count(panel => panel.Active.Value) == 2);
|
||||||
|
|
||||||
AddStep("make NF invalid", () => modSelectScreen.IsValidMod = m => !(m is ModNoFail));
|
AddStep("make NF invalid", () => modSelectOverlay.IsValidMod = m => !(m is ModNoFail));
|
||||||
AddAssert("DT + HD still selected", () => modSelectScreen.ChildrenOfType<ModPanel>().Count(panel => panel.Active.Value) == 2);
|
AddAssert("DT + HD still selected", () => modSelectOverlay.ChildrenOfType<ModPanel>().Count(panel => panel.Active.Value) == 2);
|
||||||
}
|
}
|
||||||
|
|
||||||
[Test]
|
[Test]
|
||||||
@ -422,7 +422,7 @@ namespace osu.Game.Tests.Visual.UserInterface
|
|||||||
changeRuleset(0);
|
changeRuleset(0);
|
||||||
|
|
||||||
AddStep("select DT + HD", () => SelectedMods.Value = new Mod[] { new OsuModDoubleTime(), new OsuModHidden() });
|
AddStep("select DT + HD", () => SelectedMods.Value = new Mod[] { new OsuModDoubleTime(), new OsuModHidden() });
|
||||||
AddAssert("DT + HD selected", () => modSelectScreen.ChildrenOfType<ModPanel>().Count(panel => panel.Active.Value) == 2);
|
AddAssert("DT + HD selected", () => modSelectOverlay.ChildrenOfType<ModPanel>().Count(panel => panel.Active.Value) == 2);
|
||||||
|
|
||||||
AddStep("click deselect all button", () =>
|
AddStep("click deselect all button", () =>
|
||||||
{
|
{
|
||||||
@ -448,13 +448,13 @@ namespace osu.Game.Tests.Visual.UserInterface
|
|||||||
InputManager.MoveMouseTo(this.ChildrenOfType<ShearedButton>().First());
|
InputManager.MoveMouseTo(this.ChildrenOfType<ShearedButton>().First());
|
||||||
InputManager.Click(MouseButton.Left);
|
InputManager.Click(MouseButton.Left);
|
||||||
});
|
});
|
||||||
AddAssert("mod select hidden", () => modSelectScreen.State.Value == Visibility.Hidden);
|
AddAssert("mod select hidden", () => modSelectOverlay.State.Value == Visibility.Hidden);
|
||||||
}
|
}
|
||||||
|
|
||||||
[Test]
|
[Test]
|
||||||
public void TestColumnHiding()
|
public void TestColumnHiding()
|
||||||
{
|
{
|
||||||
AddStep("create screen", () => Child = modSelectScreen = new UserModSelectScreen
|
AddStep("create screen", () => Child = modSelectOverlay = new UserModSelectOverlay
|
||||||
{
|
{
|
||||||
RelativeSizeAxes = Axes.Both,
|
RelativeSizeAxes = Axes.Both,
|
||||||
State = { Value = Visibility.Visible },
|
State = { Value = Visibility.Visible },
|
||||||
@ -466,23 +466,23 @@ namespace osu.Game.Tests.Visual.UserInterface
|
|||||||
|
|
||||||
AddAssert("two columns visible", () => this.ChildrenOfType<ModColumn>().Count(col => col.IsPresent) == 2);
|
AddAssert("two columns visible", () => this.ChildrenOfType<ModColumn>().Count(col => col.IsPresent) == 2);
|
||||||
|
|
||||||
AddStep("unset filter", () => modSelectScreen.IsValidMod = _ => true);
|
AddStep("unset filter", () => modSelectOverlay.IsValidMod = _ => true);
|
||||||
AddAssert("all columns visible", () => this.ChildrenOfType<ModColumn>().All(col => col.IsPresent));
|
AddAssert("all columns visible", () => this.ChildrenOfType<ModColumn>().All(col => col.IsPresent));
|
||||||
|
|
||||||
AddStep("filter out everything", () => modSelectScreen.IsValidMod = _ => false);
|
AddStep("filter out everything", () => modSelectOverlay.IsValidMod = _ => false);
|
||||||
AddAssert("no columns visible", () => this.ChildrenOfType<ModColumn>().All(col => !col.IsPresent));
|
AddAssert("no columns visible", () => this.ChildrenOfType<ModColumn>().All(col => !col.IsPresent));
|
||||||
|
|
||||||
AddStep("hide", () => modSelectScreen.Hide());
|
AddStep("hide", () => modSelectOverlay.Hide());
|
||||||
AddStep("set filter for 3 columns", () => modSelectScreen.IsValidMod = mod => mod.Type == ModType.DifficultyReduction
|
AddStep("set filter for 3 columns", () => modSelectOverlay.IsValidMod = mod => mod.Type == ModType.DifficultyReduction
|
||||||
|| mod.Type == ModType.Automation
|
|| mod.Type == ModType.Automation
|
||||||
|| mod.Type == ModType.Conversion);
|
|| mod.Type == ModType.Conversion);
|
||||||
|
|
||||||
AddStep("show", () => modSelectScreen.Show());
|
AddStep("show", () => modSelectOverlay.Show());
|
||||||
AddUntilStep("3 columns visible", () => this.ChildrenOfType<ModColumn>().Count(col => col.IsPresent) == 3);
|
AddUntilStep("3 columns visible", () => this.ChildrenOfType<ModColumn>().Count(col => col.IsPresent) == 3);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void waitForColumnLoad() => AddUntilStep("all column content loaded",
|
private void waitForColumnLoad() => AddUntilStep("all column content loaded",
|
||||||
() => modSelectScreen.ChildrenOfType<ModColumn>().Any() && modSelectScreen.ChildrenOfType<ModColumn>().All(column => column.IsLoaded && column.ItemsLoaded));
|
() => modSelectOverlay.ChildrenOfType<ModColumn>().Any() && modSelectOverlay.ChildrenOfType<ModColumn>().All(column => column.IsLoaded && column.ItemsLoaded));
|
||||||
|
|
||||||
private void changeRuleset(int id)
|
private void changeRuleset(int id)
|
||||||
{
|
{
|
||||||
@ -492,14 +492,14 @@ namespace osu.Game.Tests.Visual.UserInterface
|
|||||||
|
|
||||||
private void assertCustomisationToggleState(bool disabled, bool active)
|
private void assertCustomisationToggleState(bool disabled, bool active)
|
||||||
{
|
{
|
||||||
ShearedToggleButton getToggle() => modSelectScreen.ChildrenOfType<ShearedToggleButton>().Single();
|
ShearedToggleButton getToggle() => modSelectOverlay.ChildrenOfType<ShearedToggleButton>().Single();
|
||||||
|
|
||||||
AddAssert($"customisation toggle is {(disabled ? "" : "not ")}disabled", () => getToggle().Active.Disabled == disabled);
|
AddAssert($"customisation toggle is {(disabled ? "" : "not ")}disabled", () => getToggle().Active.Disabled == disabled);
|
||||||
AddAssert($"customisation toggle is {(active ? "" : "not ")}active", () => getToggle().Active.Value == active);
|
AddAssert($"customisation toggle is {(active ? "" : "not ")}active", () => getToggle().Active.Value == active);
|
||||||
}
|
}
|
||||||
|
|
||||||
private ModPanel getPanelForMod(Type modType)
|
private ModPanel getPanelForMod(Type modType)
|
||||||
=> modSelectScreen.ChildrenOfType<ModPanel>().Single(panel => panel.Mod.GetType() == modType);
|
=> modSelectOverlay.ChildrenOfType<ModPanel>().Single(panel => panel.Mod.GetType() == modType);
|
||||||
|
|
||||||
private class TestUnimplementedMod : Mod
|
private class TestUnimplementedMod : Mod
|
||||||
{
|
{
|
||||||
|
@ -384,7 +384,7 @@ namespace osu.Game.Overlays.Mods
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
/// <remarks>
|
/// <remarks>
|
||||||
/// This method exists to be able to receive mod instances that come from potentially-external sources and to copy the changes across to this column's state.
|
/// This method exists to be able to receive mod instances that come from potentially-external sources and to copy the changes across to this column's state.
|
||||||
/// <see cref="ModSelectScreen"/> uses this to substitute any external mod references in <see cref="ModSelectScreen.SelectedMods"/>
|
/// <see cref="ModSelectOverlay"/> uses this to substitute any external mod references in <see cref="ModSelectOverlay.SelectedMods"/>
|
||||||
/// to references that are owned by this column.
|
/// to references that are owned by this column.
|
||||||
/// </remarks>
|
/// </remarks>
|
||||||
internal void SetSelection(IReadOnlyList<Mod> mods)
|
internal void SetSelection(IReadOnlyList<Mod> mods)
|
||||||
|
@ -27,7 +27,7 @@ using osuTK.Input;
|
|||||||
|
|
||||||
namespace osu.Game.Overlays.Mods
|
namespace osu.Game.Overlays.Mods
|
||||||
{
|
{
|
||||||
public abstract class ModSelectScreen : ShearedOverlayContainer, ISamplePlaybackDisabler
|
public abstract class ModSelectOverlay : ShearedOverlayContainer, ISamplePlaybackDisabler
|
||||||
{
|
{
|
||||||
protected const int BUTTON_WIDTH = 200;
|
protected const int BUTTON_WIDTH = 200;
|
||||||
|
|
||||||
@ -76,7 +76,7 @@ namespace osu.Game.Overlays.Mods
|
|||||||
|
|
||||||
private ShearedToggleButton? customisationButton;
|
private ShearedToggleButton? customisationButton;
|
||||||
|
|
||||||
protected ModSelectScreen(OverlayColourScheme colourScheme = OverlayColourScheme.Green)
|
protected ModSelectOverlay(OverlayColourScheme colourScheme = OverlayColourScheme.Green)
|
||||||
: base(colourScheme)
|
: base(colourScheme)
|
||||||
{
|
{
|
||||||
}
|
}
|
@ -10,9 +10,9 @@ using osuTK.Input;
|
|||||||
|
|
||||||
namespace osu.Game.Overlays.Mods
|
namespace osu.Game.Overlays.Mods
|
||||||
{
|
{
|
||||||
public class UserModSelectScreen : ModSelectScreen
|
public class UserModSelectOverlay : ModSelectOverlay
|
||||||
{
|
{
|
||||||
public UserModSelectScreen(OverlayColourScheme colourScheme = OverlayColourScheme.Green)
|
public UserModSelectOverlay(OverlayColourScheme colourScheme = OverlayColourScheme.Green)
|
||||||
: base(colourScheme)
|
: base(colourScheme)
|
||||||
{
|
{
|
||||||
}
|
}
|
@ -13,7 +13,7 @@ using osu.Game.Localisation;
|
|||||||
|
|
||||||
namespace osu.Game.Screens.OnlinePlay
|
namespace osu.Game.Screens.OnlinePlay
|
||||||
{
|
{
|
||||||
public class FreeModSelectScreen : ModSelectScreen
|
public class FreeModSelectOverlay : ModSelectOverlay
|
||||||
{
|
{
|
||||||
protected override bool ShowTotalMultiplier => false;
|
protected override bool ShowTotalMultiplier => false;
|
||||||
|
|
||||||
@ -23,7 +23,7 @@ namespace osu.Game.Screens.OnlinePlay
|
|||||||
set => base.IsValidMod = m => m.UserPlayable && value.Invoke(m);
|
set => base.IsValidMod = m => m.UserPlayable && value.Invoke(m);
|
||||||
}
|
}
|
||||||
|
|
||||||
public FreeModSelectScreen()
|
public FreeModSelectOverlay()
|
||||||
: base(OverlayColourScheme.Plum)
|
: base(OverlayColourScheme.Plum)
|
||||||
{
|
{
|
||||||
IsValidMod = _ => true;
|
IsValidMod = _ => true;
|
@ -81,7 +81,7 @@ namespace osu.Game.Screens.OnlinePlay.Match
|
|||||||
public readonly Room Room;
|
public readonly Room Room;
|
||||||
private readonly bool allowEdit;
|
private readonly bool allowEdit;
|
||||||
|
|
||||||
private ModSelectScreen userModsSelectOverlay;
|
private ModSelectOverlay userModsSelectOverlay;
|
||||||
|
|
||||||
[CanBeNull]
|
[CanBeNull]
|
||||||
private IDisposable userModsSelectOverlayRegistration;
|
private IDisposable userModsSelectOverlayRegistration;
|
||||||
@ -231,7 +231,7 @@ namespace osu.Game.Screens.OnlinePlay.Match
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
LoadComponent(userModsSelectOverlay = new UserModSelectScreen(OverlayColourScheme.Plum)
|
LoadComponent(userModsSelectOverlay = new UserModSelectOverlay(OverlayColourScheme.Plum)
|
||||||
{
|
{
|
||||||
SelectedMods = { BindTarget = UserMods },
|
SelectedMods = { BindTarget = UserMods },
|
||||||
IsValidMod = _ => false
|
IsValidMod = _ => false
|
||||||
|
@ -53,7 +53,7 @@ namespace osu.Game.Screens.OnlinePlay
|
|||||||
private IReadOnlyList<Mod> initialMods;
|
private IReadOnlyList<Mod> initialMods;
|
||||||
private bool itemSelected;
|
private bool itemSelected;
|
||||||
|
|
||||||
private readonly FreeModSelectScreen freeModSelectOverlay;
|
private readonly FreeModSelectOverlay freeModSelectOverlay;
|
||||||
private IDisposable freeModSelectOverlayRegistration;
|
private IDisposable freeModSelectOverlayRegistration;
|
||||||
|
|
||||||
protected OnlinePlaySongSelect(Room room)
|
protected OnlinePlaySongSelect(Room room)
|
||||||
@ -62,7 +62,7 @@ namespace osu.Game.Screens.OnlinePlay
|
|||||||
|
|
||||||
Padding = new MarginPadding { Horizontal = HORIZONTAL_OVERFLOW_PADDING };
|
Padding = new MarginPadding { Horizontal = HORIZONTAL_OVERFLOW_PADDING };
|
||||||
|
|
||||||
freeModSelectOverlay = new FreeModSelectScreen
|
freeModSelectOverlay = new FreeModSelectOverlay
|
||||||
{
|
{
|
||||||
SelectedMods = { BindTarget = FreeMods },
|
SelectedMods = { BindTarget = FreeMods },
|
||||||
IsValidMod = IsValidFreeMod,
|
IsValidMod = IsValidFreeMod,
|
||||||
@ -160,7 +160,7 @@ namespace osu.Game.Screens.OnlinePlay
|
|||||||
return base.OnExiting(e);
|
return base.OnExiting(e);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override ModSelectScreen CreateModSelectOverlay() => new UserModSelectScreen(OverlayColourScheme.Plum)
|
protected override ModSelectOverlay CreateModSelectOverlay() => new UserModSelectOverlay(OverlayColourScheme.Plum)
|
||||||
{
|
{
|
||||||
IsValidMod = IsValidMod
|
IsValidMod = IsValidMod
|
||||||
};
|
};
|
||||||
|
@ -102,7 +102,7 @@ namespace osu.Game.Screens.Select
|
|||||||
[Resolved(CanBeNull = true)]
|
[Resolved(CanBeNull = true)]
|
||||||
private LegacyImportManager legacyImportManager { get; set; }
|
private LegacyImportManager legacyImportManager { get; set; }
|
||||||
|
|
||||||
protected ModSelectScreen ModSelect { get; private set; }
|
protected ModSelectOverlay ModSelect { get; private set; }
|
||||||
|
|
||||||
protected Sample SampleConfirm { get; private set; }
|
protected Sample SampleConfirm { get; private set; }
|
||||||
|
|
||||||
@ -333,7 +333,7 @@ namespace osu.Game.Screens.Select
|
|||||||
(new FooterButtonOptions(), BeatmapOptions)
|
(new FooterButtonOptions(), BeatmapOptions)
|
||||||
};
|
};
|
||||||
|
|
||||||
protected virtual ModSelectScreen CreateModSelectOverlay() => new UserModSelectScreen();
|
protected virtual ModSelectOverlay CreateModSelectOverlay() => new UserModSelectOverlay();
|
||||||
|
|
||||||
protected virtual void ApplyFilterToCarousel(FilterCriteria criteria)
|
protected virtual void ApplyFilterToCarousel(FilterCriteria criteria)
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user