Display typed open-chat locally so the sender sees their own bubble

Reported in #31: when a player uses the typed chat box, everyone else
sees the chat bubble over their toon but they do not. Speedchat works
fine for the sender.

The asymmetry is in how the two paths broadcast. Speedchat goes through
the b_setSC family (b_setSC -> setSC + d_setSC), which calls the
receiver-side handler locally on the sender before sending the DC
update, so the sender's bubble appears. Typed chat in
TalkAssistant.sendOpenTalk only does sendUpdate('setTalk', ...) and
relies on the DC broadcast to reach other clients. The 'setTalk' field
is not echoed back to the originating client by the AI, so the
DistributedToon.setTalk handler that calls displayTalk never fires for
the sender's own message.

Mirror the speedchat pattern by also calling setChatAbsolute locally
after sendUpdate. This is the same call DistributedPlayer.setSC makes
when it displays speedchat for the sender, so the bubble behavior is
now identical between the two input paths.

Closes #31
This commit is contained in:
Nicolas Sanchez 2026-05-19 01:39:23 -05:00
parent a5ecbb8b1e
commit c0aabf66e7
1 changed files with 1 additions and 0 deletions

View File

@ -630,6 +630,7 @@ class TalkAssistant(DirectObject.DirectObject):
message,
[],
0])
base.localAvatar.setChatAbsolute(message, chatFlags)
messenger.send('chatUpdate', [message, chatFlags])
return error