Skip to content
This repository was archived by the owner on Aug 22, 2025. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions Content.Client/Ghost/GhostSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ public override void Initialize()
SubscribeLocalEvent<EyeComponent, ToggleLightingActionEvent>(OnToggleLighting);
SubscribeLocalEvent<EyeComponent, ToggleFoVActionEvent>(OnToggleFoV);
SubscribeLocalEvent<GhostComponent, ToggleGhostsActionEvent>(OnToggleGhosts);
SubscribeLocalEvent<GhostComponent, ToggleGhostHudActionEvent>(OnToggleGhostHud); // WD
}

private void OnStartup(EntityUid uid, GhostComponent component, ComponentStartup args)
Expand All @@ -85,6 +86,15 @@ private void OnToggleLighting(EntityUid uid, EyeComponent component, ToggleLight
args.Handled = true;
}

private void OnToggleGhostHud(EntityUid uid, GhostComponent component, ToggleGhostHudActionEvent args) // WD start
{
if (args.Handled)
return;

Popup.PopupEntity(Loc.GetString("ghost-gui-toggle-hud-popup"), args.Performer);
args.Handled = true;
}

private void OnToggleFoV(EntityUid uid, EyeComponent component, ToggleFoVActionEvent args)
{
if (args.Handled)
Expand Down Expand Up @@ -114,6 +124,7 @@ private void OnGhostRemove(EntityUid uid, GhostComponent component, ComponentRem
_actions.RemoveAction(uid, component.ToggleFoVActionEntity);
_actions.RemoveAction(uid, component.ToggleGhostsActionEntity);
_actions.RemoveAction(uid, component.ToggleGhostHearingActionEntity);
_actions.RemoveAction(uid, component.ToggleGhostHudActionEntity); // WD

if (uid != _playerManager.LocalEntity)
return;
Expand Down
1 change: 1 addition & 0 deletions Content.Server/Ghost/GhostSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -315,6 +315,7 @@ private void OnMapInit(EntityUid uid, GhostComponent component, MapInitEvent arg
_actions.AddAction(uid, ref component.ToggleLightingActionEntity, component.ToggleLightingAction);
_actions.AddAction(uid, ref component.ToggleFoVActionEntity, component.ToggleFoVAction);
_actions.AddAction(uid, ref component.ToggleGhostsActionEntity, component.ToggleGhostsAction);
_actions.AddAction(uid, ref component.ToggleGhostHudActionEntity, component.ToggleGhostHudAction); // WD
}

private void OnGhostExamine(EntityUid uid, GhostComponent component, ExaminedEvent args)
Expand Down
8 changes: 8 additions & 0 deletions Content.Shared/Ghost/GhostComponent.cs
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,12 @@ public sealed partial class GhostComponent : Component
[DataField, AutoNetworkedField]
public EntityUid? BooActionEntity;

[DataField] // WD start
public EntProtoId ToggleGhostHudAction = "ActionToggleGhostHud";

[DataField, AutoNetworkedField]
public EntityUid? ToggleGhostHudActionEntity; // WD end

// End actions

[ViewVariables(VVAccess.ReadWrite), DataField]
Expand Down Expand Up @@ -102,3 +108,5 @@ public sealed partial class ToggleLightingActionEvent : InstantActionEvent { }
public sealed partial class ToggleGhostHearingActionEvent : InstantActionEvent { }

public sealed partial class BooActionEvent : InstantActionEvent { }

public sealed partial class ToggleGhostHudActionEvent : InstantActionEvent { }
3 changes: 3 additions & 0 deletions Resources/Locale/ru-RU/ghost/ghost-gui.ftl
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@ ghost-gui-toggle-ghost-hearing-name = Переключить видимость
ghost-gui-toggle-ghost-hearing-desc = Переключение между прослушиванием всех сообщений и прослушиванием только радиосвязи и ближайших сообщений.
ghost-gui-toggle-hearing-popup-on = Теперь вы слышите все сообщения.
ghost-gui-toggle-hearing-popup-off = Теперь вы можете слышать только радиосвязь и ближайшие сообщения.
ghost-gui-toggle-hud-name = "Переключить HUD"
ghost-gui-toggle-hud-desc = "Отображает базовые параметры существ"
ghost-gui-toggle-hud-popup = "Переключена видимость информации о игроках."


ghost-target-window-title = Телепорт призрака
Expand Down
12 changes: 12 additions & 0 deletions Resources/Prototypes/Entities/Mobs/Player/observer.yml
Original file line number Diff line number Diff line change
Expand Up @@ -110,3 +110,15 @@
state: icon
iconOn: Interface/Actions/ghostHearingToggled.png
event: !type:ToggleGhostHearingActionEvent

- type: entity # WD
id: ActionToggleGhostHud
name: ghost-gui-toggle-hud-name
description: ghost-gui-toggle-hud-desc
noSpawn: true
components:
- type: InstantAction
icon: Interface/VerbIcons/sentient.svg.192dpi.png
clientExclusive: true
checkCanInteract: false
event: !type:ToggleGhostHudActionEvent # WD