[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; }
if (args.Handled)
return;
- Popup.PopupEntity(Loc.GetString("ghost-gui-toggle-lighting-manager-popup"), args.Performer);
- _contentEye.RequestToggleLight(uid, component);
+ TryComp<PointLightComponent>(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;
}
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.
- type: Tag
tags:
- BypassInteractionRangeChecks
+ - type: PointLight
+ radius: 6
+ enabled: false
# proto for player ghosts specifically
- type: entity
- 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