Enhance sheets
This commit is contained in:
@ -1,5 +1,8 @@
|
||||
/* -------------------------------------------- */
|
||||
import { SoSDialogCombatActions } from "./sos-dialog-combat-actions.js";
|
||||
|
||||
export class SoSUtility {
|
||||
/* -------------------------------------------- */
|
||||
export class SoSUtility {
|
||||
|
||||
/* -------------------------------------------- */
|
||||
static async preloadHandlebarsTemplates() {
|
||||
@ -24,6 +27,14 @@ export class SoSUtility {
|
||||
return Array(end - start + 1).fill().map((item, index) => start + index);
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
onSocketMesssage( msg ) {
|
||||
if (msg.name == 'msg_declare_actions' ) {
|
||||
let combat = game.combats.get( msg.data.combatId); // Get the associated combat
|
||||
combat.setupActorActions( msg.data );
|
||||
}
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
static async loadCompendiumNames(compendium) {
|
||||
const pack = game.packs.get(compendium);
|
||||
@ -49,4 +60,21 @@ export class SoSUtility {
|
||||
return list;
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
static async openDeclareActions( event) {
|
||||
event.preventDefault();
|
||||
let round = event.currentTarget.attributes['data-round'].value;
|
||||
let combatId = event.currentTarget.attributes['data-combat-id'].value;
|
||||
let d = await SoSDialogCombatActions.create( combatId, round );
|
||||
d.render(true);
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
static async registerChatCallbacks(html) {
|
||||
html.on("click", '#button-declare-actions', event => {
|
||||
SoSUtility.openDeclareActions( event );
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
}
|
Reference in New Issue
Block a user