tellement de trucs

This commit is contained in:
rwanoux
2024-05-13 18:27:54 +02:00
parent 9cee590267
commit 83c3f1df0b
83 changed files with 1457 additions and 702 deletions
+31 -1
View File
@@ -1,4 +1,5 @@
import { onManageActiveEffect, prepareActiveEffectCategories } from "../system/effects.mjs";
import { preloadHandlebarsTemplates } from "../system/handlebars-manager.mjs";
/**
* Extend the basic ActorSheet with some very simple modifications
@@ -53,7 +54,7 @@ export class VermineActorSheet extends ActorSheet {
/** @override */
activateListeners(html) {
super.activateListeners(html);
html.find('.min-max-edit').click(this._onMinMaxEdit.bind(this))
// Render the item sheet for viewing/editing prior to the editable check.
html.find('.item-edit').click(ev => {
const li = $(ev.currentTarget).parents(".item");
@@ -105,6 +106,35 @@ export class VermineActorSheet extends ActorSheet {
this.actor.update(update)
}
async _onMinMaxEdit(event) {
event.preventDefault();
let propPath = event.currentTarget.dataset.prop;
let propName = propPath.split('.').slice(-1).pop()
let data = {
actorName: this.actor.name,
propName: propName
}
let html = await renderTemplate('systems/vermine2047/templates/dialogs/min-max-edit.hbs', data);
let ui = new Dialog({
title: "edit : " + propName,
content: html,
buttons: {
roll: {
label: "ok",
callback: (html) => { }
},
cancel: {
label: game.i18n.localize('Close'),
callback: () => { }
}
}
}
);
ui.render(true)
}
async _onItemCreate(event) {
event.preventDefault();
const header = event.currentTarget;