Working on 0.8.x
- NPC with all ring on strengths/weaknesses (CSS TODO). - Removed Custom tech "Links" as they are in fact "Bonds" and need more work. - Added Bonds, SignatureScroll, ItemPatterns and working on titles
This commit is contained in:
@@ -20,8 +20,8 @@ export class AdvancementSheetL5r5e extends ItemSheetL5r5e {
|
||||
});
|
||||
}
|
||||
|
||||
async getData() {
|
||||
const sheetData = await super.getData();
|
||||
async getData(options = {}) {
|
||||
const sheetData = await super.getData(options);
|
||||
|
||||
sheetData.data.subTypesList = AdvancementSheetL5r5e.types;
|
||||
sheetData.data.skillsList = game.l5r5e.HelpersL5r5e.getSkillsList(true);
|
||||
@@ -47,46 +47,18 @@ export class AdvancementSheetL5r5e extends ItemSheetL5r5e {
|
||||
|
||||
html.find("#advancement_type").on("change", (event) => {
|
||||
if ($(event.target).val() === "skill") {
|
||||
this._updateChoice(
|
||||
{
|
||||
ring: currentRing,
|
||||
},
|
||||
{
|
||||
skill: currentSkill,
|
||||
}
|
||||
);
|
||||
this._updateChoice({ ring: currentRing }, { skill: currentSkill });
|
||||
} else {
|
||||
this._updateChoice(
|
||||
{
|
||||
skill: currentSkill,
|
||||
},
|
||||
{
|
||||
ring: currentRing,
|
||||
}
|
||||
);
|
||||
this._updateChoice({ skill: currentSkill }, { ring: currentRing });
|
||||
}
|
||||
});
|
||||
|
||||
html.find("#advancement_ring").on("change", (event) => {
|
||||
this._updateChoice(
|
||||
{
|
||||
ring: currentRing,
|
||||
},
|
||||
{
|
||||
ring: $(event.target).val(),
|
||||
}
|
||||
);
|
||||
this._updateChoice({ ring: currentRing }, { ring: $(event.target).val() });
|
||||
});
|
||||
|
||||
html.find("#advancement_skill").on("change", (event) => {
|
||||
this._updateChoice(
|
||||
{
|
||||
skill: currentSkill,
|
||||
},
|
||||
{
|
||||
skill: $(event.target).val(),
|
||||
}
|
||||
);
|
||||
this._updateChoice({ skill: currentSkill }, { skill: $(event.target).val() });
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
17
system/scripts/items/bond-sheet.js
Normal file
17
system/scripts/items/bond-sheet.js
Normal file
@@ -0,0 +1,17 @@
|
||||
import { ItemSheetL5r5e } from "./item-sheet.js";
|
||||
|
||||
/**
|
||||
* @extends {ItemSheet}
|
||||
*/
|
||||
export class BondSheetL5r5e extends ItemSheetL5r5e {
|
||||
/** @override */
|
||||
static get defaultOptions() {
|
||||
return foundry.utils.mergeObject(super.defaultOptions, {
|
||||
classes: ["l5r5e", "sheet", "bond"],
|
||||
template: CONFIG.l5r5e.paths.templates + "items/bond/bond-sheet.html",
|
||||
width: 520,
|
||||
height: 480,
|
||||
tabs: [{ navSelector: ".sheet-tabs", contentSelector: ".sheet-body", initial: "description" }],
|
||||
});
|
||||
}
|
||||
}
|
||||
17
system/scripts/items/item-pattern-sheet.js
Normal file
17
system/scripts/items/item-pattern-sheet.js
Normal file
@@ -0,0 +1,17 @@
|
||||
import { ItemSheetL5r5e } from "./item-sheet.js";
|
||||
|
||||
/**
|
||||
* @extends {ItemSheet}
|
||||
*/
|
||||
export class ItemPatternSheetL5r5e extends ItemSheetL5r5e {
|
||||
/** @override */
|
||||
static get defaultOptions() {
|
||||
return foundry.utils.mergeObject(super.defaultOptions, {
|
||||
classes: ["l5r5e", "sheet", "item-pattern"],
|
||||
template: CONFIG.l5r5e.paths.templates + "items/item-pattern/item-pattern-sheet.html",
|
||||
width: 520,
|
||||
height: 480,
|
||||
tabs: [{ navSelector: ".sheet-tabs", contentSelector: ".sheet-body", initial: "description" }],
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -14,13 +14,14 @@ export class ItemSheetL5r5e extends ItemSheet {
|
||||
});
|
||||
}
|
||||
|
||||
/** @override */
|
||||
/**
|
||||
* @return {Object|Promise}
|
||||
*/
|
||||
async getData(options = {}) {
|
||||
const sheetData = super.getData();
|
||||
const sheetData = await super.getData(options);
|
||||
|
||||
sheetData.data.dtypes = ["String", "Number", "Boolean"];
|
||||
sheetData.data.ringsList = game.l5r5e.HelpersL5r5e.getRingsList();
|
||||
sheetData.data.techniquesList = game.l5r5e.HelpersL5r5e.getTechniquesList();
|
||||
|
||||
// Prepare Properties (id/name => object)
|
||||
await this._prepareProperties(sheetData);
|
||||
|
||||
@@ -21,8 +21,8 @@ export class PeculiaritySheetL5r5e extends ItemSheetL5r5e {
|
||||
});
|
||||
}
|
||||
|
||||
async getData() {
|
||||
const sheetData = await super.getData();
|
||||
async getData(options = {}) {
|
||||
const sheetData = await super.getData(options);
|
||||
|
||||
sheetData.data.subTypesList = PeculiaritySheetL5r5e.types.map((e) => ({
|
||||
id: e,
|
||||
|
||||
17
system/scripts/items/signature-scroll-sheet.js
Normal file
17
system/scripts/items/signature-scroll-sheet.js
Normal file
@@ -0,0 +1,17 @@
|
||||
import { ItemSheetL5r5e } from "./item-sheet.js";
|
||||
|
||||
/**
|
||||
* @extends {ItemSheet}
|
||||
*/
|
||||
export class SignatureScrollSheetL5r5e extends ItemSheetL5r5e {
|
||||
/** @override */
|
||||
static get defaultOptions() {
|
||||
return foundry.utils.mergeObject(super.defaultOptions, {
|
||||
classes: ["l5r5e", "sheet", "signature-scroll"],
|
||||
template: CONFIG.l5r5e.paths.templates + "items/signature-scroll/signature-scroll-sheet.html",
|
||||
width: 520,
|
||||
height: 480,
|
||||
tabs: [{ navSelector: ".sheet-tabs", contentSelector: ".sheet-body", initial: "description" }],
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -16,19 +16,15 @@ export class TechniqueSheetL5r5e extends ItemSheetL5r5e {
|
||||
}
|
||||
|
||||
/** @override */
|
||||
async getData() {
|
||||
const sheetData = await super.getData();
|
||||
async getData(options = {}) {
|
||||
const sheetData = await super.getData(options);
|
||||
|
||||
// Add "school ability", "mastery ability" and customs if active
|
||||
[
|
||||
...CONFIG.l5r5e.techniques_school,
|
||||
...(game.settings.get("l5r5e", "techniques-customs") ? CONFIG.l5r5e.techniques_custom : []),
|
||||
].forEach((e) => {
|
||||
sheetData.data.techniquesList.push({
|
||||
id: e,
|
||||
label: game.i18n.localize(`l5r5e.techniques.${e}`),
|
||||
});
|
||||
});
|
||||
// List all available techniques type
|
||||
const types = ["core", "school", "title"];
|
||||
if (game.settings.get("l5r5e", "techniques-customs")) {
|
||||
types.push("custom");
|
||||
}
|
||||
sheetData.data.techniquesList = game.l5r5e.HelpersL5r5e.getTechniquesList({ types });
|
||||
|
||||
return sheetData;
|
||||
}
|
||||
|
||||
17
system/scripts/items/title-sheet.js
Normal file
17
system/scripts/items/title-sheet.js
Normal file
@@ -0,0 +1,17 @@
|
||||
import { ItemSheetL5r5e } from "./item-sheet.js";
|
||||
|
||||
/**
|
||||
* @extends {ItemSheet}
|
||||
*/
|
||||
export class TitleSheetL5r5e extends ItemSheetL5r5e {
|
||||
/** @override */
|
||||
static get defaultOptions() {
|
||||
return foundry.utils.mergeObject(super.defaultOptions, {
|
||||
classes: ["l5r5e", "sheet", "title"],
|
||||
template: CONFIG.l5r5e.paths.templates + "items/title/title-sheet.html",
|
||||
width: 520,
|
||||
height: 480,
|
||||
tabs: [{ navSelector: ".sheet-tabs", contentSelector: ".sheet-body", initial: "description" }],
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -15,8 +15,8 @@ export class WeaponSheetL5r5e extends ItemSheetL5r5e {
|
||||
});
|
||||
}
|
||||
|
||||
async getData() {
|
||||
const sheetData = await super.getData();
|
||||
async getData(options = {}) {
|
||||
const sheetData = await super.getData(options);
|
||||
|
||||
// Martial skills only
|
||||
sheetData.data.skills = Array.from(CONFIG.l5r5e.skills)
|
||||
|
||||
Reference in New Issue
Block a user