Boutons encaisser/remise à neuf #69

Pour entités et créatures
This commit is contained in:
2020-12-27 19:55:51 +01:00
parent 01b98f2f3b
commit ac8a1b509b
6 changed files with 74 additions and 28 deletions

View File

@ -4,6 +4,7 @@
* @extends {ActorSheet}
*/
import { HtmlUtility } from "./html-utility.js";
import { RdDUtility } from "./rdd-utility.js";
/* -------------------------------------------- */
@ -64,7 +65,9 @@ export class RdDActorCreatureSheet extends ActorSheet {
/** @override */
activateListeners(html) {
super.activateListeners(html);
HtmlUtility._showControlWhen($(".gm-only"), game.user.isGM);
// Everything below here is only needed if the sheet is editable
if (!this.options.editable) return;
@ -147,7 +150,17 @@ export class RdDActorCreatureSheet extends ActorSheet {
this.actor.santeIncDec("endurance", -1);
this.render(true);
});
}
html.find('#encaisser-direct').click(ev => {
this.actor.encaisser();
});
html.find('#remise-a-neuf').click(ev => {
if (game.user.isGM) {
this.actor.remiseANeuf();
}
});
}
/* -------------------------------------------- */