check on tech type on drop

This commit is contained in:
Vlyan
2020-12-24 18:40:47 +01:00
parent 542786aaa4
commit 53a717bdf6
4 changed files with 19 additions and 5 deletions

View File

@@ -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õ",

View File

@@ -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õ",

View File

@@ -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õ",

View File

@@ -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: '<i class="fas fa-check"></i>',
},
},
}).render(true);
return Promise.resolve();
}
// Ok add item