mclemente / fvtt-module-polyglot

Talk to others using a language you can speak and scrambles text you can't understand.
MIT License
41 stars 48 forks source link

Popup chat window only uses sidebar chat window's settings #194

Closed GojimboGoGo closed 3 years ago

GojimboGoGo commented 3 years ago

Describe the bug One of my players seemed to be unable to use Polyglot no matter what we debugged, no matter what browser he used. It was only after a lot of checking that we were able to find the culprit: Foundry opened up a popup chat window for him automatically, and he'd been using that to chat with. Hopefully, pointing this bug out will help prevent any other groups encountering this issue.

To Reproduce Steps to reproduce the behavior:

  1. Use a token that has multiple languages like Common, Elvish, for example
  2. Open the sidebar chat window, set the language dropdown to "Elvish"
  3. Open the popup chat window by right clicking the chat icon
  4. Set the language on the popup chat window to "Common"
  5. Type a message on the popup chat window

Expected behavior I expected the chat to be sent in "Common". Instead, it seemed to send a message using the sidebar chat window's settings, which were set to "Elvish". Settings seem to copy over from the sidebar chat window to a new popup window when a new chat is created, but changes on the popup chat window do not carry over to the sidebar chat window. This also means that a sidebar chat window set to "Common" will make all messages send as "Common" no matter what the popup chat window is set to.

I have tried this with custom languages as well.

Screenshots https://i.imgur.com/J2ojqZz.png

Additional context Add any other context about the problem here.

mclemente commented 3 years ago

Ok, got it fixed. The only remaining issue is that there's no way to tell from which chat the message was sent, so the popout will take priority over the sidebar when it's open.

GojimboGoGo commented 3 years ago

Thank you for looking into this! Polyglot is a really fun module.