CreateModSections -> GetModsFor(PlayMode), fixed deselect not working in ModSelectOverlay, added MultiMod for multiple mods in one mod, fixed issues with SelectedColour in ModSection

This commit is contained in:
DrabWeb
2017-03-02 01:07:28 -04:00
parent 6c680825ed
commit 1eee587c18
15 changed files with 339 additions and 502 deletions

View File

@ -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;
}
}
}