Files
Delta-v/Content.Client/UserInterface/Systems/Sandbox/Windows/SandboxWindow.xaml.cs

48 lines
1.9 KiB
C#

using Content.Client.Markers;
using Content.Client.SubFloor;
using Content.Client.Stylesheets;
using Content.Shared.Silicons.StationAi;
using Robust.Client.AutoGenerated;
using Robust.Client.Debugging;
using Robust.Client.Graphics;
using Robust.Client.Player;
using Robust.Client.UserInterface.CustomControls;
using Robust.Client.UserInterface.XAML;
namespace Content.Client.UserInterface.Systems.Sandbox.Windows;
[GenerateTypedNameReferences]
public sealed partial class SandboxWindow : DefaultWindow
{
[Dependency] private readonly IEntityManager _entManager = null!;
[Dependency] private readonly IEyeManager _eyeManager = null!;
[Dependency] private readonly ILightManager _lightManager = null!;
[Dependency] private readonly IPlayerManager _playerManager = null!;
private readonly DebugPhysicsSystem _debugPhysicsSystem;
private readonly MarkerSystem _markerSystem;
private readonly SubFloorHideSystem _subFloorSystem;
public SandboxWindow()
{
RobustXamlLoader.Load(this);
IoCManager.InjectDependencies(this);
_debugPhysicsSystem = _entManager.System<DebugPhysicsSystem>();
_markerSystem = _entManager.System<MarkerSystem>();
_subFloorSystem = _entManager.System<SubFloorHideSystem>();
}
protected override void Opened()
{
base.Opened();
ToggleSubfloorButton.Pressed = _subFloorSystem.ShowAll;
ToggleLightButton.Pressed = !_lightManager.Enabled;
ToggleFovButton.Pressed = !_eyeManager.CurrentEye.DrawFov;
ToggleShadowsButton.Pressed = !_lightManager.DrawShadows;
ShowMarkersButton.Pressed = _markerSystem.MarkersVisible;
ShowBbButton.Pressed = (_debugPhysicsSystem.Flags & PhysicsDebugFlags.Shapes) != 0x0;
AiOverlayButton.Pressed = _playerManager.LocalEntity is { } player && _entManager.HasComponent<StationAiOverlayComponent>(player);
}
}