forked from public/foundryvtt-reve-de-dragon
Simplify ChatMessage whispers
Les messages dans les TMRs sont envoyés au GM Simplification des messages de tchat liés à un actor: on peut utiliser les Owners (car les GMs sont owner). Au lieu de passer le name de l'Actor (qui peut être incorrect si deux actors ont le même, mais pas les mêmes propriétaires), on passe directement l'actor pour déterminer mles destinataires de messages
This commit is contained in:
@ -17,6 +17,7 @@ import { RdDUtility } from "./rdd-utility.js";
|
||||
import { FenetreRechercheTirage } from "./tirage/fenetre-recherche-tirage.js";
|
||||
import { TMRUtility } from "./tmr-utility.js";
|
||||
import { DialogFatigueVoyage } from "./voyage/dialog-fatigue-voyage.js";
|
||||
import { ChatUtility } from "./chat-utility.js";
|
||||
|
||||
const rddRollNumeric = /^(\d+)\s*([\+\-]?\d+)?\s*(s)?/;
|
||||
|
||||
@ -206,26 +207,20 @@ export class RdDCommands {
|
||||
/* Manage chat commands */
|
||||
processChatCommand(commandLine, content = '', msg = {}) {
|
||||
// Setup new message's visibility
|
||||
let rollMode = game.settings.get("core", "rollMode");
|
||||
if (["gmroll", "blindroll"].includes(rollMode)) {
|
||||
msg["whisper"] = ChatMessage.getWhisperRecipients("GM");
|
||||
}
|
||||
if (rollMode === "blindroll") {
|
||||
msg["blind"] = true;
|
||||
}
|
||||
msg["type"] = 0;
|
||||
ChatUtility.applyRollMode(msg)
|
||||
msg.type = 0;
|
||||
|
||||
if (!this.commandsTable) {
|
||||
this._registerCommands();
|
||||
this._registerCommands()
|
||||
}
|
||||
|
||||
let command = commandLine[0].toLowerCase();
|
||||
if (this._isCommandHandled(command)) {
|
||||
let params = commandLine.slice(1);
|
||||
this._processCommand(this.commandsTable, command, params, content, msg);
|
||||
return true;
|
||||
this._processCommand(this.commandsTable, command, params, content, msg)
|
||||
return true
|
||||
}
|
||||
return false;
|
||||
return false
|
||||
}
|
||||
|
||||
_isCommandHandled(command) {
|
||||
@ -300,7 +295,7 @@ export class RdDCommands {
|
||||
async getRencontreTMR(params) {
|
||||
if (params.length == 1 || params.length == 2) {
|
||||
return game.system.rdd.rencontresTMR.rollRencontre(params[0], params[1])
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user