Thermal vision overlay for admins (#42812)

* revert of the revert

* tests

* changes

* more fun

* test

* ccvvvar

* works but bad

* now its better

* more fixes

* more cleanup

* cleaning

* last fixes before move to glasses activ

* x

* glasses only

* working

* fix toolbox

* cleanup

* ThermalByte added

* small fix

* small optimalisations

* float bux fix

* comments add

* more comments

* more comments

* last fix

* revert cvar delete

* wrong blue shades

* cvar refactor

* Update Content.Shared/Atmos/EntitySystems/SharedGasTileOverlaySystem.cs

Co-authored-by: ArtisticRoomba <145879011+ArtisticRoomba@users.noreply.github.com>

* Update Content.Client/Atmos/Overlays/GasTileDangerousTemperatureOverlay.cs

Co-authored-by: ArtisticRoomba <145879011+ArtisticRoomba@users.noreply.github.com>

* tweak to TryGetTemperature comment

* Factors are now const

* renames

* Interface for ThermalByte

* admin button

* cleanup

* sandoboxenabled

---------

Co-authored-by: ArtisticRoomba <145879011+ArtisticRoomba@users.noreply.github.com>
This commit is contained in:
InsoPL
2026-02-09 02:06:46 +01:00
committed by GitHub
parent 545223af9b
commit 676492e667
6 changed files with 30 additions and 4 deletions

View File

@@ -83,6 +83,11 @@ namespace Content.Client.Sandbox
RaiseNetworkEvent(new MsgSandboxSuicide());
}
public void ToggleThermalVision()
{
RaiseNetworkEvent(new MsgSandboxThermalVision());
}
public bool Copy(ICommonSession? session, EntityCoordinates coords, EntityUid uid)
{
if (!SandboxAllowed)

View File

@@ -1,4 +1,4 @@
using System.Numerics;
using System.Numerics;
using Content.Client.Administration.Managers;
using Content.Client.Gameplay;
using Content.Client.Sandbox;
@@ -137,6 +137,7 @@ public sealed class SandboxUIController : UIController, IOnStateChanged<Gameplay
_window.ToggleSubfloorButton.OnPressed += _ => _sandbox.ToggleSubFloor();
_window.ShowMarkersButton.OnPressed += _ => _sandbox.ShowMarkers();
_window.ShowBbButton.OnPressed += _ => _sandbox.ShowBb();
_window.ToggleThermalVisionButton.OnToggled += _ => _sandbox.ToggleThermalVision();
}
private void CheckSandboxVisibility()

View File

@@ -1,4 +1,4 @@
<windows:SandboxWindow
<windows:SandboxWindow
xmlns="https://spacestation14.io"
xmlns:windows="clr-namespace:Content.Client.UserInterface.Systems.Sandbox.Windows"
Title="{Loc sandbox-window-title}"
@@ -12,6 +12,7 @@
<Label Text="{Loc sandbox-window-visibility-label}"/>
<Button Name="ToggleLightButton" Access="Public" Text="{Loc sandbox-window-toggle-lights-button}" ToggleMode="True"/>
<Button Name="ToggleFovButton" Access="Public" Text="{Loc sandbox-window-toggle-fov-button}" ToggleMode="True"/>
<Button Name="ToggleThermalVisionButton" Access="Public" Text="{Loc sandbox-window-toggle-thermal-vision}" ToggleMode="True"/>
<Button Name="ToggleShadowsButton" Access="Public" Text="{Loc sandbox-window-toggle-shadows-button}" ToggleMode="True"/>
<Button Name="ToggleSubfloorButton" Access="Public" Text="{Loc sandbox-window-toggle-subfloor-button}" ToggleMode="True"/>
<Button Name="AiOverlayButton" Access="Public" Text="{Loc sandbox-window-ai-overlay-button}" ToggleMode="True"/>

View File

@@ -1,4 +1,3 @@
using System.Linq;
using Content.Server.GameTicking;
using Content.Shared.Access;
using Content.Shared.Access.Components;
@@ -7,6 +6,7 @@ using Content.Shared.Containers.ItemSlots;
using Content.Shared.Hands.Components;
using Content.Shared.Hands.EntitySystems;
using Content.Shared.Inventory;
using Content.Shared.Overlays;
using Content.Shared.PDA;
using Content.Shared.Sandbox;
using Robust.Server.Console;
@@ -15,6 +15,7 @@ using Robust.Server.Player;
using Robust.Shared.Enums;
using Robust.Shared.Player;
using Robust.Shared.Prototypes;
using System.Linq;
namespace Content.Server.Sandbox
{
@@ -50,6 +51,7 @@ namespace Content.Server.Sandbox
SubscribeNetworkEvent<MsgSandboxGiveAccess>(SandboxGiveAccessReceived);
SubscribeNetworkEvent<MsgSandboxGiveAghost>(SandboxGiveAghostReceived);
SubscribeNetworkEvent<MsgSandboxSuicide>(SandboxSuicideReceived);
SubscribeNetworkEvent<MsgSandboxThermalVision>(UpdateSandboxThermalVision);
SubscribeLocalEvent<GameRunLevelChangedEvent>(GameTickerOnOnRunLevelChanged);
@@ -193,5 +195,18 @@ namespace Content.Server.Sandbox
{
RaiseNetworkEvent(new MsgSandboxStatus { SandboxAllowed = IsSandboxEnabled });
}
private void UpdateSandboxThermalVision(MsgSandboxThermalVision message, EntitySessionEventArgs args)
{
if (!IsSandboxEnabled)
return;
var ent = args.SenderSession.AttachedEntity;
if (ent == null) return;
if (HasComp<ThermalSightComponent>(ent))
RemComp<ThermalSightComponent>(ent.Value);
else
EnsureComp<ThermalSightComponent>(ent.Value);
}
}
}

View File

@@ -1,4 +1,4 @@
using Robust.Shared.Prototypes;
using Robust.Shared.Prototypes;
using Robust.Shared.Serialization;
namespace Content.Shared.Sandbox
@@ -24,5 +24,8 @@ namespace Content.Shared.Sandbox
[Serializable, NetSerializable]
protected sealed class MsgSandboxSuicide : EntityEventArgs {}
[Serializable, NetSerializable]
protected sealed class MsgSandboxThermalVision : EntityEventArgs {}
}
}

View File

@@ -19,3 +19,4 @@ sandbox-window-toggle-suicide-button = Suicide
sandbox-window-show-spawns-button = Show Spawns
sandbox-window-show-bb-button = Show BB
sandbox-window-show-npc-button = Show NPC
sandbox-window-toggle-thermal-vision = Toggle Thermal Vision