diff --git a/src/main.mjs b/src/main.mjs index dcb4bd20..fa69514f 100644 --- a/src/main.mjs +++ b/src/main.mjs @@ -23,7 +23,7 @@ import {ActiveEffectDataModel} from "./module/data/activeeffect.mjs"; import {Trefferzone, Wunde, Zonenruestung, Zonenwunde} from "./module/data/Trefferzone.js"; async function preloadHandlebarsTemplates() { - return loadTemplates([ + return foundry.applications.handlebars.loadTemplates([ // ui partials. 'systems/DSA_4-1/templates/ui/partial-rollable-button.hbs', 'systems/DSA_4-1/templates/ui/partial-rollable-weaponskill-button.hbs', @@ -79,55 +79,55 @@ Hooks.once("init", () => { console.log("DSA 4.1 is ready for development!") - Actors.registerSheet('dsa41.character', CharacterSheet, { + foundry.documents.collections.Actors.registerSheet('dsa41.character', CharacterSheet, { types: ["character"], makeDefault: true, label: 'DSA41.CharacterLabels.Item' }) - Actors.registerSheet('dsa41.creature', CreatureSheet, { + foundry.documents.collections.Actors.registerSheet('dsa41.creature', CreatureSheet, { types: ["creature"], makeDefault: true, label: 'DSA41.CreatureLabel.Item' }) - Actors.registerSheet('dsa41.group', GroupSheet, { + foundry.documents.collections.Actors.registerSheet('dsa41.group', GroupSheet, { types: ["group"], makeDefault: true, label: 'DSA41.GroupLabel.Item' }) // Register sheet application classes - Items.registerSheet('dsa41.skill', SkillSheet, { + foundry.documents.collections.Items.registerSheet('dsa41.skill', SkillSheet, { types: ["Skill"], makeDefault: true, label: 'DSA41.SkillLabels.Item', }); - Items.registerSheet('dsa41.spell', SpellSheet, { + foundry.documents.collections.Items.registerSheet('dsa41.spell', SpellSheet, { types: ["Spell"], makeDefault: true, label: 'DSA41.SpellLabels.Item', }); - Items.registerSheet('dsa41.advantage', VornachteilSheet, { + foundry.documents.collections.Items.registerSheet('dsa41.advantage', VornachteilSheet, { types: ["Advantage"], makeDefault: true, label: 'DSA41.VornachteilLabels.Item' }) - Items.registerSheet('dsa41.equipment', AusruestungSheet, { + foundry.documents.collections.Items.registerSheet('dsa41.equipment', AusruestungSheet, { types: ["Equipment"], makeDefault: false, label: 'DSA41.AusruestungLabels.Item' }) - Items.registerSheet('dsa41.liturgy', LiturgySheet, { + foundry.documents.collections.Items.registerSheet('dsa41.liturgy', LiturgySheet, { types: ["SpecialAbility"], makeDefault: true, label: 'DSA41.SpecialAbilityLabels.Item' }) - Items.registerSheet('dsa41.specialAbility', SpecialAbilitySheet, { + foundry.documents.collections.Items.registerSheet('dsa41.specialAbility', SpecialAbilitySheet, { types: ["Liturgy"], makeDefault: true, label: 'DSA41.LiturgyLabels.Item' }) - Items.registerSheet('dsa41.activeEffect', ActiveEffectSheet, { + foundry.documents.collections.Items.registerSheet('dsa41.activeEffect', ActiveEffectSheet, { types: ['ActiveEffect'], makeDefault: true, label: 'DSA41.ActiveEffectLabels.ActiveFfect' diff --git a/src/module/sheets/ActiveEffectSheet.mjs b/src/module/sheets/ActiveEffectSheet.mjs index 99211ed2..ef2c1d03 100644 --- a/src/module/sheets/ActiveEffectSheet.mjs +++ b/src/module/sheets/ActiveEffectSheet.mjs @@ -1,4 +1,4 @@ -export class ActiveEffectSheet extends ItemSheet { +export class ActiveEffectSheet extends foundry.appv1.sheets.ItemSheet { /**@override */ static get defaultOptions() { return foundry.utils.mergeObject(super.defaultOptions, { diff --git a/src/module/sheets/characterSheet.mjs b/src/module/sheets/characterSheet.mjs index 60176c50..743b73b0 100644 --- a/src/module/sheets/characterSheet.mjs +++ b/src/module/sheets/characterSheet.mjs @@ -3,7 +3,7 @@ import {ActionManager} from "./actions/action-manager.mjs"; import {LiturgyData} from "../data/miracle/liturgydata.mjs"; import {ModifyLiturgy} from "../dialog/modify-liturgy.mjs"; -export class CharacterSheet extends ActorSheet { +export class CharacterSheet extends foundry.appv1.sheets.ActorSheet { /**@override */ static get defaultOptions() { return foundry.utils.mergeObject(super.defaultOptions, { @@ -841,7 +841,7 @@ export class CharacterSheet extends ActorSheet { activateListeners(html) { super.activateListeners(html); - const tabs = new Tabs({ + const tabs = new foundry.applications.ux.Tabs({ navSelector: ".paperdoll-tabs.tabs", contentSelector: ".sheet-body.paperdoll-sets", initial: "set" + (this.object.system.setEquipped + 1) @@ -926,7 +926,7 @@ export class CharacterSheet extends ActorSheet { } }) - new ContextMenu(html, '.talent.rollable', [ + new foundry.applications.ux.ContextMenu(html[0], '.talent.rollable', [ { name: "Entfernen", icon: '', @@ -935,10 +935,12 @@ export class CharacterSheet extends ActorSheet { }, condition: () => true } - ]); + ], { + jQuery: false + }); - new ContextMenu(html, '.attribute.rollable', [ + new foundry.applications.ux.ContextMenu(html[0], '.attribute.rollable', [ { name: "Anpassen", icon: '', @@ -947,7 +949,9 @@ export class CharacterSheet extends ActorSheet { }, condition: () => true } - ]); + ], { + jQuery: false + }); let handler = evt => { const talentId = evt.target.dataset.id @@ -965,7 +969,7 @@ export class CharacterSheet extends ActorSheet { li.addEventListener("dragstart", handler, false); }); - new ContextMenu(html, '.equipment', [ + new foundry.applications.ux.ContextMenu(html[0], '.equipment', [ { name: "Aus dem Inventar entfernen", icon: '', @@ -975,9 +979,11 @@ export class CharacterSheet extends ActorSheet { }, condition: () => true } - ]); + ], { + jQuery: false + }); - new ContextMenu(html, '.equipped', [ + new foundry.applications.ux.ContextMenu(html[0], '.equipped', [ { name: "Gegenstand vom Set entfernen", callback: (event) => { @@ -990,7 +996,9 @@ export class CharacterSheet extends ActorSheet { }, condition: () => true } - ]); + ], { + jQuery: false + }); html.on('click', '[data-operation="addWounds"]', async (evt) => { const {value} = evt.currentTarget.dataset diff --git a/src/module/sheets/equipmentSheet.mjs b/src/module/sheets/equipmentSheet.mjs index c5179223..d3d769f8 100644 --- a/src/module/sheets/equipmentSheet.mjs +++ b/src/module/sheets/equipmentSheet.mjs @@ -1,4 +1,4 @@ -export class AusruestungSheet extends ItemSheet { +export class AusruestungSheet extends foundry.appv1.sheets.ItemSheet { /**@override */ static get defaultOptions() { return foundry.utils.mergeObject(super.defaultOptions, { diff --git a/src/module/sheets/groupSheet.mjs b/src/module/sheets/groupSheet.mjs index 7e179037..3edff152 100644 --- a/src/module/sheets/groupSheet.mjs +++ b/src/module/sheets/groupSheet.mjs @@ -1,4 +1,4 @@ -export class GroupSheet extends ActorSheet { +export class GroupSheet extends foundry.appv1.sheets.ActorSheet { /**@override */ static get defaultOptions() { return foundry.utils.mergeObject(super.defaultOptions, { diff --git a/src/module/sheets/liturgySheet.mjs b/src/module/sheets/liturgySheet.mjs index 0a531f9a..3bb34124 100644 --- a/src/module/sheets/liturgySheet.mjs +++ b/src/module/sheets/liturgySheet.mjs @@ -1,4 +1,4 @@ -export class LiturgySheet extends ItemSheet { +export class LiturgySheet extends foundry.appv1.sheets.ItemSheet { /**@override */ static get defaultOptions() { return foundry.utils.mergeObject(super.defaultOptions, { diff --git a/src/module/sheets/skillSheet.mjs b/src/module/sheets/skillSheet.mjs index abffa724..0a3dc7e6 100644 --- a/src/module/sheets/skillSheet.mjs +++ b/src/module/sheets/skillSheet.mjs @@ -1,4 +1,4 @@ -export class SkillSheet extends ItemSheet { +export class SkillSheet extends foundry.appv1.sheets.ItemSheet { /**@override */ static get defaultOptions() { return foundry.utils.mergeObject(super.defaultOptions, { @@ -52,7 +52,7 @@ export class SkillSheet extends ItemSheet { super.activateListeners(html); // Everything below here is only needed if the sheet is editable - if (!this.isEditable) return; + if (!this.isEditable) } } \ No newline at end of file diff --git a/src/module/sheets/specialAbilitySheet.mjs b/src/module/sheets/specialAbilitySheet.mjs index a1c6bb08..533f1a8a 100644 --- a/src/module/sheets/specialAbilitySheet.mjs +++ b/src/module/sheets/specialAbilitySheet.mjs @@ -1,4 +1,4 @@ -export class SpecialAbilitySheet extends ItemSheet { +export class SpecialAbilitySheet extends foundry.appv1.sheets.ItemSheet { /**@override */ static get defaultOptions() { return foundry.utils.mergeObject(super.defaultOptions, { diff --git a/src/module/sheets/vornachteilSheet.mjs b/src/module/sheets/vornachteilSheet.mjs index bfc5ad0d..9db27543 100644 --- a/src/module/sheets/vornachteilSheet.mjs +++ b/src/module/sheets/vornachteilSheet.mjs @@ -1,4 +1,4 @@ -export class VornachteilSheet extends ItemSheet { +export class VornachteilSheet extends foundry.appv1.sheets.ItemSheet { /**@override */ static get defaultOptions() { return foundry.utils.mergeObject(super.defaultOptions, {