Health alerts + Modular tools labeling renaming (#708)

* fix health alert

* grips label

* Update grips.yml
This commit is contained in:
Ed
2025-01-08 23:22:58 +03:00
committed by GitHub
parent 815c031a16
commit 00ecf1f4b6
7 changed files with 45 additions and 4 deletions

View File

@@ -1,6 +1,8 @@
using Content.Shared._CP14.ModularCraft.Components;
using Content.Shared.DoAfter;
using Content.Shared.Examine;
using Content.Shared.Interaction;
using Content.Shared.Labels.EntitySystems;
using Robust.Shared.Serialization;
namespace Content.Shared._CP14.ModularCraft;
@@ -8,12 +10,23 @@ namespace Content.Shared._CP14.ModularCraft;
public abstract class CP14SharedModularCraftSystem : EntitySystem
{
[Dependency] private readonly SharedDoAfterSystem _doAfter = default!;
[Dependency] private readonly SharedLabelSystem _label = default!;
[Dependency] private readonly MetaDataSystem _meta = default!;
public override void Initialize()
{
base.Initialize();
SubscribeLocalEvent<CP14ModularCraftPartComponent, AfterInteractEvent>(OnAfterInteractPart);
SubscribeLocalEvent<CP14LabeledRenamingComponent, CP14LabeledEvent>(OnLabelRenaming);
}
private void OnLabelRenaming(Entity<CP14LabeledRenamingComponent> ent, ref CP14LabeledEvent args)
{
if (args.Text is null)
return;
_meta.SetEntityName(ent, args.Text);
_label.Label(ent, null);
}
private void OnAfterInteractPart(Entity<CP14ModularCraftPartComponent> start, ref AfterInteractEvent args)