mirror of
https://github.com/osukey/osukey.git
synced 2025-07-02 08:49:59 +09:00
Simplify SelectedMods.
This commit is contained in:
@ -2,7 +2,6 @@
|
|||||||
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
||||||
|
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
|
||||||
using OpenTK;
|
using OpenTK;
|
||||||
using OpenTK.Graphics;
|
using OpenTK.Graphics;
|
||||||
using OpenTK.Input;
|
using OpenTK.Input;
|
||||||
@ -30,23 +29,6 @@ namespace osu.Game.Overlays.Mods
|
|||||||
public Action<Mod> Action;
|
public Action<Mod> Action;
|
||||||
protected virtual Key[] ToggleKeys => new Key[] { };
|
protected virtual Key[] ToggleKeys => new Key[] { };
|
||||||
|
|
||||||
public Mod[] SelectedMods
|
|
||||||
{
|
|
||||||
get
|
|
||||||
{
|
|
||||||
List<Mod> selectedMods = new List<Mod>();
|
|
||||||
|
|
||||||
foreach (ModButton button in Buttons)
|
|
||||||
{
|
|
||||||
Mod selectedMod = button.SelectedMod;
|
|
||||||
if (selectedMod != null)
|
|
||||||
selectedMods.Add(selectedMod);
|
|
||||||
}
|
|
||||||
|
|
||||||
return selectedMods.ToArray();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private string header;
|
private string header;
|
||||||
public string Header
|
public string Header
|
||||||
{
|
{
|
||||||
|
@ -3,7 +3,6 @@
|
|||||||
|
|
||||||
using System;
|
using System;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Collections.Generic;
|
|
||||||
using OpenTK;
|
using OpenTK;
|
||||||
using OpenTK.Graphics;
|
using OpenTK.Graphics;
|
||||||
using osu.Framework.Configuration;
|
using osu.Framework.Configuration;
|
||||||
@ -189,17 +188,7 @@ namespace osu.Game.Overlays.Mods
|
|||||||
|
|
||||||
private void refreshSelectedMods()
|
private void refreshSelectedMods()
|
||||||
{
|
{
|
||||||
List<Mod> selectedMods = new List<Mod>();
|
SelectedMods.Value = modSectionsContainer.Children.SelectMany(s => s.Buttons.Select(x => x.SelectedMod).Where(x => x != null)).ToArray();
|
||||||
|
|
||||||
foreach (ModSection section in modSectionsContainer.Children)
|
|
||||||
{
|
|
||||||
foreach (Mod mod in section.SelectedMods)
|
|
||||||
{
|
|
||||||
selectedMods.Add(mod);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
SelectedMods.Value = selectedMods.ToArray();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public ModSelectOverlay()
|
public ModSelectOverlay()
|
||||||
|
Reference in New Issue
Block a user