Working on 0.8.x

- Title's Advancements are now reflected on actor
- Migration update
This commit is contained in:
Vlyan
2021-05-22 17:20:17 +02:00
parent 4f9b72c63f
commit 53f04e6cef
33 changed files with 423 additions and 281 deletions

View File

@@ -12,12 +12,14 @@ __! Be certain to carefully back up any critical user data before installing thi
- Can be dropped on another item to add the associated property. - Can be dropped on another item to add the associated property.
- To change the linked property, drop any property on the item pattern sheet. - To change the linked property, drop any property on the item pattern sheet.
- 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).
- Fix : The "Crescent Moon Style" technique rank from 4 to 2 - Fix : The "Crescent Moon Style" technique rank from 4 to 2.
- Fix : Drop an advancement on a PC/NPC sheet now correctly add the bonus to the Actor (ex Air +1).
- QoL : RnK button is now black in chat if no actions are left in roll. - QoL : RnK button is now black in chat if no actions are left in roll.
- QoL : Added symbols legend in RnK dialog as reminder. - QoL : Added symbols legend in RnK dialog as reminder.
- QoL : Added "(x Max)" display in RnK picker for max number of dice to keep (thanks to Bragma). - QoL : Added "(x Max)" display in RnK picker for max number of dice to keep (thanks to Bragma).
- Others minor optimizations (ex: 20q saving multiple item at once).
## 1.2.1 - Praised be Firefox ## 1.2.1 - Praised be Firefox
- Fix dice swap on firefox that overflowed on the top and bottom of the RnK dialog - Fix dice swap on firefox that overflowed on the top and bottom of the RnK dialog

View File

@@ -108,4 +108,65 @@ export class ActorL5r5e extends Actor {
} }
} }
} }
/**
* Add a Ring/Skill point to the current actor if the item is a advancement
* @param {Item} item
* @return {Promise<void>}
*/
async addBonus(item) {
return this._updateActorFromAdvancement(item, true);
}
/**
* Remove a Ring/Skill point to the current actor if the item is a advancement
* @param {Item} item
* @return {Promise<void>}
*/
async removeBonus(item) {
return this._updateActorFromAdvancement(item, false);
}
/**
* Alter Actor skill/ring from a advancement
* @param {Item} item
* @param {boolean} isAdd True=add, false=remove
* @return {Promise<void>}
* @private
*/
async _updateActorFromAdvancement(item, isAdd) {
if (item && item.type === "advancement") {
const actor = foundry.utils.duplicate(this.data.data);
const itemData = item.data.data;
if (itemData.advancement_type === "ring") {
// Ring
if (isAdd) {
actor.rings[itemData.ring] = Math.min(9, actor.rings[itemData.ring] + 1);
} else {
actor.rings[itemData.ring] = Math.max(1, actor.rings[itemData.ring] - 1);
}
} else {
// Skill
const skillCatId = CONFIG.l5r5e.skills.get(itemData.skill);
if (skillCatId) {
if (isAdd) {
actor.skills[skillCatId][itemData.skill] = Math.min(
9,
actor.skills[skillCatId][itemData.skill] + 1
);
} else {
actor.skills[skillCatId][itemData.skill] = Math.max(
0,
actor.skills[skillCatId][itemData.skill] - 1
);
}
}
}
// Update Actor
await this.update({
data: foundry.utils.diffObject(this.data.data, actor),
});
}
}
} }

View File

@@ -58,9 +58,19 @@ export class BaseSheetL5r5e extends ActorSheet {
// Add tech the character knows // Add tech the character knows
sheetData.items.forEach((item) => { sheetData.items.forEach((item) => {
if (item.type === "technique") { switch (item.type) {
out[item.data.technique_type].push(item); case "technique":
} out[item.data.technique_type].push(item);
break;
case "title":
Array.from(item.data.items).forEach(([id, embedItem]) => {
if (embedItem.data.type === "technique") {
out[embedItem.data.data.technique_type].push(embedItem.data);
}
});
break;
} //swi
}); });
// Remove unused techs // Remove unused techs
@@ -170,35 +180,44 @@ 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.quantity && this.actor.data.items) { if (item.data.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.data.name && e.type === item.data.type);
if (tmpItem && this._modifyQuantity(tmpItem.id, 1)) { if (tmpItem && this._modifyQuantity(tmpItem.id, 1)) {
return; return;
} }
} }
// Item subtype specific // Item subtype specific
switch (item.type) { switch (item.data.type) {
case "bond": // no break case "bond": // no break
case "advancement": // no break
case "peculiarity": // no break case "peculiarity": // no break
case "item_pattern": // no break case "item_pattern": // no break
case "signature_scroll": 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.bought_at_rank = this.actor.data.data.identity.school_rank; item.data.data.bought_at_rank = this.actor.data.data.identity.school_rank;
} }
break; break;
case "advancement":
// Modify the bought at rank to the current actor rank
if (this.actor.data.data.identity?.school_rank) {
item.data.data.bought_at_rank = this.actor.data.data.identity.school_rank;
}
// Specific advancements, remove 1 to selected ring/skill
await this.actor.addBonus(item);
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.technique_type)?.type === "school") { if (CONFIG.l5r5e.techniques.get(item.data.data.technique_type)?.type === "school") {
if ( if (
Array.from(this.actor.items).some( Array.from(this.actor.items).some(
(e) => e.type === "technique" && e.data.data.technique_type === item.data.technique_type (e) =>
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"));
@@ -206,24 +225,25 @@ export class BaseSheetL5r5e extends ActorSheet {
} }
// No cost for schools // No cost for schools
item.data.xp_cost = 0; item.data.data.xp_cost = 0;
item.data.xp_used = 0; item.data.data.xp_used = 0;
item.data.in_curriculum = true; item.data.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.technique_type]) { if (!game.user.isGM && !this.actor.data.data.techniques[item.data.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.xp_cost = item.data.xp_cost > 0 ? item.data.xp_cost : CONFIG.l5r5e.xp.techniqueCost; item.data.data.xp_cost =
item.data.xp_used = item.data.xp_cost; item.data.data.xp_cost > 0 ? item.data.data.xp_cost : CONFIG.l5r5e.xp.techniqueCost;
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.bought_at_rank = this.actor.data.data.identity.school_rank; item.data.data.bought_at_rank = this.actor.data.data.identity.school_rank;
} }
break; break;
} }
@@ -234,7 +254,7 @@ export class BaseSheetL5r5e extends ActorSheet {
return; return;
} }
return this._onDropItemCreate(item); return this._onDropItemCreate(item.data.toObject(false));
} }
/** /**
@@ -395,12 +415,25 @@ export class BaseSheetL5r5e extends ActorSheet {
event.preventDefault(); event.preventDefault();
event.stopPropagation(); event.stopPropagation();
let item;
const itemId = $(event.currentTarget).data("item-id"); const itemId = $(event.currentTarget).data("item-id");
if (!itemId) { if (!itemId) {
return; return;
} }
const item = this.actor.items.get(itemId); const itemParentId = $(event.currentTarget).data("item-parent-id");
if (itemParentId) {
// Embed Item
const parentItem = this.actor.items.get(itemParentId);
if (!parentItem) {
return;
}
item = parentItem.items.get(itemId);
} else {
// Regular item
item = this.actor.items.get(itemId);
}
if (!item) { if (!item) {
return; return;
} }
@@ -421,35 +454,20 @@ export class BaseSheetL5r5e extends ActorSheet {
return; return;
} }
// Remove 1 qty if possible
const tmpItem = this.actor.items.get(itemId); const tmpItem = this.actor.items.get(itemId);
if (tmpItem && tmpItem.data.data.quantity > 1 && this._modifyQuantity(tmpItem.id, -1)) { if (!tmpItem) {
return;
}
// Remove 1 qty if possible
if (tmpItem.data.data.quantity > 1 && this._modifyQuantity(tmpItem.id, -1)) {
return; return;
} }
const callback = async () => { const callback = async () => {
// Specific advancements, remove 1 to selected ring/skill // Specific advancements, remove 1 to selected ring/skill
if (tmpItem.type === "advancement") { if (tmpItem.type === "advancement") {
const actor = duplicate(this.actor.data.data); await this.actor.removeBonus(tmpItem);
const itmData = tmpItem.data.data;
if (itmData.advancement_type === "ring") {
// Ring
actor.rings[itmData.ring] = Math.max(1, actor.rings[itmData.ring] - 1);
} else {
// Skill
const skillCatId = CONFIG.l5r5e.skills.get(itmData.skill);
if (skillCatId) {
actor.skills[skillCatId][itmData.skill] = Math.max(
0,
actor.skills[skillCatId][itmData.skill] - 1
);
}
}
// Update Actor
this.actor.update({
data: diffObject(this.actor.data.data, actor),
});
} }
return this.actor.deleteEmbeddedDocuments("Item", [itemId]); return this.actor.deleteEmbeddedDocuments("Item", [itemId]);
}; };

View File

@@ -49,13 +49,10 @@ export class CharacterSheetL5r5e extends BaseSheetL5r5e {
// Split Money // Split Money
sheetData.data.data.money = this._zeniToMoney(this.actor.data.data.zeni); sheetData.data.data.money = this._zeniToMoney(this.actor.data.data.zeni);
// Split school advancements by rank, and calculate xp spent // Split school advancements by rank, and calculate xp spent and add it to total
this._prepareSchoolAdvancement(sheetData); this._prepareSchoolAdvancement(sheetData);
// Titles // Split Others advancements, and calculate xp spent and add it to total
this._prepareTitles(sheetData);
// Others
this._prepareOthersAdvancement(sheetData); this._prepareOthersAdvancement(sheetData);
// Total // Total
@@ -105,13 +102,6 @@ export class CharacterSheetL5r5e extends BaseSheetL5r5e {
.activate("advancement_rank_" + (this.actor.data.data.identity.school_rank || 0)); .activate("advancement_rank_" + (this.actor.data.data.identity.school_rank || 0));
} }
/**
* Prepare Titles, and get xp spend
*/
_prepareTitles(sheetData) {
// TODO
}
/** /**
* Split the school advancement, calculate the total xp spent and the current total xp spent by rank * Split the school advancement, calculate the total xp spent and the current total xp spent by rank
*/ */
@@ -148,12 +138,23 @@ export class CharacterSheetL5r5e extends BaseSheetL5r5e {
* Prepare Bonds, Item Pattern, Signature Scroll and get xp spend * Prepare Bonds, Item Pattern, Signature Scroll and get xp spend
*/ */
_prepareOthersAdvancement(sheetData) { _prepareOthersAdvancement(sheetData) {
// Split OthersAdvancement from items
sheetData.data.advancementsOthers = sheetData.items.filter((item) => sheetData.data.advancementsOthers = sheetData.items.filter((item) =>
["bond", "item_pattern", "title", "signature_scroll"].includes(item.type) ["bond", "item_pattern", "title", "signature_scroll"].includes(item.type)
); );
// Sort by rank desc // Sort by rank desc
// sheetData.data.bondsList.sort((a, b) => (b.data.rank || 0) - (a.data.rank || 0)); sheetData.data.advancementsOthers.sort((a, b) => (b.data.rank || 0) - (a.data.rank || 0));
// Total xp spent
sheetData.data.advancementsOthersTotalXp = sheetData.data.advancementsOthers.reduce(
(acc, item) => acc + (item.data.xp_used || 0),
0
);
// Update the total spent
sheetData.data.data.xp_spent =
parseInt(sheetData.data.data.xp_spent) + sheetData.data.advancementsOthersTotalXp;
} }
/** /**
@@ -177,6 +178,12 @@ export class CharacterSheetL5r5e extends BaseSheetL5r5e {
return super._updateObject(event, formData); return super._updateObject(event, formData);
} }
/**
* Convert a sum in Zeni to Zeni, Bu and Koku
* @param {number} zeni
* @return {{bu: number, koku: number, zeni: number}}
* @private
*/
_zeniToMoney(zeni) { _zeniToMoney(zeni) {
const money = { const money = {
koku: 0, koku: 0,
@@ -196,6 +203,14 @@ export class CharacterSheetL5r5e extends BaseSheetL5r5e {
return money; return money;
} }
/**
* Convert a sum in Zeni, Bu and Koku to Zeni
* @param {number} koku
* @param {number} bu
* @param {number} zeni
* @return {number}
* @private
*/
_moneyToZeni(koku, bu, zeni) { _moneyToZeni(koku, bu, zeni) {
return Math.floor(koku * CONFIG.l5r5e.money[0]) + Math.floor(bu * CONFIG.l5r5e.money[1]) + Math.floor(zeni); return Math.floor(koku * CONFIG.l5r5e.money[0]) + Math.floor(bu * CONFIG.l5r5e.money[1]) + Math.floor(zeni);
} }

View File

@@ -287,11 +287,14 @@ export class TwentyQuestions {
// Clear and add items to actor // Clear and add items to actor
const deleteIds = actor.data.items.map((e) => e.id); const deleteIds = actor.data.items.map((e) => e.id);
await actor.deleteEmbeddedDocuments("Item", deleteIds); if (deleteIds.length > 0) {
await actor.deleteEmbeddedDocuments("Item", deleteIds);
}
// Add items in 20Q to actor // Add items in 20Q to actor
for (const types of Object.values(itemsCache)) { const newItemsData = [];
for (const item of types) { Object.values(itemsCache).forEach((types) => {
types.forEach((item) => {
const itemData = foundry.utils.duplicate(item.data); const itemData = foundry.utils.duplicate(item.data);
if (itemData.data?.bought_at_rank) { if (itemData.data?.bought_at_rank) {
itemData.data.bought_at_rank = 0; itemData.data.bought_at_rank = 0;
@@ -299,8 +302,11 @@ export class TwentyQuestions {
if (itemData.data?.xp_spent) { if (itemData.data?.xp_spent) {
itemData.data.xp_spent = 0; itemData.data.xp_spent = 0;
} }
await actor.createEmbeddedDocuments("Item", [itemData]); newItemsData.push(itemData);
} });
});
if (newItemsData.length > 0) {
await actor.createEmbeddedDocuments("Item", newItemsData);
} }
// Update actor // Update actor

View File

@@ -23,7 +23,7 @@ L5R5E.techniques.set("ninjutsu", { type: "core", displayInTypes: true });
L5R5E.techniques.set("school_ability", { type: "school", displayInTypes: false }); L5R5E.techniques.set("school_ability", { type: "school", displayInTypes: false });
L5R5E.techniques.set("mastery_ability", { type: "school", displayInTypes: false }); L5R5E.techniques.set("mastery_ability", { type: "school", displayInTypes: false });
// Title // Title
// L5R5E.techniques.set("title_ability", { type: "title", displayInTypes: false }); L5R5E.techniques.set("title_ability", { type: "title", displayInTypes: false });
// Custom // Custom
L5R5E.techniques.set("specificity", { type: "custom", displayInTypes: false }); L5R5E.techniques.set("specificity", { type: "custom", displayInTypes: false });

View File

@@ -71,14 +71,14 @@ export class L5rBaseDie extends DiceTerm {
* Evaluate the roll term, populating the results Array * Evaluate the roll term, populating the results Array
* @override * @override
*/ */
evaluate({ minimize = false, maximize = false } = {}) { evaluate({ minimize = false, maximize = false, async = false } = {}) {
if (this._evaluated) { if (this._evaluated) {
throw new Error(`This ${this.constructor.name} has already been evaluated and is immutable`); throw new Error(`This ${this.constructor.name} has already been evaluated and is immutable`);
} }
// Roll the initial number of dice // Roll the initial number of dice
for (let n = 1; n <= this.number; n++) { for (let n = 1; n <= this.number; n++) {
this.roll({ minimize, maximize }); this.roll({ minimize, maximize, async });
} }
// Apply modifiers // Apply modifiers

View File

@@ -294,14 +294,6 @@ export class RollL5r5e extends Roll {
return renderTemplate(chatOptions.template, chatData); return renderTemplate(chatOptions.template, chatData);
} }
/**
* Render the HTML for the ChatMessage which should be added to the log
* @return {Promise<jQuery>}
*/
async getHTML() {
console.log(" --------- getHTML");
}
/** /**
* Transform a Roll instance into a ChatMessage, displaying the roll result. * Transform a Roll instance into a ChatMessage, displaying the roll result.
* This function can either create the ChatMessage directly, or return the data object that will be used to create. * This function can either create the ChatMessage directly, or return the data object that will be used to create.

View File

@@ -7,6 +7,14 @@ export class ItemL5r5e extends Item {
return this.data.data.items || null; return this.data.data.items || null;
} }
/**
* Return the linked Actor instance if any (current or embed)
* @return {Actor|null}
*/
get actor() {
return super.actor || game.actors.get(this.data.data.parent_id?.actor_id) || null;
}
/** /**
* Create a new entity using provided input data * Create a new entity using provided input data
* @override * @override
@@ -27,7 +35,7 @@ export class ItemL5r5e extends Item {
*/ */
async update(data = {}, context = {}) { async update(data = {}, context = {}) {
// Regular // Regular
if (!this.data.data.parentId) { if (!this.data.data.parent_id) {
return super.update(data, context); return super.update(data, context);
} }
@@ -67,7 +75,7 @@ export class ItemL5r5e extends Item {
this.data.data.items = new Map(); this.data.data.items = new Map();
itemsData.forEach((item) => { itemsData.forEach((item) => {
this.addEmbedItem(item, { save: false, newId: false }); this.addEmbedItem(item, { save: false, newId: false, addBonusToActor: false });
}); });
} }
} }
@@ -75,10 +83,16 @@ export class ItemL5r5e extends Item {
// ***** parent ids management ***** // ***** parent ids management *****
/** /**
* Return a string with idemId + actorId if any * Return a string with idemId + actorId if any
* @return {string} itemId|actor * @return {{item_id: (string|null), actor_id?: (string|null)}}
*/ */
getParentsIds() { getParentsIds() {
return this.id + (this.actor?.data?._id ? `|${this.actor.data._id}` : ""); const parent = {
item_id: this.id,
};
if (this.actor?.data?._id) {
parent.actor_id = this.actor.data._id;
}
return parent;
} }
/** /**
@@ -86,17 +100,18 @@ export class ItemL5r5e extends Item {
* @return {ItemL5r5e|null} * @return {ItemL5r5e|null}
*/ */
getItemFromParentId() { getItemFromParentId() {
const parentIds = this.data.data.parent_id;
let parentItem; let parentItem;
let [parentItemId, parentActorId] = this.data.data.parentId.split("|");
if (parentActorId) { if (parentIds?.actor_id) {
// Actor item object // Actor item object
const parentActor = parentActorId ? game.actors.get(parentActorId) : null; const parentActor = parentIds.actor_id ? game.actors.get(parentIds.actor_id) : null;
parentItem = parentActor?.items.get(parentItemId); parentItem = parentActor?.items.get(parentIds.item_id);
} else { } else if (parentIds?.item_id) {
// World Object // World Object
parentItem = game.items.get(parentItemId); parentItem = game.items.get(parentIds.item_id);
} }
return parentItem; return parentItem;
} }
@@ -115,9 +130,10 @@ export class ItemL5r5e extends Item {
* @param {ItemL5r5e} item Object to add * @param {ItemL5r5e} item Object to add
* @param {boolean} save if we save in db or not (used internally) * @param {boolean} save if we save in db or not (used internally)
* @param {boolean} newId if we change the id * @param {boolean} newId if we change the id
* @param {boolean} addBonusToActor if we update the actor bonus for advancements
* @return {Promise<void>} * @return {Promise<void>}
*/ */
async addEmbedItem(item, { save = true, newId = true } = {}) { async addEmbedItem(item, { save = true, newId = true, addBonusToActor = true } = {}) {
if (!item) { if (!item) {
return; return;
} }
@@ -133,14 +149,17 @@ export class ItemL5r5e extends Item {
} }
// Tag parent (flags won't work as we have no id in db) // Tag parent (flags won't work as we have no id in db)
item.data.data.parentId = this.getParentsIds(); item.data.data.parent_id = this.getParentsIds();
// Object // Object
this.data.data.items.set(item.data._id, item); this.data.data.items.set(item.data._id, item);
// TODO add bonus from actor // Add bonus to actor
if (this.actor instanceof Actor) { if (addBonusToActor) {
// const item = this.data.data.items.get(id); const actor = this.actor;
if (item instanceof Item && actor instanceof Actor) {
actor.addBonus(item);
}
} }
if (save) { if (save) {
@@ -155,23 +174,28 @@ export class ItemL5r5e extends Item {
* @return {Promise<void>} * @return {Promise<void>}
*/ */
async updateEmbedItem(item, { save = true } = {}) { async updateEmbedItem(item, { save = true } = {}) {
await this.addEmbedItem(item, { save, newId: false }); await this.addEmbedItem(item, { save, newId: false, addBonusToActor: false });
} }
/** /**
* Delete the Embed Item and clear the actor bonus if any * Delete the Embed Item and clear the actor bonus if any
* @param {ItemL5r5e} item Object to add * @param id Item id
* @param {boolean} save if we save in db or not (used internally) * @param {boolean} save if we save in db or not (used internally)
* @param {boolean} removeBonusFromActor if we update the actor bonus for advancements
* @return {Promise<void>} * @return {Promise<void>}
*/ */
async deleteEmbedItem(id, { save = true } = {}) { async deleteEmbedItem(id, { save = true, removeBonusFromActor = true } = {}) {
if (!this.data.data.items.has(id)) { if (!this.data.data.items.has(id)) {
return; return;
} }
// TODO remove bonus from actor // Remove bonus from actor
if (this.actor instanceof Actor) { if (removeBonusFromActor) {
// const item = this.data.data.items.get(id); const actor = this.actor;
const item = this.data.data.items.get(id);
if (item instanceof Item && actor instanceof Actor) {
actor.removeBonus(item);
}
} }
// Remove the embed item // Remove the embed item

View File

@@ -7,7 +7,7 @@ export class AdvancementSheetL5r5e extends ItemSheetL5r5e {
/** /**
* Sub Types of advancements * Sub Types of advancements
*/ */
static types = ["ring", "skill"]; // "peculiarity" and "technique" have theirs own xp count static types = ["ring", "skill"]; // others have theirs own xp count
/** @override */ /** @override */
static get defaultOptions() { static get defaultOptions() {
@@ -73,47 +73,55 @@ export class AdvancementSheetL5r5e extends ItemSheetL5r5e {
// Modify image to reflect choice // Modify image to reflect choice
if (newChoice.ring) { if (newChoice.ring) {
name = game.i18n.localize(`l5r5e.rings.${newChoice.ring}`) + "+1";
img = `systems/l5r5e/assets/icons/rings/${newChoice.ring}.svg`; img = `systems/l5r5e/assets/icons/rings/${newChoice.ring}.svg`;
} else if (newChoice.skill) { } else if (newChoice.skill) {
name =
game.i18n.localize(`l5r5e.skills.${CONFIG.l5r5e.skills.get(newChoice.skill)}.${newChoice.skill}`) +
"+1";
img = `systems/l5r5e/assets/dices/default/skill_blank.svg`; img = `systems/l5r5e/assets/dices/default/skill_blank.svg`;
} }
// Object embed in actor ? // Object embed in actor ?
if (this.actor) { const actor = this.document.actor;
const actor = duplicate(this.actor.data.data); if (actor) {
const actorData = foundry.utils.duplicate(actor.data.data);
let skillCatId = null; let skillCatId = null;
// Old choices // Old choices
if (oldChoice.ring) { if (oldChoice.ring) {
actor.rings[oldChoice.ring] = Math.max(1, actor.rings[oldChoice.ring] - 1); actorData.rings[oldChoice.ring] = Math.max(1, actorData.rings[oldChoice.ring] - 1);
} }
if (oldChoice.skill) { if (oldChoice.skill) {
skillCatId = CONFIG.l5r5e.skills.get(oldChoice.skill); skillCatId = CONFIG.l5r5e.skills.get(oldChoice.skill);
actor.skills[skillCatId][oldChoice.skill] = Math.max(0, actor.skills[skillCatId][oldChoice.skill] - 1); actorData.skills[skillCatId][oldChoice.skill] = Math.max(
0,
actorData.skills[skillCatId][oldChoice.skill] - 1
);
} }
// new choices // new choices
if (newChoice.ring) { if (newChoice.ring) {
actor.rings[newChoice.ring] = actor.rings[newChoice.ring] + 1; actorData.rings[newChoice.ring] = actorData.rings[newChoice.ring] + 1;
xp_used = actor.rings[newChoice.ring] * CONFIG.l5r5e.xp.ringCostMultiplier; xp_used = actorData.rings[newChoice.ring] * CONFIG.l5r5e.xp.ringCostMultiplier;
name = name =
game.i18n.localize(`l5r5e.rings.${newChoice.ring}`) + game.i18n.localize(`l5r5e.rings.${newChoice.ring}`) +
` +1 (${actor.rings[newChoice.ring] - 1} -> ${actor.rings[newChoice.ring]})`; ` +1 (${actorData.rings[newChoice.ring] - 1} -> ${actorData.rings[newChoice.ring]})`;
} }
if (newChoice.skill) { if (newChoice.skill) {
skillCatId = CONFIG.l5r5e.skills.get(newChoice.skill); skillCatId = CONFIG.l5r5e.skills.get(newChoice.skill);
actor.skills[skillCatId][newChoice.skill] = actor.skills[skillCatId][newChoice.skill] + 1; actorData.skills[skillCatId][newChoice.skill] = actorData.skills[skillCatId][newChoice.skill] + 1;
xp_used = actor.skills[skillCatId][newChoice.skill] * CONFIG.l5r5e.xp.skillCostMultiplier; xp_used = actorData.skills[skillCatId][newChoice.skill] * CONFIG.l5r5e.xp.skillCostMultiplier;
name = name =
game.i18n.localize(`l5r5e.skills.${skillCatId}.${newChoice.skill}`) + game.i18n.localize(`l5r5e.skills.${skillCatId}.${newChoice.skill}`) +
` +1 (${actor.skills[skillCatId][newChoice.skill] - 1} -> ${ ` +1 (${actorData.skills[skillCatId][newChoice.skill] - 1} -> ${
actor.skills[skillCatId][newChoice.skill] actorData.skills[skillCatId][newChoice.skill]
})`; })`;
} }
// Update Actor // Update Actor
await this.actor.update({ await actor.update({
data: diffObject(this.actor.data.data, actor), data: foundry.utils.diffObject(actor.data.data, actorData),
}); });
} }

View File

@@ -21,9 +21,6 @@ export class ItemPatternSheetL5r5e extends ItemSheetL5r5e {
async getData(options = {}) { async getData(options = {}) {
const sheetData = await super.getData(options); const sheetData = await super.getData(options);
sheetData.data.dtypes = ["String", "Number", "Boolean"];
sheetData.data.ringsList = game.l5r5e.HelpersL5r5e.getRingsList();
// Linked Property // Linked Property
sheetData.data.linkedProperty = await this.getLinkedProperty(sheetData); sheetData.data.linkedProperty = await this.getLinkedProperty(sheetData);

View File

@@ -256,6 +256,23 @@ export class ItemSheetL5r5e extends ItemSheet {
event.preventDefault(); event.preventDefault();
event.stopPropagation(); event.stopPropagation();
const itemId = $(event.currentTarget).data("item-id"); const itemId = $(event.currentTarget).data("item-id");
this.document.deleteEmbedItem(itemId); const item = this.document.getEmbedItem(itemId);
if (!item) {
return;
}
const callback = async () => {
this.document.deleteEmbedItem(itemId);
};
// Holing Ctrl = without confirm
if (event.ctrlKey) {
return callback();
}
game.l5r5e.HelpersL5r5e.confirmDeleteDialog(
game.i18n.format("l5r5e.global.delete_confirm", { name: item.name }),
callback
);
} }
} }

View File

@@ -21,14 +21,15 @@ export class TitleSheetL5r5e extends ItemSheetL5r5e {
async getData(options = {}) { async getData(options = {}) {
const sheetData = await super.getData(options); const sheetData = await super.getData(options);
sheetData.data.dtypes = ["String", "Number", "Boolean"];
sheetData.data.ringsList = game.l5r5e.HelpersL5r5e.getRingsList();
console.log(sheetData.data.data.items); // todo tmp
// Prepare OwnedItems // Prepare OwnedItems
sheetData.data.embedItemsList = this._prepareEmbedItems(sheetData.data.data.items); sheetData.data.embedItemsList = this._prepareEmbedItems(sheetData.data.data.items);
console.log(sheetData); // todo tmp // Automatically compute the xp cost
sheetData.data.data.xp_used = sheetData.data.embedItemsList.reduce(
(acc, item) => acc + (+item.data.xp_used || 0),
0
);
return sheetData; return sheetData;
} }
@@ -63,17 +64,19 @@ export class TitleSheetL5r5e extends ItemSheetL5r5e {
// Check item type and subtype // Check item type and subtype
let item = await game.l5r5e.HelpersL5r5e.getDragnDropTargetObject(event); let item = await game.l5r5e.HelpersL5r5e.getDragnDropTargetObject(event);
if (!item || (item.documentName !== "Item" && !["technique", "advancement"].includes(item.data.type))) { if (!item || item.documentName !== "Item" || !["technique", "advancement"].includes(item.data.type)) {
return; return;
} }
const data = item.data.toJSON(); const data = item.data.toObject(false);
console.log("------ data", data); // todo tmp // Check xp for techs
if (item.data.type === "technique") {
data.data.xp_cost = data.data.xp_cost > 0 ? data.data.xp_cost : CONFIG.l5r5e.xp.techniqueCost;
data.data.xp_used = data.data.xp_cost;
}
this.document.addEmbedItem(data); this.document.addEmbedItem(data);
console.log(this.document); // todo tmp
} }
/** /**
@@ -93,16 +96,4 @@ export class TitleSheetL5r5e extends ItemSheetL5r5e {
html.find(`.item-edit`).on("click", this._editSubItem.bind(this)); html.find(`.item-edit`).on("click", this._editSubItem.bind(this));
html.find(`.item-delete`).on("click", this._deleteSubItem.bind(this)); html.find(`.item-delete`).on("click", this._deleteSubItem.bind(this));
} }
/**
* This method is called upon form submission after form data is validated
* @param {Event} event The initial triggering submission event
* @param {object} formData The object of validated form data with which to update the object
* @returns {Promise} A Promise which resolves once the update operation has completed
* @abstract
*/
// async _updateObject(event, formData) {
// console.log("------- _updateObject.", formData); // todo TMP
// return super._updateObject(event, formData);
// }
} }

View File

@@ -3,10 +3,10 @@
*/ */
export class MigrationL5r5e { export class MigrationL5r5e {
/** /**
* Version needed for migration stuff to trigger * Minimum Version needed for migration stuff to trigger
* @type {string} * @type {string}
*/ */
static NEEDED_VERSION = "1.1.0"; static NEEDED_VERSION = "1.3.0";
/** /**
* Return true if the current world need some updates * Return true if the current world need some updates
@@ -14,7 +14,7 @@ export class MigrationL5r5e {
*/ */
static needUpdate() { static needUpdate() {
const currentVersion = game.settings.get("l5r5e", "systemMigrationVersion"); const currentVersion = game.settings.get("l5r5e", "systemMigrationVersion");
return currentVersion && isNewerVersion(MigrationL5r5e.NEEDED_VERSION, currentVersion); return currentVersion && foundry.utils.isNewerVersion(MigrationL5r5e.NEEDED_VERSION, currentVersion);
} }
/** /**
@@ -26,6 +26,7 @@ export class MigrationL5r5e {
return; return;
} }
// Warn the users
ui.notifications.info( ui.notifications.info(
`Applying L5R5e System Migration for version ${game.system.data.version}.` + `Applying L5R5e System Migration for version ${game.system.data.version}.` +
` Please be patient and do not close your game or shut down your server.`, ` Please be patient and do not close your game or shut down your server.`,
@@ -33,56 +34,53 @@ export class MigrationL5r5e {
); );
// Migrate World Actors // Migrate World Actors
for (let a of game.actors.contents) { for (let actor of game.actors.contents) {
try { try {
const updateData = MigrationL5r5e._migrateActorData(a.data); const updateData = MigrationL5r5e._migrateActorData(actor.data);
if (!isObjectEmpty(updateData)) { if (!foundry.utils.isObjectEmpty(updateData)) {
console.log(`Migrating Actor entity ${a.name}`); console.log(`L5R5E | Migrating Actor entity ${actor.name}`);
await a.update(updateData, { enforceTypes: false }); // TODO use Actor.updateDocuments(data, context) for multiple actors await actor.update(updateData);
} }
} catch (err) { } catch (err) {
err.message = `Failed L5R5e system migration for Actor ${a.name}: ${err.message}`; err.message = `L5R5E | Failed L5R5e system migration for Actor ${actor.name}: ${err.message}`;
console.error(err); console.error(err);
} }
} }
// Migrate World Items // Migrate World Items
for (let i of game.items.contents) { for (let item of game.items.contents) {
try { try {
const updateData = MigrationL5r5e._migrateItemData(i.data); const updateData = MigrationL5r5e._migrateItemData(item.data);
if (!isObjectEmpty(updateData)) { if (!foundry.utils.isObjectEmpty(updateData)) {
console.log(`Migrating Item entity ${i.name}`); console.log(`L5R5E | Migrating Item entity ${item.name}`);
await i.update(updateData, { enforceTypes: false }); // TODO use Item.updateDocuments(data, context) for multiple actors await item.update(updateData);
} }
} catch (err) { } catch (err) {
err.message = `Failed L5R5e system migration for Item ${i.name}: ${err.message}`; err.message = `L5R5E | Failed L5R5e system migration for Item ${item.name}: ${err.message}`;
console.error(err); console.error(err);
} }
} }
// Migrate Actor Override Tokens // Migrate Actor Override Tokens
for (let s of game.scenes.contents) { for (let scene of game.scenes.contents) {
try { try {
const updateData = MigrationL5r5e._migrateSceneData(s.data); const updateData = MigrationL5r5e._migrateSceneData(scene.data);
if (!isObjectEmpty(updateData)) { if (!foundry.utils.isObjectEmpty(updateData)) {
console.log(`Migrating Scene entity ${s.name}`); console.log(`L5R5E | Migrating Scene entity ${scene.name}`);
await s.update(updateData, { enforceTypes: false }); // TODO use Scene.updateDocuments(data, context) for multiple actors await scene.update(updateData);
} }
} catch (err) { } catch (err) {
err.message = `Failed L5R5e system migration for Scene ${s.name}: ${err.message}`; err.message = `L5R5E | Failed L5R5e system migration for Scene ${scene.name}: ${err.message}`;
console.error(err); console.error(err);
} }
} }
// Migrate World Compendium Packs // Migrate World Compendium Packs
for (let p of game.packs) { for (let pack of game.packs) {
if (p.metadata.package !== "world") { if (pack.metadata.package !== "world" || !["Actor", "Item", "Scene"].includes(pack.metadata.entity)) {
continue; continue;
} }
if (!["Actor", "Item", "Scene"].includes(p.metadata.entity)) { await MigrationL5r5e._migrateCompendium(pack);
continue;
}
await MigrationL5r5e._migrateCompendium(p);
} }
// Set the migration as complete // Set the migration as complete
@@ -94,7 +92,7 @@ export class MigrationL5r5e {
/** /**
* Apply migration rules to all Entities within a single Compendium pack * Apply migration rules to all Entities within a single Compendium pack
* @param pack * @param {Compendium} pack
* @return {Promise} * @return {Promise}
*/ */
static async _migrateCompendium(pack) { static async _migrateCompendium(pack) {
@@ -103,18 +101,20 @@ export class MigrationL5r5e {
return; return;
} }
// Unlock the pack for editing
const wasLocked = pack.locked; const wasLocked = pack.locked;
await pack.configure({ locked: false }); try {
// Unlock the pack for editing
await pack.configure({ locked: false });
// Begin by requesting server-side data model migration and get the migrated content // Begin by requesting server-side data model migration and get the migrated content
await pack.migrate(); await pack.migrate();
const content = await pack.getContent(); const documents = await pack.getDocuments();
// Iterate over compendium entries - applying fine-tuned migration functions
const updateDatasList = [];
for (let ent of documents) {
let updateData = {};
// Iterate over compendium entries - applying fine-tuned migration functions
for (let ent of content) {
let updateData = {};
try {
switch (entity) { switch (entity) {
case "Actor": case "Actor":
updateData = MigrationL5r5e._migrateActorData(ent.data); updateData = MigrationL5r5e._migrateActorData(ent.data);
@@ -126,24 +126,30 @@ export class MigrationL5r5e {
updateData = MigrationL5r5e._migrateSceneData(ent.data); updateData = MigrationL5r5e._migrateSceneData(ent.data);
break; break;
} }
if (isObjectEmpty(updateData)) { if (foundry.utils.isObjectEmpty(updateData)) {
continue; continue;
} }
// Save the entry, if data was changed // Add the entry, if data was changed
updateData["_id"] = ent._id; updateData["_id"] = ent.data._id;
await pack.updateEntity(updateData); // TODO use Item/Actor.updateDocuments(data, context) for multiple actors updateDatasList.push(updateData);
console.log(`Migrated ${entity} entity ${ent.name} in Compendium ${pack.collection}`);
} catch (err) { console.log(`L5R5E | Migrating ${entity} entity ${ent.name} in Compendium ${pack.collection}`);
// Handle migration failures
err.message = `Failed L5R5e system migration for entity ${ent.name} in pack ${pack.collection}: ${err.message}`;
console.error(err);
} }
// Save the modified entries
if (updateDatasList.length > 0) {
await pack.documentClass.updateDocuments(updateDatasList, { pack: pack.collection });
}
} catch (err) {
// Handle migration failures
err.message = `L5R5E | Failed system migration for entities ${entity} in pack ${pack.collection}: ${err.message}`;
console.error(err);
} }
// Apply the original locked status for the pack // Apply the original locked status for the pack
pack.configure({ locked: wasLocked }); pack.configure({ locked: wasLocked });
console.log(`Migrated all ${entity} contents from Compendium ${pack.collection}`); console.log(`L5R5E | Migrated all ${entity} contents from Compendium ${pack.collection}`);
} }
/** /**
@@ -153,7 +159,7 @@ export class MigrationL5r5e {
* @return {Object} The updateData to apply * @return {Object} The updateData to apply
*/ */
static _migrateSceneData(scene) { static _migrateSceneData(scene) {
const tokens = duplicate(scene.tokens); const tokens = foundry.utils.duplicate(scene.tokens);
return { return {
tokens: tokens.map((t) => { tokens: tokens.map((t) => {
if (!t.actorId || t.actorLink || !t.actorData.data) { if (!t.actorId || t.actorLink || !t.actorData.data) {
@@ -183,8 +189,6 @@ export class MigrationL5r5e {
const updateData = {}; const updateData = {};
const actorData = actor.data; const actorData = actor.data;
console.log(actorData); // TODO TMP data.data ? à vérifier
// ***** Start of 1.1.0 ***** // ***** Start of 1.1.0 *****
// Add "Prepared" in actor // Add "Prepared" in actor
if (actorData.prepared === undefined) { if (actorData.prepared === undefined) {
@@ -211,6 +215,10 @@ export class MigrationL5r5e {
actorData.rings_affinities.strength.value; actorData.rings_affinities.strength.value;
updateData["data.rings_affinities." + actorData.rings_affinities.weakness.ring] = updateData["data.rings_affinities." + actorData.rings_affinities.weakness.ring] =
actorData.rings_affinities.weakness.value; actorData.rings_affinities.weakness.value;
// Delete old keys : not working :'(
updateData["-=data.rings_affinities.strength"] = null;
updateData["-=data.rings_affinities.weakness"] = null;
} }
// ***** End of 1.3.0 ***** // ***** End of 1.3.0 *****
@@ -224,7 +232,7 @@ export class MigrationL5r5e {
*/ */
static cleanActorData(actorData) { static cleanActorData(actorData) {
const model = game.system.model.Actor[actorData.type]; const model = game.system.model.Actor[actorData.type];
actorData.data = filterObject(actorData.data, model); actorData.data = foundry.utils.filterObject(actorData.data, model);
return actorData; return actorData;
} }

View File

@@ -6,8 +6,8 @@
"manifest": "https://gitlab.com/teaml5r/l5r5e/-/raw/master/system/system.json", "manifest": "https://gitlab.com/teaml5r/l5r5e/-/raw/master/system/system.json",
"download": "https://gitlab.com/teaml5r/l5r5e/-/jobs/artifacts/v1.3.0/raw/l5r5e.zip?job=build", "download": "https://gitlab.com/teaml5r/l5r5e/-/jobs/artifacts/v1.3.0/raw/l5r5e.zip?job=build",
"version": "1.3.0", "version": "1.3.0",
"minimumCoreVersion": "0.8.2", "minimumCoreVersion": "0.8.5",
"compatibleCoreVersion": "0.8.2", "compatibleCoreVersion": "0.8.5",
"manifestPlusVersion": "1.0.0", "manifestPlusVersion": "1.0.0",
"socket": true, "socket": true,
"author": "Team L5R", "author": "Team L5R",
@@ -22,12 +22,6 @@
}, },
{ {
"name": "Carter" "name": "Carter"
},
{
"name": "Hrunh"
},
{
"name": "Sasmira"
} }
], ],
"background": "L5R-Header.webp", "background": "L5R-Header.webp",

View File

@@ -1,9 +1,9 @@
<form class="{{cssClass}}" data-lang="{{localize 'I18N.Language'}}" autocomplete="off"> <form class="{{cssClass}}" data-lang="{{localize 'I18N.Language'}}" autocomplete="off">
{{!-- Sheet Header --}} {{!-- Sheet Header --}}
<header class="sheet-header"> <header class="sheet-header">
<img class="profile-img" src="{{actor.img}}" data-edit="img" title="{{actor.name}}"/> <img class="profile-img" src="{{data.img}}" data-edit="img" title="{{data.name}}"/>
<div class="header-fields identity-wrapper"> <div class="header-fields identity-wrapper">
<h1 class="charname"><input name="name" type="text" value="{{actor.name}}" placeholder="Name"/></h1> <h1 class="charname"><input name="name" type="text" value="{{data.name}}" placeholder="Name"/></h1>
{{> 'systems/l5r5e/templates/actors/character/identity.html'}} {{> 'systems/l5r5e/templates/actors/character/identity.html'}}
</div> </div>
<div class="header-fields"> <div class="header-fields">
@@ -28,7 +28,7 @@
{{!-- Skills Tab --}} {{!-- Skills Tab --}}
<article class="tab skills" data-group="primary" data-tab="skills"> <article class="tab skills" data-group="primary" data-tab="skills">
<ul class="skills-wrapper"> <ul class="skills-wrapper">
{{#each actor.data.data.skills as |category id|}} {{#each data.data.skills as |category id|}}
{{> 'systems/l5r5e/templates/actors/character/category.html' category=category categoryId=id}} {{> 'systems/l5r5e/templates/actors/character/category.html' category=category categoryId=id}}
{{/each}} {{/each}}
</ul> </ul>

View File

@@ -1,5 +1,5 @@
<tr class="flexrow row advancement"> <tr class="flexrow row advancement">
<td class="name" name="advancement.name"><img src="{{ advancement.img }}" title="{{advancement.name}}"> {{advancement.name}}{{#if advancement.data.bond_type}} ({{advancement.data.bond_type}}){{/if}}</td> <td class="name" name="advancement.name"><img src="{{advancement.img}}" title="{{advancement.name}}"> {{advancement.name}}{{#if advancement.data.bond_type}} ({{advancement.data.bond_type}}){{/if}}</td>
<td class="xp" name="advancement.xp">{{advancement.data.xp_used}}</td> <td class="xp" name="advancement.xp">{{advancement.data.xp_used}}</td>
<td class="rank" name="advancement.rank">{{advancement.data.rank}}</td> <td class="rank" name="advancement.rank">{{advancement.data.rank}}</td>
{{#if editable}} {{#if editable}}

View File

@@ -1,15 +1,15 @@
<li class="skill-category-wrapper skill-category-content"> <li class="skill-category-wrapper skill-category-content">
<h4 class="section-header">{{ localizeSkill categoryId 'title' }}</h4> <h4 class="section-header">{{localizeSkill categoryId 'title'}}</h4>
<ul class="skill-category-skills-list"> <ul class="skill-category-skills-list">
{{#each category as |skill id| }} {{#each category as |skill id|}}
{{> 'systems/l5r5e/templates/actors/character/skill.html' categoryId=../categoryId skill=skill skillId=id }} {{> 'systems/l5r5e/templates/actors/character/skill.html' categoryId=../categoryId skill=skill skillId=id}}
{{/each}} {{/each}}
</ul> </ul>
<ul class="skill-category-ring-actions"> <ul class="skill-category-ring-actions">
<li name="air" class="air"><i class="i_air"></i> {{ localizeSkill categoryId 'air' }} </li> <li name="air" class="air"><i class="i_air"></i> {{localizeSkill categoryId 'air'}} </li>
<li name="earth" class="earth"><i class="i_earth"></i> {{ localizeSkill categoryId 'earth' }} </li> <li name="earth" class="earth"><i class="i_earth"></i> {{localizeSkill categoryId 'earth'}} </li>
<li name="fire" class="fire"><i class="i_fire"></i> {{ localizeSkill categoryId 'fire' }} </li> <li name="fire" class="fire"><i class="i_fire"></i> {{localizeSkill categoryId 'fire'}} </li>
<li name="water" class="water"><i class="i_water"></i> {{ localizeSkill categoryId 'water' }} </li> <li name="water" class="water"><i class="i_water"></i> {{localizeSkill categoryId 'water'}} </li>
<li name="void" class="void"><i class="i_void"></i> {{ localizeSkill categoryId 'void' }} </li> <li name="void" class="void"><i class="i_void"></i> {{localizeSkill categoryId 'void'}} </li>
</ul> </ul>
</li> </li>

View File

@@ -1,8 +1,8 @@
<fieldset class="initiative initiative-wrapper"> <fieldset class="initiative initiative-wrapper">
<legend class="section-header"> <legend class="section-header">
{{localize 'l5r5e.conflict.initiative.title'}} {{localize 'l5r5e.conflict.initiative.title'}}
<a class="encounter prepared-control" data-id="{{entity.type}}"> <a class="encounter prepared-control" data-id="{{data.type}}">
<i class="fa fas prepared-icon prepared-icon-{{data.data.prepared}} prepared-{{entity.type}}" title="{{localize (localize 'l5r5e.conflict.initiative.prepared_{value}' value=data.data.prepared)}}"></i> <i class="fa fas prepared-icon prepared-icon-{{data.data.prepared}} prepared-{{data.type}}" title="{{localize (localize 'l5r5e.conflict.initiative.prepared_{value}' value=data.data.prepared)}}"></i>
</a> </a>
</legend> </legend>
<button class="initiative dice-picker" data-initiative="true" data-skill="sentiment">{{localize 'l5r5e.conflict.initiative.intrigue'}}</button> <button class="initiative dice-picker" data-initiative="true" data-skill="sentiment">{{localize 'l5r5e.conflict.initiative.intrigue'}}</button>

View File

@@ -70,7 +70,7 @@
<th class="name">{{localize 'l5r5e.name'}}</th> <th class="name">{{localize 'l5r5e.name'}}</th>
<th class="xp">{{localize 'l5r5e.advancements.spent'}}</th> <th class="xp">{{localize 'l5r5e.advancements.spent'}}</th>
<th class="rank">{{localize 'l5r5e.rank'}}</th> <th class="rank">{{localize 'l5r5e.rank'}}</th>
{{#if editable}} {{#if options.editable}}
<th class="actions"></th> <th class="actions"></th>
{{/if}} {{/if}}
</tr> </tr>
@@ -80,5 +80,12 @@
{{> 'systems/l5r5e/templates/actors/character/advancement-others.html' advancement=advancement editable=../options.editable}} {{> 'systems/l5r5e/templates/actors/character/advancement-others.html' advancement=advancement editable=../options.editable}}
{{/each}} {{/each}}
</tbody> </tbody>
<tfoot class="flex">
<tr>
<th>
{{localize 'l5r5e.advancements.total_xp_rank'}} : {{data.advancementsOthersTotalXp}}
</th>
</tr>
</tfoot>
</table> </table>
</fieldset> </fieldset>

View File

@@ -1,8 +1,8 @@
<form class="{{cssClass}} flexcol limited" data-lang="{{localize 'I18N.Language'}}" autocomplete="off"> <form class="{{cssClass}} flexcol limited" data-lang="{{localize 'I18N.Language'}}" autocomplete="off">
<img class="profile-img full" src="{{actor.img}}" data-edit="img" title="{{actor.name}}" /> <img class="profile-img full" src="{{data.img}}" data-edit="img" title="{{data.name}}" />
{{!-- Sheet Header --}} {{!-- Sheet Header --}}
<div class="sheet-header"> <div class="sheet-header">
<h1 class="charname"><input name="name" type="text" value="{{actor.name}}" placeholder="Name"/></h1> <h1 class="charname"><input name="name" type="text" value="{{data.name}}" placeholder="Name"/></h1>
{{!-- Sheet identity --}} {{!-- Sheet identity --}}
<ul class="identity-content"> <ul class="identity-content">
<li> <li>

View File

@@ -2,8 +2,8 @@
{{!-- Sheet Header --}} {{!-- Sheet Header --}}
<header class="sheet-header"> <header class="sheet-header">
<div class="header-fields identity-wrapper"> <div class="header-fields identity-wrapper">
<img class="profile-img" src="{{actor.img}}" data-edit="img" title="{{actor.name}}"/> <img class="profile-img" src="{{data.img}}" data-edit="img" title="{{data.name}}"/>
<h1 class="charname"><input name="name" type="text" value="{{actor.name}}" placeholder="Name"/></h1> <h1 class="charname"><input name="name" type="text" value="{{data.name}}" placeholder="Name"/></h1>
{{> 'systems/l5r5e/templates/actors/npc/identity.html'}} {{> 'systems/l5r5e/templates/actors/npc/identity.html'}}
</div> </div>
<fieldset class="npc-note"> <fieldset class="npc-note">

View File

@@ -1,23 +1,23 @@
<form class="{{cssClass}}" autocomplete="off"> <form class="{{cssClass}}" autocomplete="off">
<header class="sheet-header"> <header class="sheet-header">
<img class="profile-img" src="{{document.img}}" data-edit="img" title="{{document.name}}"/> <img class="profile-img" src="{{data.img}}" data-edit="img" title="{{data.name}}"/>
<h1 class="charname"><input name="name" type="text" value="{{document.name}}" placeholder="Name"/></h1> <h1 class="charname"><input name="name" type="text" value="{{data.name}}" placeholder="Name"/></h1>
</header> </header>
{{!-- 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="attributes" data-group="primary" data-tab="attributes">
<select name="data.advancement_type" id="advancement_type"> <select name="data.advancement_type" id="advancement_type">
{{#select document.data.data.advancement_type}} {{#select data.data.advancement_type}}
{{#each data.subTypesList as |type|}} {{#each data.subTypesList as |type|}}
<option value="{{type}}">{{type}}</option> <option value="{{type}}">{{type}}</option>
{{/each}} {{/each}}
{{/select}} {{/select}}
</select> </select>
{{#ifCond document.data.data.advancement_type '==' 'ring' }} {{#ifCond data.data.advancement_type '==' 'ring' }}
<select name="data.ring" id="advancement_ring"> <select name="data.ring" id="advancement_ring">
{{#select document.data.data.ring}} {{#select data.data.ring}}
{{#each data.ringsList as |obj|}} {{#each data.ringsList as |obj|}}
<option value="{{obj.id}}">{{obj.label}}</option> <option value="{{obj.id}}">{{obj.label}}</option>
{{/each}} {{/each}}
@@ -25,10 +25,10 @@
</select> </select>
{{/ifCond}} {{/ifCond}}
{{#ifCond document.data.data.advancement_type '==' 'skill' }} {{#ifCond data.data.advancement_type '==' 'skill' }}
<select name="data.skill" id="advancement_skill"> <select name="data.skill" id="advancement_skill">
<option value="">{{localize 'l5r5e.twenty_questions.choose_one_skill'}}</option> <option value="">{{localize 'l5r5e.twenty_questions.choose_one_skill'}}</option>
{{#select document.data.data.skill}} {{#select data.data.skill}}
{{#each data.skillsList as |skills catId|}} {{#each data.skillsList as |skills catId|}}
<optgroup label="{{localizeSkill catId 'title'}}"> <optgroup label="{{localizeSkill catId 'title'}}">
{{#each skills as |obj|}} {{#each skills as |obj|}}
@@ -40,7 +40,7 @@
</select> </select>
{{/ifCond}} {{/ifCond}}
<label class="cursus attribute-value checkbox"> <label class="cursus attribute-value checkbox">
<input type="checkbox" name="data.in_curriculum" {{checked document.data.data.in_curriculum}} /> <input type="checkbox" name="data.in_curriculum" {{checked data.data.in_curriculum}} />
{{ localize 'l5r5e.advancements.curriculum' }} {{ localize 'l5r5e.advancements.curriculum' }}
</label> </label>
<label class="attribute"> <label class="attribute">

View File

@@ -1,31 +1,31 @@
<form class="{{cssClass}}" autocomplete="off"> <form class="{{cssClass}}" autocomplete="off">
<header class="sheet-header"> <header class="sheet-header">
<img class="profile-img" src="{{document.img}}" data-edit="img" title="{{document.name}}"/> <img class="profile-img" src="{{data.img}}" data-edit="img" title="{{data.name}}"/>
<h1 class="charname"><input name="name" type="text" value="{{document.name}}" placeholder="Name"/></h1> <h1 class="charname"><input name="name" type="text" value="{{data.name}}" placeholder="Name"/></h1>
</header> </header>
{{!-- Sheet Body --}} {{!-- Sheet Body --}}
<section class="sheet-body"> <section class="sheet-body">
{{!-- attributes --}} {{!-- attributes --}}
<article class="attributes" data-group="primary" data-tab="description"> <article class="attributes" data-group="primary" data-tab="description">
<label class="equipped checkbox"> <label class="equipped checkbox">
<input type="checkbox" name="data.equipped" {{checked document.data.data.equipped}} /> <input type="checkbox" name="data.equipped" {{checked data.data.equipped}} />
{{ localize 'l5r5e.armors.equipped' }} {{ localize 'l5r5e.armors.equipped' }}
</label> </label>
{{> 'systems/l5r5e/templates/items/item/item-value.html' }} {{> 'systems/l5r5e/templates/items/item/item-value.html' }}
<fieldset class="attribute type"> <fieldset class="attribute type">
<legend class="text-header">{{ localize 'l5r5e.armors.type' }}</legend> <legend class="text-header">{{localize 'l5r5e.armors.type'}}</legend>
<label> <label>
{{ localize 'l5r5e.armors.physical' }} {{localize 'l5r5e.armors.physical'}}
<input class="select-on-focus" type="number" name="data.armor.physical" value="{{data.data.armor.physical}}" data-dtype="Number" min="0" placeholder="0"/> <input class="select-on-focus" type="number" name="data.armor.physical" value="{{data.data.armor.physical}}" data-dtype="Number" min="0" placeholder="0"/>
</label> </label>
<label> <label>
{{ localize 'l5r5e.armors.supernatural' }} {{localize 'l5r5e.armors.supernatural'}}
<input class="select-on-focus" type="number" name="data.armor.supernatural" value="{{data.data.armor.supernatural}}" data-dtype="Number" min="0" placeholder="0"/> <input class="select-on-focus" type="number" name="data.armor.supernatural" value="{{data.data.armor.supernatural}}" data-dtype="Number" min="0" placeholder="0"/>
</label> </label>
</fieldset> </fieldset>
</article> </article>
<article class="properties" data-group="primary" data-tab="properties"> <article class="properties" data-group="primary" data-tab="properties">
{{> 'systems/l5r5e/templates/items/property/properties.html' properties=data.propertiesList }} {{> 'systems/l5r5e/templates/items/property/properties.html' properties=data.propertiesList}}
</article> </article>
{{> 'systems/l5r5e/templates/items/item/item-infos.html'}} {{> 'systems/l5r5e/templates/items/item/item-infos.html'}}
</section> </section>

View File

@@ -1,7 +1,7 @@
<form class="{{cssClass}}" autocomplete="off"> <form class="{{cssClass}}" autocomplete="off">
<header class="sheet-header"> <header class="sheet-header">
<img class="profile-img" src="{{document.img}}" data-edit="img" title="{{document.name}}"/> <img class="profile-img" src="{{data.img}}" data-edit="img" title="{{data.name}}"/>
<h1 class="charname"><input name="name" type="text" value="{{document.name}}" placeholder="Name"/></h1> <h1 class="charname"><input name="name" type="text" value="{{data.name}}" placeholder="Name"/></h1>
</header> </header>
{{!-- Sheet Body --}} {{!-- Sheet Body --}}
<section class="sheet-body"> <section class="sheet-body">
@@ -9,23 +9,23 @@
<article class="attributes" data-group="primary" data-tab="attributes"> <article class="attributes" data-group="primary" data-tab="attributes">
<label class="attribute"> <label class="attribute">
{{ localize 'l5r5e.types' }} {{ localize 'l5r5e.types' }}
<input class="select-on-focus" type="text" name="data.bond_type" value="{{document.data.data.bond_type}}" data-dtype="String"/> <input class="select-on-focus" type="text" name="data.bond_type" value="{{data.data.bond_type}}" data-dtype="String"/>
</label> </label>
<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="{{data.data.xp_cost}}" data-dtype="Number" min="0" placeholder="0"/>
</label> </label>
<label class="attribute"> <label class="attribute">
{{ localize 'l5r5e.advancements.spent' }} {{ localize 'l5r5e.advancements.spent' }}
<input class="select-on-focus" type="number" name="data.xp_used" value="{{document.data.data.xp_used}}" data-dtype="Number" min="0" placeholder="0"/> <input class="select-on-focus" type="number" name="data.xp_used" value="{{data.data.xp_used}}" data-dtype="Number" min="0" placeholder="0"/>
</label> </label>
<label class="attribute"> <label class="attribute">
{{ localize 'l5r5e.rank' }} {{ localize 'l5r5e.rank' }}
<input class="select-on-focus" type="number" name="data.rank" value="{{document.data.data.rank}}" data-dtype="Number" min="0" placeholder="0"/> <input class="select-on-focus" type="number" name="data.rank" value="{{data.data.rank}}" data-dtype="Number" min="0" placeholder="0"/>
</label> </label>
<label class="attribute"> <label class="attribute">
{{ localize 'l5r5e.bought_at_rank' }} {{ localize 'l5r5e.bought_at_rank' }}
<input class="select-on-focus" type="number" name="data.bought_at_rank" value="{{document.data.data.bought_at_rank}}" data-dtype="Number" min="0" placeholder="0"/> <input class="select-on-focus" type="number" name="data.bought_at_rank" value="{{data.data.bought_at_rank}}" data-dtype="Number" min="0" placeholder="0"/>
</label> </label>
</article> </article>
{{> 'systems/l5r5e/templates/items/item/item-infos.html'}} {{> 'systems/l5r5e/templates/items/item/item-infos.html'}}

View File

@@ -1,7 +1,7 @@
<form class="{{cssClass}}" autocomplete="off"> <form class="{{cssClass}}" autocomplete="off">
<header class="sheet-header"> <header class="sheet-header">
<img class="profile-img" src="{{document.img}}" data-edit="img" title="{{document.name}}"/> <img class="profile-img" src="{{data.img}}" data-edit="img" title="{{data.name}}"/>
<h1 class="charname"><input name="name" type="text" value="{{document.name}}" placeholder="Name"/></h1> <h1 class="charname"><input name="name" type="text" value="{{data.name}}" placeholder="Name"/></h1>
</header> </header>
{{!-- Sheet Body --}} {{!-- Sheet Body --}}
<section class="sheet-body"> <section class="sheet-body">
@@ -9,23 +9,23 @@
<article class="attributes" data-group="primary" data-tab="attributes"> <article class="attributes" data-group="primary" data-tab="attributes">
<label class="attribute"> <label class="attribute">
{{ localize 'l5r5e.advancements.rarity_modifier' }} {{ localize 'l5r5e.advancements.rarity_modifier' }}
<input class="select-on-focus" type="number" name="data.rarity_modifier" value="{{document.data.data.rarity_modifier}}" data-dtype="Number" min="0" placeholder="0"/> <input class="select-on-focus" type="number" name="data.rarity_modifier" value="{{data.data.rarity_modifier}}" data-dtype="Number" min="0" placeholder="0"/>
</label> </label>
<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="{{data.data.xp_cost}}" data-dtype="Number" min="0" placeholder="0"/>
</label> </label>
<label class="attribute"> <label class="attribute">
{{ localize 'l5r5e.advancements.spent' }} {{ localize 'l5r5e.advancements.spent' }}
<input class="select-on-focus" type="number" name="data.xp_used" value="{{document.data.data.xp_used}}" data-dtype="Number" min="0" placeholder="0"/> <input class="select-on-focus" type="number" name="data.xp_used" value="{{data.data.xp_used}}" data-dtype="Number" min="0" placeholder="0"/>
</label> </label>
<label class="attribute"> <label class="attribute">
{{ localize 'l5r5e.rank' }} {{ localize 'l5r5e.rank' }}
<input class="select-on-focus" type="number" name="data.rank" value="{{document.data.data.rank}}" data-dtype="Number" min="0" placeholder="0"/> <input class="select-on-focus" type="number" name="data.rank" value="{{data.data.rank}}" data-dtype="Number" min="0" placeholder="0"/>
</label> </label>
<label class="attribute"> <label class="attribute">
{{ localize 'l5r5e.bought_at_rank' }} {{ localize 'l5r5e.bought_at_rank' }}
<input class="select-on-focus" type="number" name="data.bought_at_rank" value="{{document.data.data.bought_at_rank}}" data-dtype="Number" min="0" placeholder="0"/> <input class="select-on-focus" type="number" name="data.bought_at_rank" value="{{data.data.bought_at_rank}}" data-dtype="Number" min="0" placeholder="0"/>
</label> </label>
<label class="attribute"> <label class="attribute">
{{ localize 'l5r5e.linked_property' }} {{ localize 'l5r5e.linked_property' }}

View File

@@ -1,14 +1,14 @@
<form class="{{cssClass}}" autocomplete="off"> <form class="{{cssClass}}" autocomplete="off">
<header class="sheet-header"> <header class="sheet-header">
<img class="profile-img" src="{{document.img}}" data-edit="img" title="{{document.name}}"/> <img class="profile-img" src="{{data.img}}" data-edit="img" title="{{data.name}}"/>
<h1 class="charname"><input name="name" type="text" value="{{document.name}}" placeholder="Name"/></h1> <h1 class="charname"><input name="name" type="text" value="{{data.name}}" placeholder="Name"/></h1>
</header> </header>
{{!-- Sheet Body --}} {{!-- Sheet Body --}}
<section class="sheet-body"> <section class="sheet-body">
{{!-- properties Tab --}} {{!-- properties Tab --}}
<article class="attributes" data-group="primary" data-tab="checkbox"> <article class="attributes" data-group="primary" data-tab="checkbox">
<label class="equipped checkbox"> <label class="equipped checkbox">
<input type="checkbox" name="data.equipped" {{checked document.data.data.equipped}} /> <input type="checkbox" name="data.equipped" {{checked data.data.equipped}} />
{{ localize 'l5r5e.armors.equipped' }} {{ localize 'l5r5e.armors.equipped' }}
</label> </label>
{{> 'systems/l5r5e/templates/items/item/item-value.html' }} {{> 'systems/l5r5e/templates/items/item/item-value.html' }}

View File

@@ -1,45 +1,45 @@
<form class="{{cssClass}}" autocomplete="off"> <form class="{{cssClass}}" autocomplete="off">
<header class="sheet-header"> <header class="sheet-header">
<img class="profile-img" src="{{document.img}}" data-edit="img" title="{{document.name}}" /> <img class="profile-img" src="{{data.img}}" data-edit="img" title="{{data.name}}" />
<h1 class="charname"><input name="name" type="text" value="{{document.name}}" placeholder="Name" /></h1> <h1 class="charname"><input name="name" type="text" value="{{data.name}}" placeholder="Name" /></h1>
</header> </header>
{{!-- Sheet Body --}} {{!-- Sheet Body --}}
<section class="sheet-body"> <section class="sheet-body">
{{!-- Attributes Tab --}} {{!-- Attributes Tab --}}
<article class="tab attributes" data-group="primary" data-tab="attributes"> <article class="tab attributes" data-group="primary" data-tab="attributes">
<select name="data.ring"> <select name="data.ring">
{{#select document.data.data.ring}} {{#select data.data.ring}}
{{#each data.ringsList as |obj|}} {{#each data.ringsList as |obj|}}
<option value="{{obj.id}}">{{obj.label}}</option> <option value="{{obj.id}}">{{obj.label}}</option>
{{/each}} {{/each}}
{{/select}} {{/select}}
</select> </select>
<select class="attribute" name="data.peculiarity_type"> <select class="attribute" name="data.peculiarity_type">
{{#select document.data.data.peculiarity_type}} {{#select data.data.peculiarity_type}}
{{#each data.subTypesList as |type|}} {{#each data.subTypesList as |type|}}
<option value="{{type.id}}">{{type.label}}</option> <option value="{{type.id}}">{{type.label}}</option>
{{/each}} {{/each}}
{{/select}} {{/select}}
</select> </select>
<label class="cursus attribute-value checkbox"> <label class="cursus attribute-value checkbox">
<input type="checkbox" name="data.in_curriculum" {{checked document.data.data.in_curriculum}} /> <input type="checkbox" name="data.in_curriculum" {{checked data.data.in_curriculum}} />
{{localize 'l5r5e.advancements.curriculum'}} {{localize 'l5r5e.advancements.curriculum'}}
</label> </label>
<label class="attribute"> <label class="attribute">
{{localize 'l5r5e.advancements.spent'}} {{localize 'l5r5e.advancements.spent'}}
<input class="select-on-focus" type="number" name="data.xp_used" value="{{document.data.data.xp_used}}" data-dtype="Number" min="0" placeholder="0" /> <input class="select-on-focus" type="number" name="data.xp_used" value="{{data.data.xp_used}}" data-dtype="Number" min="0" placeholder="0" />
</label> </label>
<label class="attribute"> <label class="attribute">
{{localize 'l5r5e.rank' }} {{localize 'l5r5e.rank' }}
<input class="select-on-focus" type="number" name="data.rank" value="{{document.data.data.rank}}" data-dtype="Number" min="0" placeholder="0" /> <input class="select-on-focus" type="number" name="data.rank" value="{{data.data.rank}}" data-dtype="Number" min="0" placeholder="0" />
</label> </label>
<label class="attribute"> <label class="attribute">
{{localize 'l5r5e.bought_at_rank'}} {{localize 'l5r5e.bought_at_rank'}}
<input class="select-on-focus" type="number" name="data.bought_at_rank" value="{{document.data.data.bought_at_rank}}" data-dtype="Number" min="0" placeholder="0" /> <input class="select-on-focus" type="number" name="data.bought_at_rank" value="{{data.data.bought_at_rank}}" data-dtype="Number" min="0" placeholder="0" />
</label> </label>
<label class="attribute full"> <label class="attribute full">
{{localize 'l5r5e.types' }} {{localize 'l5r5e.types' }}
<input type="text" name="data.types" value="{{document.data.data.types}}" /> <input type="text" name="data.types" value="{{data.data.types}}" />
</label> </label>
</article> </article>
{{> 'systems/l5r5e/templates/items/item/item-infos.html'}} {{> 'systems/l5r5e/templates/items/item/item-infos.html'}}

View File

@@ -1,7 +1,7 @@
<form class="{{cssClass}}" autocomplete="off"> <form class="{{cssClass}}" autocomplete="off">
<header class="sheet-header"> <header class="sheet-header">
<img class="profile-img" src="{{document.img}}" data-edit="img" title="{{document.name}}"/> <img class="profile-img" src="{{data.img}}" data-edit="img" title="{{data.name}}"/>
<h1 class="charname"><input name="name" type="text" value="{{document.name}}" placeholder="Name"/></h1> <h1 class="charname"><input name="name" type="text" value="{{data.name}}" placeholder="Name"/></h1>
</header> </header>
{{!-- Sheet Body --}} {{!-- Sheet Body --}}
<section class="sheet-body"> <section class="sheet-body">

View File

@@ -1,7 +1,7 @@
<form class="{{cssClass}}" autocomplete="off"> <form class="{{cssClass}}" autocomplete="off">
<header class="sheet-header"> <header class="sheet-header">
<img class="profile-img" src="{{document.img}}" data-edit="img" title="{{document.name}}"/> <img class="profile-img" src="{{data.img}}" data-edit="img" title="{{data.name}}"/>
<h1 class="charname"><input name="name" type="text" value="{{document.name}}" placeholder="Name"/></h1> <h1 class="charname"><input name="name" type="text" value="{{data.name}}" placeholder="Name"/></h1>
</header> </header>
{{!-- Sheet Body --}} {{!-- Sheet Body --}}
<section class="sheet-body"> <section class="sheet-body">
@@ -9,19 +9,19 @@
<article class="attributes" data-group="primary" data-tab="attributes"> <article class="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="{{data.data.xp_cost}}" data-dtype="Number" min="0" placeholder="0"/>
</label> </label>
<label class="attribute"> <label class="attribute">
{{ localize 'l5r5e.advancements.spent' }} {{ localize 'l5r5e.advancements.spent' }}
<input class="select-on-focus" type="number" name="data.xp_used" value="{{document.data.data.xp_used}}" data-dtype="Number" min="0" placeholder="0"/> <input class="select-on-focus" type="number" name="data.xp_used" value="{{data.data.xp_used}}" data-dtype="Number" min="0" placeholder="0"/>
</label> </label>
<label class="attribute"> <label class="attribute">
{{ localize 'l5r5e.rank' }} {{ localize 'l5r5e.rank' }}
<input class="select-on-focus" type="number" name="data.rank" value="{{document.data.data.rank}}" data-dtype="Number" min="0" placeholder="0"/> <input class="select-on-focus" type="number" name="data.rank" value="{{data.data.rank}}" data-dtype="Number" min="0" placeholder="0"/>
</label> </label>
<label class="attribute"> <label class="attribute">
{{ localize 'l5r5e.bought_at_rank' }} {{ localize 'l5r5e.bought_at_rank' }}
<input class="select-on-focus" type="number" name="data.bought_at_rank" value="{{document.data.data.bought_at_rank}}" data-dtype="Number" min="0" placeholder="0"/> <input class="select-on-focus" type="number" name="data.bought_at_rank" value="{{data.data.bought_at_rank}}" data-dtype="Number" min="0" placeholder="0"/>
</label> </label>
</article> </article>
{{> 'systems/l5r5e/templates/items/item/item-infos.html'}} {{> 'systems/l5r5e/templates/items/item/item-infos.html'}}

View File

@@ -3,8 +3,10 @@
<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>
{{#if editable}} {{#if editable}}
<li data-item-id="{{technique._id}}" class="item-control item-edit" title="{{localize 'l5r5e.global.edit'}}"><i class="fas fa-edit"></i></li> <li data-item-id="{{technique._id}}" {{#if technique.data.parent_id.item_id}}data-item-parent-id="{{technique.data.parent_id.item_id}}"{{/if}} class="item-control item-edit" title="{{localize 'l5r5e.global.edit'}}"><i class="fas fa-edit"></i></li>
{{^if technique.data.parent_id.item_id}}
<li data-item-id="{{technique._id}}" class="item-control item-delete" title="{{localize 'Delete'}}"><i class="fas fa-trash"></i></li> <li data-item-id="{{technique._id}}" class="item-control item-delete" title="{{localize 'Delete'}}"><i class="fas fa-trash"></i></li>
{{/if}}
{{/if}} {{/if}}
</ul> </ul>
{{#if technique.data.description}} {{#if technique.data.description}}

View File

@@ -1,45 +1,45 @@
<form class="{{cssClass}}" autocomplete="off"> <form class="{{cssClass}}" autocomplete="off">
<header class="sheet-header"> <header class="sheet-header">
<img class="profile-img" src="{{document.img}}" data-edit="img" title="{{document.name}}"/> <img class="profile-img" src="{{data.img}}" data-edit="img" title="{{data.name}}"/>
<h1 class="charname"><input name="name" type="text" value="{{document.name}}" placeholder="Name"/></h1> <h1 class="charname"><input name="name" type="text" value="{{data.name}}" placeholder="Name"/></h1>
</header> </header>
{{!-- 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="attributes" data-group="primary" data-tab="attributes">
<select name="data.ring"> <select name="data.ring">
{{#select document.data.data.ring}} {{#select data.data.ring}}
{{#each data.ringsList as |obj|}} {{#each data.ringsList as |obj|}}
<option value="{{obj.id}}">{{obj.label}}</option> <option value="{{obj.id}}">{{obj.label}}</option>
{{/each}} {{/each}}
{{/select}} {{/select}}
</select> </select>
<select name="data.technique_type"> <select name="data.technique_type">
{{#select document.data.data.technique_type}} {{#select data.data.technique_type}}
{{#each data.techniquesList as |obj|}} {{#each data.techniquesList as |obj|}}
<option value="{{obj.id}}">{{obj.label}}</option> <option value="{{obj.id}}">{{obj.label}}</option>
{{/each}} {{/each}}
{{/select}} {{/select}}
</select> </select>
<label class="cursus attribute-value checkbox"> <label class="cursus attribute-value checkbox">
<input type="checkbox" name="data.in_curriculum" {{checked document.data.data.in_curriculum}} /> <input type="checkbox" name="data.in_curriculum" {{checked data.data.in_curriculum}} />
{{ localize 'l5r5e.advancements.curriculum' }} {{ localize 'l5r5e.advancements.curriculum' }}
</label> </label>
<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="{{data.data.xp_cost}}" data-dtype="Number" min="0" placeholder="0"/>
</label> </label>
<label class="attribute"> <label class="attribute">
{{ localize 'l5r5e.advancements.spent' }} {{ localize 'l5r5e.advancements.spent' }}
<input class="select-on-focus" type="number" name="data.xp_used" value="{{document.data.data.xp_used}}" data-dtype="Number" min="0" placeholder="0"/> <input class="select-on-focus" type="number" name="data.xp_used" value="{{data.data.xp_used}}" data-dtype="Number" min="0" placeholder="0"/>
</label> </label>
<label class="attribute"> <label class="attribute">
{{ localize 'l5r5e.rank' }} {{ localize 'l5r5e.rank' }}
<input class="select-on-focus" type="number" name="data.rank" value="{{document.data.data.rank}}" data-dtype="Number" min="0" placeholder="0"/> <input class="select-on-focus" type="number" name="data.rank" value="{{data.data.rank}}" data-dtype="Number" min="0" placeholder="0"/>
</label> </label>
<label class="attribute"> <label class="attribute">
{{ localize 'l5r5e.bought_at_rank' }} {{ localize 'l5r5e.bought_at_rank' }}
<input class="select-on-focus" type="number" name="data.bought_at_rank" value="{{document.data.data.bought_at_rank}}" data-dtype="Number" min="0" placeholder="0"/> <input class="select-on-focus" type="number" name="data.bought_at_rank" value="{{data.data.bought_at_rank}}" data-dtype="Number" min="0" placeholder="0"/>
</label> </label>
</article> </article>
{{> 'systems/l5r5e/templates/items/item/item-infos.html'}} {{> 'systems/l5r5e/templates/items/item/item-infos.html'}}

View File

@@ -1,7 +1,7 @@
<form class="{{cssClass}}" autocomplete="off"> <form class="{{cssClass}}" autocomplete="off">
<header class="sheet-header"> <header class="sheet-header">
<img class="profile-img" src="{{document.img}}" data-edit="img" title="{{document.name}}"/> <img class="profile-img" src="{{data.img}}" data-edit="img" title="{{data.name}}"/>
<h1 class="charname"><input name="name" type="text" value="{{document.name}}" placeholder="Name"/></h1> <h1 class="charname"><input name="name" type="text" value="{{data.name}}" placeholder="Name"/></h1>
</header> </header>
{{!-- Sheet Navigation --}} {{!-- Sheet Navigation --}}
<nav class="sheet-tabs tabs" data-group="primary"> <nav class="sheet-tabs tabs" data-group="primary">
@@ -13,20 +13,20 @@
{{!-- Attributes Tab --}} {{!-- Attributes Tab --}}
<article class="tab 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="{{data.data.xp_cost}}" data-dtype="Number" min="0" placeholder="0"/>
</label> </label>
<label class="attribute"> <label class="attribute">
{{ localize 'l5r5e.advancements.spent' }} {{localize 'l5r5e.advancements.spent'}}
<input class="select-on-focus" type="number" name="data.xp_used" value="{{document.data.data.xp_used}}" data-dtype="Number" min="0" placeholder="0"/> <input class="select-on-focus" type="number" name="data.xp_used" value="{{data.data.xp_used}}" data-dtype="Number" min="0" placeholder="0" readonly/>
</label> </label>
<label class="attribute"> <label class="attribute">
{{ localize 'l5r5e.rank' }} {{localize 'l5r5e.rank'}}
<input class="select-on-focus" type="number" name="data.rank" value="{{document.data.data.rank}}" data-dtype="Number" min="0" placeholder="0"/> <input class="select-on-focus" type="number" name="data.rank" value="{{data.data.rank}}" data-dtype="Number" min="0" placeholder="0"/>
</label> </label>
<label class="attribute"> <label class="attribute">
{{ localize 'l5r5e.bought_at_rank' }} {{localize 'l5r5e.bought_at_rank'}}
<input class="select-on-focus" type="number" name="data.bought_at_rank" value="{{document.data.data.bought_at_rank}}" data-dtype="Number" min="0" placeholder="0"/> <input class="select-on-focus" type="number" name="data.bought_at_rank" value="{{data.data.bought_at_rank}}" data-dtype="Number" min="0" placeholder="0"/>
</label> </label>
</article> </article>