diff --git a/system/lang/en-en.json b/system/lang/en-en.json index 569f382..fe39b40 100644 --- a/system/lang/en-en.json +++ b/system/lang/en-en.json @@ -90,6 +90,7 @@ "physical": "physical", "supernatural": "supernatural" }, + "add": "Add", "items": "Items", "feats": "Feats", "techniques": { diff --git a/system/lang/es-es.json b/system/lang/es-es.json index 8c5a997..1a8140f 100644 --- a/system/lang/es-es.json +++ b/system/lang/es-es.json @@ -90,6 +90,7 @@ "physical": "physical", "supernatural": "supernatural" }, + "add": "Add", "items": "Equipo", "feats": "Feats", "techniques": { diff --git a/system/lang/fr-fr.json b/system/lang/fr-fr.json index f018467..63549d4 100644 --- a/system/lang/fr-fr.json +++ b/system/lang/fr-fr.json @@ -90,6 +90,7 @@ "physical": "Physique", "supernatural": "Spirituelle" }, + "add": "Ajouter", "items": "Objets", "feats": "Prouesses", "techniques": { diff --git a/system/scripts/items/advancement-sheet.js b/system/scripts/items/advancement-sheet.js new file mode 100644 index 0000000..b3551b0 --- /dev/null +++ b/system/scripts/items/advancement-sheet.js @@ -0,0 +1,48 @@ +import { ItemSheetL5r5e } from "./item-sheet.js"; + +/** + * @extends {ItemSheet} + */ +export class AdvancementSheetL5r5e extends ItemSheetL5r5e { + /** @override */ + static get defaultOptions() { + return mergeObject(super.defaultOptions, { + classes: ["l5r5e", "sheet", "advancement"], + template: CONFIG.L5r5e.paths.templates + "item/advancement-sheet.html", + width: 520, + height: 480, + tabs: [{ navSelector: ".sheet-tabs", contentSelector: ".sheet-body", initial: "description" }], + }); + } + + getData() { + const sheetData = super.getData(); + sheetData.data.dtypes = ["String", "Number", "Boolean"]; + + sheetData.data.isAdvancement = true; + + return sheetData; + } + + /** + * Subscribe to events from the sheet. + * @param html HTML content of the sheet. + */ + activateListeners(html) { + super.activateListeners(html); + + // Everything below here is only needed if the sheet is editable + if (!this.options.editable) { + return; + } + } + + /** + * Update item with values from the sheet. + * @param event + * @param formData + */ + _updateObject(event, formData) { + return this.object.update(formData); + } +} diff --git a/system/scripts/main-l5r5e.js b/system/scripts/main-l5r5e.js index 7e6e8a4..b2db6e8 100644 --- a/system/scripts/main-l5r5e.js +++ b/system/scripts/main-l5r5e.js @@ -12,6 +12,7 @@ import { ArmorSheetL5r5e } from "./items/armor-sheet.js"; import { WeaponSheetL5r5e } from "./items/weapon-sheet.js"; import { TechniqueSheetL5r5e } from "./items/technique-sheet.js"; import { QualitySheetL5r5e } from "./items/quality-sheet.js"; +import { AdvancementSheetL5r5e } from "./items/advancement-sheet.js"; // Import Dice Types @@ -69,6 +70,7 @@ Hooks.once("init", async function () { Items.registerSheet("l5r5e", WeaponSheetL5r5e, { types: ["weapon"], makeDefault: true }); Items.registerSheet("l5r5e", TechniqueSheetL5r5e, { types: ["technique"], makeDefault: true }); Items.registerSheet("l5r5e", QualitySheetL5r5e, { types: ["quality"], makeDefault: true }); + Items.registerSheet("l5r5e", AdvancementSheetL5r5e, { types: ["advancement"], makeDefault: true }); // for debug Handlebars.registerHelper("json", function (...objects) { @@ -111,7 +113,7 @@ Hooks.once("init", async function () { return game.i18n.localize(key); }); - Handlebars.registerHelper("localizeTechniques", function (techniqueName) { + Handlebars.registerHelper("localizeTechnique", function (techniqueName) { return game.i18n.localize("l5r5e.techniques." + techniqueName.toLowerCase()); }); }); diff --git a/system/scripts/preloadTemplates.js b/system/scripts/preloadTemplates.js index 16686bc..acf9c41 100644 --- a/system/scripts/preloadTemplates.js +++ b/system/scripts/preloadTemplates.js @@ -35,6 +35,9 @@ export const PreloadTemplates = async function () { "systems/l5r5e/templates/item/qualities.html", "systems/l5r5e/templates/item/quality-sheet.html", "systems/l5r5e/templates/item/quality-entry.html", + "systems/l5r5e/templates/item/advancements.html", + "systems/l5r5e/templates/item/advancement-sheet.html", + "systems/l5r5e/templates/item/advancement-entry.html", ]; return loadTemplates(templatePaths); diff --git a/system/template.json b/system/template.json index 0007374..fe0aa96 100644 --- a/system/template.json +++ b/system/template.json @@ -101,7 +101,6 @@ }, "character": { "templates": ["identity", "rings", "social", "skills", "techniques", "conflict", "xp"], - "advancements": [], "zeni": 0, "notes": "", "twenty_questions": {} @@ -189,7 +188,9 @@ "description": "" }, "advancement": { - "description": "TODO" + "xp_used": 0, + "rank": "", + "description": "" } } } diff --git a/system/templates/item/advancement-entry.html b/system/templates/item/advancement-entry.html new file mode 100644 index 0000000..fccc138 --- /dev/null +++ b/system/templates/item/advancement-entry.html @@ -0,0 +1,9 @@ +