Better management for School Techniques
Gray color for hidden TN result in chat Removed unused "techniques.list" props in template
This commit is contained in:
@@ -59,11 +59,23 @@ export class BaseSheetL5r5e extends ActorSheet {
|
|||||||
|
|
||||||
// Remove unused techs
|
// Remove unused techs
|
||||||
Object.keys(out).forEach((tech) => {
|
Object.keys(out).forEach((tech) => {
|
||||||
if (out[tech].length < 1 && !sheetData.data.techniques[tech]) {
|
if (
|
||||||
|
out[tech].length < 1 &&
|
||||||
|
!sheetData.data.techniques[tech] &&
|
||||||
|
!CONFIG.l5r5e.techniques_school.includes(tech)
|
||||||
|
) {
|
||||||
delete out[tech];
|
delete out[tech];
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// Manage school add button
|
||||||
|
sheetData.data.techniques["school_ability"] = out["school_ability"].length === 0;
|
||||||
|
sheetData.data.techniques["mastery_ability"] = out["mastery_ability"].length === 0;
|
||||||
|
|
||||||
|
// Always display "school_ability", but display "mastery_ability" only if rank >= 5
|
||||||
|
if (sheetData.data.identity.school_rank < 5 && out["mastery_ability"].length === 0) {
|
||||||
|
delete out["mastery_ability"];
|
||||||
|
}
|
||||||
return out;
|
return out;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -302,7 +314,7 @@ export class BaseSheetL5r5e extends ActorSheet {
|
|||||||
// If technique, select the current type
|
// If technique, select the current type
|
||||||
if (item.data.type === "technique") {
|
if (item.data.type === "technique") {
|
||||||
const techType = $(event.currentTarget).data("tech-type");
|
const techType = $(event.currentTarget).data("tech-type");
|
||||||
if (CONFIG.l5r5e.techniques.includes(techType)) {
|
if ([...CONFIG.l5r5e.techniques, ...CONFIG.l5r5e.techniques_school].includes(techType)) {
|
||||||
item.data.data.technique_type = techType;
|
item.data.data.technique_type = techType;
|
||||||
item.data.img = `${CONFIG.l5r5e.paths.assets}/icons/techs/${techType}.svg`;
|
item.data.img = `${CONFIG.l5r5e.paths.assets}/icons/techs/${techType}.svg`;
|
||||||
}
|
}
|
||||||
|
|||||||
File diff suppressed because one or more lines are too long
@@ -55,9 +55,9 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
&.unknown {
|
&.unknown {
|
||||||
background: rgba(255, 191, 0, 0.1);
|
background: rgba(121, 121, 121, 0.1);
|
||||||
border-color: rgba(133, 123, 51, 0.75);
|
border-color: rgba(124, 124, 124, 0.75);
|
||||||
color: rgba(155, 138, 55, 0.75);
|
color: rgba(91, 91, 91, 0.75);
|
||||||
}
|
}
|
||||||
&.fail {
|
&.fail {
|
||||||
background: rgba(255, 0, 0, 0.1);
|
background: rgba(255, 0, 0, 0.1);
|
||||||
|
|||||||
@@ -102,8 +102,7 @@
|
|||||||
"ritual": false,
|
"ritual": false,
|
||||||
"shuji": false,
|
"shuji": false,
|
||||||
"maho": false,
|
"maho": false,
|
||||||
"ninjutsu": false,
|
"ninjutsu": false
|
||||||
"list": []
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|||||||
Reference in New Issue
Block a user