Screen load event for GameplayState (#14316)

Co-authored-by: metalgearsloth <comedian_vs_clown@hotmail.com>
This commit is contained in:
Flipp Syder
2023-03-10 19:25:56 -08:00
committed by GitHub
parent 20eb8f9178
commit 3eb8f70985
9 changed files with 141 additions and 49 deletions

View File

@@ -11,6 +11,7 @@ using Content.Client.Ghost;
using Content.Client.Lobby.UI;
using Content.Client.UserInterface.Screens;
using Content.Client.UserInterface.Systems.Chat.Widgets;
using Content.Client.UserInterface.Systems.Gameplay;
using Content.Shared.Administration;
using Content.Shared.CCVar;
using Content.Shared.Chat;
@@ -183,6 +184,23 @@ public sealed class ChatUIController : UIController
_input.SetInputCommand(ContentKeyFunctions.CycleChatChannelBackward,
InputCmdHandler.FromDelegate(_ => CycleChatChannel(false)));
var gameplayStateLoad = UIManager.GetUIController<GameplayStateLoadController>();
gameplayStateLoad.OnScreenLoad += OnScreenLoad;
gameplayStateLoad.OnScreenUnload += OnScreenUnload;
}
public void OnScreenLoad()
{
SetMainChat(true);
var viewportContainer = UIManager.ActiveScreen!.FindControl<LayoutContainer>("ViewportContainer");
SetSpeechBubbleRoot(viewportContainer);
}
public void OnScreenUnload()
{
SetMainChat(false);
}
public void SetMainChat(bool setting)