use bool for npc anim event instead of 2-option enum

This commit is contained in:
JohnCorby 2021-12-25 23:08:11 -08:00
parent f0fe15847e
commit 2ae4fb9805
2 changed files with 10 additions and 11 deletions

View File

@ -4,9 +4,9 @@ using QSB.WorldSync;
namespace QSB.Animation.NPC.Messages
{
internal class NpcAnimationMessage : QSBEnumWorldObjectMessage<INpcAnimController, AnimationEvent>
internal class NpcAnimationMessage : QSBBoolWorldObjectMessage<INpcAnimController>
{
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:
}
else
{
WorldObject.EndConversation();
break;
}
}
}

View File

@ -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;
}