Disable SSD indicator for NPC (#20027)
* Make ActiveNPCComponent shared * Check if entity have ActiveNPC component * Make networked * Fix path * fix
This commit is contained in:
parent
6a636d8e7a
commit
f657e29547
|
|
@ -10,6 +10,7 @@ using Content.Server.NPC.Systems;
|
|||
using Content.Shared.Administration;
|
||||
using Content.Shared.Mobs;
|
||||
using Content.Shared.NPC;
|
||||
using Content.Shared.NPC;
|
||||
using JetBrains.Annotations;
|
||||
using Robust.Server.GameObjects;
|
||||
using Robust.Server.Player;
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@ using Content.Server.NPC.Components;
|
|||
using Content.Server.NPC.Events;
|
||||
using Content.Shared.CombatMode;
|
||||
using Content.Shared.NPC;
|
||||
using Content.Shared.NPC;
|
||||
using Content.Shared.Weapons.Melee;
|
||||
using Robust.Shared.Map;
|
||||
using Robust.Shared.Physics.Components;
|
||||
|
|
|
|||
|
|
@ -15,6 +15,7 @@ using Content.Shared.Interaction;
|
|||
using Content.Shared.Movement.Components;
|
||||
using Content.Shared.Movement.Systems;
|
||||
using Content.Shared.NPC;
|
||||
using Content.Shared.NPC;
|
||||
using Content.Shared.NPC.Events;
|
||||
using Content.Shared.Physics;
|
||||
using Content.Shared.Weapons.Melee;
|
||||
|
|
|
|||
|
|
@ -4,6 +4,7 @@ using Content.Server.NPC.HTN;
|
|||
using Content.Shared.CCVar;
|
||||
using Content.Shared.Mobs;
|
||||
using Content.Shared.Mobs.Systems;
|
||||
using Content.Shared.NPC;
|
||||
using Robust.Server.GameObjects;
|
||||
using Robust.Shared.Configuration;
|
||||
|
||||
|
|
|
|||
|
|
@ -1,7 +1,9 @@
|
|||
namespace Content.Server.NPC.Components;
|
||||
using Robust.Shared.GameStates;
|
||||
|
||||
namespace Content.Shared.NPC;
|
||||
|
||||
/// <summary>
|
||||
/// Added to NPCs that are actively being updated.
|
||||
/// </summary>
|
||||
[RegisterComponent]
|
||||
[RegisterComponent, NetworkedComponent]
|
||||
public sealed partial class ActiveNPCComponent : Component {}
|
||||
|
|
@ -13,7 +13,7 @@ public sealed partial class SSDIndicatorComponent : Component
|
|||
{
|
||||
[ViewVariables(VVAccess.ReadWrite)]
|
||||
[AutoNetworkedField]
|
||||
public bool IsSSD = true;
|
||||
public bool IsSSD = false;
|
||||
|
||||
[ViewVariables(VVAccess.ReadWrite)]
|
||||
[DataField("icon", customTypeSerializer: typeof(PrototypeIdSerializer<StatusIconPrototype>))]
|
||||
|
|
|
|||
|
|
@ -1,4 +1,5 @@
|
|||
using Content.Shared.Mind.Components;
|
||||
using Content.Shared.NPC;
|
||||
|
||||
namespace Content.Shared.SSDIndicator;
|
||||
|
||||
|
|
@ -9,10 +10,19 @@ public sealed class SSDIndicatorSystem : EntitySystem
|
|||
{
|
||||
public override void Initialize()
|
||||
{
|
||||
SubscribeLocalEvent<SSDIndicatorComponent, ComponentInit>(OnInit);
|
||||
SubscribeLocalEvent<SSDIndicatorComponent, MindAddedMessage>(OnMindAdded);
|
||||
SubscribeLocalEvent<SSDIndicatorComponent, MindRemovedMessage>(OnMindRemoved);
|
||||
}
|
||||
|
||||
private void OnInit(EntityUid uid, SSDIndicatorComponent component, ComponentInit args)
|
||||
{
|
||||
if (HasComp<ActiveNPCComponent>(uid))
|
||||
return;
|
||||
|
||||
component.IsSSD = !HasComp<MindContainerComponent>(uid);
|
||||
}
|
||||
|
||||
private void OnMindAdded(EntityUid uid, SSDIndicatorComponent component, MindAddedMessage args)
|
||||
{
|
||||
component.IsSSD = false;
|
||||
|
|
@ -21,6 +31,9 @@ public sealed class SSDIndicatorSystem : EntitySystem
|
|||
|
||||
private void OnMindRemoved(EntityUid uid, SSDIndicatorComponent component, MindRemovedMessage args)
|
||||
{
|
||||
if (HasComp<ActiveNPCComponent>(uid))
|
||||
return;
|
||||
|
||||
component.IsSSD = true;
|
||||
Dirty(uid, component);
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue