diff --git a/system/lang/en-en.json b/system/lang/en-en.json index 8a7313a..ebeddae 100644 --- a/system/lang/en-en.json +++ b/system/lang/en-en.json @@ -20,6 +20,7 @@ "spe.chat.pref": "If specified, this string will be prefixed to all chat messages that are not already commands (such as /emote.)", "l5r5e": { "global": { + "ok": "OK", "add": "Add", "edit": "Edit", "delete": "Delete", @@ -120,6 +121,7 @@ "techniques": { "title": "Techniques", "title_new": "New Technique", + "not_allowed": "Your character does not use this type of technique.", "type": "Type accessible", "kata": "Kata", "kiho": "Kihõ", diff --git a/system/lang/es-es.json b/system/lang/es-es.json index f967dc5..037ddda 100644 --- a/system/lang/es-es.json +++ b/system/lang/es-es.json @@ -20,6 +20,7 @@ "spe.chat.pref": "Si está configurado, la cadena será prefijada para todos los mensajes de chat que no sean ya comandos (como /emote.)", "l5r5e": { "global": { + "ok": "OK", "add": "Add", "edit": "Edit", "delete": "Delete", @@ -120,6 +121,7 @@ "techniques": { "title": "Techniques", "type": "Tipo accesible", + "not_allowed": "Your character does not use this type of technique.", "title_new": "Nuevo Rasgo", "kata": "Kata", "kiho": "Kihõ", diff --git a/system/lang/fr-fr.json b/system/lang/fr-fr.json index 2083587..948ee1a 100644 --- a/system/lang/fr-fr.json +++ b/system/lang/fr-fr.json @@ -20,6 +20,7 @@ "spe.chat.pref": "Si renseignée, la chaîne sera préfixée pour tous les messages de chat qui ne sont pas déjà des commandes (comme /emote.)", "l5r5e": { "global": { + "ok": "OK", "add": "Ajouter", "edit": "Modifier", "delete": "Supprimer", @@ -120,6 +121,7 @@ "techniques": { "title": "Techniques", "title_new": "Nouvelle Technique", + "not_allowed": "Votre personnage n'utilise pas ce type de technique.", "type": "Type accessible", "kata": "Kata", "kiho": "Kihõ", diff --git a/system/scripts/actors/base-sheet.js b/system/scripts/actors/base-sheet.js index 0cf353b..608a598 100644 --- a/system/scripts/actors/base-sheet.js +++ b/system/scripts/actors/base-sheet.js @@ -49,11 +49,19 @@ export class BaseSheetL5r5e extends ActorSheet { return Promise.resolve(); } - // Check if technique is allowed - if (item.data.type === "technique") { - // TODO Verifier que la technique est possible pour ce persos ? technique_type / techniques.kata - //console.log(item.data.data.technique_type, this.actor.data.data.techniques); - //return Promise.resolve(); + // Check if technique is allowed for this character + if (item.data.type === "technique" && !this.actor.data.data.techniques[item.data.data.technique_type]) { + new Dialog({ + title: "Nope !", + content: game.i18n.localize("l5r5e.techniques.not_allowed"), + buttons: { + ok: { + label: game.i18n.localize("l5r5e.global.ok"), + icon: '', + }, + }, + }).render(true); + return Promise.resolve(); } // Ok add item