From 276368fc3f3aeb8a898d761287c33110628c22c3 Mon Sep 17 00:00:00 2001 From: Esrin Date: Fri, 19 Aug 2022 21:42:31 +0100 Subject: [PATCH] Basic Foundry v10 compatibility There will be bugs. --- modules/actors/actor-ffg-options.js | 2 +- modules/actors/actor-ffg.js | 75 +++++++++---------- modules/actors/actor-sheet-ffg.js | 62 +++++++-------- modules/actors/adversary-sheet-ffg.js | 4 +- modules/config/ffg-skillslist.js | 4 +- modules/helpers/modifiers.js | 46 ++++++------ modules/importer/skills-list-importer.js | 4 +- modules/items/item-ffg.js | 42 +++++------ modules/items/item-sheet-ffg.js | 31 ++++---- modules/items/itembase-ffg.js | 2 +- modules/popout-editor.js | 2 +- modules/swffg-main.js | 20 ++--- scss/components/_actorsheet_base.scss | 1 + scss/components/_itemsheet_base.scss | 1 + styles/starwarsffg.css | 2 + system.json | 8 +- templates/actors/ffg-adversary-sheet.html | 2 +- templates/actors/ffg-character-sheet.html | 2 +- templates/actors/ffg-homestead-sheet.html | 2 +- templates/actors/ffg-minion-sheet.html | 2 +- templates/actors/ffg-vehicle-sheet.html | 2 +- templates/items/ffg-armour-sheet.html | 2 +- templates/items/ffg-career-sheet.html | 2 +- templates/items/ffg-criticaldamage-sheet.html | 2 +- templates/items/ffg-criticalinjury-sheet.html | 2 +- templates/items/ffg-gear-sheet.html | 2 +- .../items/ffg-homesteadupgrade-sheet.html | 2 +- templates/items/ffg-itemattachment-sheet.html | 2 +- templates/items/ffg-itemmodifier-sheet.html | 2 +- templates/items/ffg-shipattachment-sheet.html | 2 +- templates/items/ffg-shipweapon-sheet.html | 2 +- templates/items/ffg-species-sheet.html | 2 +- templates/items/ffg-talent-sheet.html | 2 +- templates/items/ffg-weapon-sheet.html | 2 +- .../parts/actor/ffg-weapon-armor-gear.html | 4 +- templates/popout-editor.html | 2 +- 36 files changed, 175 insertions(+), 173 deletions(-) diff --git a/modules/actors/actor-ffg-options.js b/modules/actors/actor-ffg-options.js index 23c1eed3..383a4a61 100644 --- a/modules/actors/actor-ffg-options.js +++ b/modules/actors/actor-ffg-options.js @@ -66,7 +66,7 @@ export default class ActorOptions { if (!this.options[optionName]) { this.options[optionName] = { ...options }; } - if (typeof this.data.object.data.flags?.starwarsffg?.config == "undefined") { + if (typeof this.data.object.flags?.starwarsffg?.config == "undefined") { await this.data.object.setFlag("starwarsffg", "config", {}); } diff --git a/modules/actors/actor-ffg.js b/modules/actors/actor-ffg.js index ce697105..a56c5d62 100644 --- a/modules/actors/actor-ffg.js +++ b/modules/actors/actor-ffg.js @@ -10,10 +10,10 @@ export class ActorFFG extends Actor { * Augment the basic actor data with additional dynamic data. */ prepareDerivedData() { - CONFIG.logger.debug(`Preparing Actor Data ${this.data.type}`); - const actorData = this.data; - const data = actorData.data; - const flags = actorData.flags; + CONFIG.logger.debug(`Preparing Actor Data ${this.type}`); + const actor = this; + const data = actor.system; + const flags = actor.flags; // Make separate methods for each Actor type (character, minion, etc.) to keep // things organized. @@ -40,13 +40,13 @@ export class ActorFFG extends Actor { }); } this._prepareSharedData.bind(this); - this._prepareSharedData(actorData); - if (actorData.type === "minion") this._prepareMinionData(actorData); - if (actorData.type === "character") this._prepareCharacterData(actorData); + this._prepareSharedData(actor); + if (actor.type === "minion") this._prepareMinionData(actor); + if (actor.type === "character") this._prepareCharacterData(actor); } _prepareSharedData(actorData) { - const data = actorData.data; + const data = actorData.system; //data.biography = PopoutEditor.replaceRollTags(data.biography, actorData); data.biography = PopoutEditor.renderDiceImages(data.biography, actorData); @@ -90,7 +90,7 @@ export class ActorFFG extends Actor { * Prepare Minion type specific data */ _prepareMinionData(actorData) { - const data = actorData.data; + const data = actorData.system; // Set Wounds threshold to unit_wounds * quantity to account for minion group health. data.stats.wounds.max = Math.floor(data.unit_wounds.value * data.quantity.max); @@ -183,7 +183,7 @@ export class ActorFFG extends Actor { * Prepare Character type specific data */ _prepareCharacterData(actorData) { - const data = actorData.data; + const data = actorData; // Build complete talent list. @@ -195,14 +195,14 @@ export class ActorFFG extends Actor { specializations.forEach((element) => { //go through each list of talent where learned = true - const learnedTalents = Object.keys(element.data.data.talents).filter((key) => element.data.data.talents[key].islearned === true); + const learnedTalents = Object.keys(element.system.talents).filter((key) => element.system.talents[key].islearned === true); learnedTalents.forEach((talent) => { - const item = JSON.parse(JSON.stringify(element.data.data.talents[talent])); + const item = JSON.parse(JSON.stringify(element.system.talents[talent])); item.firstSpecialization = element.id; item.source = [{ type: "specialization", typeLabel: "SWFFG.Specialization", name: element.name, id: element.id }]; if (item.isRanked) { - item.rank = element.data.data.talents[talent]?.rank ? element.data.data.talents[talent].rank : 1; + item.rank = element.system.talents[talent]?.rank ? element.system.talents[talent].rank : 1; } else { item.rank = "N/A"; } @@ -214,7 +214,7 @@ export class ActorFFG extends Actor { globalTalentList.push(item); } else { globalTalentList[index].source.push({ type: "specialization", typeLabel: "SWFFG.Specialization", name: element.name, id: element.id }); - globalTalentList[index].rank += element.data.data.talents[talent]?.rank ? element.data.data.talents[talent].rank : 1; + globalTalentList[index].rank += element.system.talents[talent]?.rank ? element.system.talents[talent].rank : 1; } }); }); @@ -227,21 +227,21 @@ export class ActorFFG extends Actor { const item = { name: element.name, itemId: element.id, - description: element.data?.data?.description, - activation: element.data?.data?.activation?.value, - activationLabel: element.data?.data?.activation?.label, - isRanked: element.data?.data?.ranks?.ranked, + description: element.system?.description, + activation: element.system?.activation?.value, + activationLabel: element.system?.activation?.label, + isRanked: element.system?.ranks?.ranked, source: [{ type: "talent", typeLabel: "SWFFG.Talent", name: element.name, id: element.id }], }; if (item.isRanked) { - item.rank = element.data.data.ranks.current; + item.rank = element.system.ranks.current; } else { item.rank = "N/A"; } if (CONFIG.FFG.theme !== "starwars") { - item.tier = parseInt(element.data?.data?.tier, 10); + item.tier = parseInt(element.system?.tier, 10); } let index = globalTalentList.findIndex((obj) => { @@ -252,9 +252,9 @@ export class ActorFFG extends Actor { globalTalentList.push(item); } else { globalTalentList[index].source.push({ type: "talent", typeLabel: "SWFFG.Talent", name: element.name, id: element.id }); - globalTalentList[index].rank += element.data.data.ranks.current; + globalTalentList[index].rank += element.system.ranks.current; if (CONFIG.FFG.theme !== "starwars") { - globalTalentList[index].tier = Math.abs(parseInt(globalTalentList[index].rank) + (parseInt(element.data?.data?.tier, 10) - 1)); + globalTalentList[index].tier = Math.abs(parseInt(globalTalentList[index].rank) + (parseInt(element.system?.tier, 10) - 1)); } } }); @@ -313,30 +313,30 @@ export class ActorFFG extends Actor { } _calculateDerivedValues(actorData) { - const data = actorData.data; - const items = actorData.items.map((item) => item.data); + const data = actorData.system; + const items = actorData.items; var encum = 0; // Loop through all items for (let [key, item] of Object.entries(items)) { try { // Calculate encumbrance, only if encumbrance value exists - if (item.data?.encumbrance?.adjusted !== undefined || item.data?.encumbrance?.value !== undefined) { - if (item.type === "armour" && item?.data?.equippable?.equipped) { + if (item.system?.encumbrance?.adjusted !== undefined || item.system?.encumbrance?.value !== undefined) { + if (item.type === "armour" && item?.system?.equippable?.equipped) { const equippedEncumbrance = +item.data.encumbrance.adjusted - 3; encum += equippedEncumbrance > 0 ? equippedEncumbrance : 0; } else if (item.type === "armour" || item.type === "weapon" || item.type === "shipweapon") { let count = 0; - if (item.data?.quantity?.value) { - count = item.data.quantity.value; + if (item.system?.quantity?.value) { + count = item.system.quantity.value; } - encum += ((item.data?.encumbrance?.adjusted !== undefined) ? item.data?.encumbrance?.adjusted : item.data?.encumbrance?.value) * count; + encum += ((item.system?.encumbrance?.adjusted !== undefined) ? item.system?.encumbrance?.adjusted : item.system?.encumbrance?.value) * count; } else { let count = 0; - if (item.data?.quantity?.value) { - count = item.data.quantity.value; + if (item.system?.quantity?.value) { + count = item.system.quantity.value; } - encum += item.data?.encumbrance?.value * count; + encum += item.system?.encumbrance?.value * count; } } } catch (err) { @@ -407,8 +407,7 @@ export class ActorFFG extends Actor { * @param {string} modifierType */ _setModifiers(actorData, properties, name, modifierType) { - const actor = this; - const data = actorData.data; + const data = actorData.system; const attributes = Object.keys(data.attributes) .filter((key) => Object.keys(properties) @@ -505,12 +504,12 @@ export class ActorFFG extends Actor { * @param {object} actorData */ _applyModifiers(actorData) { - const data = actorData.data; + const data = actorData.system; const isPC = this.hasPlayerOwner; if (!actorData.modifiers) { actorData.modifiers = {}; } - const items = actorData.items.map((item) => item.data); + const items = actorData.items; this._setModifiers.bind(this); @@ -634,13 +633,13 @@ export class ActorFFG extends Actor { } _applyVehicleModifiers(actorData) { - const data = actorData.data; + const data = actorData.system; const isPC = this.hasPlayerOwner; if (!actorData.modifiers) { actorData.modifiers = {}; } - const items = actorData.items.map((item) => item.data); + const items = actorData.items; this._setModifiers(actorData, CONFIG.FFG.vehicle_stats, "stats", "Stat"); Object.keys(CONFIG.FFG.vehicle_stats).forEach((k) => { diff --git a/modules/actors/actor-sheet-ffg.js b/modules/actors/actor-sheet-ffg.js index bcf699d9..716bffeb 100644 --- a/modules/actors/actor-sheet-ffg.js +++ b/modules/actors/actor-sheet-ffg.js @@ -40,7 +40,7 @@ export class ActorSheetFFG extends ActorSheet { /** @override */ get template() { const path = "systems/starwarsffg/templates/actors"; - return `${path}/ffg-${this.actor.data.type}-sheet.html`; + return `${path}/ffg-${this.actor.type}-sheet.html`; } /* -------------------------------------------- */ @@ -51,13 +51,13 @@ export class ActorSheetFFG extends ActorSheet { data.classType = this.constructor.name; // Compatibility for Foundry 0.8.x with backwards compatibility (hopefully) for 0.7.x - const actorData = this.actor.data.toObject(false); + const actorData = this.actor.toObject(false); data.actor = actorData; - data.data = actorData.data; + data.data = actorData.system; data.rollData = this.actor.getRollData.bind(this.actor); - data.token = this.token?.data; - data.items = this.actor.items.map((item) => item.data); + data.token = this.token; + data.items = this.actor.items; if (options?.action === "update" && this.object.compendium) { data.item = mergeObject(data.actor, options.data); @@ -71,28 +71,28 @@ export class ActorSheetFFG extends ActorSheet { let autoSoakCalculation = true; - if (typeof this.actor.data?.flags?.config?.enableAutoSoakCalculation === "undefined") { + if (typeof this.actor.flags?.config?.enableAutoSoakCalculation === "undefined") { autoSoakCalculation = game.settings.get("starwarsffg", "enableSoakCalc"); } else { - autoSoakCalculation = this.actor.data?.flags?.starwarsffg?.config?.enableAutoSoakCalculation; + autoSoakCalculation = this.actor.flags?.starwarsffg?.config?.enableAutoSoakCalculation; } data.settings = { enableSoakCalculation: autoSoakCalculation, - enableCriticalInjuries: this.actor.data?.flags?.starwarsffg?.config?.enableCriticalInjuries, + enableCriticalInjuries: this.actor.flags?.starwarsffg?.config?.enableCriticalInjuries, }; // Establish sheet width and height using either saved persistent values or default values defined in swffg-config.js - this.position.width = this.sheetWidth || CONFIG.FFG.sheets.defaultWidth[this.actor.data.type]; - this.position.height = this.sheetHeight || CONFIG.FFG.sheets.defaultHeight[this.actor.data.type]; + this.position.width = this.sheetWidth || CONFIG.FFG.sheets.defaultWidth[this.actor.type]; + this.position.height = this.sheetHeight || CONFIG.FFG.sheets.defaultHeight[this.actor.type]; - switch (this.actor.data.type) { + switch (this.actor.type) { case "character": if (data.limited) { this.position.height = 165; } // we need to update all specialization talents with the latest talent information - if (!this.actor.data.flags.starwarsffg?.loaded) { + if (!this.actor.flags.starwarsffg?.loaded) { this._updateSpecialization(data); } @@ -103,7 +103,7 @@ export class ActorSheetFFG extends ActorSheet { default: } - if (this.actor.data.type !== "vehicle" && this.actor.data.type !== "homestead") { + if (this.actor.type !== "vehicle" && this.actor.type !== "homestead") { // Filter out skills that are not custom (manually added) or part of the current system skill list Object.keys(data.data.skills) .filter(s => !data.data.skills[s].custom && !CONFIG.FFG.skills[s]) @@ -112,7 +112,7 @@ export class ActorSheetFFG extends ActorSheet { data.data.skilllist = this._createSkillColumns(data); } - if (this.actor.data?.flags?.config?.enableObligation === false && this.actor.data?.flags?.config?.enableDuty === false && this.actor.data?.flags?.config?.enableMorality === false && this.actor.data?.flags?.config?.enableConflict === false) { + if (this.actor.flags?.config?.enableObligation === false && this.actor.flags?.config?.enableDuty === false && this.actor.flags?.config?.enableMorality === false && this.actor.flags?.config?.enableConflict === false) { data.hideObligationDutyMoralityConflictTab = true; } @@ -267,7 +267,7 @@ export class ActorSheetFFG extends ActorSheet { if (!item) { item = await ImportHelpers.findCompendiumEntityById("Item", itemId); } - const forcedice = this.actor.data.data.stats.forcePool.max - this.actor.data.data.stats.forcePool.value; + const forcedice = this.actor.data.stats.forcePool.max - this.actor.data.stats.forcePool.value; if (forcedice > 0) { let sheet = this.getData(); const dicePool = new DicePoolFFG({ @@ -282,7 +282,7 @@ export class ActorSheetFFG extends ActorSheet { new ContextMenu(html, "li.item.forcepower", [sendToChatContextItem, rollForceToChatContextItem]); new ContextMenu(html, "div.item", [sendToChatContextItem]); - if (this.actor.data.type === "character") { + if (this.actor.type === "character") { this.sheetoptions = new ActorOptions(this, html); this.sheetoptions.register("enableAutoSoakCalculation", { name: game.i18n.localize("SWFFG.EnableSoakCalc"), @@ -335,7 +335,7 @@ export class ActorSheetFFG extends ActorSheet { }); } - if (this.actor.data.type === "minion") { + if (this.actor.type === "minion") { this.sheetoptions = new ActorOptions(this, html); this.sheetoptions.register("enableAutoSoakCalculation", { name: game.i18n.localize("SWFFG.EnableSoakCalc"), @@ -358,7 +358,7 @@ export class ActorSheetFFG extends ActorSheet { }); } - if (this.actor.data.type === "vehicle") { + if (this.actor.type === "vehicle") { this.sheetoptions = new ActorOptions(this, html); this.sheetoptions.register("enableHyperdrive", { name: game.i18n.localize("SWFFG.EnableHyperdrive"), @@ -448,7 +448,7 @@ export class ActorSheetFFG extends ActorSheet { const li = $(ev.currentTarget); const item = this.actor.items.get(li.data("itemId")); if (item) { - item.update({ ["data.equippable.equipped"]: !item.data.data.equippable.equipped }); + item.update({ ["system.equippable.equipped"]: !item.system.equippable.equipped }); } }); @@ -561,7 +561,7 @@ export class ActorSheetFFG extends ActorSheet { const li = $(ev.currentTarget).parents(".item"); const itemId = li.data("itemId"); - const item = this.actor.data.data.talentList.find((talent) => { + const item = this.actor.data.talentList.find((talent) => { return talent.itemId === itemId; }); @@ -758,7 +758,7 @@ export class ActorSheetFFG extends ActorSheet { let details = li.children(".item-details"); details.slideUp(200, () => details.remove()); } else { - let div = $(`
${PopoutEditor.renderDiceImages(itemDetails.description, this.actor.data)}
`); + let div = $(`
${PopoutEditor.renderDiceImages(itemDetails.description, this.actor)}
`); let props = $(`
`); itemDetails.properties.forEach((p) => props.append(`${p}`)); div.append(props); @@ -1058,11 +1058,11 @@ export class ActorSheetFFG extends ActorSheet { const item = this.actor.items.get(li.dataset.itemId); // limit transfer on personal weapons/armour/gear - if (["weapon", "armour", "gear"].includes(item.data.type)) { + if (["weapon", "armour", "gear"].includes(item.type)) { const dragData = { type: "Transfer", actorId: this.actor.id, - data: item.data, + data: item, }; if (this.actor.isToken) dragData.tokenId = this.actor.token.id; event.dataTransfer.setData("text/plain", JSON.stringify(dragData)); @@ -1114,17 +1114,17 @@ export class ActorSheetFFG extends ActorSheet { */ async _updateSpecialization(data) { CONFIG.logger.debug(`Running Actor initial load`); - if (this.actor.data.flags.starwarsffg === undefined) { - this.actor.data.flags.starwarsffg = {}; + if (this.actor.flags.starwarsffg === undefined) { + this.actor.flags.starwarsffg = {}; } - this.actor.data.flags.starwarsffg.loaded = true; + this.actor.flags.starwarsffg.loaded = true; - const specializations = this.actor.data.items.filter((item) => { + const specializations = this.actor.items.filter((item) => { return item.type === "specialization"; }); - specializations.forEach(async (spec) => { - const specializationTalents = spec.data.talents; + for (const spec of specializations) { + const specializationTalents = spec.talents; for (let talent in specializationTalents) { let gameItem; if (specializationTalents[talent].pack && specializationTalents[talent].pack.length > 0) { @@ -1170,8 +1170,8 @@ export class ActorSheetFFG extends ActorSheet { }); } - data.actor.data.talentList = mergeObject(data.actor.data.talentList, globalTalentList); - }); + data.data.talentList = mergeObject(data.data.talentList ? data.data.talentList : [], globalTalentList); + } } /** diff --git a/modules/actors/adversary-sheet-ffg.js b/modules/actors/adversary-sheet-ffg.js index 96a3a09f..e195916a 100644 --- a/modules/actors/adversary-sheet-ffg.js +++ b/modules/actors/adversary-sheet-ffg.js @@ -26,7 +26,7 @@ export class AdversarySheetFFG extends ActorSheetFFG { getData() { const data = super.getData(); - switch (this.actor.data.type) { + switch (this.actor.type) { case "character": this.position.width = 595; this.position.height = 783; @@ -35,7 +35,7 @@ export class AdversarySheetFFG extends ActorSheetFFG { } // we need to update all specialization talents with the latest talent information - if (!this.actor.data.flags.starwarsffg?.loaded) { + if (!this.actor.flags.starwarsffg?.loaded) { super._updateSpecialization(data); } diff --git a/modules/config/ffg-skillslist.js b/modules/config/ffg-skillslist.js index 2087ebe2..b971982b 100644 --- a/modules/config/ffg-skillslist.js +++ b/modules/config/ffg-skillslist.js @@ -1,5 +1,5 @@ // Alternate Skill Lists -export const defaultSkillArrayString = JSON.stringify([ +export const defaultSkillList = [ { "id": "starwars", "skills": { @@ -1626,4 +1626,4 @@ export const defaultSkillArrayString = JSON.stringify([ }, }, }, -]); +]; diff --git a/modules/helpers/modifiers.js b/modules/helpers/modifiers.js index 973d6221..bec1c585 100644 --- a/modules/helpers/modifiers.js +++ b/modules/helpers/modifiers.js @@ -38,23 +38,23 @@ export default class ModifierHelpers { try { items.forEach((item) => { - if (item.data.attributes) { - const attrsToApply = Object.keys(item.data.attributes) - .filter((id) => (item.data.attributes[id].mod === key || item.data.attributes[id].mod === "*") && item.data.attributes[id].modtype === modtype) - .map((i) => item.data.attributes[i]); + if (item.system?.attributes) { + const attrsToApply = Object.keys(item.system.attributes) + .filter((id) => (item.system.attributes[id].mod === key || item.system.attributes[id].mod === "*") && item.system.attributes[id].modtype === modtype) + .map((i) => item.system.attributes[i]); if (item.type === "armour" || item.type === "weapon") { - if (item?.data?.equippable?.equipped) { - if (key === "Soak" && item.data?.soak) { - sources.push({ modtype, key, name: item.name, value: item.data.soak.adjusted, type: item.type }); - total += parseInt(item.data.soak.adjusted, 10); + if (item?.system?.equippable?.equipped) { + if (key === "Soak" && item.system?.soak) { + sources.push({ modtype, key, name: item.name, value: item.system.soak.adjusted, type: item.type }); + total += parseInt(item.system.soak.adjusted, 10); } - if ((key === "Defence-Melee" || key === "Defence-Ranged") && item.data?.defence) { + if ((key === "Defence-Melee" || key === "Defence-Ranged") && item.system?.defence) { // get the highest defense item - const shouldUse = items.filter((i) => item.data.defence >= i.data.defence).length >= 0; + const shouldUse = items.filter((i) => item.system.defence >= i.data.defence).length >= 0; if (shouldUse) { - sources.push({ modtype, key, name: item.name, value: item.data.defence.adjusted, type: item.type }); - total += parseInt(item.data.defence.adjusted, 10); + sources.push({ modtype, key, name: item.name, value: item.system.defence.adjusted, type: item.type }); + total += parseInt(item.system.defence.adjusted, 10); } } if (attrsToApply.length > 0) { @@ -91,14 +91,14 @@ export default class ModifierHelpers { let upgrades; if (item.type === "forcepower" || item.type === "signatureability") { // apply force power upgrades - upgrades = Object.keys(item.data.upgrades) - .filter((k) => item.data.upgrades[k].islearned) + upgrades = Object.keys(item.system.upgrades) + .filter((k) => item.system.upgrades[k].islearned) .map((k) => { return { type: "talent", - name: `${item.name}: ${item.data.upgrades[k].name}`, + name: `${item.name}: ${item.system.upgrades[k].name}`, data: { - attributes: item.data.upgrades[k]?.attributes ? item.data.upgrades[k]?.attributes : {}, + attributes: item.system.upgrades[k]?.attributes ? item.system.upgrades[k]?.attributes : {}, ranks: { ranked: false, current: 1, @@ -108,16 +108,16 @@ export default class ModifierHelpers { }); } else if (item.type === "specialization") { // apply specialization talent modifiers - upgrades = Object.keys(item.data.talents) - .filter((k) => item.data.talents[k].islearned) + upgrades = Object.keys(item.system.talents) + .filter((k) => item.system.talents[k].islearned) .map((k) => { return { type: "talent", - name: `${item.name}: ${item.data.talents[k].name}`, + name: `${item.name}: ${item.system.talents[k].name}`, data: { - attributes: item.data.talents[k].attributes, + attributes: item.system.talents[k].attributes, ranks: { - ranked: item.data.talents[k].isRanked, + ranked: item.system.talents[k].isRanked, current: 1, }, }, @@ -150,8 +150,8 @@ export default class ModifierHelpers { } else { if (item.type === "talent") { let multiplier = 1; - if (item.data.ranks.ranked) { - multiplier = item.data.ranks.current; + if (item.system.ranks.ranked) { + multiplier = item.system.ranks.current; } sources.push({ modtype, key, name: item.name, value: attr.value * multiplier, type: item.type }); total += parseInt(attr.value, 10) * multiplier; diff --git a/modules/importer/skills-list-importer.js b/modules/importer/skills-list-importer.js index 6bb782fa..2fb46a70 100644 --- a/modules/importer/skills-list-importer.js +++ b/modules/importer/skills-list-importer.js @@ -1,5 +1,5 @@ import Helpers from "../helpers/common.js"; -import { defaultSkillArrayString } from "../config/ffg-skillslist.js"; +import { defaultSkillList } from "../config/ffg-skillslist.js"; export default class SkillListImporter extends FormApplication { /** @override */ @@ -53,7 +53,7 @@ export default class SkillListImporter extends FormApplication { event.preventDefault(); event.stopPropagation(); - game.settings.set("starwarsffg", "arraySkillList", defaultSkillArrayString); + game.settings.set("starwarsffg", "arraySkillList", defaultSkillList); game.settings.set("starwarsffg", "skilltheme", "starwars"); debounce(() => window.location.reload(), 100); diff --git a/modules/items/item-ffg.js b/modules/items/item-ffg.js index 4952f520..04a812a5 100644 --- a/modules/items/item-ffg.js +++ b/modules/items/item-ffg.js @@ -31,12 +31,12 @@ export class ItemFFG extends ItemBaseFFG { CONFIG.logger.debug(`Preparing Item Data ${this.type} ${this.name}`); // Get the Item's data - const itemData = this.data; - const actorData = this.actor ? this.actor.data : {}; - const data = itemData.data; + const item = this; + const actor = this.actor ? this.actor : {}; + const data = item.system; - if (!itemData.flags.starwarsffg) { - itemData.update({ + if (!item.flags.starwarsffg) { + await item.update({ flags: { starwarsffg: { isCompendium: !!this.compendium, @@ -48,23 +48,23 @@ export class ItemFFG extends ItemBaseFFG { }); } else { if (this.compendium) { - itemData.flags.starwarsffg.isCompendium = true; + item.flags.starwarsffg.isCompendium = true; // Temporary check on this.parent.data to avoid initialisation failing in Foundry VTT 0.8.6 - if (this.parent?.data) itemData.flags.starwarsffg.ffgUuid = this.uuid; + if (this.parent?.data) item.flags.starwarsffg.ffgUuid = this.uuid; } else { - itemData.flags.starwarsffg.isCompendium = false; - itemData.flags.starwarsffg.ffgIsOwned = false; + item.flags.starwarsffg.isCompendium = false; + item.flags.starwarsffg.ffgIsOwned = false; if (this.isEmbedded) { - itemData.flags.starwarsffg.ffgIsOwned = true; + item.flags.starwarsffg.ffgIsOwned = true; // Temporary check on this.parent.data to avoid initialisation failing in Foundry VTT 0.8.6 - if (this.parent?.data) itemData.flags.starwarsffg.ffgUuid = this.uuid; - } else if (itemData._id) { - itemData.flags.starwarsffg.ffgTempId = itemData._id; + if (this.parent) item.flags.starwarsffg.ffgUuid = this.uuid; + } else if (item._id) { + item.flags.starwarsffg.ffgTempId = item._id; } } } - data.renderedDesc = PopoutEditor.renderDiceImages(data.description, actorData); + data.renderedDesc = PopoutEditor.renderDiceImages(data.description, actor); // perform localisation of dynamic values switch (this.type) { @@ -147,7 +147,7 @@ export class ItemFFG extends ItemBaseFFG { }); } - if (this.isEmbedded && this.actor && this.actor.data) { + if (this.isEmbedded && this.actor) { let damageAdd = 0; for (let attr in data.attributes) { if (data.attributes[attr].mod === "damage" && data.attributes[attr].modtype === "Weapon Stat") { @@ -157,7 +157,7 @@ export class ItemFFG extends ItemBaseFFG { if (this.actor.type !== "vehicle") { if (ModifierHelpers.applyBrawnToDamage(data)) { const olddamage = data.damage.value; - data.damage.value = parseInt(actorData.data.characteristics[data.characteristic.value].value, 10) + damageAdd; + data.damage.value = parseInt(actor.data.characteristics[data.characteristic.value].value, 10) + damageAdd; data.damage.adjusted += parseInt(data.damage.value, 10) - olddamage; } else { data.damage.value = parseInt(data.damage.value, 10); @@ -306,8 +306,8 @@ export class ItemFFG extends ItemBaseFFG { } _prepareTalentTrees(collection, itemType, listProperty, hasGlobalList) { - const itemData = this.data; - const talents = itemData.data[collection]; + const item = this; + const talents = item.system[collection]; let rowcount = 0; const controls = Object.keys(talents).filter((item) => { return item.includes(itemType); @@ -380,7 +380,7 @@ export class ItemFFG extends ItemBaseFFG { return a.name - b.name; }); - itemData[listProperty] = itemList; + item[listProperty] = itemList; } async _prepareSpecializations() { @@ -414,12 +414,12 @@ export class ItemFFG extends ItemBaseFFG { * Prepare and return details of the item for display in inventory or chat. */ getItemDetails() { - const data = duplicate(this.data.data); + const data = duplicate(this.system); // Item type specific properties const props = []; - data.prettyDesc = PopoutEditor.renderDiceImages(data.description, this.actor?.data); + data.prettyDesc = PopoutEditor.renderDiceImages(data.description, this.actor); if (this.type === "forcepower") { //Display upgrades diff --git a/modules/items/item-sheet-ffg.js b/modules/items/item-sheet-ffg.js index 754c4561..b4613eb5 100644 --- a/modules/items/item-sheet-ffg.js +++ b/modules/items/item-sheet-ffg.js @@ -33,10 +33,7 @@ export class ItemSheetFFG extends ItemSheet { async getData(options) { let data = super.getData(options); - const itemData = data.data; - - data.item = itemData; - data.data = itemData.data; + data.data = data.item.system; if (options?.action === "update" && this.object.compendium) { data.item = mergeObject(data.item, options.data); @@ -61,11 +58,11 @@ export class ItemSheetFFG extends ItemSheet { } data.isTemp = false; - if (this.object.data?.flags?.starwarsffg?.ffgIsOwned || this.object.data?.flags?.starwarsffg?.ffgIsTemp) { + if (this.object.flags?.starwarsffg?.ffgIsOwned || this.object.flags?.starwarsffg?.ffgIsTemp) { data.isTemp = true; } - switch (this.object.data.type) { + switch (this.object.type) { case "weapon": case "shipweapon": this.position.width = 550; @@ -98,25 +95,25 @@ export class ItemSheetFFG extends ItemSheet { case "forcepower": this.position.width = 720; this.position.height = 840; - data.data.isReadOnly = false; + data.isReadOnly = false; if (!this.options.editable) { - data.data.isEditing = false; - data.data.isReadOnly = true; + data.isEditing = false; + data.isReadOnly = true; } break; case "specialization": this.position.width = 715; - data.data.isReadOnly = false; + data.isReadOnly = false; if (!this.options.editable) { - data.data.isEditing = false; - data.data.isReadOnly = true; + data.isEditing = false; + data.isReadOnly = true; } - if (!this.item.data.flags?.starwarsffg?.loaded) { + if (!this.item.flags?.starwarsffg?.loaded) { CONFIG.logger.debug(`Running Item initial load`); - this.item.data.flags.starwarsffg.loaded = true; + this.item.flags.starwarsffg.loaded = true; - const specializationTalents = data.data.talents; + const specializationTalents = data.system.talents; await ImportHelpers.asyncForEach(Object.keys(specializationTalents), async (talent) => { let gameItem; @@ -142,7 +139,7 @@ export class ItemSheetFFG extends ItemSheet { } if (gameItem) { - this._updateSpecializationTalentReference(specializationTalents[talent], gameItem.data); + this._updateSpecializationTalentReference(specializationTalents[talent], gameItem); } }); } @@ -224,7 +221,7 @@ export class ItemSheetFFG extends ItemSheet { } data.FFG = CONFIG.FFG; - data.data.renderedDesc = PopoutEditor.renderDiceImages(data.data.description, this.actor ? this.actor.data : {}); + data.renderedDesc = PopoutEditor.renderDiceImages(data.description, this.actor ? this.actor : {}); return data; } diff --git a/modules/items/itembase-ffg.js b/modules/items/itembase-ffg.js index f62f63ab..d5286289 100644 --- a/modules/items/itembase-ffg.js +++ b/modules/items/itembase-ffg.js @@ -2,7 +2,7 @@ import EmbeddedItemHelpers from "../helpers/embeddeditem-helpers.js"; export default class ItemBaseFFG extends Item { async update(data, options = {}) { - if (!this.data?.flags?.starwarsffg?.ffgTempId || (this.data?.flags?.starwarsffg?.ffgTempId === this.data._id && !this.data.isTemp) || this.data?.flags?.starwarsffg?.ffgIsOwned) { + if (!this.flags?.starwarsffg?.ffgTempId || (this.flags?.starwarsffg?.ffgTempId === this._id && !this.isTemp) || this.flags?.starwarsffg?.ffgIsOwned) { super.update(data, options); // if (this.compendium) { // return this.sheet.render(true); diff --git a/modules/popout-editor.js b/modules/popout-editor.js index 61c553a7..bf01c336 100644 --- a/modules/popout-editor.js +++ b/modules/popout-editor.js @@ -57,7 +57,7 @@ export default class PopoutEditor extends FormApplication { html = this.replaceRollTags(html, actorData); try { - html = TextEditor.enrichHTML(html, { secrets: true, documents: true }); + html = TextEditor.enrichHTML(html, { secrets: true, documents: true, async: false }); } catch (err) { // ignore the message below, it means that we already created an entity link (this could be part of an editor text) if (err.message !== "An Entity subclass must configure the EntityCollection it belongs to.") { diff --git a/modules/swffg-main.js b/modules/swffg-main.js index 9684a99f..7854f767 100644 --- a/modules/swffg-main.js +++ b/modules/swffg-main.js @@ -26,7 +26,7 @@ import Helpers from "./helpers/common.js"; import TemplateHelpers from "./helpers/partial-templates.js"; import SkillListImporter from "./importer/skills-list-importer.js"; import DestinyTracker from "./ffg-destiny-tracker.js"; -import { defaultSkillArrayString } from "./config/ffg-skillslist.js"; +import { defaultSkillList } from "./config/ffg-skillslist.js"; import SettingsHelpers from "./settings/settings-helpers.js"; // Import Dice Types @@ -197,12 +197,12 @@ Hooks.once("init", async function () { game.settings.register("starwarsffg", "arraySkillList", { name: "Skill List", scope: "world", - default: defaultSkillArrayString, + default: defaultSkillList, config: false, - type: String, + type: Object, }); - let skillList = JSON.parse(game.settings.get("starwarsffg", "arraySkillList")); + let skillList = game.settings.get("starwarsffg", "arraySkillList"); try { CONFIG.FFG.alternateskilllists = skillList; @@ -249,7 +249,9 @@ Hooks.once("init", async function () { CONFIG.FFG.skills = ordered; } - } catch (err) {} + } catch (err) { + console.error(err); + } Hooks.on("createActor", (actor) => { if (actor.type !== "vehicle" && actor.type !== "homestead") { @@ -495,10 +497,10 @@ Hooks.once("ready", async () => { const currentVersion = game.settings.get("starwarsffg", "systemMigrationVersion"); - const version = game.system.data.version; - const isAlpha = game.system.data.version.includes("alpha"); + const version = game.system.version; + const isAlpha = game.system.version.includes("alpha"); - if ((isAlpha || currentVersion === "null" || parseFloat(currentVersion) < parseFloat(game.system.data.version)) && game.user.isGM) { + if ((isAlpha || currentVersion === "null" || parseFloat(currentVersion) < parseFloat(game.system.version)) && game.user.isGM) { CONFIG.logger.log(`Migrating to from ${currentVersion} to ${game.system.data.version}`); // Calculating wound and strain .value from .real_value is no longer necessary due to the Token._drawBar() override in swffg-main.js @@ -558,7 +560,7 @@ Hooks.once("ready", async () => { if (data.files.includes(`worlds/${game.world.id}/skills.json`)) { // if the skills.json file is found AND the skillsList in setting is the default skill list then read the data from the file. // This will make sure that the data from the JSON file overwrites the data in the setting. - if ((await game.settings.get("starwarsffg", "arraySkillList")) === defaultSkillArrayString) { + if ((await game.settings.get("starwarsffg", "arraySkillList")) === defaultSkillList) { const fileData = await fetch(`/worlds/${game.world.id}/skills.json`).then((response) => response.json()); await game.settings.set("starwarsffg", "arraySkillList", JSON.stringify(fileData)); skillList = fileData; diff --git a/scss/components/_actorsheet_base.scss b/scss/components/_actorsheet_base.scss index c22f2a9e..548d3bfd 100644 --- a/scss/components/_actorsheet_base.scss +++ b/scss/components/_actorsheet_base.scss @@ -8,6 +8,7 @@ padding: 0; .item { line-height: 15px; + padding: 0; } } diff --git a/scss/components/_itemsheet_base.scss b/scss/components/_itemsheet_base.scss index ae7dfb52..c5957679 100644 --- a/scss/components/_itemsheet_base.scss +++ b/scss/components/_itemsheet_base.scss @@ -13,6 +13,7 @@ padding: 0; .item { line-height: 15px; + padding: 0; } } diff --git a/styles/starwarsffg.css b/styles/starwarsffg.css index c84673ed..4ad16437 100644 --- a/styles/starwarsffg.css +++ b/styles/starwarsffg.css @@ -233,6 +233,7 @@ img { } .starwarsffg.sheet.actor .tabs .item { line-height: 15px; + padding: 0; } .starwarsffg.sheet.actor .characteristic-item .characteristic-label { background-color: #490c0b; @@ -529,6 +530,7 @@ img { } .starwarsffg.sheet.item .tabs .item { line-height: 15px; + padding: 0; } .starwarsffg.sheet.item .characteristic .characteristic-value.restricted::after { content: "R"; diff --git a/system.json b/system.json index 4a6116d8..c68e42fd 100644 --- a/system.json +++ b/system.json @@ -3,8 +3,8 @@ "title": "Star Wars FFG", "description": "A system for playing Star Wars FFG games.", "version": "1.72", - "minimumCoreVersion": "0.8.9", - "compatibleCoreVersion": "9", + "minimumCoreVersion": "10.278", + "compatibleCoreVersion": "10.278", "templateVersion": 1, "author": "Esrin, CStadther and Jaxxa", "esmodules": ["modules/dice-pool-ffg.js", "modules/swffg-main.js"], @@ -44,7 +44,7 @@ "primaryTokenAttribute": "wounds", "secondaryTokenAttribute": "strain", "url": "https://github.com/StarWarsFoundryVTT/StarWarsFFG", - "manifest": "https://raw.githubusercontent.com/StarWarsFoundryVTT/StarWarsFFG/v1.72/system.json", - "download": "https://github.com/StarWarsFoundryVTT/StarWarsFFG/releases/download/v1.72/starwarsffg_1.72.zip", + "manifest": "https://raw.githubusercontent.com/StarWarsFoundryVTT/StarWarsFFG/v1.8-alpha1/system.json", + "download": "https://github.com/StarWarsFoundryVTT/StarWarsFFG/releases/download/v1.8-alpha1/starwarsffg_1.8.alpha1.zip", "license": "LICENSE.txt" } diff --git a/templates/actors/ffg-adversary-sheet.html b/templates/actors/ffg-adversary-sheet.html index ebd88488..871ef4a7 100644 --- a/templates/actors/ffg-adversary-sheet.html +++ b/templates/actors/ffg-adversary-sheet.html @@ -105,7 +105,7 @@

- {{editor content=data.biography target="data.biography" button=true owner=owner editable=editable}} {{!-- Footer info --}} + {{editor data.biography target="data.biography" button=true owner=owner editable=editable}} {{!-- Footer info --}}
{{> "systems/starwarsffg/templates/parts/actor/ffg-criticalinjury.html" type="criticalinjury"}} diff --git a/templates/actors/ffg-character-sheet.html b/templates/actors/ffg-character-sheet.html index 6a56f11c..53c1e254 100644 --- a/templates/actors/ffg-character-sheet.html +++ b/templates/actors/ffg-character-sheet.html @@ -112,7 +112,7 @@

- {{editor content=data.biography target="data.biography" button=true owner=owner editable=editable}} {{!-- Footer info --}} + {{editor data.biography target="data.biography" button=true owner=owner editable=editable}} {{!-- Footer info --}}
diff --git a/templates/actors/ffg-homestead-sheet.html b/templates/actors/ffg-homestead-sheet.html index 1bac63ea..3536e236 100644 --- a/templates/actors/ffg-homestead-sheet.html +++ b/templates/actors/ffg-homestead-sheet.html @@ -20,7 +20,7 @@

- {{editor content=data.biography target="data.biography" button=true owner=owner editable=editable}} + {{editor data.biography target="data.biography" button=true owner=owner editable=editable}}
{{!-- Cost Box --}} {{> "systems/starwarsffg/templates/parts/shared/ffg-block.html" (object blocktype="single" title="SWFFG.ItemsPrice" type="Number" name="data.stats.cost.value" value=data.stats.cost.value )}} diff --git a/templates/actors/ffg-minion-sheet.html b/templates/actors/ffg-minion-sheet.html index c7df9e5a..1bd17f9a 100644 --- a/templates/actors/ffg-minion-sheet.html +++ b/templates/actors/ffg-minion-sheet.html @@ -67,7 +67,7 @@

- {{editor content=data.biography target="data.biography" button=true owner=owner editable=editable}} {{!-- Footer info --}} + {{editor data.biography target="data.biography" button=true owner=owner editable=editable}} {{!-- Footer info --}}
{{#if this.settings.enableCriticalInjuries}}
diff --git a/templates/actors/ffg-vehicle-sheet.html b/templates/actors/ffg-vehicle-sheet.html index 848fab36..1370c430 100644 --- a/templates/actors/ffg-vehicle-sheet.html +++ b/templates/actors/ffg-vehicle-sheet.html @@ -97,7 +97,7 @@

- {{editor content=data.biography target="data.biography" button=true owner=owner editable=editable}} + {{editor data.biography target="data.biography" button=true owner=owner editable=editable}}
{{!-- Hyperdrive Box --}} {{#if (or (eq actor.flags.config.enableHyperdrive undefined) (eq actor.flags.config.enableHyperdrive true) )}} {{> "systems/starwarsffg/templates/parts/shared/ffg-block.html" (object blocktype="split" title="SWFFG.Hyperdrive" fields=(array (object name="data.stats.hyperdrive.value" value=data.stats.hyperdrive.value type="Number" label="SWFFG.HyperdrivePrimary") (object name="data.stats.hyperdrive.backup" value=data.stats.hyperdrive.backup type="Number" label="SWFFG.HyperdriveBackup") ))}} {{/if}} diff --git a/templates/items/ffg-armour-sheet.html b/templates/items/ffg-armour-sheet.html index 7484eb6b..45032343 100644 --- a/templates/items/ffg-armour-sheet.html +++ b/templates/items/ffg-armour-sheet.html @@ -101,7 +101,7 @@

{{!-- Description Tab --}}
- {{editor content=data.renderedDesc target="data.description" button=true owner=owner editable=editable}} + {{editor data.renderedDesc target="data.description" button=true owner=owner editable=editable}}
{{!-- Modifiers Tab --}} diff --git a/templates/items/ffg-career-sheet.html b/templates/items/ffg-career-sheet.html index 2a7e4a59..622b29fd 100644 --- a/templates/items/ffg-career-sheet.html +++ b/templates/items/ffg-career-sheet.html @@ -16,7 +16,7 @@

{{!-- Description Tab --}}
- {{editor content=data.renderedDesc target="data.description" button=true owner=owner editable=editable}} + {{editor data.renderedDesc target="data.description" button=true owner=owner editable=editable}}
{{!-- Modifiers Tab --}} diff --git a/templates/items/ffg-criticaldamage-sheet.html b/templates/items/ffg-criticaldamage-sheet.html index 3648e6b7..40a90947 100644 --- a/templates/items/ffg-criticaldamage-sheet.html +++ b/templates/items/ffg-criticaldamage-sheet.html @@ -23,7 +23,7 @@

- {{editor content=data.renderedDesc target="data.description" button=true owner=owner editable=editable}} + {{editor data.renderedDesc target="data.description" button=true owner=owner editable=editable}}

diff --git a/templates/items/ffg-criticalinjury-sheet.html b/templates/items/ffg-criticalinjury-sheet.html index 3648e6b7..40a90947 100644 --- a/templates/items/ffg-criticalinjury-sheet.html +++ b/templates/items/ffg-criticalinjury-sheet.html @@ -23,7 +23,7 @@

- {{editor content=data.renderedDesc target="data.description" button=true owner=owner editable=editable}} + {{editor data.renderedDesc target="data.description" button=true owner=owner editable=editable}}

diff --git a/templates/items/ffg-gear-sheet.html b/templates/items/ffg-gear-sheet.html index 8398cf34..e29ef5f2 100644 --- a/templates/items/ffg-gear-sheet.html +++ b/templates/items/ffg-gear-sheet.html @@ -44,7 +44,7 @@

{{!-- Description Tab --}}
- {{editor content=data.renderedDesc target="data.description" button=true owner=owner editable=editable}} + {{editor data.renderedDesc target="data.description" button=true owner=owner editable=editable}}
{{!-- Modifiers Tab --}} diff --git a/templates/items/ffg-homesteadupgrade-sheet.html b/templates/items/ffg-homesteadupgrade-sheet.html index b9abf11c..a4c363b7 100644 --- a/templates/items/ffg-homesteadupgrade-sheet.html +++ b/templates/items/ffg-homesteadupgrade-sheet.html @@ -21,7 +21,7 @@

{{!-- Description Tab --}}
- {{editor content=data.renderedDesc target="data.description" button=true owner=owner editable=editable}} + {{editor data.renderedDesc target="data.description" button=true owner=owner editable=editable}}
{{!-- Modifiers Tab --}} diff --git a/templates/items/ffg-itemattachment-sheet.html b/templates/items/ffg-itemattachment-sheet.html index a6db52c9..900417a8 100644 --- a/templates/items/ffg-itemattachment-sheet.html +++ b/templates/items/ffg-itemattachment-sheet.html @@ -51,7 +51,7 @@

{{!-- Description Tab --}}
- {{editor content=data.renderedDesc target="data.description" button=true owner=owner editable=editable}} + {{editor data.renderedDesc target="data.description" button=true owner=owner editable=editable}}
{{!-- Modifiers Tab --}} diff --git a/templates/items/ffg-itemmodifier-sheet.html b/templates/items/ffg-itemmodifier-sheet.html index 13295cb6..81ab1f31 100644 --- a/templates/items/ffg-itemmodifier-sheet.html +++ b/templates/items/ffg-itemmodifier-sheet.html @@ -20,7 +20,7 @@

{{!-- Description Tab --}}
- {{editor content=data.renderedDesc target="data.description" button=true owner=owner editable=editable}} + {{editor data.renderedDesc target="data.description" button=true owner=owner editable=editable}}
{{!-- Modifiers Tab --}} diff --git a/templates/items/ffg-shipattachment-sheet.html b/templates/items/ffg-shipattachment-sheet.html index 910e1001..fec80d03 100644 --- a/templates/items/ffg-shipattachment-sheet.html +++ b/templates/items/ffg-shipattachment-sheet.html @@ -45,7 +45,7 @@

{{!-- Description Tab --}}
- {{editor content=data.renderedDesc target="data.description" button=true owner=owner editable=editable}} + {{editor data.renderedDesc target="data.description" button=true owner=owner editable=editable}}
{{!-- Modifiers Tab --}} diff --git a/templates/items/ffg-shipweapon-sheet.html b/templates/items/ffg-shipweapon-sheet.html index 659103cd..e5cedfd0 100644 --- a/templates/items/ffg-shipweapon-sheet.html +++ b/templates/items/ffg-shipweapon-sheet.html @@ -104,7 +104,7 @@

{{!-- Description Tab --}}
- {{editor content=data.renderedDesc target="data.description" button=true owner=owner editable=editable}} + {{editor data.renderedDesc target="data.description" button=true owner=owner editable=editable}}
{{!-- Modifiers Tab --}} diff --git a/templates/items/ffg-species-sheet.html b/templates/items/ffg-species-sheet.html index 87e348f9..d16cba18 100644 --- a/templates/items/ffg-species-sheet.html +++ b/templates/items/ffg-species-sheet.html @@ -47,7 +47,7 @@

{{!-- Description Tab --}}
- {{editor content=data.renderedDesc target="data.description" button=true owner=owner editable=editable}} + {{editor data.renderedDesc target="data.description" button=true owner=owner editable=editable}}
{{!-- Modifiers Tab --}} diff --git a/templates/items/ffg-talent-sheet.html b/templates/items/ffg-talent-sheet.html index a9f15b42..540c5993 100644 --- a/templates/items/ffg-talent-sheet.html +++ b/templates/items/ffg-talent-sheet.html @@ -18,7 +18,7 @@

{{!-- Description Tab --}}
- {{editor content=data.renderedDesc target="data.description" button=true owner=owner editable=editable}} + {{editor data.renderedDesc target="data.description" button=true owner=owner editable=editable}}
{{!-- Modifiers Tab --}} diff --git a/templates/items/ffg-weapon-sheet.html b/templates/items/ffg-weapon-sheet.html index cdaccf3f..747fe670 100644 --- a/templates/items/ffg-weapon-sheet.html +++ b/templates/items/ffg-weapon-sheet.html @@ -103,7 +103,7 @@

{{!-- Description Tab --}}
- {{editor content=data.renderedDesc target="data.description" button=true owner=owner editable=editable}} + {{editor data.renderedDesc target="data.description" button=true owner=owner editable=editable}}
{{!-- Modifiers Tab --}} diff --git a/templates/parts/actor/ffg-weapon-armor-gear.html b/templates/parts/actor/ffg-weapon-armor-gear.html index 9299bd1d..84df89f4 100644 --- a/templates/parts/actor/ffg-weapon-armor-gear.html +++ b/templates/parts/actor/ffg-weapon-armor-gear.html @@ -26,7 +26,7 @@

- {{#if item.data.equippable.equipped}} + {{#if item.system.equippable.equipped}} {{else}} @@ -68,7 +68,7 @@

- {{#if item.data.equippable.equipped}} + {{#if item.system.equippable.equipped}} {{else}} diff --git a/templates/popout-editor.html b/templates/popout-editor.html index d630e665..75199663 100644 --- a/templates/popout-editor.html +++ b/templates/popout-editor.html @@ -1,5 +1,5 @@
- {{editor content=value target="value" button=true owner=owner editable=editable}} + {{editor value target="value" button=true owner=owner editable=editable}}