Replay client (#15001)

This commit is contained in:
Leon Friedrich
2023-06-05 16:44:09 +12:00
committed by GitHub
parent a8eee5878a
commit 2ef95a3225
28 changed files with 1474 additions and 1 deletions

View File

@@ -0,0 +1,48 @@
using Content.Client.Gameplay;
using Content.Client.UserInterface.Systems.Chat;
using Content.Client.UserInterface.Systems.MenuBar.Widgets;
using Robust.Client.Replays.UI;
using static Robust.Client.UserInterface.Controls.LayoutContainer;
namespace Content.Client.Replay.UI;
/// <summary>
/// Gameplay state when observing/spectating an entity during a replay.
/// </summary>
[Virtual]
public class ReplaySpectateEntityState : GameplayState
{
protected override void Startup()
{
base.Startup();
var screen = UserInterfaceManager.ActiveScreen;
if (screen == null)
return;
screen.ShowWidget<GameTopMenuBar>(false);
SetAnchorAndMarginPreset(screen.GetOrAddWidget<ReplayControlWidget>(), LayoutPreset.TopLeft, margin: 10);
foreach (var chatbox in UserInterfaceManager.GetUIController<ChatUIController>().Chats)
{
chatbox.ChatInput.Visible = false;
}
}
protected override void Shutdown()
{
var screen = UserInterfaceManager.ActiveScreen;
if (screen != null)
{
screen.RemoveWidget<ReplayControlWidget>();
screen.ShowWidget<GameTopMenuBar>(true);
}
foreach (var chatbox in UserInterfaceManager.GetUIController<ChatUIController>().Chats)
{
chatbox.ChatInput.Visible = true;
}
base.Shutdown();
}
}