diff --git a/Content.Client/Ghost/GhostSystem.cs b/Content.Client/Ghost/GhostSystem.cs index f4f7e3459f..8e977b418b 100644 --- a/Content.Client/Ghost/GhostSystem.cs +++ b/Content.Client/Ghost/GhostSystem.cs @@ -13,6 +13,7 @@ namespace Content.Client.Ghost [Dependency] private readonly IClientConsoleHost _console = default!; [Dependency] private readonly IPlayerManager _playerManager = default!; [Dependency] private readonly SharedActionsSystem _actions = default!; + [Dependency] private readonly PointLightSystem _pointLightSystem = default!; [Dependency] private readonly ContentEyeSystem _contentEye = default!; public int AvailableGhostRoleCount { get; private set; } @@ -79,8 +80,27 @@ namespace Content.Client.Ghost if (args.Handled) return; - Popup.PopupEntity(Loc.GetString("ghost-gui-toggle-lighting-manager-popup"), args.Performer); - _contentEye.RequestToggleLight(uid, component); + TryComp(uid, out var light); + + if (!component.DrawLight) + { + // normal lighting + Popup.PopupEntity(Loc.GetString("ghost-gui-toggle-lighting-manager-popup-normal"), args.Performer); + _contentEye.RequestEye(component.DrawFov, true); + } + else if (!light?.Enabled ?? false) // skip this option if we have no PointLightComponent + { + // enable personal light + Popup.PopupEntity(Loc.GetString("ghost-gui-toggle-lighting-manager-popup-personal-light"), args.Performer); + _pointLightSystem.SetEnabled(uid, true, light); + } + else + { + // fullbright mode + Popup.PopupEntity(Loc.GetString("ghost-gui-toggle-lighting-manager-popup-fullbright"), args.Performer); + _contentEye.RequestEye(component.DrawFov, false); + _pointLightSystem.SetEnabled(uid, false, light); + } args.Handled = true; } diff --git a/Resources/Locale/en-US/ghost/ghost-gui.ftl b/Resources/Locale/en-US/ghost/ghost-gui.ftl index 7d3939abb1..02beef12db 100644 --- a/Resources/Locale/en-US/ghost/ghost-gui.ftl +++ b/Resources/Locale/en-US/ghost/ghost-gui.ftl @@ -3,7 +3,9 @@ ghost-gui-ghost-warp-button = Ghost Warp ghost-gui-ghost-roles-button = Ghost Roles ({$count}) ghost-gui-toggle-ghost-visibility-popup-on = Enabled visibility of ghosts. ghost-gui-toggle-ghost-visibility-popup-off = Disabled visibility of ghosts. -ghost-gui-toggle-lighting-manager-popup = Toggled all lighting. +ghost-gui-toggle-lighting-manager-popup-normal = Lighting normal. +ghost-gui-toggle-lighting-manager-popup-personal-light = Enabled personal light. +ghost-gui-toggle-lighting-manager-popup-fullbright = Fullbright mode. ghost-gui-toggle-fov-popup = Toggled field-of-view. ghost-gui-toggle-hearing-popup-on = You can now hear all messages. diff --git a/Resources/Prototypes/Entities/Mobs/Player/observer.yml b/Resources/Prototypes/Entities/Mobs/Player/observer.yml index 32a481491c..351fab6efe 100644 --- a/Resources/Prototypes/Entities/Mobs/Player/observer.yml +++ b/Resources/Prototypes/Entities/Mobs/Player/observer.yml @@ -63,6 +63,9 @@ - type: Tag tags: - BypassInteractionRangeChecks + - type: PointLight + radius: 6 + enabled: false # proto for player ghosts specifically - type: entity @@ -85,8 +88,8 @@ - type: entity id: ActionToggleLighting - name: Toggle All Lighting - description: Toggle all light rendering to better observe dark areas. + name: Toggle Lighting + description: Toggle light rendering to better observe dark areas. components: - type: InstantAction icon: Interface/VerbIcons/light.svg.192dpi.png