diff --git a/osu.Game.Modes.Catch/CatchMod.cs b/osu.Game.Modes.Catch/CatchMod.cs index 3cebab8cf2..f8edd1845f 100644 --- a/osu.Game.Modes.Catch/CatchMod.cs +++ b/osu.Game.Modes.Catch/CatchMod.cs @@ -56,4 +56,9 @@ namespace osu.Game.Modes.Catch public override double ScoreMultiplier => 1.12; public override Mods[] DisablesMods => new Mods[] { }; } + + public class CatchModPerfect : ModPerfect + { + + } } diff --git a/osu.Game.Modes.Catch/CatchRuleset.cs b/osu.Game.Modes.Catch/CatchRuleset.cs index 95b6d15e39..16bf0e6b42 100644 --- a/osu.Game.Modes.Catch/CatchRuleset.cs +++ b/osu.Game.Modes.Catch/CatchRuleset.cs @@ -33,110 +33,60 @@ namespace osu.Game.Modes.Catch new CatchModFlashlight(), }; - public override IEnumerable CreateModSections() => new ModSection[] + public override IEnumerable GetModsFor(ModType type) { - new DifficultyReductionSection + switch (type) { - Buttons = new[] - { - new ModButton + case ModType.DifficultyReduction: + return new Mod[] { - ToggleKey = Key.Q, - Mods = new Mod[] - { - new CatchModEasy(), - }, - }, - new ModButton + new CatchModEasy(), + new CatchModNoFail(), + new CatchModHalfTime(), + }; + + case ModType.DifficultyIncrease: + return new Mod[] { - ToggleKey = Key.W, - Mods = new Mod[] + new CatchModHardRock(), + new MultiMod { - new CatchModNoFail(), + Mods = new Mod[] + { + new CatchModPerfect(), + new CatchModSuddenDeath(), + }, }, - }, - new ModButton + new MultiMod + { + Mods = new Mod[] + { + new CatchModDoubleTime(), + new CatchModNightcore(), + }, + }, + new CatchModHidden(), + new CatchModFlashlight(), + }; + + case ModType.Special: + return new Mod[] { - ToggleKey = Key.E, - Mods = new Mod[] + new CatchModRelax(), + new MultiMod { - new CatchModHalfTime(), + Mods = new Mod[] + { + new ModAutoplay(), + new ModCinema(), + }, }, - }, - }, - }, - new DifficultyIncreaseSection - { - Buttons = new ModButton[] - { - new ModButton - { - ToggleKey = Key.A, - Mods = new Mod[] - { - new CatchModHardRock(), - }, - }, - new ModButton - { - ToggleKey = Key.S, - Mods = new Mod[] - { - new CatchModSuddenDeath(), - new ModPerfect(), - }, - }, - new ModButton - { - ToggleKey = Key.D, - Mods = new Mod[] - { - new CatchModDoubleTime(), - new CatchModNightcore(), - }, - }, - new ModButton - { - ToggleKey = Key.F, - Mods = new Mod[] - { - new CatchModHidden(), - }, - }, - new ModButton - { - ToggleKey = Key.G, - Mods = new Mod[] - { - new CatchModFlashlight(), - }, - }, - }, - }, - new AssistedSection - { - Buttons = new[] - { - new ModButton - { - ToggleKey = Key.Z, - Mods = new Mod[] - { - new CatchModRelax(), - }, - }, - new ModButton - { - ToggleKey = Key.B, - Mods = new Mod[] - { - new ModAutoplay(), - new ModCinema(), - }, - }, - } - }, - }; + }; + + default: + return new Mod[] { }; + } + } protected override PlayMode PlayMode => PlayMode.Catch; diff --git a/osu.Game.Modes.Mania/ManiaMod.cs b/osu.Game.Modes.Mania/ManiaMod.cs index 9c056a0663..7cd1ee2e79 100644 --- a/osu.Game.Modes.Mania/ManiaMod.cs +++ b/osu.Game.Modes.Mania/ManiaMod.cs @@ -54,6 +54,11 @@ namespace osu.Game.Modes.Mania public override Mods[] DisablesMods => new Mods[] { Mods.Hidden }; } + public class ManiaModPerfect : ModPerfect + { + + } + public class ManiaModFadeIn : Mod { public override Mods Name => Mods.FadeIn; diff --git a/osu.Game.Modes.Mania/ManiaRuleset.cs b/osu.Game.Modes.Mania/ManiaRuleset.cs index 5bbbc6e76c..24850e7c25 100644 --- a/osu.Game.Modes.Mania/ManiaRuleset.cs +++ b/osu.Game.Modes.Mania/ManiaRuleset.cs @@ -44,134 +44,76 @@ namespace osu.Game.Modes.Mania new ManiaModKeyCoop(), }; - public override IEnumerable CreateModSections() => new ModSection[] + public override IEnumerable GetModsFor(ModType type) { - new DifficultyReductionSection + switch (type) { - Buttons = new[] - { - new ModButton + case ModType.DifficultyReduction: + return new Mod[] { - ToggleKey = Key.Q, - Mods = new Mod[] - { - new ManiaModEasy(), - }, - }, - new ModButton + new ManiaModEasy(), + new ManiaModNoFail(), + new ManiaModHalfTime(), + }; + + case ModType.DifficultyIncrease: + return new Mod[] { - ToggleKey = Key.W, - Mods = new Mod[] + new ManiaModHardRock(), + new MultiMod { - new ManiaModNoFail(), + Mods = new Mod[] + { + new ManiaModPerfect(), + new ManiaModSuddenDeath(), + }, }, - }, - new ModButton + new MultiMod + { + Mods = new Mod[] + { + new ManiaModDoubleTime(), + new ManiaModNightcore(), + }, + }, + new ManiaModHidden(), + new ManiaModFlashlight(), + }; + + case ModType.Special: + return new Mod[] { - ToggleKey = Key.E, - Mods = new Mod[] + new MultiMod { - new ManiaModHalfTime(), + Mods = new Mod[] + { + new ManiaModKey4(), + new ManiaModKey5(), + new ManiaModKey6(), + new ManiaModKey7(), + new ManiaModKey8(), + new ManiaModKey9(), + new ManiaModKey1(), + new ManiaModKey2(), + new ManiaModKey3(), + }, }, - }, - }, - }, - new DifficultyIncreaseSection - { - Buttons = new ModButton[] - { - new ModButton - { - ToggleKey = Key.A, - Mods = new Mod[] + new ManiaModKeyCoop(), + new ManiaModRandom(), + new MultiMod { - new ManiaModHardRock(), + Mods = new Mod[] + { + new ModAutoplay(), + new ModCinema(), + }, }, - }, - new ModButton - { - ToggleKey = Key.S, - Mods = new Mod[] - { - new ManiaModSuddenDeath(), - new ModPerfect(), - }, - }, - new ModButton - { - ToggleKey = Key.D, - Mods = new Mod[] - { - new ManiaModDoubleTime(), - new ManiaModNightcore(), - }, - }, - new ModButton - { - ToggleKey = Key.F, - Mods = new Mod[] - { - new ManiaModHidden(), - }, - }, - new ModButton - { - ToggleKey = Key.G, - Mods = new Mod[] - { - new ManiaModFlashlight(), - }, - }, - }, - }, - new AssistedSection - { - Buttons = new[] - { - new ModButton - { - ToggleKey = Key.Z, - Mods = new Mod[] - { - new ManiaModKey4(), - new ManiaModKey5(), - new ManiaModKey6(), - new ManiaModKey7(), - new ManiaModKey8(), - new ManiaModKey9(), - new ManiaModKey1(), - new ManiaModKey2(), - new ManiaModKey3(), - }, - }, - new ModButton - { - ToggleKey = Key.X, - Mods = new Mod[] - { - new ManiaModKeyCoop(), - }, - }, - new ModButton - { - ToggleKey = Key.C, - Mods = new Mod[] - { - new ManiaModRandom(), - }, - }, - new ModButton - { - ToggleKey = Key.V, - Mods = new Mod[] - { - new ModAutoplay(), - new ModCinema(), - }, - }, - } - }, - }; + }; + + default: + return new Mod[] { }; + } + } protected override PlayMode PlayMode => PlayMode.Mania; diff --git a/osu.Game.Modes.Osu/OsuMod.cs b/osu.Game.Modes.Osu/OsuMod.cs index 6f28786fa2..790b87204f 100644 --- a/osu.Game.Modes.Osu/OsuMod.cs +++ b/osu.Game.Modes.Osu/OsuMod.cs @@ -59,6 +59,11 @@ namespace osu.Game.Modes.Osu public override Mods[] DisablesMods => new Mods[] { }; } + public class OsuModPerfect : ModPerfect + { + + } + public class OsuModSpunOut : Mod { public override Mods Name => Mods.SpunOut; diff --git a/osu.Game.Modes.Osu/OsuRuleset.cs b/osu.Game.Modes.Osu/OsuRuleset.cs index 8df956bdce..f596fb063d 100644 --- a/osu.Game.Modes.Osu/OsuRuleset.cs +++ b/osu.Game.Modes.Osu/OsuRuleset.cs @@ -53,134 +53,63 @@ namespace osu.Game.Modes.Osu new OsuModTarget(), }; - public override IEnumerable CreateModSections() => new ModSection[] + public override IEnumerable GetModsFor(ModType type) { - new DifficultyReductionSection + switch (type) { - Buttons = new[] - { - new ModButton + case ModType.DifficultyReduction: + return new Mod[] { - ToggleKey = Key.Q, - Mods = new Mod[] - { - new OsuModEasy(), - }, - }, - new ModButton + new OsuModEasy(), + new OsuModNoFail(), + new OsuModHalfTime(), + }; + + case ModType.DifficultyIncrease: + return new Mod[] { - ToggleKey = Key.W, - Mods = new Mod[] + new OsuModHardRock(), + new MultiMod { - new OsuModNoFail(), + Mods = new Mod[] + { + new OsuModSuddenDeath(), + new OsuModPerfect(), + }, }, - }, - new ModButton + new MultiMod + { + Mods = new Mod[] + { + new OsuModDoubleTime(), + new OsuModNightcore(), + }, + }, + new OsuModHidden(), + new OsuModFlashlight(), + }; + + case ModType.Special: + return new Mod[] { - ToggleKey = Key.E, - Mods = new Mod[] + new OsuModRelax(), + new OsuModAutopilot(), + new OsuModTarget(), + new OsuModSpunOut(), + new MultiMod { - new OsuModHalfTime(), + Mods = new Mod[] + { + new ModAutoplay(), + new ModCinema(), + }, }, - }, - }, - }, - new DifficultyIncreaseSection - { - Buttons = new ModButton[] - { - new ModButton - { - ToggleKey = Key.A, - Mods = new Mod[] - { - new OsuModHardRock(), - }, - }, - new ModButton - { - ToggleKey = Key.S, - Mods = new Mod[] - { - new OsuModSuddenDeath(), - new ModPerfect(), - }, - }, - new ModButton - { - ToggleKey = Key.D, - Mods = new Mod[] - { - new OsuModDoubleTime(), - new OsuModNightcore(), - }, - }, - new ModButton - { - ToggleKey = Key.F, - Mods = new Mod[] - { - new OsuModHidden(), - }, - }, - new ModButton - { - ToggleKey = Key.G, - Mods = new Mod[] - { - new OsuModFlashlight(), - }, - }, - }, - }, - new AssistedSection - { - Buttons = new[] - { - new ModButton - { - ToggleKey = Key.Z, - Mods = new Mod[] - { - new OsuModRelax(), - }, - }, - new ModButton - { - ToggleKey = Key.X, - Mods = new Mod[] - { - new OsuModAutopilot(), - }, - }, - new ModButton - { - ToggleKey = Key.C, - Mods = new Mod[] - { - new OsuModTarget(), - }, - }, - new ModButton - { - ToggleKey = Key.V, - Mods = new Mod[] - { - new OsuModSpunOut(), - }, - }, - new ModButton - { - ToggleKey = Key.B, - Mods = new Mod[] - { - new ModAutoplay(), - new ModCinema(), - }, - }, - } - }, - }; + }; + + default: + return new Mod[] { }; + } + } public override FontAwesome Icon => FontAwesome.fa_osu_osu_o; diff --git a/osu.Game.Modes.Taiko/TaikoMod.cs b/osu.Game.Modes.Taiko/TaikoMod.cs index 95bab294a3..104c3fe1e2 100644 --- a/osu.Game.Modes.Taiko/TaikoMod.cs +++ b/osu.Game.Modes.Taiko/TaikoMod.cs @@ -56,4 +56,9 @@ namespace osu.Game.Modes.Taiko public override double ScoreMultiplier => 1.12; public override Mods[] DisablesMods => new Mods[] { }; } + + public class TaikoModPerfect : ModPerfect + { + + } } diff --git a/osu.Game.Modes.Taiko/TaikoRuleset.cs b/osu.Game.Modes.Taiko/TaikoRuleset.cs index c3f36c74af..90a21f96bc 100644 --- a/osu.Game.Modes.Taiko/TaikoRuleset.cs +++ b/osu.Game.Modes.Taiko/TaikoRuleset.cs @@ -33,110 +33,60 @@ namespace osu.Game.Modes.Taiko new TaikoModFlashlight(), }; - public override IEnumerable CreateModSections() => new ModSection[] + public override IEnumerable GetModsFor(ModType type) { - new DifficultyReductionSection + switch (type) { - Buttons = new[] - { - new ModButton + case ModType.DifficultyReduction: + return new Mod[] { - ToggleKey = Key.Q, - Mods = new Mod[] - { - new TaikoModEasy(), - }, - }, - new ModButton + new TaikoModEasy(), + new TaikoModNoFail(), + new TaikoModHalfTime(), + }; + + case ModType.DifficultyIncrease: + return new Mod[] { - ToggleKey = Key.W, - Mods = new Mod[] + new TaikoModHardRock(), + new MultiMod { - new TaikoModNoFail(), + Mods = new Mod[] + { + new TaikoModPerfect(), + new TaikoModSuddenDeath(), + }, }, - }, - new ModButton + new MultiMod + { + Mods = new Mod[] + { + new TaikoModDoubleTime(), + new TaikoModNightcore(), + }, + }, + new TaikoModHidden(), + new TaikoModFlashlight(), + }; + + case ModType.Special: + return new Mod[] { - ToggleKey = Key.E, - Mods = new Mod[] + new TaikoModRelax(), + new MultiMod { - new TaikoModHalfTime(), + Mods = new Mod[] + { + new ModAutoplay(), + new ModCinema(), + }, }, - }, - }, - }, - new DifficultyIncreaseSection - { - Buttons = new ModButton[] - { - new ModButton - { - ToggleKey = Key.A, - Mods = new Mod[] - { - new TaikoModHardRock(), - }, - }, - new ModButton - { - ToggleKey = Key.S, - Mods = new Mod[] - { - new TaikoModSuddenDeath(), - new ModPerfect(), - }, - }, - new ModButton - { - ToggleKey = Key.D, - Mods = new Mod[] - { - new TaikoModDoubleTime(), - new TaikoModNightcore(), - }, - }, - new ModButton - { - ToggleKey = Key.F, - Mods = new Mod[] - { - new TaikoModHidden(), - }, - }, - new ModButton - { - ToggleKey = Key.G, - Mods = new Mod[] - { - new TaikoModFlashlight(), - }, - }, - }, - }, - new AssistedSection - { - Buttons = new[] - { - new ModButton - { - ToggleKey = Key.Z, - Mods = new Mod[] - { - new TaikoModRelax(), - }, - }, - new ModButton - { - ToggleKey = Key.B, - Mods = new Mod[] - { - new ModAutoplay(), - new ModCinema(), - }, - }, - } - }, - }; + }; + + default: + return new Mod[] { }; + } + } protected override PlayMode PlayMode => PlayMode.Taiko; diff --git a/osu.Game/Modes/Mod.cs b/osu.Game/Modes/Mod.cs index d6139056e8..2d0a26f208 100644 --- a/osu.Game/Modes/Mod.cs +++ b/osu.Game/Modes/Mod.cs @@ -43,6 +43,18 @@ namespace osu.Game.Modes public abstract Mods[] DisablesMods { get; } } + public class MultiMod : Mod + { + public override Mods Name => Modes.Mods.None; + public override FontAwesome Icon => FontAwesome.fa_close; + public override string Description => @""; + public override double ScoreMultiplier => 0.0; + public override bool Ranked => false; + public override Mods[] DisablesMods => new Mods[] { }; + + public Mod[] Mods; + } + public abstract class ModNoFail : Mod { public override Mods Name => Mods.NoFail; @@ -140,7 +152,7 @@ namespace osu.Game.Modes public override Mods[] DisablesMods => new Mods[] { Mods.Relax, Mods.Autopilot, Mods.SpunOut, Mods.SuddenDeath, Mods.Perfect }; } - public class ModPerfect : ModSuddenDeath + public abstract class ModPerfect : ModSuddenDeath { public override Mods Name => Mods.Perfect; public override FontAwesome Icon => FontAwesome.fa_osu_mod_perfect; @@ -250,4 +262,11 @@ namespace osu.Game.Modes FreeModAllowed = NoFail | Easy | Hidden | HardRock | SuddenDeath | Flashlight | FadeIn | Relax | Autopilot | SpunOut | KeyMod, ScoreIncreaseMods = Hidden | HardRock | DoubleTime | Flashlight | FadeIn } + + public enum ModType + { + DifficultyReduction, + DifficultyIncrease, + Special, + } } diff --git a/osu.Game/Modes/Ruleset.cs b/osu.Game/Modes/Ruleset.cs index f108732d18..212449af63 100644 --- a/osu.Game/Modes/Ruleset.cs +++ b/osu.Game/Modes/Ruleset.cs @@ -29,7 +29,7 @@ namespace osu.Game.Modes public abstract IEnumerable AvailableMods { get; } - public abstract IEnumerable CreateModSections(); + public abstract IEnumerable GetModsFor(ModType type); public abstract ScoreProcessor CreateScoreProcessor(int hitObjectCount); diff --git a/osu.Game/Overlays/Mods/AssistedSection.cs b/osu.Game/Overlays/Mods/AssistedSection.cs index 67a5c2015a..08a7b5db6c 100644 --- a/osu.Game/Overlays/Mods/AssistedSection.cs +++ b/osu.Game/Overlays/Mods/AssistedSection.cs @@ -1,14 +1,11 @@ // Copyright (c) 2007-2017 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE -using System; -using OpenTK.Input; using osu.Framework.Allocation; using osu.Game.Graphics; using osu.Game.Modes; -using osu.Game.Overlays.Mods; -namespace osu.Game +namespace osu.Game.Overlays.Mods { public class AssistedSection : ModSection { diff --git a/osu.Game/Overlays/Mods/DifficultyIncreaseSection.cs b/osu.Game/Overlays/Mods/DifficultyIncreaseSection.cs index 703748f815..2ae7b06386 100644 --- a/osu.Game/Overlays/Mods/DifficultyIncreaseSection.cs +++ b/osu.Game/Overlays/Mods/DifficultyIncreaseSection.cs @@ -1,13 +1,10 @@ // Copyright (c) 2007-2017 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE -using OpenTK.Input; using osu.Framework.Allocation; using osu.Game.Graphics; -using osu.Game.Modes; -using osu.Game.Overlays.Mods; -namespace osu.Game +namespace osu.Game.Overlays.Mods { public class DifficultyIncreaseSection : ModSection { diff --git a/osu.Game/Overlays/Mods/ModButton.cs b/osu.Game/Overlays/Mods/ModButton.cs index fb20116c46..4c309a4953 100644 --- a/osu.Game/Overlays/Mods/ModButton.cs +++ b/osu.Game/Overlays/Mods/ModButton.cs @@ -100,25 +100,38 @@ namespace osu.Game.Overlays.Mods } } - private Mod[] mods; - public Mod[] Mods + private Mod mod; + public Mod Mod { get { - return mods; + return mod; } set { - if (mods == value) return; - mods = value; - createIcons(); - if (value.Length > 0) + if (mod == value) return; + mod = value; + + if (mod is MultiMod) { - displayMod(value[0]); + mods = ((MultiMod)mod).Mods; + } + else + { + mods = new Mod[] { mod }; + } + + createIcons(); + if (mods.Length > 0) + { + displayMod(mods[0]); } } } + private Mod[] mods; + public Mod[] Mods => mods; // the mods from Mod, only multiple if Mod is a MultiMod + public Mod SelectedMod => Mods.ElementAtOrDefault(selectedMod); [BackgroundDependencyLoader] @@ -233,7 +246,7 @@ namespace osu.Game.Overlays.Mods return base.OnKeyDown(state, args); } - public ModButton() + public ModButton(Mod m) { Direction = FlowDirections.Vertical; Spacing = new Vector2(0f, -5f); @@ -263,6 +276,8 @@ namespace osu.Game.Overlays.Mods TextSize = 18, }, }; + + Mod = m; } } } diff --git a/osu.Game/Overlays/Mods/ModSection.cs b/osu.Game/Overlays/Mods/ModSection.cs index 013816e865..d70ed686a2 100644 --- a/osu.Game/Overlays/Mods/ModSection.cs +++ b/osu.Game/Overlays/Mods/ModSection.cs @@ -37,9 +37,7 @@ namespace osu.Game.Overlays.Mods { Mod selectedMod = button.SelectedMod; if (selectedMod != null) - { selectedMods.Add(selectedMod); - } } return selectedMods.ToArray(); @@ -75,6 +73,7 @@ namespace osu.Game.Overlays.Mods foreach (ModButton button in value) { button.Colour = Colour; + button.SelectedColour = selectedColour; button.Action = buttonPressed; } diff --git a/osu.Game/Overlays/Mods/ModSelectOverlay.cs b/osu.Game/Overlays/Mods/ModSelectOverlay.cs index d8e0787d84..c4ac7aa07e 100644 --- a/osu.Game/Overlays/Mods/ModSelectOverlay.cs +++ b/osu.Game/Overlays/Mods/ModSelectOverlay.cs @@ -1,6 +1,7 @@ // Copyright (c) 2007-2017 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE +using System.Linq; using System.Collections.Generic; using OpenTK; using OpenTK.Graphics; @@ -10,11 +11,11 @@ using osu.Framework.Graphics.Containers; using osu.Framework.Graphics.Primitives; using osu.Framework.Graphics.Sprites; using osu.Framework.Graphics.Transforms; +using osu.Framework.Allocation; using osu.Game.Graphics; using osu.Game.Graphics.Backgrounds; using osu.Game.Graphics.Sprites; using osu.Game.Modes; -using osu.Framework.Allocation; namespace osu.Game.Overlays.Mods { @@ -43,17 +44,35 @@ namespace osu.Game.Overlays.Mods set { modMode = value; + var ruleset = Ruleset.GetRuleset(value); - modSectionsContainer.RemoveAll(delegate (ModSection m) { return true; }); - foreach (ModSection s in Ruleset.GetRuleset(value).CreateModSections()) + modSectionsContainer.Children = new ModSection[] { - s.RelativeSizeAxes = Axes.X; - s.Origin = Anchor.TopCentre; - s.Anchor = Anchor.TopCentre; - s.Action = modButtonPressed; - - modSectionsContainer.Add(s); - } + new DifficultyReductionSection + { + RelativeSizeAxes = Axes.X, + Origin = Anchor.TopCentre, + Anchor = Anchor.TopCentre, + Action = modButtonPressed, + Buttons = ruleset.GetModsFor(ModType.DifficultyReduction).Select(m => new ModButton(m)).ToArray(), + }, + new DifficultyIncreaseSection + { + RelativeSizeAxes = Axes.X, + Origin = Anchor.TopCentre, + Anchor = Anchor.TopCentre, + Action = modButtonPressed, + Buttons = ruleset.GetModsFor(ModType.DifficultyIncrease).Select(m => new ModButton(m)).ToArray(), + }, + new AssistedSection + { + RelativeSizeAxes = Axes.X, + Origin = Anchor.TopCentre, + Anchor = Anchor.TopCentre, + Action = modButtonPressed, + Buttons = ruleset.GetModsFor(ModType.Special).Select(m => new ModButton(m)).ToArray(), + }, + }; } } @@ -109,51 +128,6 @@ namespace osu.Game.Overlays.Mods } } - private void modButtonPressed(Mod selectedMod) - { - if (selectedMod != null) - { - foreach (Modes.Mods disableMod in selectedMod.DisablesMods) - { - DeselectMod(disableMod); - } - refreshSelectedMods(); - } - - double multiplier = 1; - bool ranked = true; - - foreach (Mod mod in SelectedMods.Value) - { - multiplier *= mod.ScoreMultiplier; - - if (ranked) - { - ranked = mod.Ranked; - } - } - - // 1.00x - // 1.05x - // 1.20x - - multiplierLabel.Text = string.Format("{0:N2}x", multiplier); - string rankedString = ranked ? "Ranked" : "Unranked"; - rankedLabel.Text = $@"{rankedString}, Score Multiplier: "; - if (multiplier > 1.0) - { - multiplierLabel.FadeColour(highMultiplierColour, 200); - } - else if (multiplier < 1.0) - { - multiplierLabel.FadeColour(lowMultiplierColour, 200); - } - else - { - multiplierLabel.FadeColour(Color4.White, 200); - } - } - public void DeselectMod(Modes.Mods modName) { foreach (ModSection section in modSectionsContainer.Children) @@ -172,6 +146,51 @@ namespace osu.Game.Overlays.Mods } } + private void modButtonPressed(Mod selectedMod) + { + if (selectedMod != null) + { + foreach (Modes.Mods disableMod in selectedMod.DisablesMods) + { + DeselectMod(disableMod); + } + } + + refreshSelectedMods(); + + double multiplier = 1.0; + bool ranked = true; + + foreach (Mod mod in SelectedMods.Value) + { + multiplier *= mod.ScoreMultiplier; + + if (ranked) + ranked = mod.Ranked; + } + + // 1.00x + // 1.05x + // 1.20x + + multiplierLabel.Text = string.Format("{0:N2}x", multiplier); + string rankedString = ranked ? "Ranked" : "Unranked"; + rankedLabel.Text = $@"{rankedString}, Score Multiplier: "; + + if (multiplier > 1.0) + { + multiplierLabel.FadeColour(highMultiplierColour, 200); + } + else if (multiplier < 1.0) + { + multiplierLabel.FadeColour(lowMultiplierColour, 200); + } + else + { + multiplierLabel.FadeColour(Color4.White, 200); + } + } + private void refreshSelectedMods() { List selectedMods = new List();