Nouvelles corrections sur la fiche
This commit is contained in:
@@ -19,7 +19,8 @@ export default class AwECharacterSheet extends AwEActorSheet {
|
||||
createEquipment: AwECharacterSheet.#onCreateEquipment,
|
||||
flowPointsPlus: AwECharacterSheet.#onFlowPointsPlus,
|
||||
flowPointsMinus: AwECharacterSheet.#onFlowPointsMinus,
|
||||
rollField: AwECharacterSheet.#onRollField
|
||||
rollField: AwECharacterSheet.#onRollField,
|
||||
rollWeapon: AwECharacterSheet.#onRollWeapon
|
||||
}
|
||||
}
|
||||
|
||||
@@ -240,6 +241,13 @@ export default class AwECharacterSheet extends AwEActorSheet {
|
||||
})
|
||||
}
|
||||
|
||||
static async #onRollWeapon(event, target) {
|
||||
const itemId = target.closest("[data-item-id]")?.dataset.itemId
|
||||
const item = this.document.items.get(itemId)
|
||||
if (!item) return
|
||||
await this.document.rollWeapon(item)
|
||||
}
|
||||
|
||||
/** Slugify a string for loose name matching (lowercase, trim, spaces→dash, strip non-alphanum). */
|
||||
static #slugify(str) {
|
||||
return (str ?? "").toLowerCase().trim().replace(/\s+/g, "-").replace(/[^a-z0-9-]/g, "")
|
||||
|
||||
Reference in New Issue
Block a user