mirror of
https://github.com/ppy/osu.git
synced 2025-02-15 21:42:55 +08:00
Simplify and add null check
This commit is contained in:
parent
25d2d9ba5c
commit
9c039848bc
@ -388,9 +388,8 @@ namespace osu.Game.Online.Leaderboards
|
||||
|
||||
private void getMods()
|
||||
{
|
||||
songSelect.ModSelect.DeselectAll(true);
|
||||
|
||||
songSelect.Mods.Value = score.Mods;
|
||||
if (songSelect != null)
|
||||
songSelect.Mods.Value = score.Mods;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -95,7 +95,7 @@ namespace osu.Game.Overlays.Mods
|
||||
return base.OnKeyDown(e);
|
||||
}
|
||||
|
||||
public void DeselectAll(bool immediate = false) => DeselectTypes(buttons.Select(b => b.SelectedMod?.GetType()).Where(t => t != null), immediate);
|
||||
public void DeselectAll() => DeselectTypes(buttons.Select(b => b.SelectedMod?.GetType()).Where(t => t != null));
|
||||
|
||||
/// <summary>
|
||||
/// Deselect one or more mods in this section.
|
||||
|
@ -231,7 +231,7 @@ namespace osu.Game.Overlays.Mods
|
||||
{
|
||||
Width = 180,
|
||||
Text = "Deselect All",
|
||||
Action = () => DeselectAll(),
|
||||
Action = DeselectAll,
|
||||
Origin = Anchor.CentreLeft,
|
||||
Anchor = Anchor.CentreLeft,
|
||||
},
|
||||
@ -328,10 +328,10 @@ namespace osu.Game.Overlays.Mods
|
||||
sampleOff = audio.Samples.Get(@"UI/check-off");
|
||||
}
|
||||
|
||||
public void DeselectAll(bool immediate = false)
|
||||
public void DeselectAll()
|
||||
{
|
||||
foreach (var section in ModSectionsContainer.Children)
|
||||
section.DeselectAll(immediate);
|
||||
section.DeselectAll();
|
||||
|
||||
refreshSelectedMods();
|
||||
}
|
||||
|
@ -86,7 +86,7 @@ namespace osu.Game.Screens.Select
|
||||
[Resolved]
|
||||
private BeatmapManager beatmaps { get; set; }
|
||||
|
||||
public ModSelectOverlay ModSelect { get; private set; }
|
||||
protected ModSelectOverlay ModSelect { get; private set; }
|
||||
|
||||
protected SampleChannel SampleConfirm { get; private set; }
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user