Added translation for npc subtype

This commit is contained in:
Vlyan
2020-12-25 11:06:28 +01:00
parent 6820ea7684
commit 139b6eb54d
7 changed files with 44 additions and 26 deletions

View File

@@ -255,6 +255,12 @@
"rank": "Rank Total Xp: ", "rank": "Rank Total Xp: ",
"curriculum": "in curriculum" "curriculum": "in curriculum"
}, },
"npc": {
"types": {
"adversary": "Adversary",
"minion": "Minion"
}
},
"twenty_questions": { "twenty_questions": {
"title": "Twenty questions", "title": "Twenty questions",
"bt_abrev": "20Q", "bt_abrev": "20Q",

View File

@@ -255,6 +255,12 @@
"rank": "Rank Total Xp: ", "rank": "Rank Total Xp: ",
"curriculum": "in curriculum" "curriculum": "in curriculum"
}, },
"npc": {
"types": {
"adversary": "Adversary",
"minion": "Minion"
}
},
"twenty_questions": { "twenty_questions": {
"title": "Twenty questions", "title": "Twenty questions",
"bt_abrev": "20Q", "bt_abrev": "20Q",

View File

@@ -255,6 +255,12 @@
"rank": "Xp Total du rang : ", "rank": "Xp Total du rang : ",
"curriculum": "Inclus dans le cursus" "curriculum": "Inclus dans le cursus"
}, },
"npc": {
"types": {
"adversary": "Antagoniste",
"minion": "Sous-fifre"
}
},
"twenty_questions": { "twenty_questions": {
"title": "Vingt questions", "title": "Vingt questions",
"bt_abrev": "20Q", "bt_abrev": "20Q",

View File

@@ -4,7 +4,10 @@ import { BaseSheetL5r5e } from "./base-sheet.js";
* NPC Sheet * NPC Sheet
*/ */
export class NpcSheetL5r5e extends BaseSheetL5r5e { export class NpcSheetL5r5e extends BaseSheetL5r5e {
static types = ["minion", "adversary"]; /**
* Sub Types
*/
static types = ["adversary", "minion"];
static get defaultOptions() { static get defaultOptions() {
return mergeObject(super.defaultOptions, { return mergeObject(super.defaultOptions, {
@@ -20,7 +23,10 @@ export class NpcSheetL5r5e extends BaseSheetL5r5e {
getData() { getData() {
const sheetData = super.getData(); const sheetData = super.getData();
sheetData.data.types = NpcSheetL5r5e.types; sheetData.data.types = NpcSheetL5r5e.types.map((e) => ({
id: e,
label: game.i18n.localize("l5r5e.npc.types." + e),
}));
return sheetData; return sheetData;
} }

View File

@@ -308,7 +308,7 @@ export class TwentyQuestions {
const exceed = {}; const exceed = {};
TwentyQuestions[listName].forEach((formName) => { TwentyQuestions[listName].forEach((formName) => {
const id = getProperty(this.data, formName); const id = getProperty(this.data, formName);
if (id === "none") { if (!id || id === "none") {
return; return;
} }
if (!store[id]) { if (!store[id]) {

View File

@@ -8,13 +8,11 @@ export class HelpersL5r5e {
* Get Rings/Element for List / Select * Get Rings/Element for List / Select
*/ */
static getRingsList(actor = null) { static getRingsList(actor = null) {
return CONFIG.l5r5e.stances.map((e) => { return CONFIG.l5r5e.stances.map((e) => ({
return { id: e,
id: e, label: game.i18n.localize(`l5r5e.rings.${e}`),
label: game.i18n.localize(`l5r5e.rings.${e}`), value: actor?.data?.data?.rings?.[e] || 0,
value: actor?.data?.data?.rings?.[e] || 0, }));
};
});
} }
/** /**
@@ -22,13 +20,11 @@ export class HelpersL5r5e {
*/ */
static getSkillsList(useGroup = false) { static getSkillsList(useGroup = false) {
if (!useGroup) { if (!useGroup) {
return Array.from(L5R5E.skills).map(([id, cat]) => { return Array.from(L5R5E.skills).map(([id, cat]) => ({
return { id: id,
id: id, cat: cat,
cat: cat, label: game.i18n.localize(`l5r5e.skills.${cat}.${id}`),
label: game.i18n.localize(`l5r5e.skills.${cat}.${id}`), }));
};
});
} }
const skills = {}; const skills = {};
@@ -49,12 +45,10 @@ export class HelpersL5r5e {
* Get Techniques for List / Select * Get Techniques for List / Select
*/ */
static getTechniquesList() { static getTechniquesList() {
return CONFIG.l5r5e.techniques.map((e) => { return CONFIG.l5r5e.techniques.map((e) => ({
return { id: e,
id: e, label: game.i18n.localize(`l5r5e.techniques.${e}`),
label: game.i18n.localize(`l5r5e.techniques.${e}`), }));
};
});
} }
/** /**

View File

@@ -3,9 +3,9 @@
<li> <li>
<select class="attribute-dtype" name="data.type"> <select class="attribute-dtype" name="data.type">
{{#select data.type}} {{#select data.type}}
{{#each data.types as |t|}} {{#each data.types as |t|}}
<option value="{{t}}">{{t}}</option> <option value="{{t.id}}">{{t.label}}</option>
{{/each}} {{/each}}
{{/select}} {{/select}}
</select> </select>
</li> </li>