Fouindry v13 support
This commit is contained in:
@@ -7,7 +7,7 @@ import { WastelandUtility } from "./wasteland-utility.js";
|
||||
import { WastelandRollDialog } from "./wasteland-roll-dialog.js";
|
||||
|
||||
/* -------------------------------------------- */
|
||||
export class WastelandActorSheet extends ActorSheet {
|
||||
export class WastelandActorSheet extends foundry.appv1.sheets.ActorSheet {
|
||||
|
||||
/** @override */
|
||||
static get defaultOptions() {
|
||||
@@ -25,8 +25,8 @@ export class WastelandActorSheet extends ActorSheet {
|
||||
|
||||
/* -------------------------------------------- */
|
||||
async getData() {
|
||||
const objectData = foundry.utils.duplicate(this.object)
|
||||
let actorData = objectData
|
||||
const objectData = foundry.utils.duplicate(this.object)
|
||||
let actorData = objectData
|
||||
|
||||
let formData = {
|
||||
title: this.title,
|
||||
@@ -52,15 +52,15 @@ export class WastelandActorSheet extends ActorSheet {
|
||||
origine: foundry.utils.duplicate(this.actor.getOrigine() || {}),
|
||||
heritage: foundry.utils.duplicate(this.actor.getHeritage() || {}),
|
||||
metier: foundry.utils.duplicate(this.actor.getMetier() || {}),
|
||||
combat: this.actor.getCombatValues(),
|
||||
combat: this.actor.getCombatValues(),
|
||||
config: foundry.utils.duplicate(game.system.wasteland.config),
|
||||
capacites: foundry.utils.duplicate(this.actor.getCapacites()),
|
||||
equipements: foundry.utils.duplicate(this.actor.getEquipments()),
|
||||
monnaies: foundry.utils.duplicate(this.actor.getMonnaies()),
|
||||
mutations: foundry.utils.duplicate(this.actor.getMutations()),
|
||||
description: await TextEditor.enrichHTML(this.object.system.biodata.description, {async: true}),
|
||||
comportement: await TextEditor.enrichHTML(this.object.system.biodata.comportement, {async: true}),
|
||||
habitat: await TextEditor.enrichHTML(this.object.system.biodata.habitat, {async: true}),
|
||||
description: await foundry.applications.ux.TextEditor.implementation.enrichHTML(this.object.system.biodata.description, {async: true}),
|
||||
comportement: await foundry.applications.ux.TextEditor.implementation.enrichHTML(this.object.system.biodata.comportement, {async: true}),
|
||||
habitat: await foundry.applications.ux.TextEditor.implementation.enrichHTML(this.object.system.biodata.habitat, {async: true}),
|
||||
options: this.options,
|
||||
owner: this.document.isOwner,
|
||||
editScore: this.options.editScore,
|
||||
@@ -73,7 +73,7 @@ export class WastelandActorSheet extends ActorSheet {
|
||||
return formData;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/* -------------------------------------------- */
|
||||
/** @override */
|
||||
activateListeners(html) {
|
||||
@@ -81,14 +81,14 @@ export class WastelandActorSheet extends ActorSheet {
|
||||
|
||||
// Everything below here is only needed if the sheet is editable
|
||||
if (!this.options.editable) return;
|
||||
|
||||
|
||||
// Update Inventory Item
|
||||
html.find('.item-edit').click(ev => {
|
||||
const li = $(ev.currentTarget).parents(".item")
|
||||
let itemId = li.data("item-id")
|
||||
const item = this.actor.items.get( itemId )
|
||||
item.sheet.render(true)
|
||||
})
|
||||
})
|
||||
// Delete Inventory Item
|
||||
html.find('.item-delete').click(ev => {
|
||||
const li = $(ev.currentTarget).parents(".item");
|
||||
@@ -103,7 +103,7 @@ export class WastelandActorSheet extends ActorSheet {
|
||||
let value = ev.currentTarget.value
|
||||
this.actor.editItemField(itemId, itemType, itemField, dataType, value)
|
||||
})
|
||||
|
||||
|
||||
html.find('.quantity-minus').click(event => {
|
||||
const li = $(event.currentTarget).parents(".item");
|
||||
this.actor.incDecQuantity( li.data("item-id"), -1 );
|
||||
@@ -129,7 +129,7 @@ export class WastelandActorSheet extends ActorSheet {
|
||||
let charmeId = li.data("item-id")
|
||||
this.actor.rollCharme(charmeId)
|
||||
})
|
||||
|
||||
|
||||
html.find('.roll-pouvoir').click((event) => {
|
||||
const li = $(event.currentTarget).parents(".item")
|
||||
let pouvoirId = li.data("item-id")
|
||||
@@ -155,19 +155,19 @@ export class WastelandActorSheet extends ActorSheet {
|
||||
this.actor.createEmbeddedDocuments('Item', [{ name: `Nouveau ${itemType}`, type: itemType }], { renderSheet: true })
|
||||
})
|
||||
|
||||
|
||||
|
||||
html.find('.lock-unlock-sheet').click((event) => {
|
||||
this.options.editScore = !this.options.editScore;
|
||||
this.render(true);
|
||||
});
|
||||
});
|
||||
html.find('.item-equip').click(ev => {
|
||||
const li = $(ev.currentTarget).parents(".item");
|
||||
this.actor.equipItem( li.data("item-id") );
|
||||
this.render(true);
|
||||
this.render(true);
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
|
||||
/* -------------------------------------------- */
|
||||
/** @override */
|
||||
setPosition(options = {}) {
|
||||
|
||||
Reference in New Issue
Block a user