diff --git a/lang/en.json b/lang/en.json index e69de29..077404a 100644 --- a/lang/en.json +++ b/lang/en.json @@ -0,0 +1,3 @@ +{ + +} \ No newline at end of file diff --git a/module/actor/actor-sheet.js b/module/actor/actor-sheet.js index 899688b..a6401c1 100644 --- a/module/actor/actor-sheet.js +++ b/module/actor/actor-sheet.js @@ -7,7 +7,7 @@ export class frostgraveActorSheet extends ActorSheet { static get defaultOptions() { return mergeObject(super.defaultOptions, { classes: ["frostgrave", "sheet", "actor"], - template: "systems/frostgrave/templates/actor/actor-sheet.html", + template: "systems/foundryvtt-frostgrave/templates/actor/actor-sheet.html", width: 650, height: 650, tabs: [{ @@ -23,17 +23,23 @@ export class frostgraveActorSheet extends ActorSheet { /** @override */ getData() { const data = super.getData(); - data.dtypes = ["String", "Number", "Boolean"]; + let formData = { + data: data.data, + actor: this.actor, + dtypes: ["String", "Number", "Boolean"] + } + //for (let attr of Object.values(data.data.attributes)) { // attr.isCheckbox = attr.dtype === "Boolean"; // } // Prepare items. if (this.actor.data.type == "character") { - this._prepareCharacterItems(data); + this._prepareCharacterItems(formData); } - - return data; + + console.log("FORMDATA", formData); + return formData; } /** @override */ @@ -203,9 +209,9 @@ export class frostgraveActorSheet extends ActorSheet { // Iterate through items, allocating to containers // let totalWeight = 0; - for (let i of sheetData.items) { + for (let i of actorData.data.items) { let item = i.data; - i.img = i.img || DEFAULT_TOKEN; + //i.img = i.img || DEFAULT_TOKEN; // Append to gear. if (i.type === "item") { gear.push(i); @@ -221,8 +227,8 @@ export class frostgraveActorSheet extends ActorSheet { } // Assign and return - actorData.gear = gear; - actorData.features = features; - actorData.spells = spells; + sheetData.gear = gear; + sheetData.features = features; + sheetData.spells = spells; } } \ No newline at end of file diff --git a/module/frostgrave.js b/module/frostgrave.js index 7387703..30660a5 100644 --- a/module/frostgrave.js +++ b/module/frostgrave.js @@ -21,16 +21,16 @@ Hooks.once("init", async function () { }; // Define custom Entity classes - CONFIG.Actor.entityClass = frostgraveActor; - CONFIG.Item.entityClass = frostgraveItem; + CONFIG.Actor.documentClas = frostgraveActor; + CONFIG.Item.documentClas = frostgraveItem; // Register sheet application classes Actors.unregisterSheet("core", ActorSheet); - Actors.registerSheet("frostgrave", frostgraveActorSheet, { + Actors.registerSheet("foundryvtt-frostgrave", frostgraveActorSheet, { makeDefault: true, }); Items.unregisterSheet("core", ItemSheet); - Items.registerSheet("frostgrave", frostgraveItemSheet, { + Items.registerSheet("foundryvtt-frostgrave", frostgraveItemSheet, { types: ["item", "feature", "spell"], makeDefault: true, }); diff --git a/module/item/dist/item-sheet.dev.js b/module/item/dist/item-sheet.dev.js index 2c8a0f7..e812fe4 100644 --- a/module/item/dist/item-sheet.dev.js +++ b/module/item/dist/item-sheet.dev.js @@ -99,7 +99,7 @@ function (_ItemSheet) { /** @override */ get: function get() { return mergeObject(_get(_getPrototypeOf(frostgraveItemSheet), "defaultOptions", this), { - classes: ["frostgrave", "sheet", "item"], + classes: ["foundryvtt-frostgrave", "sheet", "item"], width: 450, height: 500, tabs: [{ diff --git a/module/item/item-sheet.js b/module/item/item-sheet.js index 3a46e76..754711a 100644 --- a/module/item/item-sheet.js +++ b/module/item/item-sheet.js @@ -6,7 +6,7 @@ export class frostgraveItemSheet extends ItemSheet { /** @override */ static get defaultOptions() { return mergeObject(super.defaultOptions, { - classes: ["frostgrave", "sheet", "item"], + classes: ["foundryvtt-frostgrave", "sheet", "item"], width: 450, height: 500, tabs: [{ @@ -19,7 +19,7 @@ export class frostgraveItemSheet extends ItemSheet { /** @override */ get template() { - const path = "systems/frostgrave/templates/item"; + const path = "systems/foundryvtt-frostgrave/templates/item"; // Return a single sheet for all item types. // return `${path}/item-sheet.html`; @@ -33,7 +33,11 @@ export class frostgraveItemSheet extends ItemSheet { /** @override */ getData() { const data = super.getData(); - return data; + + let formData = duplicate(data.data) + console.log("ITEM", formData); + + return formData; } /* -------------------------------------------- */ diff --git a/module/templates.js b/module/templates.js index 059957b..84b2f1c 100644 --- a/module/templates.js +++ b/module/templates.js @@ -9,14 +9,14 @@ export const preloadHandlebarsTemplates = async function() { const templatePaths = [ // Actor Sheet Partials - "systems/frostgrave/templates/actor/partials/actor-header.html", - "systems/frostgrave/templates/actor/partials/actor-stats.html", - "systems/frostgrave/templates/actor/partials/actor-tab-navigation.html", - "systems/frostgrave/templates/actor/partials/actor-tab-notes.html", - "systems/frostgrave/templates/actor/partials/actor-tab-experience.html", - "systems/frostgrave/templates/actor/partials/actor-tab-homebase.html", - "systems/frostgrave/templates/actor/partials/actor-tab-items.html", - "systems/frostgrave/templates/actor/partials/actor-tab-spells.html" + "systems/foundryvtt-frostgrave/templates/actor/partials/actor-header.html", + "systems/foundryvtt-frostgrave/templates/actor/partials/actor-stats.html", + "systems/foundryvtt-frostgrave/templates/actor/partials/actor-tab-navigation.html", + "systems/foundryvtt-frostgrave/templates/actor/partials/actor-tab-notes.html", + "systems/foundryvtt-frostgrave/templates/actor/partials/actor-tab-experience.html", + "systems/foundryvtt-frostgrave/templates/actor/partials/actor-tab-homebase.html", + "systems/foundryvtt-frostgrave/templates/actor/partials/actor-tab-items.html", + "systems/foundryvtt-frostgrave/templates/actor/partials/actor-tab-spells.html" // Item Sheet Partials diff --git a/system.json b/system.json index db5c75e..4208bd4 100644 --- a/system.json +++ b/system.json @@ -1,10 +1,10 @@ { - "name": "frostgrave", + "name": "foundryvtt-frostgrave", "title": "Frostgrave", "description": "The Frostgrave system for Foundry VTT", - "version": "1.0.0", - "minimumCoreVersion": "0.6.5", - "compatibleCoreVersion": "0.6.6", + "version": "2.0.0", + "minimumCoreVersion": "0.8.0", + "compatibleCoreVersion": "0.8.5", "templateVersion": 2, "author": "Phenomen", "esmodules": [ @@ -17,35 +17,35 @@ "packs": [{ "name": "spellcasters", "label": "Spellcasters", - "system": "frostgrave", + "system": "foundryvtt-frostgrave", "path": "./packs/spellcasters.db", "entity": "Actor" }, { "name": "soldiers", "label": "Soldiers", - "system": "frostgrave", + "system": "foundryvtt-frostgrave", "path": "./packs/soldiers.db", "entity": "Actor" }, { "name": "armour", "label": "Armour", - "system": "frostgrave", + "system": "foundryvtt-frostgrave", "path": "./packs/armour.db", "entity": "Item" }, { "name": "weapons", "label": "Weapons", - "system": "frostgrave", + "system": "foundryvtt-frostgrave", "path": "./packs/weapons.db", "entity": "Item" }, { "name": "potions", "label": "Potions", - "system": "frostgrave", + "system": "foundryvtt-frostgrave", "path": "./packs/potions.db", "entity": "Item" } @@ -58,8 +58,8 @@ "gridDistance": 5, "gridUnits": "ft", "primaryTokenAttribute": "health", - "url": "https://github.com/Phenomen/foundry-frostgrave", - "manifest": "https://raw.githubusercontent.com/Phenomen/foundry-frostgrave/master/system.json", - "download": "https://github.com/Phenomen/foundry-frostgrave/archive/master.zip", + "url": "https://gitlab.com/LeRatierBretonnien/foundryvtt-frostgrave", + "manifest": "https://gitlab.com/LeRatierBretonnien/foundryvtt-frostgrave/-/raw/master/system.json", + "download": "https://gitlab.com/LeRatierBretonnien/foundryvtt-frostgrave/archive/master.zip", "license": "LICENSE.txt" -} \ No newline at end of file +} diff --git a/templates/actor/actor-sheet.html b/templates/actor/actor-sheet.html index 4170c53..0cbdf5e 100644 --- a/templates/actor/actor-sheet.html +++ b/templates/actor/actor-sheet.html @@ -1,30 +1,30 @@
\ No newline at end of file diff --git a/templates/actor/partials/actor-header.html b/templates/actor/partials/actor-header.html index 1e93667..ebc8101 100644 --- a/templates/actor/partials/actor-header.html +++ b/templates/actor/partials/actor-header.html @@ -16,7 +16,7 @@