Foundry v13 migration
This commit is contained in:
@@ -4,7 +4,7 @@ import { HeritiersUtility } from "./heritiers-utility.js";
|
||||
* Extend the basic ItemSheet with some very simple modifications
|
||||
* @extends {ItemSheet}
|
||||
*/
|
||||
export class HeritiersItemSheet extends ItemSheet {
|
||||
export class HeritiersItemSheet extends foundry.appv1.sheets.ItemSheet {
|
||||
|
||||
/** @override */
|
||||
static get defaultOptions() {
|
||||
@@ -61,9 +61,9 @@ export class HeritiersItemSheet extends ItemSheet {
|
||||
limited: this.object.limited,
|
||||
options: this.options,
|
||||
owner: this.document.isOwner,
|
||||
config: game.system.lesheritiers.config,
|
||||
config: game.system.lesheritiers.config,
|
||||
isArmeMelee: HeritiersUtility.isArmeMelee(this.object),
|
||||
description: await TextEditor.enrichHTML(this.object.system.description, {async: true}),
|
||||
description: await foundry.applications.ux.TextEditor.implementation.enrichHTML(this.object.system.description, {async: true}),
|
||||
mr: (this.object.type == 'specialisation'),
|
||||
isGM: game.user.isGM,
|
||||
usageMax: -1
|
||||
@@ -143,7 +143,7 @@ export class HeritiersItemSheet extends ItemSheet {
|
||||
|
||||
html.find('#add-specialite').click(ev => {
|
||||
let spec = foundry.utils.duplicate(this.object.system.specialites)
|
||||
spec.push( { name: "Nouvelle Spécialité", id: foundry.utils.randomID(16), used: false })
|
||||
spec.push( { name: "Nouvelle Spécialité", id: foundry.utils.randomID(16), used: false })
|
||||
this.object.update( { 'system.specialites': spec })
|
||||
})
|
||||
html.find('.delete-specialite').click(ev => {
|
||||
@@ -168,11 +168,11 @@ export class HeritiersItemSheet extends ItemSheet {
|
||||
spec[index].description = ev.currentTarget.value
|
||||
spec[index].id = spec[index].id || foundry.utils.randomID(16)
|
||||
this.object.update( { 'system.specialites': spec })
|
||||
})
|
||||
})
|
||||
|
||||
html.find('#add-automation').click(ev => {
|
||||
let autom = foundry.utils.duplicate(this.object.system.automations)
|
||||
autom.push( { eventtype: "on-drop", name: "Automatisation 1", competence: "", minLevel: 0, id: foundry.utils.randomID(16) })
|
||||
autom.push( { eventtype: "on-drop", name: "Automatisation 1", competence: "", minLevel: 0, id: foundry.utils.randomID(16) })
|
||||
this.object.update( { 'system.automations': autom })
|
||||
})
|
||||
html.find('.delete-automation').click(ev => {
|
||||
@@ -189,8 +189,8 @@ export class HeritiersItemSheet extends ItemSheet {
|
||||
auto[index][field] = ev.currentTarget.value
|
||||
auto[index].id = auto[index].id || foundry.utils.randomID(16)
|
||||
this.object.update( { 'system.automations': auto })
|
||||
})
|
||||
|
||||
})
|
||||
|
||||
// Update Inventory Item
|
||||
html.find('.item-delete').click(ev => {
|
||||
const li = $(ev.currentTarget).parents(".item");
|
||||
|
Reference in New Issue
Block a user