Skip to content

Commit

Permalink
Merge pull request #172 from redweller/fix/chat-lang-startup
Browse files Browse the repository at this point in the history
  • Loading branch information
TheGiddyLimit authored May 18, 2023
2 parents 9df53a1 + 4b351c8 commit 5c500c9
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions js/base-chat.js
Original file line number Diff line number Diff line change
Expand Up @@ -693,8 +693,8 @@ function baseChat () {
d20plus.chat.processIncomingMsg = (msg, msgData) => {
if (msg.listenerid?.language && d20plus.cfg.getOrDefault("chat", "languages")) {
const speech = msg.listenerid;
const inKnownLanguage = hasLanguageProficiency(speech.languageid);
if (window.is_gm || msgData.from_me || inKnownLanguage) {
const inKnownLanguage = window.is_gm || hasLanguageProficiency(speech.languageid);
if (msgData.from_me || inKnownLanguage) {
const translated = speech.message.replace(/\n/g, "<br>").replace(/ --([^ ^-])/g, " $1");
msg.content += `<br><i class="showtip tipsy-n-right" title="You understand this because one of your characters speaks ${speech.language}">
<strong>(${speech.language})</strong> ${translated}</i>`;
Expand Down Expand Up @@ -906,7 +906,7 @@ function baseChat () {
const openedMacroId = $(target).closest(`[data-macroid]`).data("macroid");
d20plus.engine.enhanceMacros(openedMacroId);
});
availableLanguagesPlayer();
is_gm || availableLanguagesPlayer();
buildLanguageIndex();

if (window.is_gm) {
Expand Down

0 comments on commit 5c500c9

Please sign in to comment.