diff --git a/Content.Server/Labels/Label/LabelSystem.cs b/Content.Server/Labels/Label/LabelSystem.cs index b70c004123..df1150e668 100644 --- a/Content.Server/Labels/Label/LabelSystem.cs +++ b/Content.Server/Labels/Label/LabelSystem.cs @@ -47,6 +47,16 @@ namespace Content.Server.Labels label.CurrentLabel = text; NameMod.RefreshNameModifiers(uid); + + //CP14 Events + var ev = new CP14LabeledEvent() + { + LabeledEntity = uid, + Text = text, + }; + RaiseLocalEvent(uid, ev); + //CP14 Events end + Dirty(uid, label); } diff --git a/Content.Shared/Labels/EntitySystems/SharedLabelSystem.cs b/Content.Shared/Labels/EntitySystems/SharedLabelSystem.cs index eb3a0f185b..2647e9216d 100644 --- a/Content.Shared/Labels/EntitySystems/SharedLabelSystem.cs +++ b/Content.Shared/Labels/EntitySystems/SharedLabelSystem.cs @@ -49,3 +49,10 @@ public abstract partial class SharedLabelSystem : EntitySystem args.AddModifier("comp-label-format", extraArgs: ("label", entity.Comp.CurrentLabel)); } } + +//CP14 Labeling Event +public sealed class CP14LabeledEvent : EntityEventArgs +{ + public EntityUid? LabeledEntity; + public string? Text; +} diff --git a/Content.Shared/_CP14/ModularCraft/CP14SharedModularCraftSystem.cs b/Content.Shared/_CP14/ModularCraft/CP14SharedModularCraftSystem.cs index 900d1f30cd..c28c1728b5 100644 --- a/Content.Shared/_CP14/ModularCraft/CP14SharedModularCraftSystem.cs +++ b/Content.Shared/_CP14/ModularCraft/CP14SharedModularCraftSystem.cs @@ -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(OnAfterInteractPart); + SubscribeLocalEvent(OnLabelRenaming); + } + + private void OnLabelRenaming(Entity ent, ref CP14LabeledEvent args) + { + if (args.Text is null) + return; + _meta.SetEntityName(ent, args.Text); + _label.Label(ent, null); } private void OnAfterInteractPart(Entity start, ref AfterInteractEvent args) diff --git a/Content.Shared/_CP14/ModularCraft/Components/CP14LabeledRenamingComponent.cs b/Content.Shared/_CP14/ModularCraft/Components/CP14LabeledRenamingComponent.cs new file mode 100644 index 0000000000..17eff7a510 --- /dev/null +++ b/Content.Shared/_CP14/ModularCraft/Components/CP14LabeledRenamingComponent.cs @@ -0,0 +1,9 @@ +namespace Content.Shared._CP14.ModularCraft.Components; + +/// +/// Adding an outfit to this item will fully rename the item and automatically unlabel it +/// +[RegisterComponent] +public sealed partial class CP14LabeledRenamingComponent : Component +{ +} diff --git a/Resources/Prototypes/Alerts/alerts.yml b/Resources/Prototypes/Alerts/alerts.yml index 3298e697f4..053c5d962e 100644 --- a/Resources/Prototypes/Alerts/alerts.yml +++ b/Resources/Prototypes/Alerts/alerts.yml @@ -200,10 +200,12 @@ state: health1 - sprite: /Textures/_CP14/Interface/Alerts/alive.rsi state: health0 + - sprite: /Textures/_CP14/Interface/Alerts/empty.rsi + state: empty name: alerts-health-name description: alerts-health-desc minSeverity: 0 - maxSeverity: 4 + maxSeverity: 5 - type: alert id: BorgHealth diff --git a/Resources/Prototypes/_CP14/Entities/Objects/ModularTools/grips.yml b/Resources/Prototypes/_CP14/Entities/Objects/ModularTools/grips.yml index b343f546df..1523a71695 100644 --- a/Resources/Prototypes/_CP14/Entities/Objects/ModularTools/grips.yml +++ b/Resources/Prototypes/_CP14/Entities/Objects/ModularTools/grips.yml @@ -31,12 +31,13 @@ quickEquip: false breakOnMove: false - type: CP14MeleeParriable + - type: CP14LabeledRenaming - type: entity parent: CP14ModularGripBase id: CP14ModularGripShort abstract: true - description: A short handle for a weapon or tool. + description: A tool for your purposes! components: - type: CP14ModularCraftStartPoint startSlots: @@ -58,7 +59,7 @@ parent: CP14ModularGripBase id: CP14ModularGripLong abstract: true - description: long, two-handed handle for heavy weapons or large tools. + description: A tool for your purposes! Now long enough to hold in two hands. components: - type: CP14ModularCraftStartPoint startSlots: diff --git a/Resources/Prototypes/_CP14/GameRules/events.yml b/Resources/Prototypes/_CP14/GameRules/events.yml index beea77677c..372fcab3d5 100644 --- a/Resources/Prototypes/_CP14/GameRules/events.yml +++ b/Resources/Prototypes/_CP14/GameRules/events.yml @@ -62,7 +62,6 @@ - id: CP14MobGroupSpawnerHydras prob: 0.05 - - type: entity parent: CP14BaseStationEventShortDelay id: CP14MosquitoSpawn