Make KeyBindingOverlay support variants as settings sub sections.

This commit is contained in:
smoogipooo
2017-08-23 12:49:30 +09:00
parent 38a4c84163
commit c1860f2ce2
6 changed files with 63 additions and 30 deletions

View File

@ -2,20 +2,26 @@
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
using osu.Game.Graphics;
using osu.Game.Overlays.Settings;
using osu.Game.Rulesets;
namespace osu.Game.Overlays.KeyBinding
{
public class RulesetBindingsSection : KeyBindingsSection
public class RulesetBindingsSection : SettingsSection
{
public override FontAwesome Icon => FontAwesome.fa_osu_mod_nofail;
public override string Header => Ruleset.Name;
public override FontAwesome Icon => FontAwesome.fa_osu_hot;
public override string Header => ruleset.Name;
private readonly RulesetInfo ruleset;
public RulesetBindingsSection(RulesetInfo ruleset)
{
Ruleset = ruleset;
this.ruleset = ruleset;
Defaults = ruleset.CreateInstance().GetDefaultKeyBindings();
var r = ruleset.CreateInstance();
foreach (var variant in r.AvailableVariants)
Add(new VariantBindingsSubsection(ruleset, variant));
}
}
}