From 4d027c3d4b595140ced3ad0e0700556f30a644fc Mon Sep 17 00:00:00 2001 From: keslik Date: Sun, 18 Aug 2024 18:51:00 +0300 Subject: [PATCH 1/3] Tweak: ghosts have huds --- Resources/Prototypes/Entities/Mobs/Player/observer.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Resources/Prototypes/Entities/Mobs/Player/observer.yml b/Resources/Prototypes/Entities/Mobs/Player/observer.yml index c86d0ed7092..5058fcf3cc1 100644 --- a/Resources/Prototypes/Entities/Mobs/Player/observer.yml +++ b/Resources/Prototypes/Entities/Mobs/Player/observer.yml @@ -45,6 +45,11 @@ bodyType: KinematicController bodyStatus: InAir - type: CanMoveInAir + - type: ShowSecurityIcons # WD start + - type: ShowHealthBars + damageContainers: + - Biological + - Inorganic # WD end - type: Tag tags: - BypassInteractionRangeChecks From 3bddb2392340b63091d9240c9efb775c48d5fcb4 Mon Sep 17 00:00:00 2001 From: keslik Date: Wed, 21 Aug 2024 18:49:43 +0300 Subject: [PATCH 2/3] Tweak: ghost hud button [WIP] --- Content.Client/Ghost/GhostSystem.cs | 9 +++++++++ Content.Shared/Ghost/GhostComponent.cs | 8 ++++++++ .../Prototypes/Entities/Mobs/Player/observer.yml | 12 ++++++++++++ 3 files changed, 29 insertions(+) diff --git a/Content.Client/Ghost/GhostSystem.cs b/Content.Client/Ghost/GhostSystem.cs index f8f0d0206a7..14ee7b4488d 100644 --- a/Content.Client/Ghost/GhostSystem.cs +++ b/Content.Client/Ghost/GhostSystem.cs @@ -67,6 +67,7 @@ public override void Initialize() SubscribeLocalEvent(OnToggleLighting); SubscribeLocalEvent(OnToggleFoV); SubscribeLocalEvent(OnToggleGhosts); + SubscribeLocalEvent(OnToggleGhostHud); // WD } private void OnStartup(EntityUid uid, GhostComponent component, ComponentStartup args) @@ -85,6 +86,14 @@ private void OnToggleLighting(EntityUid uid, EyeComponent component, ToggleLight args.Handled = true; } + private void OnToggleGhostHud(EntityUid uid, ToggleGhostHudActionEvent args) // WD start + { + if (args.Handled) + return; + + args.Handled = true; + } + private void OnToggleFoV(EntityUid uid, EyeComponent component, ToggleFoVActionEvent args) { if (args.Handled) diff --git a/Content.Shared/Ghost/GhostComponent.cs b/Content.Shared/Ghost/GhostComponent.cs index f7717e8d232..146cf6c80b3 100644 --- a/Content.Shared/Ghost/GhostComponent.cs +++ b/Content.Shared/Ghost/GhostComponent.cs @@ -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] @@ -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 { } diff --git a/Resources/Prototypes/Entities/Mobs/Player/observer.yml b/Resources/Prototypes/Entities/Mobs/Player/observer.yml index 5058fcf3cc1..f9662a73a0e 100644 --- a/Resources/Prototypes/Entities/Mobs/Player/observer.yml +++ b/Resources/Prototypes/Entities/Mobs/Player/observer.yml @@ -115,3 +115,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/vv.svg.192dpi.png + clientExclusive: true + checkCanInteract: false + event: !type:ToggleGhostHudActionEvent # WD From 9ea78242619bcc6b1bef79d41f8af34f25d6bf0c Mon Sep 17 00:00:00 2001 From: keslik Date: Wed, 28 Aug 2024 11:21:26 +0300 Subject: [PATCH 3/3] Tweak: button UI [WIP] --- Content.Client/Ghost/GhostSystem.cs | 4 +++- Content.Server/Ghost/GhostSystem.cs | 1 + Resources/Locale/ru-RU/ghost/ghost-gui.ftl | 3 +++ Resources/Prototypes/Entities/Mobs/Player/observer.yml | 7 +------ 4 files changed, 8 insertions(+), 7 deletions(-) diff --git a/Content.Client/Ghost/GhostSystem.cs b/Content.Client/Ghost/GhostSystem.cs index 14ee7b4488d..603ccaa53b7 100644 --- a/Content.Client/Ghost/GhostSystem.cs +++ b/Content.Client/Ghost/GhostSystem.cs @@ -86,11 +86,12 @@ private void OnToggleLighting(EntityUid uid, EyeComponent component, ToggleLight args.Handled = true; } - private void OnToggleGhostHud(EntityUid uid, ToggleGhostHudActionEvent args) // WD start + 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; } @@ -123,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; diff --git a/Content.Server/Ghost/GhostSystem.cs b/Content.Server/Ghost/GhostSystem.cs index 858dbecf13b..82b10ac7d09 100644 --- a/Content.Server/Ghost/GhostSystem.cs +++ b/Content.Server/Ghost/GhostSystem.cs @@ -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) diff --git a/Resources/Locale/ru-RU/ghost/ghost-gui.ftl b/Resources/Locale/ru-RU/ghost/ghost-gui.ftl index 074860a264f..dde535a3081 100644 --- a/Resources/Locale/ru-RU/ghost/ghost-gui.ftl +++ b/Resources/Locale/ru-RU/ghost/ghost-gui.ftl @@ -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 = Телепорт призрака diff --git a/Resources/Prototypes/Entities/Mobs/Player/observer.yml b/Resources/Prototypes/Entities/Mobs/Player/observer.yml index f9662a73a0e..1c20fcf833c 100644 --- a/Resources/Prototypes/Entities/Mobs/Player/observer.yml +++ b/Resources/Prototypes/Entities/Mobs/Player/observer.yml @@ -45,11 +45,6 @@ bodyType: KinematicController bodyStatus: InAir - type: CanMoveInAir - - type: ShowSecurityIcons # WD start - - type: ShowHealthBars - damageContainers: - - Biological - - Inorganic # WD end - type: Tag tags: - BypassInteractionRangeChecks @@ -123,7 +118,7 @@ noSpawn: true components: - type: InstantAction - icon: Interface/VerbIcons/vv.svg.192dpi.png + icon: Interface/VerbIcons/sentient.svg.192dpi.png clientExclusive: true checkCanInteract: false event: !type:ToggleGhostHudActionEvent # WD