mirror of
https://github.com/ppy/osu
synced 2025-02-18 19:36:58 +00:00
Merge pull request #7577 from ProTheory8/mod-autoopen
Make Difficulty Adjust mod customisation menu open automatically
This commit is contained in:
commit
a6d97f8ee6
@ -25,6 +25,8 @@ namespace osu.Game.Tests.Visual.UserInterface
|
||||
|
||||
private readonly Mod testCustomisableMod = new TestModCustomisable1();
|
||||
|
||||
private readonly Mod testCustomisableAutoOpenMod = new TestModCustomisable2();
|
||||
|
||||
[Test]
|
||||
public void TestButtonShowsOnCustomisableMod()
|
||||
{
|
||||
@ -53,6 +55,17 @@ namespace osu.Game.Tests.Visual.UserInterface
|
||||
AddAssert("button enabled", () => modSelect.CustomiseButton.Enabled.Value);
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void TestCustomisationOpensOnModSelect()
|
||||
{
|
||||
createModSelect();
|
||||
|
||||
AddStep("open", () => modSelect.Show());
|
||||
AddAssert("Customisation closed", () => modSelect.ModSettingsContainer.Alpha == 0);
|
||||
AddStep("select mod", () => modSelect.SelectMod(testCustomisableAutoOpenMod));
|
||||
AddAssert("Customisation opened", () => modSelect.ModSettingsContainer.Alpha == 1);
|
||||
}
|
||||
|
||||
private void createModSelect()
|
||||
{
|
||||
AddStep("create mod select", () =>
|
||||
@ -128,6 +141,8 @@ namespace osu.Game.Tests.Visual.UserInterface
|
||||
public override string Name => "Customisable Mod 2";
|
||||
|
||||
public override string Acronym => "CM2";
|
||||
|
||||
public override bool RequiresConfiguration => true;
|
||||
}
|
||||
|
||||
private abstract class TestModCustomisable : Mod, IApplicableMod
|
||||
|
@ -473,7 +473,10 @@ namespace osu.Game.Overlays.Mods
|
||||
if (selectedMod != null)
|
||||
{
|
||||
if (State.Value == Visibility.Visible) sampleOn?.Play();
|
||||
|
||||
DeselectTypes(selectedMod.IncompatibleMods, true);
|
||||
|
||||
if (selectedMod.RequiresConfiguration) ModSettingsContainer.Alpha = 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -60,6 +60,12 @@ namespace osu.Game.Rulesets.Mods
|
||||
[JsonIgnore]
|
||||
public virtual bool Ranked => false;
|
||||
|
||||
/// <summary>
|
||||
/// Whether this mod requires configuration to apply changes to the game.
|
||||
/// </summary>
|
||||
[JsonIgnore]
|
||||
public virtual bool RequiresConfiguration => false;
|
||||
|
||||
/// <summary>
|
||||
/// The mods this mod cannot be enabled with.
|
||||
/// </summary>
|
||||
|
@ -24,6 +24,8 @@ namespace osu.Game.Rulesets.Mods
|
||||
|
||||
public override double ScoreMultiplier => 1.0;
|
||||
|
||||
public override bool RequiresConfiguration => true;
|
||||
|
||||
public override Type[] IncompatibleMods => new[] { typeof(ModEasy), typeof(ModHardRock) };
|
||||
|
||||
[SettingSource("Drain Rate", "Override a beatmap's set HP.")]
|
||||
|
Loading…
Reference in New Issue
Block a user