Add items

This commit is contained in:
2021-02-17 22:38:12 +01:00
parent f57e5030c5
commit 64ef6e3c67
4 changed files with 23 additions and 16 deletions

View File

@ -36,7 +36,7 @@ export class SoSUtility extends Entity {
}
/* -------------------------------------------- */
onSocketMesssage( msg ) {
static onSocketMesssage( msg ) {
if( !game.user.isGM ) return; // Only GM
if (msg.name == 'msg_declare_actions' ) {
@ -120,10 +120,7 @@ export class SoSUtility extends Entity {
/* -------------------------------------------- */
static closeAction(event) {
let uniqId = event.currentTarget.attributes['data-uniq-id'].value;
// Delete message !
const toDelete = game.messages.filter(it => it.data.content.includes( uniqId ));
toDelete.forEach(it => it.delete());
if ( game.user.isGM ) {
game.combat.closeAction( uniqId );
} else {
@ -294,7 +291,7 @@ export class SoSUtility extends Entity {
flipData.uniqId = randomID(16);
this.registry[flipData.uniqId] = flipData;
let html = await renderTemplate('systems/foundryvtt-shadows-over-sol/templates/chat-damage-request-dodge.html', flipData );
ChatMessage.create( { content: html, whisper: [ChatMessage.getWhisperRecipients(flipData.target.actor.name), ChatMessage.getWhisperRecipients("GM") ] } );
ChatMessage.create( { content: html, whisper: ChatMessage.getWhisperRecipients(flipData.target.actor.name).concat(ChatMessage.getWhisperRecipients("GM")) } );
return; // Wait message response
}
}