forked from public/foundryvtt-reve-de-dragon
Amelioration des commandes de tchat et aide
This commit is contained in:
@ -138,26 +138,10 @@ Hooks.once("ready", function() {
|
||||
/* -------------------------------------------- */
|
||||
/* Foundry VTT Initialization */
|
||||
/* -------------------------------------------- */
|
||||
const table2func = { "queues": TMRUtility.getQueue, "ombre": TMRUtility.getOmbre, "tetehr": TMRUtility.getTeteHR, "tete": TMRUtility.getTete, "souffle": TMRUtility.getSouffle };
|
||||
Hooks.on("chatMessage", (html, content, msg) => {
|
||||
let regExp;
|
||||
regExp = /(\S+)/g;
|
||||
let commands = content.match(regExp);
|
||||
|
||||
// Setup new message's visibility
|
||||
let rollMode = game.settings.get("core", "rollMode");
|
||||
if (["gmroll", "blindroll"].includes(rollMode)) msg["whisper"] = ChatMessage.getWhisperIDs("GM");
|
||||
if (rollMode === "blindroll") msg["blind"] = true;
|
||||
msg["type"] = 0;
|
||||
|
||||
let regExp;
|
||||
regExp = /(\S+)/g;
|
||||
let commands = content.match(regExp);
|
||||
let command = commands[0];
|
||||
|
||||
// Roll on a table
|
||||
if (command === "/table") {
|
||||
let tableName = commands[1].toLowerCase();
|
||||
table2func[tableName]();
|
||||
return false
|
||||
}
|
||||
|
||||
return true;
|
||||
return RdDUtility.processChatCommand( commands, content, msg );
|
||||
} );
|
||||
|
Reference in New Issue
Block a user