From: deltanedas <39013340+deltanedas@users.noreply.github.com>
Date: Mon, 6 Nov 2023 01:21:04 +0000 (+0000)
Subject: hide medibot messages from chat and logs (#21468)
X-Git-Url: https://git.smokeofanarchy.ru/gitweb.cgi?a=commitdiff_plain;h=2c87c53ed15547797012a54f266f1ce583e7f3d0;p=space-station-14.git
hide medibot messages from chat and logs (#21468)
* support npc speech being hidden
* hide medibot messages
---------
Co-authored-by: deltanedas <@deltanedas:kde.org>
---
diff --git a/Content.Server/NPC/HTN/PrimitiveTasks/Operators/SpeakOperator.cs b/Content.Server/NPC/HTN/PrimitiveTasks/Operators/SpeakOperator.cs
index 7fb2f91b94..cf07831959 100644
--- a/Content.Server/NPC/HTN/PrimitiveTasks/Operators/SpeakOperator.cs
+++ b/Content.Server/NPC/HTN/PrimitiveTasks/Operators/SpeakOperator.cs
@@ -9,6 +9,12 @@ public sealed partial class SpeakOperator : HTNOperator
[DataField("speech", required: true)]
public string Speech = string.Empty;
+ ///
+ /// Whether to hide message from chat window and logs.
+ ///
+ [DataField]
+ public bool Hidden;
+
public override void Initialize(IEntitySystemManager sysManager)
{
base.Initialize(sysManager);
@@ -19,7 +25,7 @@ public sealed partial class SpeakOperator : HTNOperator
{
var speaker = blackboard.GetValue(NPCBlackboard.Owner);
- _chat.TrySendInGameICMessage(speaker, Loc.GetString(Speech), InGameICChatType.Speak, false);
+ _chat.TrySendInGameICMessage(speaker, Loc.GetString(Speech), InGameICChatType.Speak, hideChat: Hidden, hideLog: Hidden);
return base.Update(blackboard, frameTime);
}
}
diff --git a/Resources/Prototypes/NPCs/medibot.yml b/Resources/Prototypes/NPCs/medibot.yml
index 91aae781a7..c0853984ee 100644
--- a/Resources/Prototypes/NPCs/medibot.yml
+++ b/Resources/Prototypes/NPCs/medibot.yml
@@ -21,6 +21,7 @@
- !type:HTNPrimitiveTask
operator: !type:SpeakOperator
speech: medibot-start-inject
+ hidden: true
- !type:HTNPrimitiveTask
operator: !type:MoveToOperator