20Q added a summary

Some language refactoring
Allow toggle even without editing perm
Fix DnD on school rank with npc as they don't have it
This commit is contained in:
Vlyan
2021-01-03 12:22:53 +01:00
parent b1298c50c4
commit 791a98eb3c
10 changed files with 308 additions and 221 deletions

View File

@@ -300,82 +300,86 @@
"title": "Twenty questions", "title": "Twenty questions",
"bt_abrev": "20Q", "bt_abrev": "20Q",
"bt_refresh": "Refresh", "bt_refresh": "Refresh",
"intro": "You can use this sheet to fill in your answers to The Game of Twenty Questions, and to take notes for later!", "increase_ring1": "Ring increase (1)",
"section": "Legend of the Five Rings Core Rulebook, Chapter 2 : Creating a character, p. 41-95", "increase_ring2": "Ring increase (2)",
"incring1": "Ring increase (1)", "increase_skill1": "Skill increases (1)",
"incring2": "Ring increase (2)", "increase_skill2": "Skill increases (2)",
"incskill1": "Skill increases (1)", "increase_skill3": "Skill increases (3-5)",
"incskill2": "Skill increases (2)", "choose_one_ring": "Pick one",
"incskill3": "Skill increases (3-5)", "choose_one_skill": "Pick one",
"choosem": "Pick one",
"choosef": "Pick one",
"money": "Starting wealth in Koku :",
"glory": "Glory :",
"school": "School :",
"status": "Status",
"role": "Roles",
"access": "Technique types available",
"startech": "Starting techniques (2-5)",
"schoolab": "School ability",
"outfit": "Starting outfit",
"honor": "Honor",
"choogiri": "Select giri:",
"chooninjo": "Select ninjō:",
"or": "OR", "or": "OR",
"incglory": "Glory increase", "part0": {
"inchonor": "Honor increase", "intro": "You can use this sheet to fill in your answers to The Game of Twenty Questions, and to take notes for later!",
"distinction": "Distinction (1)", "section": "Legend of the Five Rings Core Rulebook, Chapter 2 : Creating a character, p. 41-95"
"adversity": "Adversity (1)", },
"passion": "Passion (1)",
"anxiety": "Anxiety (1)",
"disadvant": "Disadvantage (1)",
"advant": "Advantage (1)",
"accoutr": "Personal accoutrement",
"object": "Item (Rarity 7 or lower)",
"d10r1": "D10 Result (1/2)",
"d10r2": "D10 Result (2/2)",
"generchar": "Generate the character",
"generchar_disclaimer": "Warning, this will erase character's current datas !",
"part1": { "part1": {
"title": "Part I: Core Identity (Clan and Family)", "title": "Part I: Core Identity (Clan and Family)",
"q1": "1. What clan does your character belong to ? (p. 41)", "q1": "1. What clan does your character belong to ? (p. 41)",
"q2": "2. What family does your character belong to ? (p. 49)" "status": "Status",
"q2": "2. What family does your character belong to ? (p. 49)",
"money": "Starting wealth in Koku :",
"glory": "Glory :"
}, },
"part2": { "part2": {
"title": "Part II: Role and School", "title": "Part II: Role and School",
"q3": "3. What is your characters school, and what roles does that school fall into ? (p. 56)", "q3": "3. What is your characters school, and what roles does that school fall into ? (p. 56)",
"school": "School :",
"role": "Roles",
"honor": "Honor",
"access": "Technique types available",
"school_ability": "School ability",
"starting_techniques": "Starting techniques (2-5)",
"outfit": "Starting outfit",
"q4": "4. How does your character stand out within their school ? (p. 88)" "q4": "4. How does your character stand out within their school ? (p. 88)"
}, },
"part3": { "part3": {
"title": "Part III: Honor and Glory", "title": "Part III: Honor and Glory",
"q5": "5. Who is your lord and what is your characters duty to them ? (p. 88)", "q5": "5. Who is your lord and what is your characters duty to them ? (p. 88)",
"choose_giri": "Select giri:",
"q6": "6. What does your character long for, and how might this impede their duty ? (p. 90)", "q6": "6. What does your character long for, and how might this impede their duty ? (p. 90)",
"choose_ninjo": "Select ninjō:",
"q7": "7. What is your characters relationship with their clan ? (p. 91)", "q7": "7. What is your characters relationship with their clan ? (p. 91)",
"q8": "8. What does your character think of Bushidō ? (p. 91)" "increase_glory": "Glory increase",
"q8": "8. What does your character think of Bushidō ? (p. 91)",
"increase_honor": "Honor increase"
}, },
"part4": { "part4": {
"title": "Part IV: Strengths and Weaknesses", "title": "Part IV: Strengths and Weaknesses",
"q9": "9. What is your characters greatest accomplishment so far ? (p. 92)", "q9": "9. What is your characters greatest accomplishment so far ? (p. 92)",
"distinction": "Distinction (1)",
"q10": "10. What holds your character back the most in life ? (p. 92)", "q10": "10. What holds your character back the most in life ? (p. 92)",
"adversity": "Adversity (1)",
"q11": "11. What activity Most makes your character feel at peace ? (p. 93)", "q11": "11. What activity Most makes your character feel at peace ? (p. 93)",
"passion": "Passion (1)",
"q12": "12. What concern, fear, or foible troubles your character the most ? (p. 93)", "q12": "12. What concern, fear, or foible troubles your character the most ? (p. 93)",
"q13": "13. Who has your character learned the most from during their life (p. 93)" "anxiety": "Anxiety (1)",
"q13": "13. Who has your character learned the most from during their life (p. 93)",
"disadvantage": "Disadvantage (1)",
"advantage": "Advantage (1)"
}, },
"part5": { "part5": {
"title": "Part V: Personality and Behavior", "title": "Part V: Personality and Behavior",
"q14": "14. What do people notice first upon encountering your character? (p. 93)", "q14": "14. What do people notice first upon encountering your character? (p. 93)",
"accoutrement": "Personal accoutrement",
"q15": "15. How does your character react to stressful situations ? (p. 94)", "q15": "15. How does your character react to stressful situations ? (p. 94)",
"q16": "16. What are your characters preexisting relationships with other clans, families, organizations, and traditions ? (p. 94)" "q16": "16. What are your characters preexisting relationships with other clans, families, organizations, and traditions ? (p. 94)",
"object": "Item (Rarity 7 or lower)"
}, },
"part6": { "part6": {
"title": "Part VI: Ancestry and Family", "title": "Part VI: Ancestry and Family",
"q17": "17. How would your characters parents describe them ? (p. 95)", "q17": "17. How would your characters parents describe them ? (p. 95)",
"q18": "18. Who was your character named to honor ? (p. 95)", "q18": "18. Who was your character named to honor ? (p. 95)",
"d10r1": "D10 Result (1/2)",
"d10r2": "D10 Result (2/2)",
"q19": "19. What is your characters personal name ? (p. 95)" "q19": "19. What is your characters personal name ? (p. 95)"
}, },
"part7": { "part7": {
"title": "Part VII: Death", "title": "Part VII: Death",
"q20": "20. How should your character die ? (p. 95)" "q20": "20. How should your character die ? (p. 95)",
"summary": "Summary",
"generchar": "Generate the character",
"generchar_disclaimer": "Warning, this will erase character's current datas !",
"generchar_errors": "Clear errors before continuing !"
} }
} }
} }

View File

@@ -300,82 +300,86 @@
"title": "Twenty questions", "title": "Twenty questions",
"bt_abrev": "20Q", "bt_abrev": "20Q",
"bt_refresh": "Refresh", "bt_refresh": "Refresh",
"intro": "You can use this sheet to fill in your answers to The Game of Twenty Questions, and to take notes for later!", "increase_ring1": "Ring increase (1)",
"section": "Legend of the Five Rings Core Rulebook, Chapter 2 : Creating a character, p. 41-95", "increase_ring2": "Ring increase (2)",
"incring1": "Ring increase (1)", "increase_skill1": "Skill increases (1)",
"incring2": "Ring increase (2)", "increase_skill2": "Skill increases (2)",
"incskill1": "Skill increases (1)", "increase_skill3": "Skill increases (3-5)",
"incskill2": "Skill increases (2)", "choose_one_ring": "Pick one",
"incskill3": "Skill increases (3-5)", "choose_one_skill": "Pick one",
"choosem": "Pick one",
"choosef": "Pick one",
"money": "Starting wealth in Koku :",
"glory": "Glory :",
"school": "School :",
"status": "Status",
"role": "Roles",
"access": "Technique types available",
"startech": "Starting techniques (2-5)",
"schoolab": "School ability",
"outfit": "Starting outfit",
"honor": "Honor",
"choogiri": "Select giri:",
"chooninjo": "Select ninjō:",
"or": "OR", "or": "OR",
"incglory": "Glory increase", "part0": {
"inchonor": "Honor increase", "intro": "You can use this sheet to fill in your answers to The Game of Twenty Questions, and to take notes for later!",
"distinction": "Distinction (1)", "section": "Legend of the Five Rings Core Rulebook, Chapter 2 : Creating a character, p. 41-95"
"adversity": "Adversity (1)", },
"passion": "Passion (1)",
"anxiety": "Anxiety (1)",
"disadvant": "Disadvantage (1)",
"advant": "Advantage (1)",
"accoutr": "Personal accoutrement",
"object": "Item (Rarity 7 or lower)",
"d10r1": "D10 Result (1/2)",
"d10r2": "D10 Result (2/2)",
"generchar": "Generate the character",
"generchar_disclaimer": "Warning, this will erase character's current datas !",
"part1": { "part1": {
"title": "Part I: Core Identity (Clan and Family)", "title": "Part I: Core Identity (Clan and Family)",
"q1": "1. What clan does your character belong to ? (p. 41)", "q1": "1. What clan does your character belong to ? (p. 41)",
"q2": "2. What family does your character belong to ? (p. 49)" "status": "Status",
"q2": "2. What family does your character belong to ? (p. 49)",
"money": "Starting wealth in Koku :",
"glory": "Glory :"
}, },
"part2": { "part2": {
"title": "Part II: Role and School", "title": "Part II: Role and School",
"q3": "3. What is your characters school, and what roles does that school fall into ? (p. 56)", "q3": "3. What is your characters school, and what roles does that school fall into ? (p. 56)",
"school": "School :",
"role": "Roles",
"honor": "Honor",
"access": "Technique types available",
"school_ability": "School ability",
"starting_techniques": "Starting techniques (2-5)",
"outfit": "Starting outfit",
"q4": "4. How does your character stand out within their school ? (p. 88)" "q4": "4. How does your character stand out within their school ? (p. 88)"
}, },
"part3": { "part3": {
"title": "Part III: Honor and Glory", "title": "Part III: Honor and Glory",
"q5": "5. Who is your lord and what is your characters duty to them ? (p. 88)", "q5": "5. Who is your lord and what is your characters duty to them ? (p. 88)",
"choose_giri": "Select giri:",
"q6": "6. What does your character long for, and how might this impede their duty ? (p. 90)", "q6": "6. What does your character long for, and how might this impede their duty ? (p. 90)",
"choose_ninjo": "Select ninjō:",
"q7": "7. What is your characters relationship with their clan ? (p. 91)", "q7": "7. What is your characters relationship with their clan ? (p. 91)",
"q8": "8. What does your character think of Bushidō ? (p. 91)" "increase_glory": "Glory increase",
"q8": "8. What does your character think of Bushidō ? (p. 91)",
"increase_honor": "Honor increase"
}, },
"part4": { "part4": {
"title": "Part IV: Strengths and Weaknesses", "title": "Part IV: Strengths and Weaknesses",
"q9": "9. What is your characters greatest accomplishment so far ? (p. 92)", "q9": "9. What is your characters greatest accomplishment so far ? (p. 92)",
"distinction": "Distinction (1)",
"q10": "10. What holds your character back the most in life ? (p. 92)", "q10": "10. What holds your character back the most in life ? (p. 92)",
"adversity": "Adversity (1)",
"q11": "11. What activity Most makes your character feel at peace ? (p. 93)", "q11": "11. What activity Most makes your character feel at peace ? (p. 93)",
"passion": "Passion (1)",
"q12": "12. What concern, fear, or foible troubles your character the most ? (p. 93)", "q12": "12. What concern, fear, or foible troubles your character the most ? (p. 93)",
"q13": "13. Who has your character learned the most from during their life (p. 93)" "anxiety": "Anxiety (1)",
"q13": "13. Who has your character learned the most from during their life (p. 93)",
"disadvantage": "Disadvantage (1)",
"advantage": "Advantage (1)"
}, },
"part5": { "part5": {
"title": "Part V: Personality and Behavior", "title": "Part V: Personality and Behavior",
"q14": "14. What do people notice first upon encountering your character? (p. 93)", "q14": "14. What do people notice first upon encountering your character? (p. 93)",
"accoutrement": "Personal accoutrement",
"q15": "15. How does your character react to stressful situations ? (p. 94)", "q15": "15. How does your character react to stressful situations ? (p. 94)",
"q16": "16. What are your characters preexisting relationships with other clans, families, organizations, and traditions ? (p. 94)" "q16": "16. What are your characters preexisting relationships with other clans, families, organizations, and traditions ? (p. 94)",
"object": "Item (Rarity 7 or lower)"
}, },
"part6": { "part6": {
"title": "Part VI: Ancestry and Family", "title": "Part VI: Ancestry and Family",
"q17": "17. How would your characters parents describe them ? (p. 95)", "q17": "17. How would your characters parents describe them ? (p. 95)",
"q18": "18. Who was your character named to honor ? (p. 95)", "q18": "18. Who was your character named to honor ? (p. 95)",
"d10r1": "D10 Result (1/2)",
"d10r2": "D10 Result (2/2)",
"q19": "19. What is your characters personal name ? (p. 95)" "q19": "19. What is your characters personal name ? (p. 95)"
}, },
"part7": { "part7": {
"title": "Part VII: Death", "title": "Part VII: Death",
"q20": "20. How should your character die ? (p. 95)" "q20": "20. How should your character die ? (p. 95)",
"summary": "Summary",
"generchar": "Generate the character",
"generchar_disclaimer": "Warning, this will erase character's current datas !",
"generchar_errors": "Correct the errors before continuing !"
} }
} }
} }

View File

@@ -300,82 +300,86 @@
"title": "Le jeu des Vingt questions", "title": "Le jeu des Vingt questions",
"bt_abrev": "20Q", "bt_abrev": "20Q",
"bt_refresh": "Actualiser", "bt_refresh": "Actualiser",
"intro": "Renseignez vos réponses au jeu des vingt questions sur ce formulaire et notez-y des éléments à utiliser ultérieurement !", "increase_ring1": "Augmentation d'anneau (1)",
"section": "Livre de Règles de La Légende des Cinq Anneaux, Chapitre 2 : Création de personnage, p. 41-95", "increase_ring2": "Augmentations d'anneau (2)",
"incring1": "Augmentation d'anneau (1)", "increase_skill1": "Augmentation de compétence (1)",
"incring2": "Augmentations d'anneau (2)", "increase_skill2": "Augmentations de compétences (2)",
"incskill1": "Augmentation de compétence (1)", "increase_skill3": "Augmentations de compétences (3-5)",
"incskill2": "Augmentations de compétences (2)", "choose_one_ring": "En choisir un",
"incskill3": "Augmentations de compétences (3-5)", "choose_one_skill": "En choisir une",
"choosem": "En choisir un",
"choosef": "En choisir une",
"money": "Fortune de départ en Koku :",
"glory": "Gloire :",
"school": "École :",
"status": "Statut",
"role": "Rôles",
"access": "Types de techniques accessibles",
"startech": "Techniques de départ (2-5)",
"schoolab": "Capacité d'école",
"outfit": "Équipement de départ",
"honor": "Honneur",
"choogiri": "Choisissez un giri:",
"chooninjo": "Choisissez un ninjō:",
"or": "OU", "or": "OU",
"incglory": "Augmentation de la gloire (+5)", "part0": {
"inchonor": "Augmentation de l'honneur (+10)", "intro": "Renseignez vos réponses au jeu des vingt questions sur ce formulaire et notez-y des éléments à utiliser ultérieurement !",
"distinction": "Aptitude (1)", "section": "Livre de Règles de La Légende des Cinq Anneaux, Chapitre 2 : Création de personnage, p. 41-95"
"adversity": "Coup du sort (1)", },
"passion": "Passion (1)",
"anxiety": "Défaillance (1)",
"disadvant": "Désavantage (1)",
"advant": "Avantage (1)",
"accoutr": "Vêtement ou objet distinctif",
"object": "Objet (Rareté inférieur ou égale à 7)",
"d10r1": "Résultat du 1er D10",
"d10r2": "Résultat du 2eme D10",
"generchar": "Générer le personnage",
"generchar_disclaimer": "Attention cela écrasera les données de votre personnage actuel !",
"part1": { "part1": {
"title": "Partie I: Identité (clan et famille)", "title": "Partie I: Identité (clan et famille)",
"q1": "1. A quel clan appartient votre personnage ? (p. 41)", "q1": "1. A quel clan appartient votre personnage ? (p. 41)",
"q2": "2. A quelle famille appartient votre personnage ? (p. 49)" "status": "Statut",
"q2": "2. A quelle famille appartient votre personnage ? (p. 49)",
"money": "Fortune de départ en Koku :",
"glory": "Gloire :"
}, },
"part2": { "part2": {
"title": "Partie II: Rôle et École", "title": "Partie II: Rôle et École",
"q3": "3. Quelle est l'École votre personnage, et quel rôle remplit-elle ? (p. 56)", "q3": "3. Quelle est l'École votre personnage, et quel rôle remplit-elle ? (p. 56)",
"school": "École :",
"role": "Rôles",
"honor": "Honneur",
"access": "Types de techniques accessibles",
"school_ability": "Capacité d'école",
"starting_techniques": "Techniques de départ (2-5)",
"outfit": "Équipement de départ",
"q4": "4. De quelle manière votre personnage se démarque-t-il au sein de son école ? (p. 88)" "q4": "4. De quelle manière votre personnage se démarque-t-il au sein de son école ? (p. 88)"
}, },
"part3": { "part3": {
"title": "Partie III: Honneur et Gloire", "title": "Partie III: Honneur et Gloire",
"q5": "5. Qui est le seigneur de votre personnage et quel est le devoir de votre personnage envers lui ? (p. 88)", "q5": "5. Qui est le seigneur de votre personnage et quel est le devoir de votre personnage envers lui ? (p. 88)",
"choose_giri": "Choisissez un giri:",
"q6": "6. Que désire votre personnage, et en quoi ce désir risque-t-il de lempêcher daccomplir son devoir ? (p. 90)", "q6": "6. Que désire votre personnage, et en quoi ce désir risque-t-il de lempêcher daccomplir son devoir ? (p. 90)",
"choose_ninjo": "Choisissez un ninjō:",
"q7": "7. Quelle relation votre personnage entretient-il avec son clan ? (p. 91)", "q7": "7. Quelle relation votre personnage entretient-il avec son clan ? (p. 91)",
"q8": "8. Que pense votre personnage du bushido ? (p. 91)" "increase_glory": "Augmentation de la gloire (+5)",
"q8": "8. Que pense votre personnage du bushido ? (p. 91)",
"increase_honor": "Augmentation de l'honneur (+10)"
}, },
"part4": { "part4": {
"title": "Partie IV: Forces et Faiblesses", "title": "Partie IV: Forces et Faiblesses",
"q9": "9. Quelle est à ce jour la plus belle réussite de votre personnage ? (p. 92)", "q9": "9. Quelle est à ce jour la plus belle réussite de votre personnage ? (p. 92)",
"distinction": "Aptitude (1)",
"q10": "10. Quel est le frein principal dans la vie de votre personnage ? (p. 92)", "q10": "10. Quel est le frein principal dans la vie de votre personnage ? (p. 92)",
"adversity": "Coup du sort (1)",
"q11": "11. Quelle activité apaise le plus votre personnage ? (p. 93)", "q11": "11. Quelle activité apaise le plus votre personnage ? (p. 93)",
"passion": "Passion (1)",
"q12": "12. Quelle inquiétude, crainte ou manie tracasse le plus votre personnage ? (p. 93)", "q12": "12. Quelle inquiétude, crainte ou manie tracasse le plus votre personnage ? (p. 93)",
"q13": "13. De qui votre personnage a-t-il le plus appris au cours de sa vie ? (p. 93)" "anxiety": "Défaillance (1)",
"q13": "13. De qui votre personnage a-t-il le plus appris au cours de sa vie ? (p. 93)",
"disadvantage": "Désavantage (1)",
"advantage": "Avantage (1)"
}, },
"part5": { "part5": {
"title": "Partie V: Personnalité et Comportement", "title": "Partie V: Personnalité et Comportement",
"q14": "14. Que remarque-t-on en premier chez votre personnage ? (p. 93)", "q14": "14. Que remarque-t-on en premier chez votre personnage ? (p. 93)",
"accoutrement": "Vêtement ou objet distinctif",
"q15": "15. Comment votre personnage réagit-il aux situations stressantes ? (p. 94)", "q15": "15. Comment votre personnage réagit-il aux situations stressantes ? (p. 94)",
"q16": "16. Quelles relations votre personnage entretient-il avec des familles, des organisations, des traditions et des clans différents ? (p. 94)" "q16": "16. Quelles relations votre personnage entretient-il avec des familles, des organisations, des traditions et des clans différents ? (p. 94)",
"object": "Objet (Rareté inférieur ou égale à 7)"
}, },
"part6": { "part6": {
"title": "Partie VI: Lignée et Famille", "title": "Partie VI: Lignée et Famille",
"q17": "17. Comment les parents de votre personnage le décriraient-ils ? (p. 95)", "q17": "17. Comment les parents de votre personnage le décriraient-ils ? (p. 95)",
"q18": "18. En lhonneur de qui votre personnage a-t-il été prénommé ? (p. 95)", "q18": "18. En lhonneur de qui votre personnage a-t-il été prénommé ? (p. 95)",
"d10r1": "Résultat du 1er D10",
"d10r2": "Résultat du 2eme D10",
"q19": "19. Quel est le prénom de votre personnage ? (p. 95)" "q19": "19. Quel est le prénom de votre personnage ? (p. 95)"
}, },
"part7": { "part7": {
"title": "Partie VII: Mort", "title": "Partie VII: Mort",
"q20": "20. Comment envisagez-vous la mort de votre personnage ? (p. 95)" "q20": "20. Comment envisagez-vous la mort de votre personnage ? (p. 95)",
"summary": "Résumé",
"generchar": "Générer le personnage",
"generchar_disclaimer": "Attention cela écrasera les données de votre personnage actuel !",
"generchar_errors": "Corriger les erreurs pour poursuivre !"
} }
} }
} }

View File

@@ -109,7 +109,9 @@ export class BaseSheetL5r5e extends ActorSheet {
case "advancement": // no break case "advancement": // no break
case "peculiarity": case "peculiarity":
// Modify the bought at rank to the current actor rank // Modify the bought at rank to the current actor rank
if (this.actor.data.data.identity?.school_rank) {
item.data.data.bought_at_rank = this.actor.data.data.identity.school_rank; item.data.data.bought_at_rank = this.actor.data.data.identity.school_rank;
}
break; break;
case "technique": case "technique":
@@ -161,7 +163,9 @@ export class BaseSheetL5r5e extends ActorSheet {
} }
// Modify the bought at rank to the current actor rank // Modify the bought at rank to the current actor rank
if (this.actor.data.data.identity?.school_rank) {
item.data.data.bought_at_rank = this.actor.data.data.identity.school_rank; item.data.data.bought_at_rank = this.actor.data.data.identity.school_rank;
}
break; break;
} }
@@ -180,6 +184,13 @@ export class BaseSheetL5r5e extends ActorSheet {
activateListeners(html) { activateListeners(html) {
super.activateListeners(html); super.activateListeners(html);
// Toggle
html.find(".toggle-on-click").on("click", (event) => {
const elmt = $(event.currentTarget).data("toggle");
const tgt = html.find("." + elmt);
tgt.hasClass("toggle-active") ? tgt.removeClass("toggle-active") : tgt.addClass("toggle-active");
});
// *** Everything below here is only needed if the sheet is editable *** // *** Everything below here is only needed if the sheet is editable ***
if (!this.options.editable) { if (!this.options.editable) {
return; return;
@@ -201,13 +212,6 @@ export class BaseSheetL5r5e extends ActorSheet {
event.target.select(); event.target.select();
}); });
// Toggle
html.find(".toggle-on-click").on("click", (event) => {
const elmt = $(event.currentTarget).data("toggle");
const tgt = html.find("." + elmt);
tgt.hasClass("toggle-active") ? tgt.removeClass("toggle-active") : tgt.addClass("toggle-active");
});
// *** Items : add, edit, delete *** // *** Items : add, edit, delete ***
html.find(".item-add").on("click", (event) => { html.find(".item-add").on("click", (event) => {
this._addSubItem(event); this._addSubItem(event);

View File

@@ -13,9 +13,15 @@ export class TwentyQuestionsDialog extends FormApplication {
actor = null; actor = null;
/** /**
* Errors * Summary & Errors
*/ */
errors = []; summary = {
errors: [],
summary: {
rings: [],
skills: [],
},
};
/** /**
* Cache for items (techniques, adv...) * Cache for items (techniques, adv...)
@@ -68,7 +74,7 @@ export class TwentyQuestionsDialog extends FormApplication {
super({}, options); super({}, options);
this.actor = actor; this.actor = actor;
this.object = new TwentyQuestions(actor); this.object = new TwentyQuestions(actor);
this.errors = this.object.validateForm(); this.summary = this.object.validateForm();
} }
/** /**
@@ -124,8 +130,10 @@ export class TwentyQuestionsDialog extends FormApplication {
techniquesList: CONFIG.l5r5e.techniques, techniquesList: CONFIG.l5r5e.techniques,
data: this.object.data, data: this.object.data,
cache: this.cache, cache: this.cache,
errors: this.errors.join(", "), summary: {
hasErrors: this.errors.length > 0, ...this.summary,
errors: this.summary.errors.join(", "),
},
}; };
} }
@@ -136,6 +144,13 @@ export class TwentyQuestionsDialog extends FormApplication {
activateListeners(html) { activateListeners(html) {
super.activateListeners(html); super.activateListeners(html);
// Toggle
html.find(".toggle-on-click").on("click", (event) => {
const elmt = $(event.currentTarget).data("toggle");
const tgt = html.find("." + elmt);
tgt.hasClass("toggle-active") ? tgt.removeClass("toggle-active") : tgt.addClass("toggle-active");
});
// *** Everything below here is only needed if the sheet is editable *** // *** Everything below here is only needed if the sheet is editable ***
if (!this.options.editable) { if (!this.options.editable) {
return; return;
@@ -288,8 +303,8 @@ export class TwentyQuestionsDialog extends FormApplication {
// Update 20Q object data // Update 20Q object data
this.object.updateFromForm(formData); this.object.updateFromForm(formData);
// Get errors if any // Get errors if any, and redo summary table
this.errors = this.object.validateForm(); this.summary = this.object.validateForm();
// Store this form datas in actor // Store this form datas in actor
this.actor.data.data.twenty_questions = this.object.data; this.actor.data.data.twenty_questions = this.object.data;

View File

@@ -287,33 +287,56 @@ export class TwentyQuestions {
} }
/** /**
* Return a array of errors, empty array if no errors founds * Return summary and errors if any
*/ */
validateForm() { validateForm() {
const errors = []; const out = {
errors: [],
summary: {
rings: [],
skills: [],
},
};
// Rings & Skills, 3pt max for each // Rings & Skills, 3pt max for each
const rings = this._checkRingsOrSkills("ringList", 2); // ring start at 1 const rings = this._summariesRingsOrSkills("ringList");
for (const key in rings) { for (const key in rings) {
errors.push(`${game.i18n.localize("l5r5e.rings." + key)} (${rings[key]})`); // ring start at 1
rings[key] = rings[key] + 1;
const label = `${game.i18n.localize("l5r5e.rings." + key)} (${rings[key]})`;
if (rings[key] > 3) {
out.errors.push(label);
}
out.summary.rings.push(label);
} }
const skills = this._checkRingsOrSkills("skillList", 3); // skill start at 0 const skills = this._summariesRingsOrSkills("skillList");
for (const key in skills) { for (const key in skills) {
errors.push( // skill start at 0
`${game.i18n.localize("l5r5e.skills." + CONFIG.l5r5e.skills.get(key) + "." + key)} (${skills[key]})` const label = `${game.i18n.localize("l5r5e.skills." + CONFIG.l5r5e.skills.get(key) + "." + key)} (${
); skills[key]
})`;
if (rings[key] > 3) {
out.errors.push(label);
}
out.summary.skills.push(label);
} }
return errors; out.summary.rings.sort((a, b) => {
return a.localeCompare(b);
});
out.summary.skills.sort((a, b) => {
return a.localeCompare(b);
});
return out;
} }
/** /**
* Return a list of exceeded ring/skill * Return a list of ring/skill
*/ */
_checkRingsOrSkills(listName, max) { _summariesRingsOrSkills(listName) {
const store = {}; const store = {};
const exceed = {};
TwentyQuestions[listName].forEach((formName) => { TwentyQuestions[listName].forEach((formName) => {
const id = getProperty(this.data, formName); const id = getProperty(this.data, formName);
if (!id || id === "none") { if (!id || id === "none") {
@@ -323,10 +346,7 @@ export class TwentyQuestions {
store[id] = 0; store[id] = 0;
} }
store[id] = store[id] + 1; store[id] = store[id] + 1;
if (store[id] > max) {
exceed[id] = store[id];
}
}); });
return exceed; return store;
} }
} }

View File

@@ -83,6 +83,13 @@ export class ItemSheetL5r5e extends ItemSheet {
activateListeners(html) { activateListeners(html) {
super.activateListeners(html); super.activateListeners(html);
// Toggle
html.find(".toggle-on-click").on("click", (event) => {
const elmt = $(event.currentTarget).data("toggle");
const tgt = html.find("." + elmt);
tgt.hasClass("toggle-active") ? tgt.removeClass("toggle-active") : tgt.addClass("toggle-active");
});
// Everything below here is only needed if the sheet is editable // Everything below here is only needed if the sheet is editable
if (!this.options.editable) { if (!this.options.editable) {
return; return;
@@ -93,13 +100,6 @@ export class ItemSheetL5r5e extends ItemSheet {
event.target.select(); event.target.select();
}); });
// Toggle
html.find(".toggle-on-click").on("click", (event) => {
const elmt = $(event.currentTarget).data("toggle");
const tgt = html.find("." + elmt);
tgt.hasClass("toggle-active") ? tgt.removeClass("toggle-active") : tgt.addClass("toggle-active");
});
// Delete a property // Delete a property
html.find(`.property-delete`).on("click", (event) => { html.find(`.property-delete`).on("click", (event) => {
const li = $(event.currentTarget).parents(".property"); const li = $(event.currentTarget).parents(".property");

View File

@@ -1,6 +1,6 @@
<form class="l5r5e twenty-questions-dialog" autocomplete="off"> <form class="l5r5e twenty-questions-dialog" autocomplete="off">
{{#if errors}} {{#if summary.errors}}
<div id="errors" class="errors">{{errors}}</div> <div id="errors" class="errors">{{summary.errors}}</div>
{{/if}} {{/if}}
<div class="content"> <div class="content">
@@ -18,9 +18,9 @@
<article class="tab parts part0" data-group="primary" data-tab="part0"> <article class="tab parts part0" data-group="primary" data-tab="part0">
<h1>{{localize 'l5r5e.twenty_questions.title'}}</h1> <h1>{{localize 'l5r5e.twenty_questions.title'}}</h1>
<div> <div>
{{localize 'l5r5e.twenty_questions.intro'}} {{localize 'l5r5e.twenty_questions.part0.intro'}}
<br> <br>
<br><i> {{localize 'l5r5e.twenty_questions.section'}}</i> <br><i> {{localize 'l5r5e.twenty_questions.part0.section'}}</i>
</div> </div>
</article> </article>
<article class="tab parts part1" data-group="primary" data-tab="part1"> <article class="tab parts part1" data-group="primary" data-tab="part1">
@@ -35,11 +35,11 @@
<tr> <tr>
<td class="third"> <td class="third">
<label> <label>
{{localize 'l5r5e.twenty_questions.incring1'}} {{localize 'l5r5e.twenty_questions.increase_ring1'}}
<br> <br>
<select name="step1.ring" class="ring-select"> <select name="step1.ring" class="ring-select">
{{#select data.step1.ring}} {{#select data.step1.ring}}
<option value="none">{{localize 'l5r5e.twenty_questions.choosem'}}</option> <option value="none">{{localize 'l5r5e.twenty_questions.choose_one_ring'}}</option>
{{#each ringsList as |obj|}} {{#each ringsList as |obj|}}
<option value="{{obj.id}}">{{obj.label}}</option> <option value="{{obj.id}}">{{obj.label}}</option>
{{/each}} {{/each}}
@@ -49,11 +49,11 @@
</td> </td>
<td class="third"> <td class="third">
<label> <label>
{{localize 'l5r5e.twenty_questions.incskill1'}} {{localize 'l5r5e.twenty_questions.increase_skill1'}}
<br> <br>
<select name="step1.skill" class="skill-select"> <select name="step1.skill" class="skill-select">
{{#select data.step1.skill}} {{#select data.step1.skill}}
<option value="none">{{localize 'l5r5e.twenty_questions.choosef'}}</option> <option value="none">{{localize 'l5r5e.twenty_questions.choose_one_skill'}}</option>
{{#each skillsList as |skills catId|}} {{#each skillsList as |skills catId|}}
<optgroup label="{{localizeSkill catId 'title'}}"> <optgroup label="{{localizeSkill catId 'title'}}">
{{#each skills as |obj|}} {{#each skills as |obj|}}
@@ -67,7 +67,7 @@
</td> </td>
<td class="third"> <td class="third">
<label> <label>
{{localize 'l5r5e.twenty_questions.status'}} {{localize 'l5r5e.twenty_questions.part1.status'}}
<br> <br>
<input type="number" name="step1.social_status" min="0" max="100" value="{{data.step1.social_status}}" <input type="number" name="step1.social_status" min="0" max="100" value="{{data.step1.social_status}}"
data-dtype="Number" placeholder="0"> data-dtype="Number" placeholder="0">
@@ -87,11 +87,11 @@
<tr> <tr>
<td class="third"> <td class="third">
<label> <label>
{{localize 'l5r5e.twenty_questions.incring1'}} {{localize 'l5r5e.twenty_questions.increase_ring1'}}
<br> <br>
<select name="step2.ring" class="ring-select"> <select name="step2.ring" class="ring-select">
{{#select data.step2.ring}} {{#select data.step2.ring}}
<option value="none">{{localize 'l5r5e.twenty_questions.choosem'}}</option> <option value="none">{{localize 'l5r5e.twenty_questions.choose_one_ring'}}</option>
{{#each ringsList as |obj|}} {{#each ringsList as |obj|}}
<option value="{{obj.id}}">{{obj.label}}</option> <option value="{{obj.id}}">{{obj.label}}</option>
{{/each}} {{/each}}
@@ -101,11 +101,11 @@
</td> </td>
<td class="third"> <td class="third">
<label> <label>
{{localize 'l5r5e.twenty_questions.incskill2'}} {{localize 'l5r5e.twenty_questions.increase_skill2'}}
<br> <br>
<select name="step2.skill1" class="skill-select"> <select name="step2.skill1" class="skill-select">
{{#select data.step2.skill1}} {{#select data.step2.skill1}}
<option value="none">{{localize 'l5r5e.twenty_questions.choosef'}}</option> <option value="none">{{localize 'l5r5e.twenty_questions.choose_one_skill'}}</option>
{{#each skillsList as |skills catId|}} {{#each skillsList as |skills catId|}}
<optgroup label="{{localizeSkill catId 'title'}}"> <optgroup label="{{localizeSkill catId 'title'}}">
{{#each skills as |obj|}} {{#each skills as |obj|}}
@@ -119,7 +119,7 @@
<br> <br>
<select name="step2.skill2" class="skill-select"> <select name="step2.skill2" class="skill-select">
{{#select data.step2.skill2}} {{#select data.step2.skill2}}
<option value="none">{{localize 'l5r5e.twenty_questions.choosef'}}</option> <option value="none">{{localize 'l5r5e.twenty_questions.choose_one_skill'}}</option>
{{#each skillsList as |skills catId|}} {{#each skillsList as |skills catId|}}
<optgroup label="{{localizeSkill catId 'title'}}"> <optgroup label="{{localizeSkill catId 'title'}}">
{{#each skills as |obj|}} {{#each skills as |obj|}}
@@ -132,14 +132,14 @@
</td> </td>
<td class="third"> <td class="third">
<label> <label>
{{localize 'l5r5e.twenty_questions.money'}} {{localize 'l5r5e.twenty_questions.part1.money'}}
<br> <br>
<input type="number" name="step2.wealth" value="{{data.step2.wealth}}" data-dtype="Number" <input type="number" name="step2.wealth" value="{{data.step2.wealth}}" data-dtype="Number"
placeholder="0"> placeholder="0">
</label> </label>
<br> <br>
<label> <label>
{{localize 'l5r5e.twenty_questions.glory'}} {{localize 'l5r5e.twenty_questions.part1.glory'}}
<input type="number" name="step2.social_glory" min="0" max="100" value="{{data.step2.social_glory}}" <input type="number" name="step2.social_glory" min="0" max="100" value="{{data.step2.social_glory}}"
data-dtype="Number" placeholder="0"> data-dtype="Number" placeholder="0">
</label> </label>
@@ -154,13 +154,13 @@
<h3>{{localize 'l5r5e.twenty_questions.part2.q3'}}</h3> <h3>{{localize 'l5r5e.twenty_questions.part2.q3'}}</h3>
<label> <label>
{{localize 'l5r5e.twenty_questions.school'}} {{localize 'l5r5e.twenty_questions.part2.school'}}
<br> <br>
<input type="text" name="step3.school" value="{{data.step3.school}}"> <input type="text" name="step3.school" value="{{data.step3.school}}">
</label> </label>
<label> <label>
{{localize 'l5r5e.twenty_questions.role'}} {{localize 'l5r5e.twenty_questions.part2.role'}}
<br> <br>
<input type="text" name="step3.roles" value="{{data.step3.roles}}"> <input type="text" name="step3.roles" value="{{data.step3.roles}}">
</label> </label>
@@ -169,11 +169,11 @@
<tr> <tr>
<td class="fifty"> <td class="fifty">
<label> <label>
{{localize 'l5r5e.twenty_questions.incring2'}} {{localize 'l5r5e.twenty_questions.increase_ring2'}}
<br> <br>
<select name="step3.ring1" class="ring-select"> <select name="step3.ring1" class="ring-select">
{{#select data.step3.ring1}} {{#select data.step3.ring1}}
<option value="none">{{localize 'l5r5e.twenty_questions.choosem'}}</option> <option value="none">{{localize 'l5r5e.twenty_questions.choose_one_ring'}}</option>
{{#each ringsList as |obj|}} {{#each ringsList as |obj|}}
<option value="{{obj.id}}">{{obj.label}}</option> <option value="{{obj.id}}">{{obj.label}}</option>
{{/each}} {{/each}}
@@ -182,7 +182,7 @@
</label> </label>
<select name="step3.ring2" class="ring-select"> <select name="step3.ring2" class="ring-select">
{{#select data.step3.ring2}} {{#select data.step3.ring2}}
<option value="none">{{localize 'l5r5e.twenty_questions.choosem'}}</option> <option value="none">{{localize 'l5r5e.twenty_questions.choose_one_ring'}}</option>
{{#each ringsList as |obj|}} {{#each ringsList as |obj|}}
<option value="{{obj.id}}">{{obj.label}}</option> <option value="{{obj.id}}">{{obj.label}}</option>
{{/each}} {{/each}}
@@ -190,7 +190,7 @@
</select> </select>
<br> <br>
<label> <label>
{{localize 'l5r5e.twenty_questions.honor'}} {{localize 'l5r5e.twenty_questions.part2.honor'}}
<br> <br>
<input type="number" name="step3.social_honor" min="0" max="100" value="{{data.step3.social_honor}}" <input type="number" name="step3.social_honor" min="0" max="100" value="{{data.step3.social_honor}}"
data-dtype="Number" placeholder="0"> data-dtype="Number" placeholder="0">
@@ -198,11 +198,11 @@
</td> </td>
<td class="fifty"> <td class="fifty">
<label> <label>
{{localize 'l5r5e.twenty_questions.incskill3'}} {{localize 'l5r5e.twenty_questions.increase_skill3'}}
<br> <br>
<select name="step3.skill1" class="skill-select"> <select name="step3.skill1" class="skill-select">
{{#select data.step3.skill1}} {{#select data.step3.skill1}}
<option value="none">{{localize 'l5r5e.twenty_questions.choosef'}}</option> <option value="none">{{localize 'l5r5e.twenty_questions.choose_one_skill'}}</option>
{{#each skillsList as |skills catId|}} {{#each skillsList as |skills catId|}}
<optgroup label="{{localizeSkill catId 'title'}}"> <optgroup label="{{localizeSkill catId 'title'}}">
{{#each skills as |obj|}} {{#each skills as |obj|}}
@@ -215,7 +215,7 @@
</label> </label>
<select name="step3.skill2" class="skill-select"> <select name="step3.skill2" class="skill-select">
{{#select data.step3.skill2}} {{#select data.step3.skill2}}
<option value="none">{{localize 'l5r5e.twenty_questions.choosef'}}</option> <option value="none">{{localize 'l5r5e.twenty_questions.choose_one_skill'}}</option>
{{#each skillsList as |skills catId|}} {{#each skillsList as |skills catId|}}
<optgroup label="{{localizeSkill catId 'title'}}"> <optgroup label="{{localizeSkill catId 'title'}}">
{{#each skills as |obj|}} {{#each skills as |obj|}}
@@ -227,7 +227,7 @@
</select> </select>
<select name="step3.skill3" class="skill-select"> <select name="step3.skill3" class="skill-select">
{{#select data.step3.skill3}} {{#select data.step3.skill3}}
<option value="none">{{localize 'l5r5e.twenty_questions.choosef'}}</option> <option value="none">{{localize 'l5r5e.twenty_questions.choose_one_skill'}}</option>
{{#each skillsList as |skills catId|}} {{#each skillsList as |skills catId|}}
<optgroup label="{{localizeSkill catId 'title'}}"> <optgroup label="{{localizeSkill catId 'title'}}">
{{#each skills as |obj|}} {{#each skills as |obj|}}
@@ -239,7 +239,7 @@
</select> </select>
<select name="step3.skill4" class="skill-select"> <select name="step3.skill4" class="skill-select">
{{#select data.step3.skill4}} {{#select data.step3.skill4}}
<option value="none">{{localize 'l5r5e.twenty_questions.choosef'}}</option> <option value="none">{{localize 'l5r5e.twenty_questions.choose_one_skill'}}</option>
{{#each skillsList as |skills catId|}} {{#each skillsList as |skills catId|}}
<optgroup label="{{localizeSkill catId 'title'}}"> <optgroup label="{{localizeSkill catId 'title'}}">
{{#each skills as |obj|}} {{#each skills as |obj|}}
@@ -251,7 +251,7 @@
</select> </select>
<select name="step3.skill5" class="skill-select"> <select name="step3.skill5" class="skill-select">
{{#select data.step3.skill5}} {{#select data.step3.skill5}}
<option value="none">{{localize 'l5r5e.twenty_questions.choosef'}}</option> <option value="none">{{localize 'l5r5e.twenty_questions.choose_one_skill'}}</option>
{{#each skillsList as |skills catId|}} {{#each skillsList as |skills catId|}}
<optgroup label="{{localizeSkill catId 'title'}}"> <optgroup label="{{localizeSkill catId 'title'}}">
{{#each skills as |obj|}} {{#each skills as |obj|}}
@@ -265,7 +265,7 @@
</tr> </tr>
<tr> <tr>
<td colspan="2"> <td colspan="2">
{{localize 'l5r5e.twenty_questions.access'}} {{localize 'l5r5e.twenty_questions.part2.access'}}
<br> <br>
{{#each techniquesList as |technique|}} {{#each techniquesList as |technique|}}
<label> <label>
@@ -277,16 +277,16 @@
</tr> </tr>
<tr> <tr>
<td class="fifty"> <td class="fifty">
{{localize 'l5r5e.twenty_questions.schoolab'}} {{localize 'l5r5e.twenty_questions.part2.school_ability'}}
<br> <br>
{{> 'systems/l5r5e/templates/actors/character/twenty-questions-item.html' itemsList=cache.step3.school_ability stepName='step3.school_ability' itemType='techniques' hideDndAt=1 }} {{> 'systems/l5r5e/templates/actors/character/twenty-questions-item.html' itemsList=cache.step3.school_ability stepName='step3.school_ability' itemType='techniques' hideDndAt=1 }}
<br> <br>
{{localize 'l5r5e.twenty_questions.startech'}} {{localize 'l5r5e.twenty_questions.part2.starting_techniques'}}
<br> <br>
{{> 'systems/l5r5e/templates/actors/character/twenty-questions-item.html' itemsList=cache.step3.techniques stepName='step3.techniques' itemType='techniques' hideDndAt=5 }} {{> 'systems/l5r5e/templates/actors/character/twenty-questions-item.html' itemsList=cache.step3.techniques stepName='step3.techniques' itemType='techniques' hideDndAt=5 }}
</td> </td>
<td class="fifty"> <td class="fifty">
{{localize 'l5r5e.twenty_questions.outfit'}} {{localize 'l5r5e.twenty_questions.part2.outfit'}}
<br> <br>
{{> 'systems/l5r5e/templates/actors/character/twenty-questions-item.html' itemsList=cache.step3.equipment stepName='step3.equipment' itemType='items' hideDndAt=10 }} {{> 'systems/l5r5e/templates/actors/character/twenty-questions-item.html' itemsList=cache.step3.equipment stepName='step3.equipment' itemType='items' hideDndAt=10 }}
</td> </td>
@@ -301,11 +301,11 @@
</label> </label>
<br> <br>
<label> <label>
{{localize 'l5r5e.twenty_questions.incring1'}} {{localize 'l5r5e.twenty_questions.increase_ring1'}}
<br> <br>
<select name="step4.ring" class="ring-select"> <select name="step4.ring" class="ring-select">
{{#select data.step4.ring}} {{#select data.step4.ring}}
<option value="none">{{localize 'l5r5e.twenty_questions.choosem'}}</option> <option value="none">{{localize 'l5r5e.twenty_questions.choose_one_ring'}}</option>
{{#each ringsList as |obj|}} {{#each ringsList as |obj|}}
<option value="{{obj.id}}">{{obj.label}}</option> <option value="{{obj.id}}">{{obj.label}}</option>
{{/each}} {{/each}}
@@ -320,7 +320,7 @@
<h3>{{localize 'l5r5e.twenty_questions.part3.q5'}}</h3> <h3>{{localize 'l5r5e.twenty_questions.part3.q5'}}</h3>
<label> <label>
{{localize 'l5r5e.twenty_questions.choogiri'}} {{localize 'l5r5e.twenty_questions.part3.choose_giri'}}
<br> <br>
<textarea name="step5.social_giri">{{data.step5.social_giri}}</textarea> <textarea name="step5.social_giri">{{data.step5.social_giri}}</textarea>
</label> </label>
@@ -330,7 +330,7 @@
<h3>{{localize 'l5r5e.twenty_questions.part3.q6'}}</h3> <h3>{{localize 'l5r5e.twenty_questions.part3.q6'}}</h3>
<label> <label>
{{localize 'l5r5e.twenty_questions.chooninjo'}} {{localize 'l5r5e.twenty_questions.part3.choose_ninjo'}}
<br> <br>
<textarea name="step6.social_ninjo">{{data.step6.social_ninjo}}</textarea> <textarea name="step6.social_ninjo">{{data.step6.social_ninjo}}</textarea>
</label> </label>
@@ -346,11 +346,11 @@
<tr> <tr>
<td class="third"> <td class="third">
<label> <label>
{{localize 'l5r5e.twenty_questions.incskill1'}} {{localize 'l5r5e.twenty_questions.increase_skill1'}}
<br> <br>
<select name="step7.skill" class="skill-select"> <select name="step7.skill" class="skill-select">
{{#select data.step7.skill}} {{#select data.step7.skill}}
<option value="none">{{localize 'l5r5e.twenty_questions.choosef'}}</option> <option value="none">{{localize 'l5r5e.twenty_questions.choose_one_skill'}}</option>
{{#each skillsList as |skills catId|}} {{#each skillsList as |skills catId|}}
<optgroup label="{{localizeSkill catId 'title'}}"> <optgroup label="{{localizeSkill catId 'title'}}">
{{#each skills as |obj|}} {{#each skills as |obj|}}
@@ -367,7 +367,7 @@
</td> </td>
<td class=""> <td class="">
<label> <label>
{{localize 'l5r5e.twenty_questions.incglory'}} {{localize 'l5r5e.twenty_questions.part3.increase_glory'}}
<br> <br>
<input type="number" name="step7.social_add_glory" value="{{data.step7.social_add_glory}}" <input type="number" name="step7.social_add_glory" value="{{data.step7.social_add_glory}}"
data-dtype="Number" placeholder="0" disabled> data-dtype="Number" placeholder="0" disabled>
@@ -387,11 +387,11 @@
<tr> <tr>
<td class="third"> <td class="third">
<label> <label>
{{localize 'l5r5e.twenty_questions.incskill1'}} {{localize 'l5r5e.twenty_questions.increase_skill1'}}
<br> <br>
<select name="step8.skill" class="skill-select"> <select name="step8.skill" class="skill-select">
{{#select data.step8.skill}} {{#select data.step8.skill}}
<option value="none">{{localize 'l5r5e.twenty_questions.choosef'}}</option> <option value="none">{{localize 'l5r5e.twenty_questions.choose_one_skill'}}</option>
{{#each noHonorSkillsList as |skillId|}} {{#each noHonorSkillsList as |skillId|}}
<option value="{{skillId}}">{{localizeSkillId skillId}}</option> <option value="{{skillId}}">{{localizeSkillId skillId}}</option>
{{/each}} {{/each}}
@@ -404,7 +404,7 @@
</td> </td>
<td class=""> <td class="">
<label> <label>
{{localize 'l5r5e.twenty_questions.inchonor'}} {{localize 'l5r5e.twenty_questions.part3.increase_honor'}}
<br> <br>
<input type="number" name="step8.social_add_honor" value="{{data.step8.social_add_honor}}" <input type="number" name="step8.social_add_honor" value="{{data.step8.social_add_honor}}"
data-dtype="Number" placeholder="0" disabled> data-dtype="Number" placeholder="0" disabled>
@@ -422,7 +422,7 @@
<textarea name="step9.success">{{data.step9.success}}</textarea> <textarea name="step9.success">{{data.step9.success}}</textarea>
</label> </label>
<br> <br>
{{localize 'l5r5e.twenty_questions.distinction'}} {{localize 'l5r5e.twenty_questions.part4.distinction'}}
<br> <br>
{{> 'systems/l5r5e/templates/actors/character/twenty-questions-item.html' itemsList=cache.step9.distinction stepName='step9.distinction' itemType='peculiarities' hideDndAt=1 }} {{> 'systems/l5r5e/templates/actors/character/twenty-questions-item.html' itemsList=cache.step9.distinction stepName='step9.distinction' itemType='peculiarities' hideDndAt=1 }}
</div> </div>
@@ -433,7 +433,7 @@
<textarea name="step10.difficulty">{{data.step10.difficulty}}</textarea> <textarea name="step10.difficulty">{{data.step10.difficulty}}</textarea>
</label> </label>
<br> <br>
{{localize 'l5r5e.twenty_questions.adversity'}} {{localize 'l5r5e.twenty_questions.part4.adversity'}}
<br> <br>
{{> 'systems/l5r5e/templates/actors/character/twenty-questions-item.html' itemsList=cache.step10.adversity stepName='step10.adversity' itemType='peculiarities' hideDndAt=1 }} {{> 'systems/l5r5e/templates/actors/character/twenty-questions-item.html' itemsList=cache.step10.adversity stepName='step10.adversity' itemType='peculiarities' hideDndAt=1 }}
</div> </div>
@@ -444,7 +444,7 @@
<textarea name="step11.calms">{{data.step11.calms}}</textarea> <textarea name="step11.calms">{{data.step11.calms}}</textarea>
</label> </label>
<br> <br>
{{localize 'l5r5e.twenty_questions.passion'}} {{localize 'l5r5e.twenty_questions.part4.passion'}}
<br> <br>
{{> 'systems/l5r5e/templates/actors/character/twenty-questions-item.html' itemsList=cache.step11.passion stepName='step11.passion' itemType='peculiarities' hideDndAt=1 }} {{> 'systems/l5r5e/templates/actors/character/twenty-questions-item.html' itemsList=cache.step11.passion stepName='step11.passion' itemType='peculiarities' hideDndAt=1 }}
</div> </div>
@@ -455,7 +455,7 @@
<textarea name="step12.worries">{{data.step12.worries}}</textarea> <textarea name="step12.worries">{{data.step12.worries}}</textarea>
</label> </label>
<br> <br>
{{localize 'l5r5e.twenty_questions.anxiety'}} {{localize 'l5r5e.twenty_questions.part4.anxiety'}}
<br> <br>
{{> 'systems/l5r5e/templates/actors/character/twenty-questions-item.html' itemsList=cache.step12.anxiety stepName='step12.anxiety' itemType='peculiarities' hideDndAt=1 }} {{> 'systems/l5r5e/templates/actors/character/twenty-questions-item.html' itemsList=cache.step12.anxiety stepName='step12.anxiety' itemType='peculiarities' hideDndAt=1 }}
</div> </div>
@@ -471,11 +471,11 @@
<tr> <tr>
<td class="third"> <td class="third">
<label> <label>
{{localize 'l5r5e.twenty_questions.incskill1'}} {{localize 'l5r5e.twenty_questions.increase_skill1'}}
<br> <br>
<select name="step13.skill" class="skill-select"> <select name="step13.skill" class="skill-select">
{{#select data.step13.skill}} {{#select data.step13.skill}}
<option value="none">{{localize 'l5r5e.twenty_questions.choosef'}}</option> <option value="none">{{localize 'l5r5e.twenty_questions.choose_one_skill'}}</option>
{{#ifCond cache.step13.advantage.length '==' '0'}} {{#ifCond cache.step13.advantage.length '==' '0'}}
{{#each skillsList as |skills catId|}} {{#each skillsList as |skills catId|}}
<optgroup label="{{localizeSkill catId 'title'}}"> <optgroup label="{{localizeSkill catId 'title'}}">
@@ -493,7 +493,7 @@
{{localize 'l5r5e.twenty_questions.or'}} {{localize 'l5r5e.twenty_questions.or'}}
</td> </td>
<td class=""> <td class="">
{{localize 'l5r5e.twenty_questions.advant'}} {{localize 'l5r5e.twenty_questions.part4.advantage'}}
<br> <br>
{{> 'systems/l5r5e/templates/actors/character/twenty-questions-item.html' itemsList=cache.step13.advantage stepName='step13.advantage' itemType='peculiarities' hideDndAt=1 }} {{> 'systems/l5r5e/templates/actors/character/twenty-questions-item.html' itemsList=cache.step13.advantage stepName='step13.advantage' itemType='peculiarities' hideDndAt=1 }}
</td> </td>
@@ -501,7 +501,7 @@
</table> </table>
<br> <br>
{{localize 'l5r5e.twenty_questions.disadvant'}} {{localize 'l5r5e.twenty_questions.part4.disadvantage'}}
<br> <br>
{{> 'systems/l5r5e/templates/actors/character/twenty-questions-item.html' itemsList=cache.step13.disadvantage stepName='step13.disadvantage' itemType='peculiarities' hideDndAt=1 }} {{> 'systems/l5r5e/templates/actors/character/twenty-questions-item.html' itemsList=cache.step13.disadvantage stepName='step13.disadvantage' itemType='peculiarities' hideDndAt=1 }}
</div> </div>
@@ -515,7 +515,7 @@
</label> </label>
<br> <br>
<label> <label>
{{localize 'l5r5e.twenty_questions.accoutr'}} {{localize 'l5r5e.twenty_questions.part5.accoutrement'}}
<br> <br>
{{> 'systems/l5r5e/templates/actors/character/twenty-questions-item.html' itemsList=cache.step14.special_features stepName='step14.special_features' itemType='items' hideDndAt=1 }} {{> 'systems/l5r5e/templates/actors/character/twenty-questions-item.html' itemsList=cache.step14.special_features stepName='step14.special_features' itemType='items' hideDndAt=1 }}
</label> </label>
@@ -535,7 +535,7 @@
</label> </label>
<br> <br>
<label> <label>
{{localize 'l5r5e.twenty_questions.object'}} {{localize 'l5r5e.twenty_questions.part5.object'}}
<br> <br>
{{> 'systems/l5r5e/templates/actors/character/twenty-questions-item.html' itemsList=cache.step16.item stepName='step16.item' itemType='items' hideDndAt=1 }} {{> 'systems/l5r5e/templates/actors/character/twenty-questions-item.html' itemsList=cache.step16.item stepName='step16.item' itemType='items' hideDndAt=1 }}
</label> </label>
@@ -550,11 +550,11 @@
</label> </label>
<br> <br>
<label> <label>
{{localize 'l5r5e.twenty_questions.incskill1'}} {{localize 'l5r5e.twenty_questions.increase_skill1'}}
<br> <br>
<select name="step17.skill" class="skill-select"> <select name="step17.skill" class="skill-select">
{{#select data.step17.skill}} {{#select data.step17.skill}}
<option value="none">{{localize 'l5r5e.twenty_questions.choosef'}}</option> <option value="none">{{localize 'l5r5e.twenty_questions.choose_one_skill'}}</option>
{{#each skillsList as |skills catId|}} {{#each skillsList as |skills catId|}}
<optgroup label="{{localizeSkill catId 'title'}}"> <optgroup label="{{localizeSkill catId 'title'}}">
{{#each skills as |obj|}} {{#each skills as |obj|}}
@@ -576,7 +576,7 @@
<tr> <tr>
<td class="fifty"> <td class="fifty">
<label> <label>
{{localize 'l5r5e.twenty_questions.d10r1'}} {{localize 'l5r5e.twenty_questions.part6.d10r1'}}
<a class="inline-roll roll" title="1d10" data-mode="roll" <a class="inline-roll roll" title="1d10" data-mode="roll"
data-flavor="{{localize 'l5r5e.twenty_questions.d10r1'}}" data-formula="1d10" data-step="step18.heritage_1"> data-flavor="{{localize 'l5r5e.twenty_questions.d10r1'}}" data-formula="1d10" data-step="step18.heritage_1">
<i class="fas fa-dice-d20"></i> 1d10 <i class="fas fa-dice-d20"></i> 1d10
@@ -587,7 +587,7 @@
</td> </td>
<td class="fifty"> <td class="fifty">
<label> <label>
{{localize 'l5r5e.twenty_questions.d10r2'}} {{localize 'l5r5e.twenty_questions.part6.d10r2'}}
<a class="inline-roll roll" title="1d10" data-mode="roll" <a class="inline-roll roll" title="1d10" data-mode="roll"
data-flavor="{{localize 'l5r5e.twenty_questions.d10r2'}}" data-formula="1d10" data-step="step18.heritage_2"> data-flavor="{{localize 'l5r5e.twenty_questions.d10r2'}}" data-formula="1d10" data-step="step18.heritage_2">
<i class="fas fa-dice-d20"></i> 1d10 <i class="fas fa-dice-d20"></i> 1d10
@@ -615,17 +615,53 @@
<textarea name="step20.death">{{data.step20.death}}</textarea> <textarea name="step20.death">{{data.step20.death}}</textarea>
</label> </label>
</div> </div>
<br>
<h2>{{localize 'l5r5e.twenty_questions.part7.summary'}}</h2>
<table>
<tr>
<th>{{localize 'l5r5e.rings.title'}}</th>
<th>{{localize 'l5r5e.skills.title'}}</th>
<th>{{localize 'l5r5e.social.title'}}</th>
</tr>
<tr>
<td>
{{#each summary.summary.rings}}
{{this}}<br>
{{/each}}
</td>
<td>
{{#each summary.summary.skills}}
{{this}}<br>
{{/each}}
</td>
<td>
{{localize 'l5r5e.twenty_questions.part1.status'}}
<br>{{data.step1.social_status}}
<br>
<br>{{localize 'l5r5e.twenty_questions.part1.glory'}}
<br>{{data.step2.social_glory}} {{#if data.step7.social_add_glory}} + {{data.step7.social_add_glory}}{{/if}}
<br>
<br>{{localize 'l5r5e.twenty_questions.part2.honor'}}
<br>{{data.step3.social_honor}} {{#if data.step8.social_add_honor}} + {{data.step8.social_add_honor}}{{/if}}
<br>
<br>{{localize 'l5r5e.twenty_questions.part1.money'}}
<br>{{data.step2.wealth}}
</td>
</tr>
</table>
<hr> <hr>
{{#if hasErrors}} {{#if summary.errors}}
corriger les erreurs pour poursuivre ! {{localize 'l5r5e.twenty_questions.part7.generchar_errors'}}
{{else}} {{else}}
<div class="form-group footer"> <div class="form-group footer">
<div id="generchar_disclaimer"> <div id="generchar_disclaimer">
{{localize 'l5r5e.twenty_questions.generchar_disclaimer'}} {{localize 'l5r5e.twenty_questions.part7.generchar_disclaimer'}}
</div> </div>
<button name="generate" id="generate" type="button"> <button name="generate" id="generate" type="button">
{{localize 'l5r5e.twenty_questions.generchar'}} <i class='fas fa-arrow-circle-right'></i> {{localize 'l5r5e.twenty_questions.part7.generchar'}} <i class='fas fa-arrow-circle-right'></i>
</button> </button>
</div> </div>
{{/if}} {{/if}}

View File

@@ -27,7 +27,7 @@
{{#ifCond item.data.advancement_type '==' 'skill' }} {{#ifCond item.data.advancement_type '==' 'skill' }}
<select name="data.skill" id="advancement_skill"> <select name="data.skill" id="advancement_skill">
<option value="">{{localize 'l5r5e.twenty_questions.choosef'}}</option> <option value="">{{localize 'l5r5e.twenty_questions.choose_one_skill'}}</option>
{{#select item.data.skill}} {{#select item.data.skill}}
{{#each item.data.skillsList as |skills catId|}} {{#each item.data.skillsList as |skills catId|}}
<optgroup label="{{localizeSkill catId 'title'}}"> <optgroup label="{{localizeSkill catId 'title'}}">

View File

@@ -7,6 +7,6 @@
{{/if}} {{/if}}
</ul> </ul>
{{#if item.data.data.description}} {{#if item.data.data.description}}
<div class="item-description item-description-{{item._id}}">{{ item.data.data.description }}</div> <div class="item-description item-description-{{item._id}}">{{{ item.data.data.description }}}</div>
{{/if}} {{/if}}
</li> </li>