Screen load event for GameplayState (#14316)
Co-authored-by: metalgearsloth <comedian_vs_clown@hotmail.com>
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user