diff --git a/system/lang/en-en.json b/system/lang/en-en.json index 4bbe836..73496ea 100644 --- a/system/lang/en-en.json +++ b/system/lang/en-en.json @@ -1,15 +1,12 @@ { "i18n.language": "English", "i18n.maintainers": ["Team L5R"], - "settings.simplemacroshorthandn": "Shortened Macro Syntax", "settings.simplemacroshorthandl": "Enable a shortened macro syntax which allows referencing attributes directly, for example @str instead of @attributes.str.value. Disable this setting if you need the ability to reference the full attribute model, for example @attributes.str.label.", "settings.simpleinitformulan": "Initiative Formula", "settings.simpleinitformulal": "Enter an initiative formula, such as d20+@dex", - "simple.notifyinitformulaupdated": "Initiative formula was updated to:", "simple.notifyinitformulainvalid": "Initiative formula was invalid:", - "hexa.color": "Enter a hexadecimal color (such as #FFFFFF).", "ic.bg.color": "IC Background Color", "ic.text.color": "IC Text Color", @@ -21,7 +18,6 @@ "other.text.color": "Other Text Color", "def.chat.pref": "Default Chat Prefix", "spe.chat.pref": "If specified, this string will be prefixed to all chat messages that are not already commands (such as /emote.)", - "l5r5e": { "logo": { "title": "Need help?", @@ -224,46 +220,81 @@ "twenty_questions": { "title": "Twenty questions", "bt_abrev": "20Q", + "intro": "You can use this sheet to fill in your answers to The Game of Twenty Questions, and to take notes for later!", + "section": "Legend of the Five Rings Core Rulebook, Chapter 2 : Creating a character, p. 41-95", + "incring1": "Ring increase (1)", + "incring2": "Ring increase (2)", + "incskill1": "Skill increases (1)", + "incskill2": "Skill increases (2)", + "incskill3": "Skill increases (3-5)", + "choosem": "Pick one", + "choosef": "Pick one", + "money": "Starting wealth :", + "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", + "incglory": "Glory increase", + "inchonor": "Honor increase", + "distinction": "Distinction (1)", + "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 a new character", "part1": { "title": "Part I: Core Identity (Clan and Family)", - "q1": "1. What clan does your character belong to? (p. 41)", - "q2": "2. What family does your character belong to? (p. 49)" + "q1": "1. What clan does your character belong to ? (p. 41)", + "q2": "2. What family does your character belong to ? (p. 49)" }, "part2": { "title": "Part II: Role and School", - "q3": "3. What is your character’s school, and what roles does that school fall into?(p. 56)", - "q4": "4. How does your character stand out within their school?(p. 88)" + "q3": "3. What is your character’s school, and what roles does that school fall into ? (p. 56)", + "q4": "4. How does your character stand out within their school ? (p. 88)" }, "part3": { "title": "Part III: Honor and Glory", - "q5": "5. Who is your lord and what is your character’s duty to them? (p. 88)", - "q6": "6. What does your character long for, and how might this impede their duty? (p. 90)", - "q7": "7. What is your character’s relationship with their clan?(p. 91)", - "q8": "8. What does your character think of Bushidō? (p. 91)" + "q5": "5. Who is your lord and what is your character’s duty to them ? (p. 88)", + "q6": "6. What does your character long for, and how might this impede their duty ? (p. 90)", + "q7": "7. What is your character’s relationship with their clan ? (p. 91)", + "q8": "8. What does your character think of Bushidō ? (p. 91)" }, "part4": { "title": "Part IV: Strengths and Weaknesses", - "q9": "9. What is your character’s greatest accomplishment so far?(p. 92)", - "q10": "10. What holds your character back the most in life?(p. 92)", - "q11": "11. What activity Most makes your character feel at peace? (p. 92)", - "q12": "12. What concern, fear, or foible troubles your character the most? (p. 93)", + "q9": "9. What is your character’s greatest accomplishment so far ? (p. 92)", + "q10": "10. What holds your character back the most in life ? (p. 92)", + "q11": "11. What activity Most makes your character feel at peace ? (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)" }, "part5": { "title": "Part V: Personality and Behavior", "q14": "14. What do people notice first upon encountering your character? (p. 93)", - "q15": "15. How does your character react to stressful situations? (p. 94)", - "q16": "16. What are your character’s preexisting relationships with other clans, families, organizations, and traditions? (p. 94)" + "q15": "15. How does your character react to stressful situations ? (p. 94)", + "q16": "16. What are your character’s preexisting relationships with other clans, families, organizations, and traditions ? (p. 94)" }, "part6": { "title": "Part VI: Ancestry and Family", - "q17": "17. How would your character’s parents describe them? (p. 95)", - "q18": "18. Who was your character named to honor? (p. 95)", - "q19": "19. What is your character’s personal name? (p. 95)" + "q17": "17. How would your character’s parents describe them ? (p. 95)", + "q18": "18. Who was your character named to honor ? (p. 95)", + "q19": "19. What is your character’s personal name ? (p. 95)" }, "part7": { "title": "Part VII: Death", - "q20": "20. How should your character die? (p. 95)" + "q20": "20. How should your character die ? (p. 95)" } } } diff --git a/system/lang/es-es.json b/system/lang/es-es.json index 3856e06..b698d73 100644 --- a/system/lang/es-es.json +++ b/system/lang/es-es.json @@ -1,15 +1,12 @@ { "i18n.language": "Español", "i18n.maintainers": ["Team L5R"], - "settings.simplemacroshorthandn": "Macro sintaxis acortada", "settings.simplemacroshorthandl": "Habilitar una sintaxis de macro abreviada que permita referenciar directamente los atributos, por ejemplo @str en lugar de @attributes.str.value. Deshabilitar esta configuración si se necesita la capacidad de referenciar el modelo de atributos completo, por ejemplo @attributes.str.label", "settings.simpleinitformulan": "Fórmula de iniciativa", "settings.simpleinitformulal": "Introduzca una fórmula de iniciativa, como d20+@dex", - "simple.notifyinitformulaupdated": "La fórmula de la iniciativa fue actualizada a:", "simple.notifyinitformulainvalid": "La fórmula de la iniciativa fue inválida:", - "hexa.color": "Introduzca un color hexadecimal (como #FFFFFF)", "ic.bg.color": "Color de fondo en el gato", "ic.text.color": "Color del texto en el chat", @@ -21,7 +18,6 @@ "other.text.color": "Otro color de texto", "def.chat.pref": "Prefijo del chat por defecto", "spe.chat.pref": "Si está configurado, la cadena será prefijada para todos los mensajes de chat que no sean ya comandos (como /emote.)", - "l5r5e": { "logo": { "título": "¿Necesitas ayuda?", @@ -223,46 +219,81 @@ "twenty_questions": { "title": "Twenty questions", "bt_abrev": "20Q", + "intro": "You can use this sheet to fill in your answers to The Game of Twenty Questions, and to take notes for later!", + "section": "Legend of the Five Rings Core Rulebook, Chapter 2 : Creating a character, p. 41-95", + "incring1": "Ring increase (1)", + "incring2": "Ring increase (2)", + "incskill1": "Skill increases (1)", + "incskill2": "Skill increases (2)", + "incskill3": "Skill increases (3-5)", + "choosem": "Pick one", + "choosef": "Pick one", + "money": "Starting wealth :", + "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", + "incglory": "Glory increase", + "inchonor": "Honor increase", + "distinction": "Distinction (1)", + "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 a new character", "part1": { - "title": "Partie I: Core Identity (Clan and Family)", - "q1": "1. What clan does your character belong to? (p. 41)", - "q2": "2. What family does your character belong to? (p. 49)" + "title": "Part I: Core Identity (Clan and Family)", + "q1": "1. What clan does your character belong to ? (p. 41)", + "q2": "2. What family does your character belong to ? (p. 49)" }, "part2": { - "title": "Partie II: Role and School", - "q3": "3. 3. What is your character’s school, and what roles does that school fall into?(p. 56)", - "q4": "4. How does your character stand out within their school?(p. 88)" + "title": "Part II: Role and School", + "q3": "3. What is your character’s school, and what roles does that school fall into ? (p. 56)", + "q4": "4. How does your character stand out within their school ? (p. 88)" }, "part3": { - "title": "Partie III: Honor and Glory", - "q5": "5. Who is your lord and what is your character’s duty to them? (p. 88)", - "q6": "6. What does your character long for, and how might this impede their duty? (p. 90)", - "q7": "7. What is your character’s relationship with their clan?(p. 91)", - "q8": "8. What does your character think of Bushidō? (p. 91)" + "title": "Part III: Honor and Glory", + "q5": "5. Who is your lord and what is your character’s duty to them ? (p. 88)", + "q6": "6. What does your character long for, and how might this impede their duty ? (p. 90)", + "q7": "7. What is your character’s relationship with their clan ? (p. 91)", + "q8": "8. What does your character think of Bushidō ? (p. 91)" }, "part4": { - "title": "Partie IV: Strengths and Weaknesses", - "q9": "9. What is your character’s greatest accomplishment so far?(p. 92)", - "q10": "10. What holds your character back the most in life?(p. 92)", - "q11": "11. What activity Most makes your character feel at peace? (p. 93)", - "q12": "12. What concern, fear, or foible troubles your character the most? (p. 93)", - "q13": "12. Who has your character learned the most from during their life(p. 93)" + "title": "Part IV: Strengths and Weaknesses", + "q9": "9. What is your character’s greatest accomplishment so far ? (p. 92)", + "q10": "10. What holds your character back the most in life ? (p. 92)", + "q11": "11. What activity Most makes your character feel at peace ? (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)" }, "part5": { - "title": "Partie V: Personality and Behavior", + "title": "Part V: Personality and Behavior", "q14": "14. What do people notice first upon encountering your character? (p. 93)", - "q15": "15. How does your character react to stressful situations? (p. 94)", - "q16": "16. What are your character’s preexisting relationships with other clans, families, organizations, and traditions? (p. 94)" + "q15": "15. How does your character react to stressful situations ? (p. 94)", + "q16": "16. What are your character’s preexisting relationships with other clans, families, organizations, and traditions ? (p. 94)" }, "part6": { - "title": "Partie VI: Ancestry and Family", - "q17": "17. How would your character’s parents describe them? (p. 95)", - "q18": "18. Who was your character named to honor? (p. 95)", - "q19": "19. What is your character’s personal name? (p. 95)" + "title": "Part VI: Ancestry and Family", + "q17": "17. How would your character’s parents describe them ? (p. 95)", + "q18": "18. Who was your character named to honor ? (p. 95)", + "q19": "19. What is your character’s personal name ? (p. 95)" }, "part7": { - "title": "Partie VII: Death", - "q20": "20. How should your character die? (p. 95)" + "title": "Part VII: Death", + "q20": "20. How should your character die ? (p. 95)" } } } diff --git a/system/lang/fr-fr.json b/system/lang/fr-fr.json index 50c07a0..705a703 100644 --- a/system/lang/fr-fr.json +++ b/system/lang/fr-fr.json @@ -1,15 +1,12 @@ { "i18n.language": "Français", "i18n.maintainers": ["Team L5R"], - "settings.simplemacroshorthandn": "Macro syntaxe abrégée", "settings.simplemacroshorthandl": "Activer une syntaxe de macro raccourcie qui permet de référencer directement les attributs, par exemple @str au lieu de @attributes.str.value. Désactivez ce paramètre si vous avez besoin de pouvoir référencer le modèle d'attribut complet, par exemple @attributes.str.label", "settings.simpleinitformulan": "Formule d'initiative", "settings.simpleinitformulal": "Entrez une formule d'initiative, telle que d20+@dex", - "simple.notifyinitformulaupdated": "La formule de l'initiative a été mise à jour pour :", "simple.notifyinitformulainvalid": "La formule d'initiative suivante n'est pas valable :", - "hexa.color": "Entrer une couleur hexadécimale (telle que #FFFFFF).", "ic.bg.color": "Couleur de fond dans le chat", "ic.text.color": "Couleur du texte dans le chat", @@ -21,7 +18,6 @@ "other.text.color": "Autre couleur de texte", "def.chat.pref": "Préfixe de Chat par défaut", "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": { "add": "Ajouter", @@ -228,6 +224,41 @@ "twenty_questions": { "title": "Vingt questions", "bt_abrev": "20Q", + "intro": "Renseignez vos réponses au jeu des vingt questions sur ce formulaire et notez-y des éléments à utiliser ultérieurement !", + "section": "Livre de Règles de La Légende des Cinq Anneaux, Chapitre 2 : Création de personnage, p. 41-95", + "incring1": "Augmentation d'anneau (1)", + "incring2": "Augmentations d'anneau (2)", + "incskill1": "Augmentation de compétence (1)", + "incskill2": "Augmentations de compétences (2)", + "incskill3": "Augmentations de compétences (3-5)", + "choosem": "En choisir un", + "choosef": "En choisir une", + "money": "Fortune de départ :", + "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", + "incglory": "Augmentation de la gloire (+5)", + "inchonor": "Augmentation de l'honneur (+10)", + "distinction": "Aptitude (1)", + "adversity": "Coup du sort (1)", + "passion": "Passion (1)", + "anxiety": "Défaillance (1)", + "disadvant": "Désavantage (1)", + "advant": "Avantage (1)", + "accoutr": "Particularités", + "object": "Objet (Rareté inférieur ou égale à 7)", + "d10r1": "Résultat du 1er D10", + "d10r2": "Résultat du 2eme D10", + "generchar": "Générer un nouveau personnage", "part1": { "title": "Partie I: Identité (clan et famille)", "q1": "1. A quel clan appartient votre personnage ? (p. 41)", diff --git a/system/scripts/items/peculiarity-sheet.js b/system/scripts/items/peculiarity-sheet.js new file mode 100644 index 0000000..595abc9 --- /dev/null +++ b/system/scripts/items/peculiarity-sheet.js @@ -0,0 +1,29 @@ +import { ItemSheetL5r5e } from "./item-sheet.js"; + +/** + * Commun class for Advantages / Disadvantages types + * @extends {ItemSheet} + */ +export class PeculiaritySheetL5r5e extends ItemSheetL5r5e { + /** + * Sub Types of Advantage/Disadvantage + */ + static SUB_TYPES = ["distinction", "passion", "adversity", "anxiety"]; + + /** @override */ + static get defaultOptions() { + return mergeObject(super.defaultOptions, { + classes: ["l5r5e", "sheet", "peculiarity"], + template: CONFIG.L5r5e.paths.templates + "item/peculiarity-sheet.html", + width: 520, + height: 480, + tabs: [{ navSelector: ".sheet-tabs", contentSelector: ".sheet-body", initial: "description" }], + }); + } + + getData() { + const sheetData = super.getData(); + sheetData.data.dtypes = ["String", "Number", "Boolean"]; + return sheetData; + } +} diff --git a/system/scripts/sheets/twenty-questions-dialog.js b/system/scripts/sheets/twenty-questions-dialog.js index 2d8b1d7..a80ed3e 100644 --- a/system/scripts/sheets/twenty-questions-dialog.js +++ b/system/scripts/sheets/twenty-questions-dialog.js @@ -41,6 +41,36 @@ export class TwentyQuestionsDialog extends FormApplication { this.datas = this._initFormDatas(actor); } + /** + * Create drag-and-drop workflow handlers for this Application + * @return An array of DragDrop handlers + */ + _createDragDropHandlers() { + return [ + new DragDrop({ + dragSelector: ".item", + dropSelector: ".items", + permissions: { dragstart: this._canDragStart.bind(this), drop: this._canDragDrop.bind(this) }, + callbacks: { dragstart: this._onDragStart.bind(this), drop: this._onDropItem.bind(this, "item") }, + }), + new DragDrop({ + dragSelector: ".technique", + dropSelector: ".techniques", + permissions: { dragstart: this._canDragStart.bind(this), drop: this._canDragDrop.bind(this) }, + callbacks: { dragstart: this._onDragStart.bind(this), drop: this._onDropItem.bind(this, "technique") }, + }), + new DragDrop({ + dragSelector: ".peculiarity", + dropSelector: ".peculiarities", + permissions: { dragstart: this._canDragStart.bind(this), drop: this._canDragDrop.bind(this) }, + callbacks: { + dragstart: this._onDragStart.bind(this), + drop: this._onDropItem.bind(this, "peculiarity"), + }, + }), + ]; + } + /** * Construct and return the data object used to render the HTML template for this form application. * @param options @@ -84,6 +114,43 @@ export class TwentyQuestionsDialog extends FormApplication { // html.find('input[name="approach"]').on("click", async (event) => {}); } + /** + * Handle dropped items + */ + _onDropItem(type, event) { + console.log("*** _onDrop event", event, type); + if (!["item", "technique", "peculiarity"].includes(type)) { + return; + } + + // Try to extract the data + // {type: "Item", id: "pC37smMSCqu3aSRM"} + let data; + try { + data = JSON.parse(event.dataTransfer.getData("text/plain")); + if (data.type !== "Item") return; + + const item = game.items.get(data.id); + + if (item.data.type !== type) { + return; + } + console.log("** OK ", item); + // sub_type === 'peculiarity' + } catch (err) { + return false; + } + + // TODO + + return false; + } + + // _canDragDrop(event) { + // console.log("*** _canDragDrop event", event); + // return false; + // } + /** * This method is called upon form submission after form data is validated * @param event The initial triggering submission event @@ -140,7 +207,7 @@ export class TwentyQuestionsDialog extends FormApplication { // actorDatas = formData.step11_calms; // actorDatas = formData.step11_passion; // actorDatas = formData.step12_worries; - // actorDatas = formData.step12_failure; + // actorDatas = formData.step12_anxiety; // actorDatas = formData.step13_most_learn; // actorDatas = formData.step13_disadvantage; // actorDatas = formData.step13_advantage; diff --git a/system/templates/sheets/twenty-questions-dialog.html b/system/templates/sheets/twenty-questions-dialog.html index 06113a9..a17af33 100644 --- a/system/templates/sheets/twenty-questions-dialog.html +++ b/system/templates/sheets/twenty-questions-dialog.html @@ -1,78 +1,88 @@
- -

{{localize 'l5r5e.twenty_questions.title'}}

- Renseignez vos réponses au jeu des vingt questions sur ce formulaire et notez-y des éléments à utiliser - ultérieurement ! -
Livre de Règles de La Légende des Cinq Anneaux, Chapitre 2 : Création de personnage, p. 41-95 + {{localize 'l5r5e.twenty_questions.intro'}} +
{{localize 'l5r5e.twenty_questions.section'}}

{{localize 'l5r5e.twenty_questions.part1.title'}}

- {{localize 'l5r5e.twenty_questions.part1.q1'}} - +
- Augmentation d'Anneau (1) - -
- -
- Augmentation de compétence (1) - + + {{#each elementsList as |obj|}} {{/each}} - - {{/each}} - + +
+
+ +
+
- {{localize 'l5r5e.twenty_questions.part1.q2'}} - +
- Augmentation d'Anneau (1) - -
-
- Augmentation de compétence (2) - + + {{#each elementsList as |obj|}} {{/each}} - - {{/each}} - + + +
+
+ + {{localize 'l5r5e.twenty_questions.money'}} +
@@ -104,34 +116,48 @@ {{localize 'l5r5e.twenty_questions.part2.q3'}}
- Augmentations d'Anneau (2) + -
- Augmentations de compétence (3-5) + -
- - Types de techniques accessibles + + {{localize 'l5r5e.twenty_questions.access'}}
{{localizeTechnique 'title'}} {{#each techniquesList as |technique|}} - + {{/each}}
- Techniques de départ (2-5) - + +
+ + drop item here + + {{datas.step3_techniques}} +
+
- Capacité d'école - +
- Équipement de départ - +
- {{localize 'l5r5e.twenty_questions.part2.q4'}} - + - Augmentation d'Anneau (1) - +

{{localize 'l5r5e.twenty_questions.part3.title'}}

{{localize 'l5r5e.twenty_questions.part3.q5'}} - Choisissez un giri: - + +
{{localize 'l5r5e.twenty_questions.part3.q6'}} - Choisissez un ninjō: - + +
- {{localize 'l5r5e.twenty_questions.part3.q7'}} - +
- Augmentation de compétence (1) - + + {{#each skillsList as |skills catId|}} + + {{#each skills as |obj|}} + + {{/each}} + {{/each}} - - {{/each}} - + + - OU + {{localize 'l5r5e.twenty_questions.or'}}
- {{localize 'l5r5e.twenty_questions.part3.q8'}} - +
- Augmentation de compétence (1) - + + {{#each skillsList as |skills catId|}} + + {{#each skills as |obj|}} + + {{/each}} + {{/each}} - - {{/each}} - + + - OU + {{localize 'l5r5e.twenty_questions.or'}}
@@ -293,41 +346,135 @@

{{localize 'l5r5e.twenty_questions.part4.title'}}

- {{localize 'l5r5e.twenty_questions.part4.q9'}} - + - Aptitude (1) - + +
- {{localize 'l5r5e.twenty_questions.part4.q10'}} - + - Coup du sort (1) - + +
- {{localize 'l5r5e.twenty_questions.part4.q11'}} - + - Passion (1) - + +
- {{localize 'l5r5e.twenty_questions.part4.q12'}} - + - Défaillance (1) - + +
- {{localize 'l5r5e.twenty_questions.part4.q13'}} - +
- Augmentation de compétence (1) + + + {{localize 'l5r5e.twenty_questions.or'}} + + + +
+
+ + +
+
+ + +

{{localize 'l5r5e.twenty_questions.part5.title'}}

+
+ + + +
+
+ +
+
+ + + +
+ + +

{{localize 'l5r5e.twenty_questions.part6.title'}}

+
+ + +
-
- OU - Avantage (1) - -
- - - -

{{localize 'l5r5e.twenty_questions.part5.title'}}

-
- {{localize 'l5r5e.twenty_questions.part5.q14'}} - - - Particularités - +
- {{localize 'l5r5e.twenty_questions.part5.q15'}} - -
-
- {{localize 'l5r5e.twenty_questions.part5.q16'}} - - - - Objet (Rareté inférieur ou égale à 7) - -
- - -

{{localize 'l5r5e.twenty_questions.part6.title'}}

-
- {{localize 'l5r5e.twenty_questions.part6.q17'}} - - - Augmentation de compétence (1) - -
-
- {{localize 'l5r5e.twenty_questions.part6.q18'}} - +
- {{localize 'l5r5e.twenty_questions.part6.q19'}} - +

{{localize 'l5r5e.twenty_questions.part7.title'}}

- {{localize 'l5r5e.twenty_questions.part7.q20'}} - +
\ No newline at end of file