@@ -25,7 +25,7 @@ public sealed class MenuButton : ContainerButton
|
|||||||
private Color NormalColor => HasStyleClass(StyleClassRedTopButton) ? ColorRedNormal : ColorNormal;
|
private Color NormalColor => HasStyleClass(StyleClassRedTopButton) ? ColorRedNormal : ColorNormal;
|
||||||
private Color HoveredColor => HasStyleClass(StyleClassRedTopButton) ? ColorRedHovered : ColorHovered;
|
private Color HoveredColor => HasStyleClass(StyleClassRedTopButton) ? ColorRedHovered : ColorHovered;
|
||||||
|
|
||||||
private BoundKeyFunction _function;
|
private BoundKeyFunction? _function;
|
||||||
private readonly BoxContainer _root;
|
private readonly BoxContainer _root;
|
||||||
private readonly TextureRect? _buttonIcon;
|
private readonly TextureRect? _buttonIcon;
|
||||||
private readonly Label? _buttonLabel;
|
private readonly Label? _buttonLabel;
|
||||||
@@ -33,13 +33,13 @@ public sealed class MenuButton : ContainerButton
|
|||||||
public string AppendStyleClass { set => AddStyleClass(value); }
|
public string AppendStyleClass { set => AddStyleClass(value); }
|
||||||
public Texture? Icon { get => _buttonIcon!.Texture; set => _buttonIcon!.Texture = value; }
|
public Texture? Icon { get => _buttonIcon!.Texture; set => _buttonIcon!.Texture = value; }
|
||||||
|
|
||||||
public BoundKeyFunction BoundKey
|
public BoundKeyFunction? BoundKey
|
||||||
{
|
{
|
||||||
get => _function;
|
get => _function;
|
||||||
set
|
set
|
||||||
{
|
{
|
||||||
_function = value;
|
_function = value;
|
||||||
_buttonLabel!.Text = BoundKeyHelper.ShortKeyName(value);
|
_buttonLabel!.Text = _function == null ? "" : BoundKeyHelper.ShortKeyName(_function.Value);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -95,12 +95,12 @@ public sealed class MenuButton : ContainerButton
|
|||||||
|
|
||||||
private void OnKeyBindingChanged(IKeyBinding obj)
|
private void OnKeyBindingChanged(IKeyBinding obj)
|
||||||
{
|
{
|
||||||
_buttonLabel!.Text = BoundKeyHelper.ShortKeyName(_function);
|
_buttonLabel!.Text = _function == null ? "" : BoundKeyHelper.ShortKeyName(_function.Value);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void OnKeyBindingChanged()
|
private void OnKeyBindingChanged()
|
||||||
{
|
{
|
||||||
_buttonLabel!.Text = BoundKeyHelper.ShortKeyName(_function);
|
_buttonLabel!.Text = _function == null ? "" : BoundKeyHelper.ShortKeyName(_function.Value);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override void StylePropertiesChanged()
|
protected override void StylePropertiesChanged()
|
||||||
|
|||||||
Reference in New Issue
Block a user