mirror of
https://github.com/osukey/osukey.git
synced 2025-07-03 01:09:57 +09:00
Change to use ReadableKeyCombinationProvider
Changes all usages of `KeyCombination.ReadableString()` to `ReadableKeyCombinationProvider.GetReadableString()`. Subscribing to `KeymapChanged` is only required in `KeyButton`. All other places query `GetReadableString()` every time.
This commit is contained in:
@ -11,6 +11,7 @@ using osu.Framework.Graphics.Effects;
|
||||
using osu.Framework.Graphics.Shapes;
|
||||
using osu.Framework.Graphics.Sprites;
|
||||
using osu.Framework.Graphics.Textures;
|
||||
using osu.Framework.Input;
|
||||
using osu.Framework.Input.Bindings;
|
||||
using osu.Framework.Input.Events;
|
||||
using osu.Game.Database;
|
||||
@ -39,6 +40,9 @@ namespace osu.Game.Overlays.Toolbar
|
||||
[Resolved]
|
||||
private TextureStore textures { get; set; }
|
||||
|
||||
[Resolved]
|
||||
private ReadableKeyCombinationProvider readableKeyCombinationProvider { get; set; }
|
||||
|
||||
public void SetIcon(string texture) =>
|
||||
SetIcon(new Sprite
|
||||
{
|
||||
@ -207,7 +211,7 @@ namespace osu.Game.Overlays.Toolbar
|
||||
|
||||
if (realmKeyBinding != null)
|
||||
{
|
||||
string keyBindingString = realmKeyBinding.KeyCombination.ReadableString();
|
||||
string keyBindingString = readableKeyCombinationProvider.GetReadableString(realmKeyBinding.KeyCombination);
|
||||
|
||||
if (!string.IsNullOrEmpty(keyBindingString))
|
||||
keyBindingTooltip.Text = $" ({keyBindingString})";
|
||||
|
Reference in New Issue
Block a user