2022-05-13 15:00:58 -07:00
|
|
|
|
using QSB.ConversationSync.WorldObjects;
|
2021-12-25 16:29:00 -08:00
|
|
|
|
using QSB.Messaging;
|
|
|
|
|
using QSB.Player;
|
|
|
|
|
using QSB.Utility;
|
2020-10-24 15:31:20 +01:00
|
|
|
|
|
2022-03-02 19:46:33 -08:00
|
|
|
|
namespace QSB.ConversationSync.Messages;
|
|
|
|
|
|
2022-08-12 20:36:27 -07:00
|
|
|
|
public class ConversationStartEndMessage : QSBWorldObjectMessage<QSBCharacterDialogueTree, (uint playerId, bool start)>
|
2020-10-24 15:31:20 +01:00
|
|
|
|
{
|
2022-08-12 20:36:27 -07:00
|
|
|
|
public ConversationStartEndMessage(uint playerId, bool start) : base((playerId, start)) { }
|
2021-12-25 16:29:00 -08:00
|
|
|
|
|
2022-03-02 19:46:33 -08:00
|
|
|
|
public override void OnReceiveRemote()
|
|
|
|
|
{
|
2022-08-12 20:36:27 -07:00
|
|
|
|
if (Data.start)
|
2021-12-25 16:29:00 -08:00
|
|
|
|
{
|
2022-08-12 20:36:27 -07:00
|
|
|
|
QSBPlayerManager.GetPlayer(Data.playerId).CurrentCharacterDialogueTree = WorldObject;
|
2022-05-13 15:00:58 -07:00
|
|
|
|
WorldObject.AttachedObject.GetInteractVolume().DisableInteraction();
|
|
|
|
|
WorldObject.AttachedObject.RaiseEvent(nameof(CharacterDialogueTree.OnStartConversation));
|
2021-12-25 16:29:00 -08:00
|
|
|
|
}
|
2022-03-02 19:46:33 -08:00
|
|
|
|
else
|
2022-02-27 04:40:44 -08:00
|
|
|
|
{
|
2022-08-12 20:36:27 -07:00
|
|
|
|
QSBPlayerManager.GetPlayer(Data.playerId).CurrentCharacterDialogueTree = null;
|
2022-05-13 15:00:58 -07:00
|
|
|
|
WorldObject.AttachedObject.GetInteractVolume().EnableInteraction();
|
|
|
|
|
WorldObject.AttachedObject.RaiseEvent(nameof(CharacterDialogueTree.OnEndConversation));
|
2022-02-27 04:40:44 -08:00
|
|
|
|
}
|
2020-12-02 21:23:01 +00:00
|
|
|
|
}
|
2022-05-13 15:00:58 -07:00
|
|
|
|
}
|