--- /dev/null
+using Content.Shared.Ghost;
+using Robust.Client.GameObjects;
+using Robust.Shared.Console;
+
+namespace Content.Client.Ghost;
+
+public sealed class GhostToggleSelfVisibility : IConsoleCommand
+{
+ public string Command => "toggleselfghost";
+ public string Description => "Toggles seeing your own ghost.";
+ public string Help => "toggleselfghost";
+ public void Execute(IConsoleShell shell, string argStr, string[] args)
+ {
+ var attachedEntity = shell.Player?.AttachedEntity;
+ if (!attachedEntity.HasValue)
+ return;
+
+ var entityManager = IoCManager.Resolve<IEntityManager>();
+ if (!entityManager.HasComponent<GhostComponent>(attachedEntity))
+ {
+ shell.WriteError("Entity must be a ghost.");
+ return;
+ }
+
+ if (!entityManager.TryGetComponent(attachedEntity, out SpriteComponent? spriteComponent))
+ return;
+
+ spriteComponent.Visible = !spriteComponent.Visible;
+ }
+}
/// </summary>
public Type? DefaultState;
+ public bool IsScreenshotMode = false;
+
private bool _initialized;
public void Initialize()
--- /dev/null
+using Content.Client.UserInterface.Systems.Chat;
+using Content.Shared.Chat;
+using Robust.Client.Replays.Commands;
+using Robust.Client.Replays.UI;
+using Robust.Client.UserInterface;
+using Robust.Shared.Console;
+
+namespace Content.Client.Replay;
+
+public sealed class ReplayToggleScreenshotModeCommand : BaseReplayCommand
+{
+ [Dependency] private readonly IUserInterfaceManager _userInterfaceManager = default!;
+ [Dependency] private readonly ContentReplayPlaybackManager _replayManager = default!;
+
+ public override string Command => "replay_toggle_screenshot_mode";
+
+ public override void Execute(IConsoleShell shell, string argStr, string[] args)
+ {
+ var screen = _userInterfaceManager.ActiveScreen;
+ if (screen == null)
+ return;
+
+ _replayManager.IsScreenshotMode = !_replayManager.IsScreenshotMode;
+
+ var showReplayWidget = _replayManager.IsScreenshotMode;
+ screen.ShowWidget<ReplayControlWidget>(showReplayWidget);
+
+ foreach (var chatBox in _userInterfaceManager.GetUIController<ChatUIController>().Chats)
+ {
+ chatBox.ChatInput.Visible = !showReplayWidget;
+ if (!showReplayWidget)
+ chatBox.ChatInput.ChannelSelector.Select(ChatSelectChannel.Local);
+ }
+ }
+}
[Virtual]
public class ReplaySpectateEntityState : GameplayState
{
+ [Dependency] private readonly ContentReplayPlaybackManager _replayManager = default!;
+
protected override void Startup()
{
base.Startup();
return;
screen.ShowWidget<GameTopMenuBar>(false);
- SetAnchorAndMarginPreset(screen.GetOrAddWidget<ReplayControlWidget>(), LayoutPreset.TopLeft, margin: 10);
+ var replayWidget = screen.GetOrAddWidget<ReplayControlWidget>();
+ SetAnchorAndMarginPreset(replayWidget, LayoutPreset.TopLeft, margin: 10);
+ replayWidget.Visible = !_replayManager.IsScreenshotMode;
foreach (var chatbox in UserInterfaceManager.GetUIController<ChatUIController>().Chats)
{
- chatbox.ChatInput.Visible = false;
+ chatbox.ChatInput.Visible = _replayManager.IsScreenshotMode;
}
}