2022-08-12 20:36:27 -07:00
|
|
|
|
using QSB.ConversationSync.Messages;
|
|
|
|
|
using QSB.Messaging;
|
|
|
|
|
using QSB.WorldSync;
|
2022-05-13 22:38:06 +01:00
|
|
|
|
|
|
|
|
|
namespace QSB.ConversationSync.WorldObjects;
|
|
|
|
|
|
2022-08-24 14:43:57 -07:00
|
|
|
|
/// <summary>
|
|
|
|
|
/// BUG: do conversation leave on player leave so other people can actually talk lol
|
|
|
|
|
/// </summary>
|
2022-05-13 22:38:06 +01:00
|
|
|
|
public class QSBCharacterDialogueTree : WorldObject<CharacterDialogueTree>
|
|
|
|
|
{
|
|
|
|
|
public override void SendInitialState(uint to)
|
|
|
|
|
{
|
2022-08-12 20:36:27 -07:00
|
|
|
|
var playerId = ConversationManager.Instance.GetPlayerTalkingToTree(AttachedObject);
|
|
|
|
|
if (playerId != uint.MaxValue)
|
|
|
|
|
{
|
|
|
|
|
this.SendMessage(new ConversationStartEndMessage(playerId, true) { To = to });
|
|
|
|
|
}
|
|
|
|
|
// TODO: maybe also sync the dialogue box and player box?
|
2022-05-13 22:38:06 +01:00
|
|
|
|
}
|
|
|
|
|
}
|