1
0
mirror of https://github.com/ppy/osu.git synced 2025-03-18 06:27:18 +08:00

Remove live realm bindings for now

This commit is contained in:
Dean Herbert 2021-06-22 18:26:42 +09:00
parent a4b66bec2e
commit b9a9174168

View File

@ -159,28 +159,6 @@ namespace osu.Game.Overlays.Toolbar
};
}
private RealmKeyBinding realmKeyBinding;
protected override void LoadComplete()
{
base.LoadComplete();
if (Hotkey == null) return;
realmKeyBinding = realmFactory.Context.All<RealmKeyBinding>().FirstOrDefault(rkb => rkb.RulesetID == null && rkb.ActionInt == (int)Hotkey.Value);
if (realmKeyBinding != null)
{
realmKeyBinding.PropertyChanged += (sender, args) =>
{
if (args.PropertyName == nameof(realmKeyBinding.KeyCombinationString))
updateKeyBindingTooltip();
};
}
updateKeyBindingTooltip();
}
protected override bool OnMouseDown(MouseDownEvent e) => true;
protected override bool OnClick(ClickEvent e)
@ -196,6 +174,7 @@ namespace osu.Game.Overlays.Toolbar
HoverBackground.FadeIn(200);
tooltipContainer.FadeIn(100);
return base.OnHover(e);
}
@ -222,6 +201,20 @@ namespace osu.Game.Overlays.Toolbar
private void updateKeyBindingTooltip()
{
if (Hotkey == null) return;
var realmKeyBinding = realmFactory.Context.All<RealmKeyBinding>().FirstOrDefault(rkb => rkb.RulesetID == null && rkb.ActionInt == (int)Hotkey.Value);
// TODO: temporarily disabled to avoid crashes when querying after ExecutionState is changed.
// if (realmKeyBinding != null)
// {
// realmKeyBinding.PropertyChanged += (sender, args) =>
// {
// if (args.PropertyName == nameof(realmKeyBinding.KeyCombinationString))
// updateKeyBindingTooltip();
// };
// }
if (realmKeyBinding != null)
{
var keyBindingString = realmKeyBinding.KeyCombination.ReadableString();