mirror of
https://github.com/ppy/osu.git
synced 2025-01-14 01:22:59 +08:00
Refactor a bit for readability
This commit is contained in:
parent
d1b2116400
commit
551192b413
@ -34,9 +34,9 @@ namespace osu.Game.Overlays.Settings.Sections.Input
|
||||
public class KeyBindingRow : Container, IFilterable
|
||||
{
|
||||
/// <summary>
|
||||
/// Invoked when binding of this row finalises with a change being written.
|
||||
/// Invoked when the binding of this row is updated with a change being written.
|
||||
/// </summary>
|
||||
public Action<KeyBindingRow> BindingFinalised { get; set; }
|
||||
public Action<KeyBindingRow> BindingUpdated { get; set; }
|
||||
|
||||
private readonly object action;
|
||||
private readonly IEnumerable<RealmKeyBinding> bindings;
|
||||
@ -385,7 +385,7 @@ namespace osu.Game.Overlays.Settings.Sections.Input
|
||||
finalise(false);
|
||||
}
|
||||
|
||||
private void finalise(bool changedKey = true)
|
||||
private void finalise(bool hasChanged = true)
|
||||
{
|
||||
if (bindTarget != null)
|
||||
{
|
||||
@ -398,8 +398,8 @@ namespace osu.Game.Overlays.Settings.Sections.Input
|
||||
{
|
||||
// schedule to ensure we don't instantly get focus back on next OnMouseClick (see AcceptFocus impl.)
|
||||
bindTarget = null;
|
||||
if (changedKey)
|
||||
BindingFinalised?.Invoke(this);
|
||||
if (hasChanged)
|
||||
BindingUpdated?.Invoke(this);
|
||||
});
|
||||
}
|
||||
|
||||
|
@ -56,7 +56,7 @@ namespace osu.Game.Overlays.Settings.Sections.Input
|
||||
{
|
||||
AllowMainMouseButtons = Ruleset != null,
|
||||
Defaults = defaultGroup.Select(d => d.KeyCombination),
|
||||
BindingFinalised = bindingCompleted
|
||||
BindingUpdated = onBindingUpdated
|
||||
});
|
||||
}
|
||||
|
||||
@ -66,7 +66,7 @@ namespace osu.Game.Overlays.Settings.Sections.Input
|
||||
});
|
||||
}
|
||||
|
||||
private void bindingCompleted(KeyBindingRow sender)
|
||||
private void onBindingUpdated(KeyBindingRow sender)
|
||||
{
|
||||
if (AutoAdvanceTarget)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user