Working on 0.8.x

- some fix for 0.8.3, and working on titles
This commit is contained in:
Vlyan
2021-05-13 13:07:27 +02:00
parent cda02bd8c7
commit 4350ea25ee
30 changed files with 274 additions and 219 deletions

View File

@@ -1,12 +1,14 @@
# Changelog # Changelog
## 1.3.0 - Foundry 0.8.x compatibility ## 1.3.0 - Foundry 0.8.x compatibility
_! Be certain to carefully back up any critical user data before installing this update. !_
- Updated the System to the new version of Foundry VTT (a lot of things broke). - Updated the System to the new version of Foundry VTT (a lot of things broke).
- NPC can now have strengths/weaknesses with all rings. - NPC can now have strengths/weaknesses with all rings.
- Added "Title, Bond, Signature Scroll and Item Pattern": - Added "Title, Bond, Signature Scroll and Item Pattern":
- The item types. - The item types.
- Theirs compendiums entries. - Theirs compendiums entries.
- A new list in experience tab to not mess with school cursus. - A new list in experience tab to not mess with school cursus.
- Item pattern can be dropped on another item to add the associated property.
- Added an optional "Specificity" technique type to serve as a catch-all (by request). - Added an optional "Specificity" technique type to serve as a catch-all (by request).
- Added Mantis Clan compendium entries - Added Mantis Clan compendium entries
- Fix : rnkMessage not passing on actor object for NPCs (thanks to Bragma). - Fix : rnkMessage not passing on actor object for NPCs (thanks to Bragma).

View File

@@ -1,5 +1,5 @@
{"_id":"L5RCoreItp000001","name":"Kakita Pattern","permission":{"default":0},"type":"item_pattern","data":{"in_curriculum":false,"xp_used":0,"rank":1,"bought_at_rank":0,"ring":"void","xp_cost":"6","rarity_modifier":"4","description":"","book_reference":"Shadowlands p.109"},"sort":100001,"flags":{},"img":"systems/l5r5e/assets/icons/items/item_pattern.svg","effects":[]} {"_id":"L5RCoreItp000001","name":"Kakita Pattern","permission":{"default":0},"type":"item_pattern","data":{"in_curriculum":false,"xp_used":0,"rank":1,"bought_at_rank":0,"ring":"void","xp_cost":"6","rarity_modifier":"4","description":"","book_reference":"Shadowlands p.109"},"sort":100001,"flags":{"l5r5e":{"linkedPropertyId":"L5RCorePro000017"}},"img":"systems/l5r5e/assets/icons/items/item_pattern.svg","effects":[]}
{"_id":"L5RCoreItp000002","name":"Kenzō Blade","permission":{"default":0},"type":"item_pattern","data":{"in_curriculum":false,"xp_used":0,"rank":1,"bought_at_rank":0,"ring":"void","xp_cost":"8","rarity_modifier":"5","description":"","book_reference":"Shadowlands p.109"},"sort":100001,"flags":{},"img":"systems/l5r5e/assets/icons/items/item_pattern.svg","effects":[]} {"_id":"L5RCoreItp000002","name":"Kenzō Blade","permission":{"default":0},"type":"item_pattern","data":{"in_curriculum":false,"xp_used":0,"rank":1,"bought_at_rank":0,"ring":"void","xp_cost":"8","rarity_modifier":"5","description":"","book_reference":"Shadowlands p.109"},"sort":100001,"flags":{"l5r5e":{"linkedPropertyId":"L5RCorePro000018"}},"img":"systems/l5r5e/assets/icons/items/item_pattern.svg","effects":[]}
{"_id":"L5RCoreItp000003","name":"Shirogane Jade Inlay","permission":{"default":0},"type":"item_pattern","data":{"in_curriculum":false,"xp_used":0,"rank":1,"bought_at_rank":0,"ring":"void","xp_cost":"3","rarity_modifier":"2","description":"","book_reference":"Shadowlands p.109"},"sort":100001,"flags":{},"img":"systems/l5r5e/assets/icons/items/item_pattern.svg","effects":[]} {"_id":"L5RCoreItp000003","name":"Shirogane Jade Inlay","permission":{"default":0},"type":"item_pattern","data":{"in_curriculum":false,"xp_used":0,"rank":1,"bought_at_rank":0,"ring":"void","xp_cost":"3","rarity_modifier":"2","description":"","book_reference":"Shadowlands p.109"},"sort":100001,"flags":{"l5r5e":{"linkedPropertyId":"L5RCorePro000019"}},"img":"systems/l5r5e/assets/icons/items/item_pattern.svg","effects":[]}
{"_id":"L5RCoreItp000004","name":"Uchemas Technique","permission":{"default":0},"type":"item_pattern","data":{"in_curriculum":false,"xp_used":0,"rank":1,"bought_at_rank":0,"ring":"void","xp_cost":"4","rarity_modifier":"3","description":"","book_reference":"Shadowlands p.109"},"sort":100001,"flags":{},"img":"systems/l5r5e/assets/icons/items/item_pattern.svg","effects":[]} {"_id":"L5RCoreItp000004","name":"Uchemas Technique","permission":{"default":0},"type":"item_pattern","data":{"in_curriculum":false,"xp_used":0,"rank":1,"bought_at_rank":0,"ring":"void","xp_cost":"4","rarity_modifier":"3","description":"","book_reference":"Shadowlands p.109"},"sort":100001,"flags":{"l5r5e":{"linkedPropertyId":"L5RCorePro000020"}},"img":"systems/l5r5e/assets/icons/items/item_pattern.svg","effects":[]}
{"_id":"L5RCoreItp000005","name":"Yasunori Steel","permission":{"default":0},"type":"item_pattern","data":{"in_curriculum":false,"xp_used":0,"rank":1,"bought_at_rank":0,"ring":"void","xp_cost":"5","rarity_modifier":"4","description":"","book_reference":"Shadowlands p.109"},"sort":100001,"flags":{},"img":"systems/l5r5e/assets/icons/items/item_pattern.svg","effects":[]} {"_id":"L5RCoreItp000005","name":"Yasunori Steel","permission":{"default":0},"type":"item_pattern","data":{"in_curriculum":false,"xp_used":0,"rank":1,"bought_at_rank":0,"ring":"void","xp_cost":"5","rarity_modifier":"4","description":"","book_reference":"Shadowlands p.109"},"sort":100001,"flags":{"l5r5e":{"linkedPropertyId":"L5RCorePro000021"}},"img":"systems/l5r5e/assets/icons/items/item_pattern.svg","effects":[]}

View File

@@ -63,12 +63,20 @@ export class ActorL5r5e extends Actor {
* Entity-specific actions that should occur when the Entity is updated * Entity-specific actions that should occur when the Entity is updated
* @override * @override
*/ */
update(data, options = {}) { async update(data = {}, context = {}) {
// Need a _id
if (!data["_id"]) {
data["_id"] = this.id;
}
// Fix for token image unliked from character... dunno why // Fix for token image unliked from character... dunno why
if (data.img) { if (data.img) {
data["token.img"] = data.img; data["token.img"] = data.img;
} }
return super.update(data, options);
// Now using updateDocuments
data = data instanceof Array ? data : [data];
return Actor.updateDocuments(data, context);
} }
/** @override */ /** @override */

View File

@@ -151,7 +151,7 @@ export class BaseSheetL5r5e extends ActorSheet {
} }
// Check item type and subtype // Check item type and subtype
const item = await game.l5r5e.HelpersL5r5e.getDragnDropTargetObject(event); let item = await game.l5r5e.HelpersL5r5e.getDragnDropTargetObject(event);
if ( if (
!item || !item ||
item.documentName !== "Item" || item.documentName !== "Item" ||
@@ -170,9 +170,10 @@ export class BaseSheetL5r5e extends ActorSheet {
) { ) {
return; return;
} }
item = item.toJSON();
// Dropped a item with same "id" as one owned, add qte instead // Dropped a item with same "id" as one owned, add qte instead
if (item.data.data.quantity && this.actor.data.items) { if (item.data.quantity && this.actor.data.items) {
const tmpItem = this.actor.data.items.find((e) => e.name === item.name && e.type === item.type); const tmpItem = this.actor.data.items.find((e) => e.name === item.name && e.type === item.type);
if (tmpItem && this._modifyQuantity(tmpItem.id, 1)) { if (tmpItem && this._modifyQuantity(tmpItem.id, 1)) {
return; return;
@@ -180,23 +181,24 @@ export class BaseSheetL5r5e extends ActorSheet {
} }
// Item subtype specific // Item subtype specific
switch (item.data.type) { switch (item.type) {
case "advancement": // no break
case "bond": // no break case "bond": // no break
case "peculiarity": case "advancement": // no break
case "peculiarity": // no break
case "item_pattern": // no break
case "signature_scroll":
// Modify the bought at rank to the current actor rank // Modify the bought at rank to the current actor rank
if (this.actor.data.data.identity?.school_rank) { if (this.actor.data.data.identity?.school_rank) {
item.data.data.bought_at_rank = this.actor.data.data.identity.school_rank; item.data.bought_at_rank = this.actor.data.data.identity.school_rank;
} }
break; break;
case "technique": case "technique":
// School_ability and mastery_ability, allow only 1 per type // School_ability and mastery_ability, allow only 1 per type
if (CONFIG.l5r5e.techniques.get(item.data.data.technique_type)?.type === "school") { if (CONFIG.l5r5e.techniques.get(item.data.technique_type)?.type === "school") {
if ( if (
Array.from(this.actor.items).some( Array.from(this.actor.items).some(
(e) => (e) => e.type === "technique" && e.data.data.technique_type === item.data.technique_type
e.type === "technique" && e.data.data.technique_type === item.data.data.technique_type
) )
) { ) {
ui.notifications.info(game.i18n.localize("l5r5e.techniques.only_one")); ui.notifications.info(game.i18n.localize("l5r5e.techniques.only_one"));
@@ -204,25 +206,24 @@ export class BaseSheetL5r5e extends ActorSheet {
} }
// No cost for schools // No cost for schools
item.data.data.xp_cost = 0; item.data.xp_cost = 0;
item.data.data.xp_used = 0; item.data.xp_used = 0;
item.data.data.in_curriculum = true; item.data.in_curriculum = true;
} else { } else {
// Check if technique is allowed for this character // Check if technique is allowed for this character
if (!game.user.isGM && !this.actor.data.data.techniques[item.data.data.technique_type]) { if (!game.user.isGM && !this.actor.data.data.techniques[item.data.technique_type]) {
ui.notifications.info(game.i18n.localize("l5r5e.techniques.not_allowed")); ui.notifications.info(game.i18n.localize("l5r5e.techniques.not_allowed"));
return; return;
} }
// Verify cost // Verify cost
item.data.data.xp_cost = item.data.xp_cost = item.data.xp_cost > 0 ? item.data.xp_cost : CONFIG.l5r5e.xp.techniqueCost;
item.data.data.xp_cost > 0 ? item.data.data.xp_cost : CONFIG.l5r5e.xp.techniqueCost; item.data.xp_used = item.data.xp_cost;
item.data.data.xp_used = item.data.data.xp_cost;
} }
// Modify the bought at rank to the current actor rank // Modify the bought at rank to the current actor rank
if (this.actor.data.data.identity?.school_rank) { if (this.actor.data.data.identity?.school_rank) {
item.data.data.bought_at_rank = this.actor.data.data.identity.school_rank; item.data.bought_at_rank = this.actor.data.data.identity.school_rank;
} }
break; break;
} }
@@ -232,7 +233,8 @@ export class BaseSheetL5r5e extends ActorSheet {
if (allowed === false) { if (allowed === false) {
return; return;
} }
return this._onDropItemCreate(item.toJSON());
return this._onDropItemCreate(item);
} }
/** /**
@@ -244,8 +246,6 @@ export class BaseSheetL5r5e extends ActorSheet {
// Toggle // Toggle
html.find(".toggle-on-click").on("click", (event) => { html.find(".toggle-on-click").on("click", (event) => {
event.preventDefault();
event.stopPropagation();
const elmt = $(event.currentTarget).data("toggle"); const elmt = $(event.currentTarget).data("toggle");
const tgt = html.find("." + elmt); const tgt = html.find("." + elmt);
tgt.toggleClass("toggle-active"); tgt.toggleClass("toggle-active");

View File

@@ -161,8 +161,6 @@ export class TwentyQuestionsDialog extends FormApplication {
// Toggle // Toggle
html.find(".toggle-on-click").on("click", (event) => { html.find(".toggle-on-click").on("click", (event) => {
event.preventDefault();
event.stopPropagation();
const elmt = $(event.currentTarget).data("toggle"); const elmt = $(event.currentTarget).data("toggle");
const tgt = html.find("." + elmt); const tgt = html.find("." + elmt);
tgt.toggleClass("toggle-active"); tgt.toggleClass("toggle-active");
@@ -382,7 +380,7 @@ export class TwentyQuestionsDialog extends FormApplication {
if (!id) { if (!id) {
continue; continue;
} }
const item = await game.l5r5e.HelpersL5r5e.getObjectGameOrPack(id, "Item"); const item = await game.l5r5e.HelpersL5r5e.getObjectGameOrPack({ id: id, type: "Item" });
if (!item) { if (!item) {
continue; continue;
} }

View File

@@ -160,31 +160,31 @@ export class RollL5r5e extends Roll {
* @override * @override
*/ */
get total() { get total() {
//return 0; // todo Bug : Si 0 tout le temps -> pas de pb pour le chat. mais plus d'inline :'( return null; // TODO Bug 0.8.x : If not returning a null/0 value the chat ignore the template. If i do this, no inline but "/r 1dr" work fine :'(
if (!this._evaluated) { // if (!this._evaluated) {
return null; // return null;
} // }
//
let total = ""; // let total = "";
//
// Regular dices total (eg 6) // // Regular dices total (eg 6)
if (this.l5r5e.dicesTypes.std) { // if (this.l5r5e.dicesTypes.std) {
total = this._total; // total = this._total;
} // }
//
// Add L5R summary // // Add L5R summary
if (this.l5r5e.dicesTypes.l5r) { // if (this.l5r5e.dicesTypes.l5r) {
const summary = this.l5r5e.summary; // const summary = this.l5r5e.summary;
total += // total +=
(this.l5r5e.dicesTypes.std ? " | " : "") + // (this.l5r5e.dicesTypes.std ? " | " : "") +
["success", "explosive", "opportunity", "strife"] // ["success", "explosive", "opportunity", "strife"]
.map((props) => (summary[props] > 0 ? `<i class="i_${props}"></i> ${summary[props]}` : null)) // .map((props) => (summary[props] > 0 ? `<i class="i_${props}"></i> ${summary[props]}` : null))
.filter((c) => !!c) // .filter((c) => !!c)
.join(" | "); // .join(" | ");
} // }
//
return total; // return total;
} }
/** /**

View File

@@ -71,74 +71,80 @@ export class HelpersL5r5e {
return null; return null;
} }
const data = JSON.parse(json); const data = JSON.parse(json);
return await HelpersL5r5e.getObjectGameOrPack(data.id, data.type, data.pack); return await HelpersL5r5e.getObjectGameOrPack(data);
} }
/** /**
* Return the object from Game or Pack by his ID, or null if not found * Return the object from Game or Pack by his ID, or null if not found
*/ */
static async getObjectGameOrPack(id, type, pack = null) { static async getObjectGameOrPack({ id, type, data = null, pack = null }) {
let document = null;
try { try {
// If no pack passed, but it's a core item, we know the pack to get it // Direct Object
if (!pack && id.substr(0, 7) === "L5RCore") { if (data?._id) {
pack = HelpersL5r5e.getPackNameForCoreItem(id); document = HelpersL5r5e.createItemFromCompendium(data);
} else if (!id || !type) {
return null;
} }
// Named pack // Named pack
if (pack) { if (!document) {
const data = await game.packs.get(pack).getDocument(id); // If no pack passed, but it's a core item, we know the pack to get it
if (data) { if (!pack && id.substr(0, 7) === "L5RCore") {
return HelpersL5r5e.createItemFromCompendium(data); pack = HelpersL5r5e.getPackNameForCoreItem(id);
}
if (pack) {
const data = await game.packs.get(pack).getDocument(id);
if (data) {
document = HelpersL5r5e.createItemFromCompendium(data);
}
} }
} }
// Game object // Game object
let item = null; if (!document) {
switch (type) { document = CONFIG[type].collection.instance.get(id);
case "Actor":
item = game.actors.get(id);
break;
case "Item":
item = game.items.get(id);
break;
case "JournalEntry":
item = game.journal.get(id);
break;
case "Macro":
item = game.macros.get(id);
break;
}
if (item) {
await HelpersL5r5e.refreshItemProperties(item);
return item;
} }
// Unknown pack object, iterate all packs // Unknown pack object, iterate all packs
for (const comp of game.packs) { if (!document) {
// TODO Bug with babele if "comp.getDocument(id)" return null... for (const comp of game.packs) {
const babeleFix = (await comp.getIndex()).some((e) => e.id === id); // TODO Bug with babele if "comp.getDocument(id)" return null...
if (!babeleFix) { const babeleFix = (await comp.getIndex()).some((e) => e.id === id);
continue; if (!babeleFix) {
continue;
}
const data = await comp.getDocument(id);
if (data) {
document = HelpersL5r5e.createItemFromCompendium(data);
}
}
}
// Final
if (document) {
// Flag the source GUID
if (document.uuid && !document.getFlag("core", "sourceId")) {
document.data.update({ "flags.core.sourceId": document.uuid });
} }
const data = await comp.getDocument(id); await HelpersL5r5e.refreshItemProperties(document);
if (data) { document.prepareData();
return HelpersL5r5e.createItemFromCompendium(data);
}
} }
} catch (err) { } catch (err) {
console.warn(err); console.warn(err);
} }
return null; console.log(" ***** getObjectGameOrPack", document);
return document;
} }
/** /**
* Make a temporary item for compendium drag n drop * Make a temporary item for compendium drag n drop
*/ */
static async createItemFromCompendium(data) { static createItemFromCompendium(data) {
if ( if (
![ ![
"item", "item",
@@ -156,31 +162,24 @@ export class HelpersL5r5e {
return data; return data;
} }
let item; let document;
if (data instanceof ItemL5r5e) { if (data instanceof ItemL5r5e) {
item = data; document = data;
} else if (game.user.hasPermission("ACTOR_CREATE")) {
// Fail if a player do not have the right to create object (even if this is a temporary)
item = await ItemL5r5e.create(data, { temporary: true });
// reinject compendium id (required for properties)
item.data.id = data.id;
} else { } else {
// Quick object // Quick object
item = new ItemL5r5e(data); document = new ItemL5r5e(data);
} }
await HelpersL5r5e.refreshItemProperties(item); return document;
return item;
} }
/** /**
* Babele and properties specific * Babele and properties specific
*/ */
static async refreshItemProperties(item) { static async refreshItemProperties(document) {
if (item.data.data.properties && typeof Babele !== "undefined") { if (document.data.data.properties && typeof Babele !== "undefined") {
item.data.data.properties = await Promise.all( document.data.data.properties = await Promise.all(
item.data.data.properties.map(async (property) => { document.data.data.properties.map(async (property) => {
const gameProp = await game.l5r5e.HelpersL5r5e.getObjectGameOrPack(property.id, "Item"); const gameProp = await HelpersL5r5e.getObjectGameOrPack({ id: property.id, type: "Item" });
if (gameProp) { if (gameProp) {
return { id: gameProp.id, name: gameProp.name }; return { id: gameProp.id, name: gameProp.name };
} }
@@ -217,7 +216,7 @@ export class HelpersL5r5e {
/** /**
* Get the associated pack for a core item (time saving) * Get the associated pack for a core item (time saving)
*/ */
static getPackNameForCoreItem(itemId) { static getPackNameForCoreItem(documentId) {
const core = new Map(); const core = new Map();
core.set("Pro", "l5r5e.core-properties"); core.set("Pro", "l5r5e.core-properties");
core.set("Kat", "l5r5e.core-techniques-kata"); core.set("Kat", "l5r5e.core-techniques-kata");
@@ -241,7 +240,7 @@ export class HelpersL5r5e {
core.set("Pas", "l5r5e.core-peculiarities-passions"); core.set("Pas", "l5r5e.core-peculiarities-passions");
core.set("Adv", "l5r5e.core-peculiarities-adversities"); core.set("Adv", "l5r5e.core-peculiarities-adversities");
core.set("Anx", "l5r5e.core-peculiarities-anxieties"); core.set("Anx", "l5r5e.core-peculiarities-anxieties");
return core.get(itemId.replace(/L5RCore(\w{3})\d+/gi, "$1")); return core.get(documentId.replace(/L5RCore(\w{3})\d+/gi, "$1"));
} }
/** /**

View File

@@ -3,10 +3,10 @@ export class ItemL5r5e extends Item {
* Create a new entity using provided input data * Create a new entity using provided input data
* @override * @override
*/ */
static async create(data, options = {}) { static async create(data, context = {}) {
if (data.img === undefined) { if (data.img === undefined) {
data.img = `${CONFIG.l5r5e.paths.assets}icons/items/${data.type}.svg`; data.img = `${CONFIG.l5r5e.paths.assets}icons/items/${data.type}.svg`;
} }
return super.create(data, options); return super.create(data, context);
} }
} }

View File

@@ -39,7 +39,7 @@ export class ItemSheetL5r5e extends ItemSheet {
if (Array.isArray(sheetData.data.data.properties)) { if (Array.isArray(sheetData.data.data.properties)) {
const props = []; const props = [];
for (const property of sheetData.data.data.properties) { for (const property of sheetData.data.data.properties) {
const gameProp = await game.l5r5e.HelpersL5r5e.getObjectGameOrPack(property.id, "Item"); const gameProp = await game.l5r5e.HelpersL5r5e.getObjectGameOrPack({ id: property.id, type: "Item" });
if (gameProp) { if (gameProp) {
sheetData.data.propertiesList.push(gameProp); sheetData.data.propertiesList.push(gameProp);
props.push({ id: gameProp.id, name: gameProp.name }); props.push({ id: gameProp.id, name: gameProp.name });
@@ -72,6 +72,9 @@ export class ItemSheetL5r5e extends ItemSheet {
*/ */
async _updateObject(event, formData) { async _updateObject(event, formData) {
if (formData["data.description"]) { if (formData["data.description"]) {
// Base links (Journal, compendiums...)
formData["data.description"] = TextEditor.enrichHTML(formData["data.description"]);
// L5R Symbols
formData["data.description"] = game.l5r5e.HelpersL5r5e.convertSymbols(formData["data.description"], true); formData["data.description"] = game.l5r5e.HelpersL5r5e.convertSymbols(formData["data.description"], true);
} }
return super._updateObject(event, formData); return super._updateObject(event, formData);
@@ -86,8 +89,6 @@ export class ItemSheetL5r5e extends ItemSheet {
// Toggle // Toggle
html.find(".toggle-on-click").on("click", (event) => { html.find(".toggle-on-click").on("click", (event) => {
event.preventDefault();
event.stopPropagation();
const elmt = $(event.currentTarget).data("toggle"); const elmt = $(event.currentTarget).data("toggle");
const tgt = html.find("." + elmt); const tgt = html.find("." + elmt);
tgt.toggleClass("toggle-active"); tgt.toggleClass("toggle-active");
@@ -135,8 +136,18 @@ export class ItemSheetL5r5e extends ItemSheet {
} }
// Check item type and subtype // Check item type and subtype
const item = await game.l5r5e.HelpersL5r5e.getDragnDropTargetObject(event); let item = await game.l5r5e.HelpersL5r5e.getDragnDropTargetObject(event);
if (!item || item.documentName !== "Item" || item.data.type !== "property" || this.item.type === "property") { if (!item || item.documentName !== "Item" || this.item.type === "property") {
return;
}
// Specific ItemPattern's drop, get the associated props instead
if (item.data.type === "item_pattern" && item.data.flags.l5r5e?.linkedPropertyId) {
item = await game.packs.get("l5r5e.core-properties").getDocument(item.data.flags.l5r5e.linkedPropertyId);
}
// Final object has to be a property
if (item.data.type !== "property") {
return; return;
} }

View File

@@ -78,6 +78,7 @@ Hooks.once("init", async () => {
RingDie, RingDie,
AbilityDie, AbilityDie,
HelpersL5r5e, HelpersL5r5e,
ItemL5r5e,
RollL5r5e, RollL5r5e,
DicePickerDialog, DicePickerDialog,
RollnKeepDialog, RollnKeepDialog,

View File

@@ -9,6 +9,7 @@ export const PreloadTemplates = async function () {
"systems/l5r5e/templates/actors/character/conflict.html", "systems/l5r5e/templates/actors/character/conflict.html",
"systems/l5r5e/templates/actors/character/experience.html", "systems/l5r5e/templates/actors/character/experience.html",
"systems/l5r5e/templates/actors/character/identity.html", "systems/l5r5e/templates/actors/character/identity.html",
"systems/l5r5e/templates/actors/character/inventory.html",
"systems/l5r5e/templates/actors/character/narrative.html", "systems/l5r5e/templates/actors/character/narrative.html",
"systems/l5r5e/templates/actors/character/rings.html", "systems/l5r5e/templates/actors/character/rings.html",
"systems/l5r5e/templates/actors/character/skill.html", "systems/l5r5e/templates/actors/character/skill.html",
@@ -20,6 +21,7 @@ export const PreloadTemplates = async function () {
"systems/l5r5e/templates/actors/npc/attributes.html", "systems/l5r5e/templates/actors/npc/attributes.html",
"systems/l5r5e/templates/actors/npc/conflict.html", "systems/l5r5e/templates/actors/npc/conflict.html",
"systems/l5r5e/templates/actors/npc/identity.html", "systems/l5r5e/templates/actors/npc/identity.html",
"systems/l5r5e/templates/actors/npc/inventory.html",
"systems/l5r5e/templates/actors/npc/narrative.html", "systems/l5r5e/templates/actors/npc/narrative.html",
"systems/l5r5e/templates/actors/npc/rings.html", "systems/l5r5e/templates/actors/npc/rings.html",
"systems/l5r5e/templates/actors/npc/social.html", "systems/l5r5e/templates/actors/npc/social.html",

View File

@@ -47,25 +47,7 @@
{{!-- Inventory Tab --}} {{!-- Inventory Tab --}}
<article class="tab inventory" data-group="primary" data-tab="inventory"> <article class="tab inventory" data-group="primary" data-tab="inventory">
<fieldset class="money money-wrapper"> {{> 'systems/l5r5e/templates/actors/character/inventory.html'}}
<legend class="section-header">{{localize 'l5r5e.money.title'}}</legend>
<label>
{{localize 'l5r5e.money.koku'}}
<input name="data.money.koku" type="number" value="{{data.data.money.koku}}" data-dtype="Number" min="0" placeholder="0"/>
</label>
<label>
{{localize 'l5r5e.money.bu'}}
<input name="data.money.bu" type="number" value="{{data.data.money.bu}}" data-dtype="Number" min="0" placeholder="0"/>
</label>
<label>
{{localize 'l5r5e.money.zeni'}}
<input name="data.money.zeni" type="number" value="{{data.data.money.zeni}}" data-dtype="Number" min="0" placeholder="0"/>
</label>
</fieldset>
<fieldset class="items-wrapper">
<legend>{{localize 'l5r5e.equipment'}}</legend>
{{> 'systems/l5r5e/templates/items/item/items.html'}}
</fieldset>
</article> </article>
{{!-- Experience Tab --}} {{!-- Experience Tab --}}

View File

@@ -61,7 +61,6 @@
</tbody> </tbody>
</table> </table>
</fieldset> </fieldset>
{{!-- Others progession (does not count in school xp) --}} {{!-- Others progession (does not count in school xp) --}}
<fieldset class="xp-spent xp-spent-body"> <fieldset class="xp-spent xp-spent-body">
<legend class="tools">{{localize 'l5r5e.advancements.title'}} <a data-item-type="advancement-others" class="advancement-others-control item-add" title="{{localize 'l5r5e.global.add'}}"><i class="fas fa-plus"></i></a></legend> <legend class="tools">{{localize 'l5r5e.advancements.title'}} <a data-item-type="advancement-others" class="advancement-others-control item-add" title="{{localize 'l5r5e.global.add'}}"><i class="fas fa-plus"></i></a></legend>

View File

@@ -0,0 +1,36 @@
<fieldset class="money money-wrapper">
<legend class="section-header">{{localize 'l5r5e.money.title'}}</legend>
<label>
{{localize 'l5r5e.money.koku'}}
<input name="data.money.koku" type="number" value="{{data.data.money.koku}}" data-dtype="Number" min="0" placeholder="0"/>
</label>
<label>
{{localize 'l5r5e.money.bu'}}
<input name="data.money.bu" type="number" value="{{data.data.money.bu}}" data-dtype="Number" min="0" placeholder="0"/>
</label>
<label>
{{localize 'l5r5e.money.zeni'}}
<input name="data.money.zeni" type="number" value="{{data.data.money.zeni}}" data-dtype="Number" min="0" placeholder="0"/>
</label>
</fieldset>
{{!-- items list --}}
<fieldset class="items-wrapper">
<legend>{{localize 'l5r5e.equipment'}}</legend>
{{> 'systems/l5r5e/templates/items/item/items.html'}}
</fieldset>
{{!-- item patterns list --}}
<fieldset>
<legend class="text-block-header">
{{localize 'l5r5e.advancements.item_pattern'}}
{{#if options.editable}}
<a data-item-type="item_pattern" class="item-pattern-control item-add" title="{{localize 'l5r5e.global.add'}}"><i class="fas fa-plus"></i></a>
{{/if}}
</legend>
<ul class="item-list">
{{#each actor.items as |pattern id|}}
{{#ifCond pattern.data.type '==' 'item_pattern'}}
{{> 'systems/l5r5e/templates/items/item-pattern/item-pattern-entry.html' pattern=pattern id=id editable=../options.editable}}
{{/ifCond}}
{{/each}}
</ul>
</fieldset>

View File

@@ -41,38 +41,6 @@
{{/each}} {{/each}}
</ul> </ul>
</fieldset> </fieldset>
{{!-- item-pattern --}}
<fieldset>
<legend class="text-block-header">
{{localize 'l5r5e.advancements.item_pattern' }}
{{#if options.editable}}
<a data-item-type="item_pattern" class="item-pattern-control item-add" title="{{localize 'l5r5e.global.add'}}"><i class="fas fa-plus"></i></a>
{{/if}}
</legend>
<ul class="item-list">
{{#each actor.items as |pattern id|}}
{{#ifCond pattern.data.type '==' 'item_pattern'}}
{{> 'systems/l5r5e/templates/items/item-pattern/item-pattern-entry.html' pattern=pattern id=id editable=../options.editable}}
{{/ifCond}}
{{/each}}
</ul>
</fieldset>
{{!-- signature-scroll --}}
<fieldset>
<legend class="text-block-header">
{{localize 'l5r5e.advancements.signature_scroll' }}
{{#if options.editable}}
<a data-item-type="signature_scroll" class="signature-scroll-control item-add" title="{{localize 'l5r5e.global.add'}}"><i class="fas fa-plus"></i></a>
{{/if}}
</legend>
<ul class="item-list">
{{#each actor.items as |scroll id|}}
{{#ifCond scroll.data.type '==' 'signature_scroll'}}
{{> 'systems/l5r5e/templates/items/signature-scroll/signature-scroll-entry.html' scroll=scroll id=id editable=../options.editable}}
{{/ifCond}}
{{/each}}
</ul>
</fieldset>
{{!-- bonds --}} {{!-- bonds --}}
<fieldset> <fieldset>
<legend class="text-block-header"> <legend class="text-block-header">

View File

@@ -1,4 +1,5 @@
<div class="techniques-wrapper"> <div class="techniques-wrapper">
{{!-- technique types --}}
<div class="checklist"> <div class="checklist">
<i>{{localize 'l5r5e.techniques.type'}}</i> <i>{{localize 'l5r5e.techniques.type'}}</i>
{{#each data.techniquesList as |technique|}} {{#each data.techniquesList as |technique|}}
@@ -8,6 +9,7 @@
</label> </label>
{{/each}} {{/each}}
</div> </div>
{{!-- technique list --}}
{{#each data.splitTechniquesList as |list technique|}} {{#each data.splitTechniquesList as |list technique|}}
<fieldset class="section-header flexrow"> <fieldset class="section-header flexrow">
<legend class="technique-controls"> <legend class="technique-controls">
@@ -23,4 +25,20 @@
</ul> </ul>
</fieldset> </fieldset>
{{/each}} {{/each}}
{{!-- signature scroll list --}}
<fieldset class="section-header flexrow">
<legend class="text-block-header">
{{localize 'l5r5e.advancements.signature_scroll' }}
{{#if options.editable}}
<a data-item-type="signature_scroll" class="signature-scroll-control item-add" title="{{localize 'l5r5e.global.add'}}"><i class="fas fa-plus"></i></a>
{{/if}}
</legend>
<ul class="item-list">
{{#each actor.items as |scroll id|}}
{{#ifCond scroll.data.type '==' 'signature_scroll'}}
{{> 'systems/l5r5e/templates/items/signature-scroll/signature-scroll-entry.html' scroll=scroll id=id editable=../options.editable}}
{{/ifCond}}
{{/each}}
</ul>
</fieldset>
</div> </div>

View File

@@ -50,10 +50,7 @@
{{!-- Inventory Tab --}} {{!-- Inventory Tab --}}
<article class="tab inventory" data-group="primary" data-tab="inventory"> <article class="tab inventory" data-group="primary" data-tab="inventory">
<fieldset class="items-wrapper"> {{> 'systems/l5r5e/templates/actors/npc/inventory.html'}}
<legend>{{localize 'l5r5e.equipment'}}</legend>
{{> 'systems/l5r5e/templates/items/item/items.html'}}
</fieldset>
</article> </article>
</section> </section>
</form> </form>

View File

@@ -0,0 +1,20 @@
<fieldset class="items-wrapper">
<legend>{{localize 'l5r5e.equipment'}}</legend>
{{> 'systems/l5r5e/templates/items/item/items.html'}}
</fieldset>
{{!-- item patterns list --}}
<fieldset>
<legend class="text-block-header">
{{localize 'l5r5e.advancements.item_pattern' }}
{{#if options.editable}}
<a data-item-type="item_pattern" class="item-pattern-control item-add" title="{{localize 'l5r5e.global.add'}}"><i class="fas fa-plus"></i></a>
{{/if}}
</legend>
<ul class="item-list">
{{#each actor.items as |pattern id|}}
{{#ifCond pattern.data.type '==' 'item_pattern'}}
{{> 'systems/l5r5e/templates/items/item-pattern/item-pattern-entry.html' pattern=pattern id=id editable=../options.editable}}
{{/ifCond}}
{{/each}}
</ul>
</fieldset>

View File

@@ -28,38 +28,6 @@
{{/each}} {{/each}}
</ul> </ul>
</fieldset> </fieldset>
{{!-- item-pattern --}}
<fieldset>
<legend class="text-block-header">
{{localize 'l5r5e.advancements.item_pattern' }}
{{#if options.editable}}
<a data-item-type="item_pattern" class="item-pattern-control item-add" title="{{localize 'l5r5e.global.add'}}"><i class="fas fa-plus"></i></a>
{{/if}}
</legend>
<ul class="item-list">
{{#each actor.items as |pattern id|}}
{{#ifCond pattern.data.type '==' 'item_pattern'}}
{{> 'systems/l5r5e/templates/items/item-pattern/item-pattern-entry.html' pattern=pattern id=id editable=../options.editable}}
{{/ifCond}}
{{/each}}
</ul>
</fieldset>
{{!-- signature-scroll --}}
<fieldset>
<legend class="text-block-header">
{{localize 'l5r5e.advancements.signature_scroll' }}
{{#if options.editable}}
<a data-item-type="signature_scroll" class="signature-scroll-control item-add" title="{{localize 'l5r5e.global.add'}}"><i class="fas fa-plus"></i></a>
{{/if}}
</legend>
<ul class="item-list">
{{#each actor.items as |scroll id|}}
{{#ifCond scroll.data.type '==' 'signature_scroll'}}
{{> 'systems/l5r5e/templates/items/signature-scroll/signature-scroll-entry.html' scroll=scroll id=id editable=../options.editable}}
{{/ifCond}}
{{/each}}
</ul>
</fieldset>
{{!-- bonds --}} {{!-- bonds --}}
<fieldset> <fieldset>
<legend class="text-block-header"> <legend class="text-block-header">

View File

@@ -2,6 +2,7 @@
<legend class="technique-controls"> <legend class="technique-controls">
{{localize 'l5r5e.techniques.title'}} {{localize 'l5r5e.techniques.title'}}
</legend> </legend>
{{!-- technique types --}}
<div class="checklist"> <div class="checklist">
<i>{{localize 'l5r5e.techniques.type'}}</i> <i>{{localize 'l5r5e.techniques.type'}}</i>
{{#each data.techniquesList as |technique|}} {{#each data.techniquesList as |technique|}}
@@ -11,6 +12,7 @@
</label> </label>
{{/each}} {{/each}}
</div> </div>
{{!-- technique list --}}
{{#each data.splitTechniquesList as |list technique|}} {{#each data.splitTechniquesList as |list technique|}}
<fieldset class="section-header flexrow"> <fieldset class="section-header flexrow">
<legend class="technique-controls"> <legend class="technique-controls">
@@ -26,4 +28,20 @@
</ul> </ul>
</fieldset> </fieldset>
{{/each}} {{/each}}
{{!-- signature scroll list --}}
<fieldset class="section-header flexrow">
<legend class="text-block-header">
{{localize 'l5r5e.advancements.signature_scroll' }}
{{#if options.editable}}
<a data-item-type="signature_scroll" class="signature-scroll-control item-add" title="{{localize 'l5r5e.global.add'}}"><i class="fas fa-plus"></i></a>
{{/if}}
</legend>
<ul class="item-list">
{{#each actor.items as |scroll id|}}
{{#ifCond scroll.data.type '==' 'signature_scroll'}}
{{> 'systems/l5r5e/templates/items/signature-scroll/signature-scroll-entry.html' scroll=scroll id=id editable=../options.editable}}
{{/ifCond}}
{{/each}}
</ul>
</fieldset>
</fieldset> </fieldset>

View File

@@ -1,4 +1,4 @@
<li class="item advancement flexcol toggle-on-click" data-toggle="item-description-{{advancement._id}}"> <li class="item advancement flexcol toggle-on-click" data-toggle="item-description-{{advancement._id}}" data-item-id="{{advancement._id}}">
<ul class="item-header advancement-controls"> <ul class="item-header advancement-controls">
<li class="item-img"><img src="{{advancement.img}}" title="{{advancement.name}}" width="32px" height="32px"/></li> <li class="item-img"><img src="{{advancement.img}}" title="{{advancement.name}}" width="32px" height="32px"/></li>
<li class="item-name">{{advancement.name}}</li> <li class="item-name">{{advancement.name}}</li>

View File

@@ -1,4 +1,4 @@
<li class="item armor flexcol toggle-on-click" data-toggle="item-description-{{armor.id}}"> <li class="item armor flexcol toggle-on-click" data-toggle="item-description-{{armor.id}}" data-item-id="{{armor.id}}">
<ul class="item-header item-control"> <ul class="item-header item-control">
<li class="item-img"><img src="{{armor.img}}" title="{{armor.name}}" width="32px" height="32px"/></li> <li class="item-img"><img src="{{armor.img}}" title="{{armor.name}}" width="32px" height="32px"/></li>
<li class="item-name">{{armor.name}}</li> <li class="item-name">{{armor.name}}</li>

View File

@@ -1,4 +1,4 @@
<li class="item bond flexcol toggle-on-click" data-toggle="item-description-{{bond.id}}"> <li class="item bond flexcol toggle-on-click" data-toggle="item-description-{{bond.id}}" data-item-id="{{bond.id}}">
<ul class="item-header bond-controls"> <ul class="item-header bond-controls">
<li class="item-img"><img src="{{bond.img}}" title="{{bond.name}}" width="32px" height="32px"/></li> <li class="item-img"><img src="{{bond.img}}" title="{{bond.name}}" width="32px" height="32px"/></li>
<li class="item-name">{{bond.name}}</li> <li class="item-name">{{bond.name}}</li>

View File

@@ -1,4 +1,4 @@
<li class="item item-pattern flexcol toggle-on-click" data-toggle="item-description-{{pattern.id}}"> <li class="item item-pattern flexcol toggle-on-click" data-toggle="item-description-{{pattern.id}}" data-item-id="{{pattern.id}}">
<ul class="item-header pattern-controls"> <ul class="item-header pattern-controls">
<li class="item-img"><img src="{{pattern.img}}" title="{{pattern.name}}" width="24px" height="24px"/></li> <li class="item-img"><img src="{{pattern.img}}" title="{{pattern.name}}" width="24px" height="24px"/></li>
<li class="item-name">{{pattern.name}}</li> <li class="item-name">{{pattern.name}}</li>

View File

@@ -1,4 +1,4 @@
<li class="item flexcol toggle-on-click" data-toggle="item-description-{{item._id}}"> <li class="item flexcol toggle-on-click" data-toggle="item-description-{{item._id}}" data-item-id="{{item._id}}">
<ul class="item-header item-control"> <ul class="item-header item-control">
<li class="item-img"><img src="{{item.img}}" title="{{item.name}}" width="32px" height="32px"/></li> <li class="item-img"><img src="{{item.img}}" title="{{item.name}}" width="32px" height="32px"/></li>
<li class="item-name">{{ item.name }} <sub>x{{item.data.quantity}}</sub></li> <li class="item-name">{{ item.name }} <sub>x{{item.data.quantity}}</sub></li>

View File

@@ -1,4 +1,4 @@
<li class="item peculiarity flexcol toggle-on-click" data-toggle="item-description-{{peculiarity.id}}"> <li class="item peculiarity flexcol toggle-on-click" data-toggle="item-description-{{peculiarity.id}}" data-item-id="{{peculiarity.id}}">
<ul class="item-header peculiarity-controls"> <ul class="item-header peculiarity-controls">
<li class="item-img"><img src="{{peculiarity.img}}" title="{{peculiarity.name}}" width="32px" height="32px"/></li> <li class="item-img"><img src="{{peculiarity.img}}" title="{{peculiarity.name}}" width="32px" height="32px"/></li>
<li class="item-name">{{peculiarity.name}}</li> <li class="item-name">{{peculiarity.name}}</li>

View File

@@ -1,4 +1,4 @@
<li class="item signature-scroll flexcol toggle-on-click" data-toggle="item-description-{{scroll.id}}"> <li class="item signature-scroll flexcol toggle-on-click" data-toggle="item-description-{{scroll.id}}" data-item-id="{{scroll.id}}">
<ul class="item-header signature-scroll-controls"> <ul class="item-header signature-scroll-controls">
<li class="item-img"><img src="{{scroll.img}}" title="{{scroll.name}}" width="24px" height="24px"/></li> <li class="item-img"><img src="{{scroll.img}}" title="{{scroll.name}}" width="24px" height="24px"/></li>
<li class="item-name">{{scroll.name}}</li> <li class="item-name">{{scroll.name}}</li>

View File

@@ -1,4 +1,4 @@
<li class="item technique flexcol toggle-on-click" data-toggle="item-description-{{technique._id}}"> <li class="item technique flexcol toggle-on-click" data-toggle="item-description-{{technique._id}}" data-item-id="{{technique._id}}">
<ul class="item-header technique-controls"> <ul class="item-header technique-controls">
<li class="item-img"><img src="{{technique.img}}" title="{{technique.name}}" width="32px" height="32px"/></li> <li class="item-img"><img src="{{technique.img}}" title="{{technique.name}}" width="32px" height="32px"/></li>
<li class="item-name">{{technique.name}}</li> <li class="item-name">{{technique.name}}</li>

View File

@@ -1,4 +1,4 @@
<li class="item title flexcol toggle-on-click" data-toggle="item-description-{{title._id}}"> <li class="item title flexcol toggle-on-click" data-toggle="item-description-{{title._id}}" data-item-id="{{title._id}}">
<ul class="item-header title-controls"> <ul class="item-header title-controls">
<li class="item-img"><img src="{{title.img}}" title="{{title.name}}" width="24px" height="24px"/></li> <li class="item-img"><img src="{{title.img}}" title="{{title.name}}" width="24px" height="24px"/></li>
<li class="item-name"><i class="i_{{title.data.ring}}" title="{{localizeRing title.data.ring}}"></i> {{title.name}}</li> <li class="item-name"><i class="i_{{title.data.ring}}" title="{{localizeRing title.data.ring}}"></i> {{title.name}}</li>

View File

@@ -3,10 +3,15 @@
<img class="profile-img" src="{{document.img}}" data-edit="img" title="{{document.name}}"/> <img class="profile-img" src="{{document.img}}" data-edit="img" title="{{document.name}}"/>
<h1 class="charname"><input name="name" type="text" value="{{document.name}}" placeholder="Name"/></h1> <h1 class="charname"><input name="name" type="text" value="{{document.name}}" placeholder="Name"/></h1>
</header> </header>
{{!-- Sheet Navigation --}}
<nav class="sheet-tabs tabs" data-group="primary">
<a class="item active" data-tab="attributes">{{ localize "l5r5e.description" }}</a>
<a class="item" data-tab="experience">{{ localize "l5r5e.advancements.title" }}</a>
</nav>
{{!-- Sheet Body --}} {{!-- Sheet Body --}}
<section class="sheet-body"> <section class="sheet-body">
{{!-- Attributes Tab --}} {{!-- Attributes Tab --}}
<article class="attributes" data-group="primary" data-tab="attributes"> <article class="tab attributes" data-group="primary" data-tab="attributes">
<label class="attribute"> <label class="attribute">
{{ localize 'l5r5e.advancements.cost' }} {{ localize 'l5r5e.advancements.cost' }}
<input class="select-on-focus" type="number" name="data.xp_cost" value="{{document.data.data.xp_cost}}" data-dtype="Number" min="0" placeholder="0"/> <input class="select-on-focus" type="number" name="data.xp_cost" value="{{document.data.data.xp_cost}}" data-dtype="Number" min="0" placeholder="0"/>
@@ -26,7 +31,30 @@
</article> </article>
{{!-- Embbed advancements --}} {{!-- Embbed advancements --}}
{{!-- TODO --}} <article class="tab experience" data-group="primary" data-tab="experience">
{{!-- TODO --}}
{{!-- Others progession (does not count in school xp) --}}
<fieldset class="xp-spent xp-spent-body">
<legend class="tools">{{localize 'l5r5e.advancements.title'}} <a data-item-type="advancement-others" class="advancement-others-control item-add" title="{{localize 'l5r5e.global.add'}}"><i class="fas fa-plus"></i></a></legend>
<table>
<thead class="flex">
<tr class="flexrow row">
<th class="name">{{localize 'l5r5e.name'}}</th>
<th class="xp">{{localize 'l5r5e.advancements.spent'}}</th>
<th class="rank">{{localize 'l5r5e.rank'}}</th>
{{#if editable}}
<th class="actions"></th>
{{/if}}
</tr>
</thead>
<tbody class="flex">
{{#each data.advancementsOthers as |advancement advancementId|}}
{{> 'systems/l5r5e/templates/actors/character/advancement-others.html' advancement=advancement editable=../options.editable}}
{{/each}}
</tbody>
</table>
</fieldset>
</article>
{{!-- Descr + Page ref --}} {{!-- Descr + Page ref --}}
{{> 'systems/l5r5e/templates/items/item/item-infos.html'}} {{> 'systems/l5r5e/templates/items/item/item-infos.html'}}