Oldchat fixes (#12009)

* various fixes

* whoops

* oops

* oop

* removes that call from escape button on unload instead of adding another one

also just moves escape window stuff into the state entered call, as only one is instantiated whenever the state is loaded (and is not dependent on the current screen)
This commit is contained in:
Flipp Syder
2022-10-17 18:01:28 -07:00
committed by GitHub
parent 2cd8bc8489
commit c828c53b91
4 changed files with 39 additions and 47 deletions

View File

@@ -36,15 +36,7 @@ public sealed class EscapeUIController : UIController, IOnStateEntered<GameplayS
}
EscapeButton.Pressed = false;
EscapeButton.OnPressed += EscapeButtonOnOnPressed;
if (_escapeWindow == null)
{
return;
}
_escapeWindow.OnClose -= DeactivateButton;
_escapeWindow.OnOpen -= ActivateButton;
EscapeButton.OnPressed -= EscapeButtonOnOnPressed;
}
public void LoadButton()
@@ -55,14 +47,6 @@ public sealed class EscapeUIController : UIController, IOnStateEntered<GameplayS
}
EscapeButton.OnPressed += EscapeButtonOnOnPressed;
if (_escapeWindow == null)
{
return;
}
_escapeWindow.OnClose += DeactivateButton;
_escapeWindow.OnOpen += ActivateButton;
}
private void ActivateButton() => EscapeButton!.Pressed = true;
@@ -74,6 +58,9 @@ public sealed class EscapeUIController : UIController, IOnStateEntered<GameplayS
_escapeWindow = UIManager.CreateWindow<Options.UI.EscapeMenu>();
_escapeWindow.OnClose += DeactivateButton;
_escapeWindow.OnOpen += ActivateButton;
_escapeWindow.ChangelogButton.OnPressed += _ =>
{
CloseEscapeWindow();
@@ -144,6 +131,7 @@ public sealed class EscapeUIController : UIController, IOnStateEntered<GameplayS
if (_escapeWindow.IsOpen)
{
CloseEscapeWindow();
EscapeButton!.Pressed = false;
}
else
{