Dice dialog v1 and Minus all key in template and long files

This commit is contained in:
Vlyan
2020-12-10 13:51:18 +01:00
parent 1d3ec4c274
commit ca69a8f182
25 changed files with 538 additions and 507 deletions

View File

@@ -194,6 +194,11 @@ export class RollL5r5e extends Roll {
this.roll();
}
const skillName =
game.i18n.translations.l5r5e.skills?.[RollL5r5e.getCategoryForSkillId(this.l5r5e.skillId)]?.[
this.l5r5e.skillId
] || "";
// Define chat data
const chatData = {
formula: isPrivate ? "???" : this._formula,
@@ -207,7 +212,7 @@ export class RollL5r5e extends Roll {
? {}
: {
stance: this.l5r5e.stance,
skillId: this.l5r5e.skillId,
skillName: skillName,
dicesTypes: this.l5r5e.dicesTypes,
summary: this.l5r5e.summary,
dices: this.dice.map((d) => {
@@ -266,6 +271,17 @@ export class RollL5r5e extends Roll {
return create ? CONFIG.ChatMessage.entityClass.create(messageData, messageOptions) : messageData;
}
/**
* Return the categoryId for the skillId
* TODO in proper category helper ?
* @param skillId
*/
static getCategoryForSkillId(skillId) {
return Object.keys(game.i18n.translations.l5r5e.skills).find((e) => {
return !!game.i18n.translations.l5r5e.skills?.[e]?.[skillId];
});
}
/** @override */
static fromData(data) {
const roll = super.fromData(data);