Extracts magic strings from Tag calls (#36305)

* Extracts magic strings from Tag calls

When #36281 gets merged, the `TagSystem` methods will all give warnings. Let's fix those warnings before they even happen!

* Adds missing libraries

* Remove not yet implemented TagSystem changes

* Fix tag spelling error

Genuinely surprised there was only 1!

* Styling and proper type changes

* Styling

Co-authored-by: Tayrtahn <tayrtahn@gmail.com>

---------

Co-authored-by: Tayrtahn <tayrtahn@gmail.com>
This commit is contained in:
J
2025-04-05 00:20:19 +00:00
committed by GitHub
parent e58ab56e42
commit af9526197a
36 changed files with 156 additions and 51 deletions

View File

@@ -12,6 +12,7 @@ using Content.Shared.Tag;
using Content.Shared.Verbs;
using Robust.Shared.Audio.Systems;
using Robust.Shared.Containers;
using Robust.Shared.Prototypes;
namespace Content.Shared.Delivery;
@@ -30,6 +31,9 @@ public abstract class SharedDeliverySystem : EntitySystem
[Dependency] private readonly SharedHandsSystem _hands = default!;
[Dependency] private readonly NameModifierSystem _nameModifier = default!;
private static readonly ProtoId<TagPrototype> TrashTag = "Trash";
private static readonly ProtoId<TagPrototype> RecyclableTag = "Recyclable";
public override void Initialize()
{
base.Initialize();
@@ -129,7 +133,7 @@ public abstract class SharedDeliverySystem : EntitySystem
ent.Comp.IsOpened = true;
_appearance.SetData(ent, DeliveryVisuals.IsTrash, ent.Comp.IsOpened);
_tag.AddTags(ent, "Trash", "Recyclable");
_tag.AddTags(ent, TrashTag, RecyclableTag);
EnsureComp<SpaceGarbageComponent>(ent);
RemComp<StealTargetComponent>(ent); // opened mail should not count for the objective