Fix history

This commit is contained in:
2024-12-17 09:25:02 +01:00
parent 2ac69e2108
commit 2c29acd56c
32 changed files with 395 additions and 779 deletions

View File

@ -5,8 +5,8 @@ export default class CthulhuEternalProtagonistSheet extends CthulhuEternalActorS
static DEFAULT_OPTIONS = {
classes: ["protagonist"],
position: {
width: 1150,
height: 780,
width: 820,
height: 620,
},
window: {
contentClasses: ["protagonist-content"],
@ -144,20 +144,15 @@ export default class CthulhuEternalProtagonistSheet extends CthulhuEternalActorS
* corresponding value from the document's system and performs the roll.
*/
async _onRoll(event, target) {
if (this.isEditMode) return
// Jet de sauvegarde
let elt = event.currentTarget.querySelector("input")
// Jet de ressource
if (!elt) elt = event.currentTarget.querySelector("select")
// Jet de dégâts
if (!elt) elt = event.currentTarget
const rollType = elt.dataset.rollType
let rollTarget
switch (rollType) {
default:
break
const rollType = $(event.currentTarget).data("roll-type")
let item
// Debug : console.log(">>>>", event, target, rollType)
// Deprecated : if (this.isEditMode) return
if (rollType === "skill") {
const li = $(event.currentTarget).parents(".item");
item = this.actor.items.get(li.data("item-id"));
}
await this.document.system.roll(rollType, rollTarget)
await this.document.system.roll(rollType, item)
}
async _onDrop(event) {