Fix specificity always displayed in skill tab.

This commit is contained in:
Vlyan
2021-05-29 19:02:05 +02:00
parent 447c738796
commit 5c1f2fdbd9
4 changed files with 13 additions and 10 deletions

View File

@@ -177,7 +177,7 @@
"school_ability": "School Ability",
"mastery_ability": "Mastery Ability",
"title_ability": "Title Ability",
"specificity": "Specificities"
"specificity": "Specificity"
},
"peculiarities": {
"types": {

View File

@@ -177,7 +177,7 @@
"school_ability": "Capacidad de escuela",
"mastery_ability": "Habilidad de maestría",
"title_ability": "Title Ability",
"specificity": "Specificities"
"specificity": "Specificity"
},
"peculiarities": {
"types": {

View File

@@ -177,7 +177,7 @@
"school_ability": "Capacité d'école",
"mastery_ability": "Capacité de maîtrise",
"title_ability": "Capacité de Titre",
"specificity": "Particularités"
"specificity": "Particularité"
},
"peculiarities": {
"types": {

View File

@@ -49,9 +49,11 @@ export class BaseSheetL5r5e extends ActorSheet {
.map(([id, cfg]) => id);
// Build the list order
Array.from(CONFIG.l5r5e.techniques).forEach(([id, cfg]) => {
out[id] = [];
});
Array.from(CONFIG.l5r5e.techniques)
.filter(([id, cfg]) => cfg.type !== "custom" || game.settings.get("l5r5e", "techniques-customs"))
.forEach(([id, cfg]) => {
out[id] = [];
});
// Add tech the character knows
sheetData.items.forEach((item) => {
@@ -380,12 +382,12 @@ export class BaseSheetL5r5e extends ActorSheet {
img: `${CONFIG.l5r5e.paths.assets}icons/items/${type}.svg`,
},
]);
if (created?.length > 0) {
if (created?.length < 1) {
return;
}
const item = this.actor.items.get(created[0].id);
// assign current school rank to the new adv/tech
// Assign current school rank to the new adv/tech
if (this.actor.data.data.identity?.school_rank) {
item.data.data.bought_at_rank = this.actor.data.data.identity.school_rank;
if (["advancement", "technique"].includes(item.data.type)) {
@@ -401,10 +403,11 @@ export class BaseSheetL5r5e extends ActorSheet {
break;
case "technique": {
// If technique, select the current type
// If technique, select the current sub-type
if (CONFIG.l5r5e.techniques.get(techniqueType)) {
item.data.data.technique_type = techniqueType;
item.data.name = game.i18n.localize(`l5r5e.techniques.${techniqueType}`);
item.data.img = `${CONFIG.l5r5e.paths.assets}icons/techs/${techniqueType}.svg`;
item.data.data.technique_type = techniqueType;
}
break;
}