Sync
This commit is contained in:
@ -9,6 +9,7 @@ export class ChatUtility {
|
||||
ChatUtility.createChatMessage(chatOptions, rollMode, name);
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
static createChatMessage( chatOptions, rollMode, name) {
|
||||
switch (rollMode) {
|
||||
case "blindroll": // GM only
|
||||
@ -29,6 +30,7 @@ export class ChatUtility {
|
||||
ChatMessage.create(chatOptions);
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
static prepareChatMessage( rollMode, name) {
|
||||
return {
|
||||
user: game.user._id,
|
||||
@ -36,6 +38,7 @@ export class ChatUtility {
|
||||
}
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
static getWhisperRecipients( rollMode, name) {
|
||||
switch (rollMode) {
|
||||
case "blindroll": return ChatUtility.getUsers(user => user.isGM);
|
||||
@ -45,15 +48,18 @@ export class ChatUtility {
|
||||
return undefined;
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
static getWhisperRecipientsAndGMs(name) {
|
||||
return ChatMessage.getWhisperRecipients(name)
|
||||
.concat(this.getUsers(user => user.isGM));
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
static getUsers(filter) {
|
||||
return game.users.filter(filter).map(user => user.data._id);
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
static blindMessageToGM(chatOptions) {
|
||||
let chatGM = duplicate(chatOptions);
|
||||
chatGM.whisper = ChatUtility.getUsers(user => user.isGM);
|
||||
@ -62,6 +68,7 @@ export class ChatUtility {
|
||||
game.socket.emit("system.foundryvtt-reve-de-dragon", { msg: "msg_gm_chat_message", data: chatGM });
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
static handleGMChatMessage(data) {
|
||||
console.log("blindMessageToGM", data);
|
||||
if (game.user.isGM) { // message privé pour GM only
|
||||
|
Reference in New Issue
Block a user