From 3f5d15558339454dd741439b6cbd3ca3fa810836 Mon Sep 17 00:00:00 2001 From: DrabWeb Date: Sat, 18 Feb 2017 11:40:05 -0400 Subject: [PATCH] Added DeselectAll --- osu.Game/Overlays/Mods/ModSection.cs | 8 ++++++++ osu.Game/Overlays/Mods/ModSelectOverlay.cs | 20 ++++++++++++++++---- 2 files changed, 24 insertions(+), 4 deletions(-) diff --git a/osu.Game/Overlays/Mods/ModSection.cs b/osu.Game/Overlays/Mods/ModSection.cs index 644460c073..8f829c998b 100644 --- a/osu.Game/Overlays/Mods/ModSection.cs +++ b/osu.Game/Overlays/Mods/ModSection.cs @@ -121,6 +121,14 @@ namespace osu.Game.Overlays.Mods } } + public void DeselectAll() + { + foreach (ModButton button in buttons) + { + button.Deselect(); + } + } + private void buttonPressed(Mod mod) { Action?.Invoke(SelectedMods); diff --git a/osu.Game/Overlays/Mods/ModSelectOverlay.cs b/osu.Game/Overlays/Mods/ModSelectOverlay.cs index af23b47696..52d76f0941 100644 --- a/osu.Game/Overlays/Mods/ModSelectOverlay.cs +++ b/osu.Game/Overlays/Mods/ModSelectOverlay.cs @@ -97,6 +97,13 @@ namespace osu.Game.Overlays.Mods base.OnFocusLost(state); } + [BackgroundDependencyLoader] + private void load(OsuColour colours) + { + low_multiplier_colour = colours.Red; + high_multiplier_colour = colours.Green; + } + protected override void PopIn() { base.PopIn(); @@ -135,11 +142,15 @@ namespace osu.Game.Overlays.Mods } } - [BackgroundDependencyLoader] - private void load(OsuColour colours) + public void DeselectAll() { - low_multiplier_colour = colours.Red; - high_multiplier_colour = colours.Green; + foreach (ModSection section in sections) + { + foreach (ModButton button in section.Buttons) + { + button.Deselect(); + } + } } private void modButtonPressed(Mod[] sectionSelectedMods) @@ -205,6 +216,7 @@ namespace osu.Game.Overlays.Mods // 1.00x // 1.05x // 1.20x + multiplierLabel.Text = string.Format("{0:N2}x", multiplier); rankedLabel.Text = $"{ranked ? @"Ranked" : @"Unranked"}, Score Multiplier: "; if (multiplier > 1.0)