Health alerts + Modular tools labeling renaming (#708)
* fix health alert * grips label * Update grips.yml
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user