mirror of
https://github.com/ppy/osu.git
synced 2025-01-13 02:32:55 +08:00
Shorten variable names
This commit is contained in:
parent
82f24b0502
commit
f5842e7587
@ -17,12 +17,12 @@ namespace osu.Game.Input
|
|||||||
public class RealmKeyBindingStore
|
public class RealmKeyBindingStore
|
||||||
{
|
{
|
||||||
private readonly RealmContextFactory realmFactory;
|
private readonly RealmContextFactory realmFactory;
|
||||||
private readonly ReadableKeyCombinationProvider readableKeyCombinationProvider;
|
private readonly ReadableKeyCombinationProvider keyCombinationProvider;
|
||||||
|
|
||||||
public RealmKeyBindingStore(RealmContextFactory realmFactory, ReadableKeyCombinationProvider readableKeyCombinationProvider)
|
public RealmKeyBindingStore(RealmContextFactory realmFactory, ReadableKeyCombinationProvider keyCombinationProvider)
|
||||||
{
|
{
|
||||||
this.realmFactory = realmFactory;
|
this.realmFactory = realmFactory;
|
||||||
this.readableKeyCombinationProvider = readableKeyCombinationProvider;
|
this.keyCombinationProvider = keyCombinationProvider;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@ -38,7 +38,7 @@ namespace osu.Game.Input
|
|||||||
{
|
{
|
||||||
foreach (var action in context.All<RealmKeyBinding>().Where(b => b.RulesetID == null && (GlobalAction)b.ActionInt == globalAction))
|
foreach (var action in context.All<RealmKeyBinding>().Where(b => b.RulesetID == null && (GlobalAction)b.ActionInt == globalAction))
|
||||||
{
|
{
|
||||||
string str = readableKeyCombinationProvider.GetReadableString(action.KeyCombination);
|
string str = keyCombinationProvider.GetReadableString(action.KeyCombination);
|
||||||
|
|
||||||
// even if found, the readable string may be empty for an unbound action.
|
// even if found, the readable string may be empty for an unbound action.
|
||||||
if (str.Length > 0)
|
if (str.Length > 0)
|
||||||
|
@ -170,7 +170,7 @@ namespace osu.Game
|
|||||||
}
|
}
|
||||||
|
|
||||||
[BackgroundDependencyLoader]
|
[BackgroundDependencyLoader]
|
||||||
private void load(ReadableKeyCombinationProvider readableKeyCombinationProvider)
|
private void load(ReadableKeyCombinationProvider keyCombinationProvider)
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
@ -309,7 +309,7 @@ namespace osu.Game
|
|||||||
|
|
||||||
base.Content.Add(CreateScalingContainer().WithChildren(mainContent));
|
base.Content.Add(CreateScalingContainer().WithChildren(mainContent));
|
||||||
|
|
||||||
KeyBindingStore = new RealmKeyBindingStore(realmFactory, readableKeyCombinationProvider);
|
KeyBindingStore = new RealmKeyBindingStore(realmFactory, keyCombinationProvider);
|
||||||
KeyBindingStore.Register(globalBindings, RulesetStore.AvailableRulesets);
|
KeyBindingStore.Register(globalBindings, RulesetStore.AvailableRulesets);
|
||||||
|
|
||||||
dependencies.Cache(globalBindings);
|
dependencies.Cache(globalBindings);
|
||||||
|
@ -59,7 +59,7 @@ namespace osu.Game.Overlays.Settings.Sections.Input
|
|||||||
public bool FilteringActive { get; set; }
|
public bool FilteringActive { get; set; }
|
||||||
|
|
||||||
[Resolved]
|
[Resolved]
|
||||||
private ReadableKeyCombinationProvider readableKeyCombinationProvider { get; set; }
|
private ReadableKeyCombinationProvider keyCombinationProvider { get; set; }
|
||||||
|
|
||||||
private OsuSpriteText text;
|
private OsuSpriteText text;
|
||||||
private FillFlowContainer cancelAndClearButtons;
|
private FillFlowContainer cancelAndClearButtons;
|
||||||
@ -67,7 +67,7 @@ namespace osu.Game.Overlays.Settings.Sections.Input
|
|||||||
|
|
||||||
private Bindable<bool> isDefault { get; } = new BindableBool(true);
|
private Bindable<bool> isDefault { get; } = new BindableBool(true);
|
||||||
|
|
||||||
public IEnumerable<string> FilterTerms => bindings.Select(b => readableKeyCombinationProvider.GetReadableString(b.KeyCombination)).Prepend(text.Text.ToString());
|
public IEnumerable<string> FilterTerms => bindings.Select(b => keyCombinationProvider.GetReadableString(b.KeyCombination)).Prepend(text.Text.ToString());
|
||||||
|
|
||||||
public KeyBindingRow(object action, List<RealmKeyBinding> bindings)
|
public KeyBindingRow(object action, List<RealmKeyBinding> bindings)
|
||||||
{
|
{
|
||||||
@ -427,7 +427,7 @@ namespace osu.Game.Overlays.Settings.Sections.Input
|
|||||||
private OverlayColourProvider colourProvider { get; set; }
|
private OverlayColourProvider colourProvider { get; set; }
|
||||||
|
|
||||||
[Resolved]
|
[Resolved]
|
||||||
private ReadableKeyCombinationProvider readableKeyCombinationProvider { get; set; }
|
private ReadableKeyCombinationProvider keyCombinationProvider { get; set; }
|
||||||
|
|
||||||
private bool isBinding;
|
private bool isBinding;
|
||||||
|
|
||||||
@ -486,7 +486,7 @@ namespace osu.Game.Overlays.Settings.Sections.Input
|
|||||||
{
|
{
|
||||||
base.LoadComplete();
|
base.LoadComplete();
|
||||||
|
|
||||||
readableKeyCombinationProvider.KeymapChanged += updateKeyCombinationText;
|
keyCombinationProvider.KeymapChanged += updateKeyCombinationText;
|
||||||
updateKeyCombinationText();
|
updateKeyCombinationText();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -524,7 +524,7 @@ namespace osu.Game.Overlays.Settings.Sections.Input
|
|||||||
|
|
||||||
private void updateKeyCombinationText()
|
private void updateKeyCombinationText()
|
||||||
{
|
{
|
||||||
Text.Text = readableKeyCombinationProvider.GetReadableString(KeyBinding.KeyCombination);
|
Text.Text = keyCombinationProvider.GetReadableString(KeyBinding.KeyCombination);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void UpdateKeyCombination(KeyCombination newCombination)
|
public void UpdateKeyCombination(KeyCombination newCombination)
|
||||||
@ -540,7 +540,7 @@ namespace osu.Game.Overlays.Settings.Sections.Input
|
|||||||
{
|
{
|
||||||
base.Dispose(isDisposing);
|
base.Dispose(isDisposing);
|
||||||
|
|
||||||
readableKeyCombinationProvider.KeymapChanged -= updateKeyCombinationText;
|
keyCombinationProvider.KeymapChanged -= updateKeyCombinationText;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -41,7 +41,7 @@ namespace osu.Game.Overlays.Toolbar
|
|||||||
private TextureStore textures { get; set; }
|
private TextureStore textures { get; set; }
|
||||||
|
|
||||||
[Resolved]
|
[Resolved]
|
||||||
private ReadableKeyCombinationProvider readableKeyCombinationProvider { get; set; }
|
private ReadableKeyCombinationProvider keyCombinationProvider { get; set; }
|
||||||
|
|
||||||
public void SetIcon(string texture) =>
|
public void SetIcon(string texture) =>
|
||||||
SetIcon(new Sprite
|
SetIcon(new Sprite
|
||||||
@ -211,7 +211,7 @@ namespace osu.Game.Overlays.Toolbar
|
|||||||
|
|
||||||
if (realmKeyBinding != null)
|
if (realmKeyBinding != null)
|
||||||
{
|
{
|
||||||
string keyBindingString = readableKeyCombinationProvider.GetReadableString(realmKeyBinding.KeyCombination);
|
string keyBindingString = keyCombinationProvider.GetReadableString(realmKeyBinding.KeyCombination);
|
||||||
|
|
||||||
if (!string.IsNullOrEmpty(keyBindingString))
|
if (!string.IsNullOrEmpty(keyBindingString))
|
||||||
keyBindingTooltip.Text = $" ({keyBindingString})";
|
keyBindingTooltip.Text = $" ({keyBindingString})";
|
||||||
|
Loading…
Reference in New Issue
Block a user