working on advancements
This commit is contained in:
48
system/scripts/items/advancement-sheet.js
Normal file
48
system/scripts/items/advancement-sheet.js
Normal file
@@ -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);
|
||||
}
|
||||
}
|
||||
@@ -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());
|
||||
});
|
||||
});
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user