1
0
mirror of https://github.com/ppy/osu.git synced 2025-01-28 05:22:54 +08:00

Reorder KeyBindingRow members

This commit is contained in:
Bartłomiej Dach 2023-10-11 08:18:48 +02:00
parent eeb5409733
commit 1acc02405e
No known key found for this signature in database

View File

@ -39,14 +39,11 @@ namespace osu.Game.Overlays.Settings.Sections.Input
/// </summary> /// </summary>
public Action<KeyBindingRow> BindingUpdated { get; set; } public Action<KeyBindingRow> BindingUpdated { get; set; }
private readonly object action; public bool AllowMainMouseButtons;
private readonly IEnumerable<RealmKeyBinding> bindings;
private const float transition_time = 150; public IEnumerable<KeyCombination> Defaults;
private const float height = 20; #region IFilterable
private const float padding = 5;
private bool matchingFilter; private bool matchingFilter;
@ -60,23 +57,39 @@ namespace osu.Game.Overlays.Settings.Sections.Input
} }
} }
private Container content;
public override bool ReceivePositionalInputAt(Vector2 screenSpacePos) =>
content.ReceivePositionalInputAt(screenSpacePos);
public bool FilteringActive { get; set; } public bool FilteringActive { get; set; }
public IEnumerable<LocalisableString> FilterTerms => bindings.Select(b => (LocalisableString)keyCombinationProvider.GetReadableString(b.KeyCombination)).Prepend(text.Text);
#endregion
private readonly object action;
private readonly IEnumerable<RealmKeyBinding> bindings;
private Bindable<bool> isDefault { get; } = new BindableBool(true);
[Resolved] [Resolved]
private ReadableKeyCombinationProvider keyCombinationProvider { get; set; } private ReadableKeyCombinationProvider keyCombinationProvider { get; set; }
[Resolved]
private RealmAccess realm { get; set; }
private Container content;
private OsuSpriteText text; private OsuSpriteText text;
private FillFlowContainer cancelAndClearButtons; private FillFlowContainer cancelAndClearButtons;
private FillFlowContainer<KeyButton> buttons; private FillFlowContainer<KeyButton> buttons;
private Bindable<bool> isDefault { get; } = new BindableBool(true); private KeyButton bindTarget;
public IEnumerable<LocalisableString> FilterTerms => bindings.Select(b => (LocalisableString)keyCombinationProvider.GetReadableString(b.KeyCombination)).Prepend(text.Text); private const float transition_time = 150;
private const float height = 20;
private const float padding = 5;
public override bool ReceivePositionalInputAt(Vector2 screenSpacePos) =>
content.ReceivePositionalInputAt(screenSpacePos);
public override bool AcceptsFocus => bindTarget == null;
public KeyBindingRow(object action, List<RealmKeyBinding> bindings) public KeyBindingRow(object action, List<RealmKeyBinding> bindings)
{ {
@ -87,9 +100,6 @@ namespace osu.Game.Overlays.Settings.Sections.Input
AutoSizeAxes = Axes.Y; AutoSizeAxes = Axes.Y;
} }
[Resolved]
private RealmAccess realm { get; set; }
[BackgroundDependencyLoader] [BackgroundDependencyLoader]
private void load(OverlayColourProvider colourProvider) private void load(OverlayColourProvider colourProvider)
{ {
@ -205,14 +215,6 @@ namespace osu.Game.Overlays.Settings.Sections.Input
base.OnHoverLost(e); base.OnHoverLost(e);
} }
public override bool AcceptsFocus => bindTarget == null;
private KeyButton bindTarget;
public bool AllowMainMouseButtons;
public IEnumerable<KeyCombination> Defaults;
private bool isModifier(Key k) => k < Key.F1; private bool isModifier(Key k) => k < Key.F1;
protected override bool OnClick(ClickEvent e) => true; protected override bool OnClick(ClickEvent e) => true;