tweak: Изменены голобарьеры (#539)

This commit is contained in:
Spatison
2024-08-01 22:52:01 +03:00
committed by GitHub
parent 3841f3903b
commit 78de2ea3e1
4 changed files with 40 additions and 2 deletions

View File

@@ -1,3 +1,4 @@
using Content.Server._White.Holo;
using Content.Shared.Examine;
using Content.Server.Popups;
using Content.Shared.Coordinates.Helpers;
@@ -83,7 +84,11 @@ public sealed class HolosignSystem : EntitySystem
}
args.Handled = true;
component.Signs.Add(holoUid); // WD EDIT
// WD EDIT
EnsureComp<HoloComponent>(holoUid, out var holo);
component.Signs.Add(holoUid);
holo.Sign = uid;
// WD EDIT
}
private void OnComponentRemove(EntityUid uid, HolosignProjectorComponent comp, ComponentRemove args) // wd edit

View File

@@ -0,0 +1,8 @@
namespace Content.Server._White.Holo;
[RegisterComponent]
public sealed partial class HoloComponent : Component
{
[ViewVariables(VVAccess.ReadWrite), DataField]
public EntityUid? Sign;
}

View File

@@ -0,0 +1,20 @@
using Content.Server.Holosign;
using Content.Shared.Destructible;
namespace Content.Server._White.Holo;
public sealed class HoloSystem : EntitySystem
{
public override void Initialize()
{
SubscribeLocalEvent<HoloComponent, DestructionEventArgs>(OnDestruction);
}
private void OnDestruction(EntityUid uid, HoloComponent component, DestructionEventArgs args)
{
if (!TryComp<HolosignProjectorComponent>(component.Sign, out var holo))
return;
holo.Signs.Remove(uid);
}
}