]> git.smokeofanarchy.ru Git - space-station-14.git/commitdiff
Predict Labels (#36406)
authorNemanja <98561806+EmoGarbage404@users.noreply.github.com>
Fri, 11 Apr 2025 05:19:48 +0000 (01:19 -0400)
committerGitHub <noreply@github.com>
Fri, 11 Apr 2025 05:19:48 +0000 (22:19 -0700)
* Predict Labels

* nitpicks

20 files changed:
Content.Client/Labels/EntitySystems/LabelSystem.cs [deleted file]
Content.Server/Botany/Systems/PlantHolderSystem.cs
Content.Server/Cargo/Systems/CargoSystem.Bounty.cs
Content.Server/Cargo/Systems/CargoSystem.Orders.cs
Content.Server/CartridgeLoader/Cartridges/LogProbeCartridgeSystem.cs
Content.Server/Chemistry/EntitySystems/ChemMasterSystem.cs
Content.Server/Cloning/CloningSystem.Subscriptions.cs
Content.Server/Delivery/DeliverySystem.cs
Content.Server/Fax/FaxSystem.cs
Content.Server/Forensics/Systems/ForensicPadSystem.cs
Content.Server/Labels/Label/Components/PaperLabelComponent.cs [deleted file]
Content.Server/Labels/Label/LabelSystem.cs [deleted file]
Content.Server/Salvage/SalvageSystem.cs
Content.Server/Shuttles/Commands/FTLDiskCommand.cs
Content.Shared/Labels/Components/LabelComponent.cs
Content.Shared/Labels/Components/PaperLabelComponent.cs [new file with mode: 0644]
Content.Shared/Labels/Components/PaperLabelTypeComponent.cs
Content.Shared/Labels/EntitySystems/LabelSystem.cs [new file with mode: 0644]
Content.Shared/Labels/EntitySystems/SharedHandLabelerSystem.cs
Content.Shared/Labels/EntitySystems/SharedLabelSystem.cs [deleted file]

diff --git a/Content.Client/Labels/EntitySystems/LabelSystem.cs b/Content.Client/Labels/EntitySystems/LabelSystem.cs
deleted file mode 100644 (file)
index baa9f7f..0000000
+++ /dev/null
@@ -1,7 +0,0 @@
-using Content.Shared.Labels.EntitySystems;
-
-namespace Content.Client.Labels;
-
-public sealed partial class LabelSystem : SharedLabelSystem
-{
-}
index 5dbafae5afd43bc27bef1654cfd18f0e2ccff6c9..2661ed479c5353ffa35f2077f65baeaa7cc7c2c4 100644 (file)
@@ -22,10 +22,10 @@ using Robust.Shared.Player;
 using Robust.Shared.Prototypes;
 using Robust.Shared.Random;
 using Robust.Shared.Timing;
-using Content.Server.Labels.Components;
 using Content.Shared.Administration.Logs;
 using Content.Shared.Containers.ItemSlots;
 using Content.Shared.Database;
+using Content.Shared.Labels.Components;
 
 namespace Content.Server.Botany.Systems;
 
@@ -45,8 +45,7 @@ public sealed class PlantHolderSystem : EntitySystem
     [Dependency] private readonly IRobustRandom _random = default!;
     [Dependency] private readonly ItemSlotsSystem _itemSlots = default!;
     [Dependency] private readonly ISharedAdminLogManager _adminLogger = default!;
-
-
+    
     public const float HydroponicsSpeedMultiplier = 1f;
     public const float HydroponicsConsumptionMultiplier = 2f;
 
index 7f74fe269d4c39337f05ccb98eea86a95104424b..c938c6fa50be4560720bf2bd9f90d4f2d9e4a1a3 100644 (file)
@@ -1,7 +1,6 @@
 using System.Diagnostics.CodeAnalysis;
 using System.Linq;
 using Content.Server.Cargo.Components;
-using Content.Server.Labels;
 using Content.Server.NameIdentifier;
 using Content.Shared.Access.Components;
 using Content.Shared.Cargo;
@@ -9,6 +8,7 @@ using Content.Shared.Cargo.Components;
 using Content.Shared.Cargo.Prototypes;
 using Content.Shared.Database;
 using Content.Shared.IdentityManagement;
+using Content.Shared.Labels.EntitySystems;
 using Content.Shared.NameIdentifier;
 using Content.Shared.Paper;
 using Content.Shared.Stacks;
index 9b6407c6898ef7d5fa442a8403a2bb9daff324d8..ee6526c3210673608a2a31f68464ad501b4fcd5b 100644 (file)
@@ -1,6 +1,5 @@
 using System.Diagnostics.CodeAnalysis;
 using Content.Server.Cargo.Components;
-using Content.Server.Labels.Components;
 using Content.Server.Station.Components;
 using Content.Shared.Cargo;
 using Content.Shared.Cargo.BUI;
@@ -11,6 +10,7 @@ using Content.Shared.Database;
 using Content.Shared.Emag.Systems;
 using Content.Shared.IdentityManagement;
 using Content.Shared.Interaction;
+using Content.Shared.Labels.Components;
 using Content.Shared.Paper;
 using Robust.Shared.Map;
 using Robust.Shared.Prototypes;
index ac5c0baa541e5b326c6f4d2b320871297c0489af..75b6b446367496d3a52f8f13370d8f786a20b2a3 100644 (file)
@@ -23,7 +23,7 @@ public sealed class LogProbeCartridgeSystem : EntitySystem
     [Dependency] private readonly ISharedAdminLogManager _adminLogger = default!;
     [Dependency] private readonly SharedAudioSystem _audio = default!;
     [Dependency] private readonly SharedHandsSystem _hands = default!;
-    [Dependency] private readonly SharedLabelSystem _label = default!;
+    [Dependency] private readonly LabelSystem _label = default!;
     [Dependency] private readonly SharedPopupSystem _popup = default!;
     [Dependency] private readonly SharedTransformSystem _transform = default!;
     [Dependency] private readonly PaperSystem _paper = default!;
index dd97bfa8f65d8fbf2284c0039d4bb00bad0cbb94..6e2e2a91bcd9822f9a2afa9bcd341a64a355f24b 100644 (file)
@@ -1,5 +1,4 @@
 using Content.Server.Chemistry.Components;
-using Content.Server.Labels;
 using Content.Server.Popups;
 using Content.Server.Storage.EntitySystems;
 using Content.Shared.Administration.Logs;
@@ -10,6 +9,7 @@ using Content.Shared.Chemistry.Reagent;
 using Content.Shared.Containers.ItemSlots;
 using Content.Shared.Database;
 using Content.Shared.FixedPoint;
+using Content.Shared.Labels.EntitySystems;
 using Content.Shared.Storage;
 using JetBrains.Annotations;
 using Robust.Server.Audio;
index 659d9a1ea1ce4ab1f7c01ced6259f8ee6222bfb4..eba806ceb843fc6f4707b4f14e885c685a31105b 100644 (file)
@@ -25,7 +25,7 @@ namespace Content.Server.Cloning;
 public sealed partial class CloningSystem : EntitySystem
 {
     [Dependency] private readonly SharedStackSystem _stack = default!;
-    [Dependency] private readonly SharedLabelSystem _label = default!;
+    [Dependency] private readonly LabelSystem _label = default!;
     [Dependency] private readonly ForensicsSystem _forensics = default!;
     [Dependency] private readonly PaperSystem _paper = default!;
 
index 8ac87228214a231ca62ffae11a0c52fb9a8fea57..8d2052733eb026d4c65232a2286511547901019a 100644 (file)
@@ -23,7 +23,7 @@ public sealed partial class DeliverySystem : SharedDeliverySystem
     [Dependency] private readonly StationRecordsSystem _records = default!;
     [Dependency] private readonly StationSystem _station = default!;
     [Dependency] private readonly FingerprintReaderSystem _fingerprintReader = default!;
-    [Dependency] private readonly SharedLabelSystem _label = default!;
+    [Dependency] private readonly LabelSystem _label = default!;
     [Dependency] private readonly SharedContainerSystem _container = default!;
 
     public override void Initialize()
index 180689f8925387992d721a62f112ac254046c171..1ac7bd23cafebe7a3fdc807905175fdc72670529 100644 (file)
@@ -4,7 +4,6 @@ using Content.Server.Chat.Managers;
 using Content.Server.DeviceNetwork;
 using Content.Server.DeviceNetwork.Components;
 using Content.Server.DeviceNetwork.Systems;
-using Content.Server.Labels;
 using Content.Server.Popups;
 using Content.Server.Power.Components;
 using Content.Server.Tools;
@@ -20,6 +19,7 @@ using Content.Shared.Fax.Systems;
 using Content.Shared.Fax.Components;
 using Content.Shared.Interaction;
 using Content.Shared.Labels.Components;
+using Content.Shared.Labels.EntitySystems;
 using Content.Shared.Mobs.Components;
 using Content.Shared.Paper;
 using Robust.Server.GameObjects;
index 846d72a9fabf1408cd58f529f3db9e39eceee6c5..2841f36b00b41e9c864cda774240d3587f383614 100644 (file)
@@ -1,4 +1,3 @@
-using Content.Server.Labels;
 using Content.Server.Popups;
 using Content.Shared.DoAfter;
 using Content.Shared.Examine;
@@ -7,6 +6,7 @@ using Content.Shared.Forensics.Components;
 using Content.Shared.IdentityManagement;
 using Content.Shared.Interaction;
 using Content.Shared.Inventory;
+using Content.Shared.Labels.EntitySystems;
 
 namespace Content.Server.Forensics
 {
diff --git a/Content.Server/Labels/Label/Components/PaperLabelComponent.cs b/Content.Server/Labels/Label/Components/PaperLabelComponent.cs
deleted file mode 100644 (file)
index 5dead98..0000000
+++ /dev/null
@@ -1,14 +0,0 @@
-using Content.Shared.Containers.ItemSlots;
-
-namespace Content.Server.Labels.Components
-{
-    /// <summary>
-    ///     This component allows you to attach and remove a piece of paper to an entity.
-    /// </summary>
-    [RegisterComponent]
-    public sealed partial class PaperLabelComponent : Component
-    {
-        [DataField("labelSlot")]
-        public ItemSlot LabelSlot = new();
-    }
-}
diff --git a/Content.Server/Labels/Label/LabelSystem.cs b/Content.Server/Labels/Label/LabelSystem.cs
deleted file mode 100644 (file)
index b70c004..0000000
+++ /dev/null
@@ -1,115 +0,0 @@
-using Content.Server.Labels.Components;
-using Content.Shared.Containers.ItemSlots;
-using Content.Shared.Examine;
-using Content.Shared.Labels;
-using Content.Shared.Labels.Components;
-using Content.Shared.Labels.EntitySystems;
-using Content.Shared.Paper;
-using JetBrains.Annotations;
-using Robust.Shared.Containers;
-
-namespace Content.Server.Labels
-{
-    /// <summary>
-    /// A system that lets players see the contents of a label on an object.
-    /// </summary>
-    [UsedImplicitly]
-    public sealed class LabelSystem : SharedLabelSystem
-    {
-        [Dependency] private readonly ItemSlotsSystem _itemSlotsSystem = default!;
-        [Dependency] private readonly SharedAppearanceSystem _appearance = default!;
-
-        public const string ContainerName = "paper_label";
-
-        public override void Initialize()
-        {
-            base.Initialize();
-
-            SubscribeLocalEvent<PaperLabelComponent, ComponentInit>(OnComponentInit);
-            SubscribeLocalEvent<PaperLabelComponent, ComponentRemove>(OnComponentRemove);
-            SubscribeLocalEvent<PaperLabelComponent, EntInsertedIntoContainerMessage>(OnContainerModified);
-            SubscribeLocalEvent<PaperLabelComponent, EntRemovedFromContainerMessage>(OnContainerModified);
-            SubscribeLocalEvent<PaperLabelComponent, ExaminedEvent>(OnExamined);
-        }
-
-        /// <summary>
-        /// Apply or remove a label on an entity.
-        /// </summary>
-        /// <param name="uid">EntityUid to change label on</param>
-        /// <param name="text">intended label text (null to remove)</param>
-        /// <param name="label">label component for resolve</param>
-        /// <param name="metadata">metadata component for resolve</param>
-        public override void Label(EntityUid uid, string? text, MetaDataComponent? metadata = null, LabelComponent? label = null)
-        {
-            if (!Resolve(uid, ref label, false))
-                label = EnsureComp<LabelComponent>(uid);
-
-            label.CurrentLabel = text;
-            NameMod.RefreshNameModifiers(uid);
-
-            Dirty(uid, label);
-        }
-
-        private void OnComponentInit(EntityUid uid, PaperLabelComponent component, ComponentInit args)
-        {
-            _itemSlotsSystem.AddItemSlot(uid, ContainerName, component.LabelSlot);
-
-            UpdateAppearance((uid, component));
-        }
-
-        private void OnComponentRemove(EntityUid uid, PaperLabelComponent component, ComponentRemove args)
-        {
-            _itemSlotsSystem.RemoveItemSlot(uid, component.LabelSlot);
-        }
-
-        private void OnExamined(EntityUid uid, PaperLabelComponent comp, ExaminedEvent args)
-        {
-            if (comp.LabelSlot.Item is not {Valid: true} item)
-                return;
-
-            using (args.PushGroup(nameof(PaperLabelComponent)))
-            {
-                if (!args.IsInDetailsRange)
-                {
-                    args.PushMarkup(Loc.GetString("comp-paper-label-has-label-cant-read"));
-                    return;
-                }
-
-                if (!EntityManager.TryGetComponent(item, out PaperComponent? paper))
-                    // Assuming yaml has the correct entity whitelist, this should not happen.
-                    return;
-
-                if (string.IsNullOrWhiteSpace(paper.Content))
-                {
-                    args.PushMarkup(Loc.GetString("comp-paper-label-has-label-blank"));
-                    return;
-                }
-
-                args.PushMarkup(Loc.GetString("comp-paper-label-has-label"));
-                var text = paper.Content;
-                args.PushMarkup(text.TrimEnd());
-            }
-        }
-
-        private void OnContainerModified(EntityUid uid, PaperLabelComponent label, ContainerModifiedMessage args)
-        {
-            if (!label.Initialized) return;
-
-            if (args.Container.ID != label.LabelSlot.ID)
-                return;
-
-            UpdateAppearance((uid, label));
-        }
-
-        private void UpdateAppearance(Entity<PaperLabelComponent, AppearanceComponent?> ent)
-        {
-            if (!Resolve(ent, ref ent.Comp2, false))
-                return;
-
-            var slot = ent.Comp1.LabelSlot;
-            _appearance.SetData(ent, PaperLabelVisuals.HasLabel, slot.HasItem, ent.Comp2);
-            if (TryComp<PaperLabelTypeComponent>(slot.Item, out var type))
-                _appearance.SetData(ent, PaperLabelVisuals.LabelType, type.PaperType, ent.Comp2);
-        }
-    }
-}
index 9115c605366dbb53eb73aa31640cff2ba15a95f0..53bb0c06b3e7b1302deaac715e8346f5f7a8a39a 100644 (file)
@@ -16,7 +16,7 @@ using Content.Shared.Construction.EntitySystems;
 using Robust.Shared.Audio.Systems;
 using Robust.Shared.Map.Components;
 using Robust.Shared.Timing;
-using Content.Server.Labels;
+using Content.Shared.Labels.EntitySystems;
 using Robust.Shared.EntitySerialization.Systems;
 
 namespace Content.Server.Salvage
index b17c7c11a716dfd592d4819803a27a0f1a575302..014dbe6d995ed93fbb159b9da91f5c021569de98 100644 (file)
@@ -1,8 +1,8 @@
 using Content.Server.Administration;
-using Content.Server.Labels;
 using Content.Shared.Administration;
 using Content.Shared.Hands.Components;
 using Content.Shared.Hands.EntitySystems;
+using Content.Shared.Labels.EntitySystems;
 using Content.Shared.Shuttles.Components;
 using Content.Shared.Storage;
 using Content.Shared.Storage.EntitySystems;
index ee508797adead0191e28e7f201c713ce0723d4f8..d126e3bd3aecf911c907658ac6b984b636892ab1 100644 (file)
@@ -1,3 +1,4 @@
+using Content.Shared.Labels.EntitySystems;
 using Robust.Shared.GameStates;
 
 namespace Content.Shared.Labels.Components;
@@ -6,6 +7,7 @@ namespace Content.Shared.Labels.Components;
 /// Makes entities have a label in their name. Labels are normally given by <see cref="HandLabelerComponent"/>
 /// </summary>
 [RegisterComponent, NetworkedComponent, AutoGenerateComponentState]
+[Access(typeof(LabelSystem))]
 public sealed partial class LabelComponent : Component
 {
     /// <summary>
diff --git a/Content.Shared/Labels/Components/PaperLabelComponent.cs b/Content.Shared/Labels/Components/PaperLabelComponent.cs
new file mode 100644 (file)
index 0000000..e8dad61
--- /dev/null
@@ -0,0 +1,19 @@
+using Content.Shared.Containers.ItemSlots;
+using Content.Shared.Labels.EntitySystems;
+using Robust.Shared.GameStates;
+
+namespace Content.Shared.Labels.Components;
+
+/// <summary>
+///     This component allows you to attach and remove a piece of paper to an entity.
+/// </summary>
+[RegisterComponent, NetworkedComponent]
+[Access(typeof(LabelSystem))]
+public sealed partial class PaperLabelComponent : Component
+{
+    /// <summary>
+    /// The slot where the label is stored.
+    /// </summary>
+    [DataField]
+    public ItemSlot LabelSlot = new();
+}
index b045a6af3b2db943a3d1346ef8fbc4e2ad42b96d..12cddad80f4659820c1f34512b37baf4ee742595 100644 (file)
@@ -1,15 +1,17 @@
+using Content.Shared.Labels.EntitySystems;
 using Robust.Shared.GameStates;
 
 namespace Content.Shared.Labels.Components;
 
-/// <summary>                                                                                                                                                 
-/// Specifies the paper type (see textures/storage/crates/labels.rsi to see currently supported paper types)  to show on crates this label is attached to.                                                                     
-/// </summary>                                                                                                                                                
+/// <summary>
+/// Specifies the paper type (see textures/storage/crates/labels.rsi to see currently supported paper types)  to show on crates this label is attached to.
+/// </summary>
 [RegisterComponent, NetworkedComponent]
+[Access(typeof(LabelSystem))]
 public sealed partial class PaperLabelTypeComponent : Component
 {
-    /// <summary>                                                                                                                                             
-    /// The type of label to show.                                                                                                                                    
+    /// <summary>
+    /// The type of label to show.
     /// </summary>
     [DataField]
     public string PaperType = "Paper";
diff --git a/Content.Shared/Labels/EntitySystems/LabelSystem.cs b/Content.Shared/Labels/EntitySystems/LabelSystem.cs
new file mode 100644 (file)
index 0000000..569acc7
--- /dev/null
@@ -0,0 +1,144 @@
+using Content.Shared.Containers.ItemSlots;
+using Content.Shared.Examine;
+using Content.Shared.Labels.Components;
+using Content.Shared.NameModifier.EntitySystems;
+using Content.Shared.Paper;
+using Robust.Shared.Containers;
+using Robust.Shared.Utility;
+
+namespace Content.Shared.Labels.EntitySystems;
+
+public sealed partial class LabelSystem : EntitySystem
+{
+    [Dependency] private readonly NameModifierSystem _nameModifier = default!;
+    [Dependency] private readonly ItemSlotsSystem _itemSlots = default!;
+    [Dependency] private readonly SharedAppearanceSystem _appearance = default!;
+
+    public const string ContainerName = "paper_label";
+
+    public override void Initialize()
+    {
+        base.Initialize();
+
+        SubscribeLocalEvent<LabelComponent, MapInitEvent>(OnLabelCompMapInit);
+        SubscribeLocalEvent<LabelComponent, ExaminedEvent>(OnExamine);
+        SubscribeLocalEvent<LabelComponent, RefreshNameModifiersEvent>(OnRefreshNameModifiers);
+
+        SubscribeLocalEvent<PaperLabelComponent, ComponentInit>(OnComponentInit);
+        SubscribeLocalEvent<PaperLabelComponent, ComponentRemove>(OnComponentRemove);
+        SubscribeLocalEvent<PaperLabelComponent, EntInsertedIntoContainerMessage>(OnContainerModified);
+        SubscribeLocalEvent<PaperLabelComponent, EntRemovedFromContainerMessage>(OnContainerModified);
+        SubscribeLocalEvent<PaperLabelComponent, ExaminedEvent>(OnExamined);
+    }
+
+    private void OnLabelCompMapInit(Entity<LabelComponent> ent, ref MapInitEvent args)
+    {
+        if (!string.IsNullOrEmpty(ent.Comp.CurrentLabel))
+        {
+            ent.Comp.CurrentLabel = Loc.GetString(ent.Comp.CurrentLabel);
+            Dirty(ent);
+        }
+
+        _nameModifier.RefreshNameModifiers(ent.Owner);
+    }
+
+    /// <summary>
+    /// Apply or remove a label on an entity.
+    /// </summary>
+    /// <param name="uid">EntityUid to change label on</param>
+    /// <param name="text">intended label text (null to remove)</param>
+    /// <param name="label">label component for resolve</param>
+    /// <param name="metadata">metadata component for resolve</param>
+    public void Label(EntityUid uid, string? text, MetaDataComponent? metadata = null, LabelComponent? label = null)
+    {
+        label ??= EnsureComp<LabelComponent>(uid);
+
+        label.CurrentLabel = text;
+        _nameModifier.RefreshNameModifiers(uid);
+
+        Dirty(uid, label);
+    }
+
+    private void OnExamine(Entity<LabelComponent> ent, ref ExaminedEvent args)
+    {
+        if (!ent.Comp.Examinable)
+            return;
+
+        if (ent.Comp.CurrentLabel == null)
+            return;
+
+        var message = new FormattedMessage();
+        message.AddText(Loc.GetString("hand-labeler-has-label", ("label", ent.Comp.CurrentLabel)));
+        args.PushMessage(message);
+    }
+
+    private void OnRefreshNameModifiers(Entity<LabelComponent> entity, ref RefreshNameModifiersEvent args)
+    {
+        if (!string.IsNullOrEmpty(entity.Comp.CurrentLabel))
+            args.AddModifier("comp-label-format", extraArgs: ("label", entity.Comp.CurrentLabel));
+    }
+
+    private void OnComponentInit(Entity<PaperLabelComponent> ent, ref ComponentInit args)
+    {
+        _itemSlots.AddItemSlot(ent, ContainerName, ent.Comp.LabelSlot);
+
+        UpdateAppearance(ent);
+    }
+
+    private void OnComponentRemove(Entity<PaperLabelComponent> ent, ref ComponentRemove args)
+    {
+        _itemSlots.RemoveItemSlot(ent, ent.Comp.LabelSlot);
+    }
+
+    private void OnExamined(Entity<PaperLabelComponent> ent, ref ExaminedEvent args)
+    {
+        if (ent.Comp.LabelSlot.Item is not {Valid: true} item)
+            return;
+
+        using (args.PushGroup(nameof(PaperLabelComponent)))
+        {
+            if (!args.IsInDetailsRange)
+            {
+                args.PushMarkup(Loc.GetString("comp-paper-label-has-label-cant-read"));
+                return;
+            }
+
+            // Assuming yaml has the correct entity whitelist, this should not happen.
+            if (!TryComp<PaperComponent>(item, out var paper))
+                return;
+
+            if (string.IsNullOrWhiteSpace(paper.Content))
+            {
+                args.PushMarkup(Loc.GetString("comp-paper-label-has-label-blank"));
+                return;
+            }
+
+            args.PushMarkup(Loc.GetString("comp-paper-label-has-label"));
+            var text = paper.Content;
+            args.PushMarkup(text.TrimEnd());
+        }
+    }
+
+    // Not ref-sub due to being used for multiple subscriptions.
+    private void OnContainerModified(EntityUid uid, PaperLabelComponent label, ContainerModifiedMessage args)
+    {
+        if (!label.Initialized)
+            return;
+
+        if (args.Container.ID != label.LabelSlot.ID)
+            return;
+
+        UpdateAppearance((uid, label));
+    }
+
+    private void UpdateAppearance(Entity<PaperLabelComponent, AppearanceComponent?> ent)
+    {
+        if (!Resolve(ent, ref ent.Comp2, false))
+            return;
+
+        var slot = ent.Comp1.LabelSlot;
+        _appearance.SetData(ent, PaperLabelVisuals.HasLabel, slot.HasItem, ent.Comp2);
+        if (TryComp<PaperLabelTypeComponent>(slot.Item, out var type))
+            _appearance.SetData(ent, PaperLabelVisuals.LabelType, type.PaperType, ent.Comp2);
+    }
+}
index 0763bb101caeb4d7cf05f0800a8f470a3dd22182..14abae70bb5979bb236de415afa2fa902e1ba373 100644 (file)
@@ -14,7 +14,7 @@ public abstract class SharedHandLabelerSystem : EntitySystem
 {
     [Dependency] protected readonly SharedUserInterfaceSystem UserInterfaceSystem = default!;
     [Dependency] private readonly SharedPopupSystem _popupSystem = default!;
-    [Dependency] private readonly SharedLabelSystem _labelSystem = default!;
+    [Dependency] private readonly LabelSystem _labelSystem = default!;
     [Dependency] private readonly ISharedAdminLogManager _adminLogger = default!;
     [Dependency] private readonly INetManager _netManager = default!;
     [Dependency] private readonly EntityWhitelistSystem _whitelistSystem = default!;
diff --git a/Content.Shared/Labels/EntitySystems/SharedLabelSystem.cs b/Content.Shared/Labels/EntitySystems/SharedLabelSystem.cs
deleted file mode 100644 (file)
index 8d54871..0000000
+++ /dev/null
@@ -1,54 +0,0 @@
-using Content.Shared.Examine;
-using Content.Shared.Labels.Components;
-using Content.Shared.NameModifier.EntitySystems;
-using Robust.Shared.Utility;
-
-namespace Content.Shared.Labels.EntitySystems;
-
-public abstract partial class SharedLabelSystem : EntitySystem
-{
-    [Dependency] protected readonly NameModifierSystem NameMod = default!;
-    public override void Initialize()
-    {
-        base.Initialize();
-
-        SubscribeLocalEvent<LabelComponent, MapInitEvent>(OnLabelCompMapInit);
-        SubscribeLocalEvent<LabelComponent, ExaminedEvent>(OnExamine);
-        SubscribeLocalEvent<LabelComponent, RefreshNameModifiersEvent>(OnRefreshNameModifiers);
-    }
-
-    private void OnLabelCompMapInit(EntityUid uid, LabelComponent component, MapInitEvent args)
-    {
-        if (!string.IsNullOrEmpty(component.CurrentLabel))
-        {
-            component.CurrentLabel = Loc.GetString(component.CurrentLabel);
-            Dirty(uid, component);
-        }
-
-        NameMod.RefreshNameModifiers(uid);
-    }
-
-    public virtual void Label(EntityUid uid, string? text, MetaDataComponent? metadata = null, LabelComponent? label = null){}
-
-    private void OnExamine(EntityUid uid, LabelComponent? label, ExaminedEvent args)
-    {
-        if (!Resolve(uid, ref label))
-            return;
-
-        if (!label.Examinable)
-            return;
-
-        if (label.CurrentLabel == null)
-            return;
-
-        var message = new FormattedMessage();
-        message.AddText(Loc.GetString("hand-labeler-has-label", ("label", label.CurrentLabel)));
-        args.PushMessage(message);
-    }
-
-    private void OnRefreshNameModifiers(Entity<LabelComponent> entity, ref RefreshNameModifiersEvent args)
-    {
-        if (!string.IsNullOrEmpty(entity.Comp.CurrentLabel))
-            args.AddModifier("comp-label-format", extraArgs: ("label", entity.Comp.CurrentLabel));
-    }
-}