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:
@@ -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
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user