Added DeselectAll

This commit is contained in:
DrabWeb 2017-02-18 11:40:05 -04:00
parent a024353574
commit 3f5d155583
2 changed files with 24 additions and 4 deletions

View File

@ -121,6 +121,14 @@ public Color4 SelectedColour
} }
} }
public void DeselectAll()
{
foreach (ModButton button in buttons)
{
button.Deselect();
}
}
private void buttonPressed(Mod mod) private void buttonPressed(Mod mod)
{ {
Action?.Invoke(SelectedMods); Action?.Invoke(SelectedMods);

View File

@ -97,6 +97,13 @@ protected override void OnFocusLost(InputState state)
base.OnFocusLost(state); base.OnFocusLost(state);
} }
[BackgroundDependencyLoader]
private void load(OsuColour colours)
{
low_multiplier_colour = colours.Red;
high_multiplier_colour = colours.Green;
}
protected override void PopIn() protected override void PopIn()
{ {
base.PopIn(); base.PopIn();
@ -135,11 +142,15 @@ protected override void TransitionOut()
} }
} }
[BackgroundDependencyLoader] public void DeselectAll()
private void load(OsuColour colours)
{ {
low_multiplier_colour = colours.Red; foreach (ModSection section in sections)
high_multiplier_colour = colours.Green; {
foreach (ModButton button in section.Buttons)
{
button.Deselect();
}
}
} }
private void modButtonPressed(Mod[] sectionSelectedMods) private void modButtonPressed(Mod[] sectionSelectedMods)
@ -205,6 +216,7 @@ private void modButtonPressed(Mod[] sectionSelectedMods)
// 1.00x // 1.00x
// 1.05x // 1.05x
// 1.20x // 1.20x
multiplierLabel.Text = string.Format("{0:N2}x", multiplier); multiplierLabel.Text = string.Format("{0:N2}x", multiplier);
rankedLabel.Text = $"{ranked ? @"Ranked" : @"Unranked"}, Score Multiplier: "; rankedLabel.Text = $"{ranked ? @"Ranked" : @"Unranked"}, Score Multiplier: ";
if (multiplier > 1.0) if (multiplier > 1.0)