Fix warnings and code cleanup/fixes (#13570)

This commit is contained in:
Visne
2023-01-19 03:56:45 +01:00
committed by GitHub
parent 3ca5a0224b
commit c6d3e4f3bd
265 changed files with 499 additions and 666 deletions

View File

@@ -26,11 +26,11 @@ public sealed class MenuButton : ContainerButton
private BoundKeyFunction _function;
private readonly BoxContainer _root;
private readonly TextureRect _buttonIcon;
private readonly Label _buttonLabel;
private readonly TextureRect? _buttonIcon;
private readonly Label? _buttonLabel;
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
{
@@ -38,7 +38,7 @@ public sealed class MenuButton : ContainerButton
set
{
_function = value;
_buttonLabel.Text = BoundKeyHelper.ShortKeyName(value);
_buttonLabel!.Text = BoundKeyHelper.ShortKeyName(value);
}
}
@@ -95,12 +95,12 @@ public sealed class MenuButton : ContainerButton
private void OnKeyBindingChanged(IKeyBinding obj)
{
_buttonLabel.Text = BoundKeyHelper.ShortKeyName(_function);
_buttonLabel!.Text = BoundKeyHelper.ShortKeyName(_function);
}
private void OnKeyBindingChanged()
{
_buttonLabel.Text = BoundKeyHelper.ShortKeyName(_function);
_buttonLabel!.Text = BoundKeyHelper.ShortKeyName(_function);
}
protected override void StylePropertiesChanged()