Foundry v13 migration
This commit is contained in:
@@ -6,7 +6,7 @@
|
||||
import { YggdrasillUtility } from "./yggdrasill-utility.js";
|
||||
|
||||
/* -------------------------------------------- */
|
||||
export class YggdrasillActorSheet extends ActorSheet {
|
||||
export class YggdrasillActorSheet extends foundry.appv1.sheets.ActorSheet {
|
||||
|
||||
/** @override */
|
||||
static get defaultOptions() {
|
||||
@@ -25,7 +25,7 @@ export class YggdrasillActorSheet extends ActorSheet {
|
||||
/* -------------------------------------------- */
|
||||
async getData() {
|
||||
const objectData = foundry.utils.duplicate(this.object)
|
||||
|
||||
|
||||
let formData = {
|
||||
title: this.title,
|
||||
id: objectData.id,
|
||||
@@ -60,14 +60,14 @@ export class YggdrasillActorSheet extends ActorSheet {
|
||||
sortsSejdr:this.actor.getSortsSejdr(),
|
||||
sortsGaldr:this.actor.getSortsGaldr(),
|
||||
runes: this.actor.getRunes(),
|
||||
optionsCarac: YggdrasillUtility.createDirectOptionList(0, 20),
|
||||
optionsDMDP: YggdrasillUtility.createDirectSortedOptionList(-10, +10),
|
||||
optionsBase: YggdrasillUtility.createDirectOptionList(0, 20),
|
||||
optionsFuror: YggdrasillUtility.createDirectOptionList(0, 15),
|
||||
tiragerunes: await TextEditor.enrichHTML(this.object.system.tiragesrunes, {async: true}),
|
||||
description: await TextEditor.enrichHTML(this.object.system.description, {async: true}),
|
||||
notes: await TextEditor.enrichHTML(this.object.system.notes, {async: true}),
|
||||
gmnotes: await TextEditor.enrichHTML(this.object.system.biodata.gmnotes, {async: true}),
|
||||
optionsCarac: YggdrasillUtility.createDirectOptionList(0, 20),
|
||||
optionsDMDP: YggdrasillUtility.createDirectSortedOptionList(-10, +10),
|
||||
optionsBase: YggdrasillUtility.createDirectOptionList(0, 20),
|
||||
optionsFuror: YggdrasillUtility.createDirectOptionList(0, 15),
|
||||
tiragerunes: await foundry.applications.ux.TextEditor.implementation.enrichHTML(this.object.system.tiragesrunes, {async: true}),
|
||||
description: await foundry.applications.ux.TextEditor.implementation.enrichHTML(this.object.system.description, {async: true}),
|
||||
notes: await foundry.applications.ux.TextEditor.implementation.enrichHTML(this.object.system.notes, {async: true}),
|
||||
gmnotes: await foundry.applications.ux.TextEditor.implementation.enrichHTML(this.object.system.biodata.gmnotes, {async: true}),
|
||||
options: this.options,
|
||||
owner: this.document.isOwner,
|
||||
editScore: this.options.editScore,
|
||||
@@ -113,11 +113,11 @@ updateDP( data ) {
|
||||
const li = $(ev.currentTarget).parents(".item");
|
||||
YggdrasillUtility.confirmDelete(this, li);
|
||||
});
|
||||
|
||||
|
||||
html.find('#isEpuise').click(event => {
|
||||
this.actor.toggleEpuise( );
|
||||
} );
|
||||
|
||||
|
||||
html.find('.munition-moins').click(event => {
|
||||
const li = $(event.currentTarget).parents(".item");
|
||||
const item = this.actor.items.get(li.data("item-id"));
|
||||
@@ -159,29 +159,29 @@ updateDP( data ) {
|
||||
const li = $(event.currentTarget).parents(".item");
|
||||
const sortId = li.data("item-id");
|
||||
this.actor.rollSort(sortId, "sejdr");
|
||||
});
|
||||
});
|
||||
html.find('.sort-galdr').click((event) => {
|
||||
const li = $(event.currentTarget).parents(".item");
|
||||
const sortId = li.data("item-id");
|
||||
this.actor.rollSort(sortId, "galdr");
|
||||
});
|
||||
});
|
||||
html.find('.sort-rune').click((event) => {
|
||||
const li = $(event.currentTarget).parents(".item");
|
||||
const sortId = li.data("item-id");
|
||||
this.actor.rollSort(sortId, "rune");
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
html.find('.arme-label a').click((event) => {
|
||||
const li = $(event.currentTarget).parents(".item");
|
||||
const armeId = li.data("arme-id");
|
||||
this.actor.rollArme(armeId);
|
||||
});
|
||||
});
|
||||
html.find('.carac-roll').click((event) => {
|
||||
const li = $(event.currentTarget).parents(".item");
|
||||
let categ = li.data("carac-categ");
|
||||
let carac = li.data("carac-key");
|
||||
this.actor.rollCarac(categ, carac);
|
||||
});
|
||||
});
|
||||
html.find('.weapon-damage').click((event) => {
|
||||
const li = $(event.currentTarget).parents(".item");
|
||||
const weapon = this.actor.items.get(li.data("item-id"));
|
||||
@@ -195,12 +195,12 @@ updateDP( data ) {
|
||||
html.find('.lock-unlock-sheet').click((event) => {
|
||||
this.options.editScore = !this.options.editScore;
|
||||
this.render(true);
|
||||
});
|
||||
});
|
||||
html.find('.item-link a').click((event) => {
|
||||
const itemId = $(event.currentTarget).data("item-id");
|
||||
const item = this.actor.items.get(itemId);
|
||||
item.sheet.render(true);
|
||||
});
|
||||
});
|
||||
html.find('.item-equip').click(ev => {
|
||||
const li = $(ev.currentTarget).parents(".item");
|
||||
this.actor.equiperObject( li.data("item-id") );
|
||||
|
||||
Reference in New Issue
Block a user