mirror of
https://github.com/osukey/osukey.git
synced 2025-05-17 03:27:21 +09:00
Apply the rest of requested changes
This commit is contained in:
parent
518999ffab
commit
ce845a9f8d
@ -37,10 +37,7 @@ namespace osu.Game.Overlays.KeyBinding
|
|||||||
private FillFlowContainer cancelAndClearButtons;
|
private FillFlowContainer cancelAndClearButtons;
|
||||||
private FillFlowContainer<KeyButton> buttons;
|
private FillFlowContainer<KeyButton> buttons;
|
||||||
|
|
||||||
public Bindable<bool> IsDefault { get; } = new BindableBool(true)
|
public Bindable<bool> IsDefault { get; } = new BindableBool(true);
|
||||||
{
|
|
||||||
Default = true
|
|
||||||
};
|
|
||||||
|
|
||||||
public BasicKeyBindingRow(object action, IEnumerable<Framework.Input.Bindings.KeyBinding> bindings)
|
public BasicKeyBindingRow(object action, IEnumerable<Framework.Input.Bindings.KeyBinding> bindings)
|
||||||
{
|
{
|
||||||
|
@ -32,41 +32,33 @@ namespace osu.Game.Overlays.KeyBinding
|
|||||||
|
|
||||||
public IEnumerable<string> FilterTerms => bindings.Select(b => b.KeyCombination.ReadableString()).Prepend(key.ToString());
|
public IEnumerable<string> FilterTerms => bindings.Select(b => b.KeyCombination.ReadableString()).Prepend(key.ToString());
|
||||||
|
|
||||||
public KeyBindingRow(
|
public KeyBindingRow(object key, ICollection<Input.Bindings.DatabasedKeyBinding> bindings, RulesetInfo ruleset, IEnumerable<KeyCombination> defaults) {
|
||||||
object key,
|
|
||||||
ICollection<Input.Bindings.DatabasedKeyBinding> bindings,
|
|
||||||
RulesetInfo ruleset,
|
|
||||||
IEnumerable<KeyCombination> defaults)
|
|
||||||
{
|
|
||||||
this.key = key;
|
this.key = key;
|
||||||
this.bindings = bindings;
|
this.bindings = bindings;
|
||||||
|
|
||||||
RestoreDefaultValueButton<bool> restoreDefaultButton;
|
|
||||||
|
|
||||||
RelativeSizeAxes = Axes.X;
|
RelativeSizeAxes = Axes.X;
|
||||||
AutoSizeAxes = Axes.Y;
|
AutoSizeAxes = Axes.Y;
|
||||||
Padding = new MarginPadding { Right = SettingsPanel.CONTENT_MARGINS };
|
Padding = new MarginPadding { Right = SettingsPanel.CONTENT_MARGINS };
|
||||||
|
|
||||||
BasicKeyBindingRow = new BasicKeyBindingRow(key, bindings.Where(b => ((int)b.Action).Equals((int)key)))
|
|
||||||
{
|
|
||||||
AllowMainMouseButtons = ruleset != null,
|
|
||||||
Defaults = defaults
|
|
||||||
};
|
|
||||||
|
|
||||||
InternalChildren = new Drawable[]
|
InternalChildren = new Drawable[]
|
||||||
{
|
{
|
||||||
restoreDefaultButton = new RestoreDefaultValueButton<bool>(),
|
new RestoreDefaultValueButton<bool>()
|
||||||
|
{
|
||||||
|
Current = BasicKeyBindingRow.IsDefault,
|
||||||
|
Action = () => { BasicKeyBindingRow.RestoreDefaults(); }
|
||||||
|
},
|
||||||
new FillFlowContainer
|
new FillFlowContainer
|
||||||
{
|
{
|
||||||
RelativeSizeAxes = Axes.X,
|
RelativeSizeAxes = Axes.X,
|
||||||
AutoSizeAxes = Axes.Y,
|
AutoSizeAxes = Axes.Y,
|
||||||
Padding = new MarginPadding { Left = SettingsPanel.CONTENT_MARGINS },
|
Padding = new MarginPadding { Left = SettingsPanel.CONTENT_MARGINS },
|
||||||
Child = BasicKeyBindingRow
|
Child = BasicKeyBindingRow = new BasicKeyBindingRow(key, bindings.Where(b => ((int)b.Action).Equals((int)key)))
|
||||||
|
{
|
||||||
|
AllowMainMouseButtons = ruleset != null,
|
||||||
|
Defaults = defaults
|
||||||
|
}
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
restoreDefaultButton.Action = () => { BasicKeyBindingRow.RestoreDefaults(); };
|
|
||||||
restoreDefaultButton.Current = BasicKeyBindingRow.IsDefault;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user