From 2ae4fb980594adc4f8bdf8b41ba2be4a631fe9be Mon Sep 17 00:00:00 2001 From: JohnCorby Date: Sat, 25 Dec 2021 23:08:11 -0800 Subject: [PATCH] use bool for npc anim event instead of 2-option enum --- .../NPC/Messages/NpcAnimationMessage.cs | 17 ++++++++--------- .../NPC/Patches/CharacterAnimationPatches.cs | 4 ++-- 2 files changed, 10 insertions(+), 11 deletions(-) diff --git a/QSB/Animation/NPC/Messages/NpcAnimationMessage.cs b/QSB/Animation/NPC/Messages/NpcAnimationMessage.cs index 279c62b6..e451e6e3 100644 --- a/QSB/Animation/NPC/Messages/NpcAnimationMessage.cs +++ b/QSB/Animation/NPC/Messages/NpcAnimationMessage.cs @@ -4,9 +4,9 @@ using QSB.WorldSync; namespace QSB.Animation.NPC.Messages { - internal class NpcAnimationMessage : QSBEnumWorldObjectMessage + internal class NpcAnimationMessage : QSBBoolWorldObjectMessage { - public NpcAnimationMessage(AnimationEvent animationEvent) => Value = animationEvent; + public NpcAnimationMessage(bool start) => Value = start; public NpcAnimationMessage() { } @@ -14,14 +14,13 @@ namespace QSB.Animation.NPC.Messages public override void OnReceiveRemote() { - switch (Value) + if (Value) { - case AnimationEvent.StartConversation: - WorldObject.StartConversation(); - break; - case AnimationEvent.EndConversation: - WorldObject.EndConversation(); - break; + WorldObject.StartConversation(); + } + else + { + WorldObject.EndConversation(); } } } diff --git a/QSB/Animation/NPC/Patches/CharacterAnimationPatches.cs b/QSB/Animation/NPC/Patches/CharacterAnimationPatches.cs index d6522fa3..b67782b3 100644 --- a/QSB/Animation/NPC/Patches/CharacterAnimationPatches.cs +++ b/QSB/Animation/NPC/Patches/CharacterAnimationPatches.cs @@ -155,7 +155,7 @@ namespace QSB.Animation.NPC.Patches return true; } - ownerOfThis.SendMessage(new NpcAnimationMessage(AnimationEvent.StartConversation)); + ownerOfThis.SendMessage(new NpcAnimationMessage(true)); return true; } @@ -170,7 +170,7 @@ namespace QSB.Animation.NPC.Patches return true; } - ownerOfThis.SendMessage(new NpcAnimationMessage(AnimationEvent.EndConversation)); + ownerOfThis.SendMessage(new NpcAnimationMessage(false)); return true; }