FVTT v11 Compatibility

- Added CONFIG.l5r5e.namespace
- Fix new labels for Types
- Fix Effects
- Fix TokenData : actorData->delta
This commit is contained in:
Vlyan
2023-06-11 09:27:49 +02:00
parent dc00657f84
commit f6e979536e
41 changed files with 459 additions and 319 deletions

3
.gitattributes vendored
View File

@@ -1,3 +1,6 @@
# Make .db files keep LF ending as Foundry rewrite in this format # Make .db files keep LF ending as Foundry rewrite in this format
*.db text eol=lf *.db text eol=lf
*.json text eol=lf *.json text eol=lf
# Foundry pack v11 as binaries
system/packs/*/** binary

3
.gitignore vendored
View File

@@ -10,3 +10,6 @@ node_modules
# Foundry Lock files # Foundry Lock files
system/l5r5e.lock system/l5r5e.lock
# v11 db files (will be added later)
system/packs/*/**

View File

@@ -1,6 +1,16 @@
# Changelog # Changelog
Date format : day/month/year Date format : day/month/year
## 1.10.0 - 11/06/2023 - FoundryVTT v11 Compatibility
__! Be certain to carefully back up any critical user data before installing this update !__
- Updated the System to FoundryVTT v11.
- GM Monitor :
- Added ability to add unlinked token to GM monitor. Drag and drop from actor's toolbar, or select tokens in scene and click on "Add selected tokens".
- Now automatically switch to the corresponding type of the dropped character (Army/Character).
- Using the new `packFolders` in system manifest.
- System compendiums are now in folders for more readability with others modules/worlds compendiums (ex: `L5R5e System` > `Techniques` > `Techniques Kata`).
- Please note this is only by default, and you are free to move or rename it after the initial loading.
## 1.9.6 - 14/05/2023 - Bragma's QoL ## 1.9.6 - 14/05/2023 - Bragma's QoL
All these changes are thanks to Bragma. All these changes are thanks to Bragma.
- Added effects panel to both pc and npc (!26). - Added effects panel to both pc and npc (!26).
@@ -24,7 +34,7 @@ All these changes are thanks to Bragma.
## 1.9.1 - 08/09/2022 - Advancements Bugfixes ## 1.9.1 - 08/09/2022 - Advancements Bugfixes
- Fix for advancements fail to add new items ("_id" readonly error. see #42). - Fix for advancements fail to add new items ("_id" readonly error. see #42).
## 1.9.0 - 01/09/2022 - Foundry v10 Compatibility ## 1.9.0 - 01/09/2022 - FoundryVTT v10 Compatibility
__! Be certain to carefully back up any critical user data before installing this update !__ __! Be certain to carefully back up any critical user data before installing this update !__
- Updated the System to FoundryVTT v10. - Updated the System to FoundryVTT v10.
- Updated the initiative behaviour, he now open the DicePicker for PC and Adversaries locally or remotely. - Updated the initiative behaviour, he now open the DicePicker for PC and Adversaries locally or remotely.

View File

@@ -1,8 +1,9 @@
# Legend of the Five Rings (5th Edition) authorized by [Edge Studio](https://edge-studio.net/) # Legend of the Five Rings (5th Edition) authorized by [Edge Studio](https://edge-studio.net/)
![Banner Legend of the Five Rings](./l5rBan.jpg) ![Banner Legend of the Five Rings](./l5rBan.jpg)
[![Buy Me a Coffee](./tags-bymecoffee.svg)](https://ko-fi.com/vlyan) [![Buy Me a Coffee](./tags-bymecoffee.svg)](https://ko-fi.com/vlyan)
[![FoundryVTT version](https://img.shields.io/badge/FVTT-v10.x-informational)](https://foundryvtt.com/) [![FoundryVTT version](https://img.shields.io/badge/FVTT-v10/v11-informational)](https://foundryvtt.com/)
[![Forge Installs](https://img.shields.io/badge/dynamic/json?label=Forge%20Installs&query=package.installs&suffix=%25&url=https%3A%2F%2Fforge-vtt.com%2Fapi%2Fbazaar%2Fpackage%2Fl5r5e&colorB=4aa94a)](https://forge-vtt.com/bazaar#package=l5r5e) [![Forge Installs](https://img.shields.io/badge/dynamic/json?label=Forge%20Installs&query=package.installs&suffix=%25&url=https%3A%2F%2Fforge-vtt.com%2Fapi%2Fbazaar%2Fpackage%2Fl5r5e&colorB=4aa94a)](https://forge-vtt.com/bazaar#package=l5r5e)
[![Foundry Hub Endorsements](https://img.shields.io/endpoint?logoColor=white&url=https%3A%2F%2Fwww.foundryvtt-hub.com%2Fwp-json%2Fhubapi%2Fv1%2Fpackage%2Fl5r5e%2Fshield%2Fendorsements)](https://www.foundryvtt-hub.com/package/l5r5e/) [![Foundry Hub Endorsements](https://img.shields.io/endpoint?logoColor=white&url=https%3A%2F%2Fwww.foundryvtt-hub.com%2Fwp-json%2Fhubapi%2Fv1%2Fpackage%2Fl5r5e%2Fshield%2Fendorsements)](https://www.foundryvtt-hub.com/package/l5r5e/)
[![Foundry Hub Comments](https://img.shields.io/endpoint?logoColor=white&url=https%3A%2F%2Fwww.foundryvtt-hub.com%2Fwp-json%2Fhubapi%2Fv1%2Fpackage%2Fl5r5e%2Fshield%2Fcomments)](https://www.foundryvtt-hub.com/package/l5r5e/) [![Foundry Hub Comments](https://img.shields.io/endpoint?logoColor=white&url=https%3A%2F%2Fwww.foundryvtt-hub.com%2Fwp-json%2Fhubapi%2Fv1%2Fpackage%2Fl5r5e%2Fshield%2Fcomments)](https://www.foundryvtt-hub.com/package/l5r5e/)

View File

@@ -19,28 +19,30 @@
"Hint": "Add 'Specificity' technique type to serve as a catch-all." "Hint": "Add 'Specificity' technique type to serve as a catch-all."
} }
}, },
"ACTOR": { "TYPES": {
"TypeCharacter": "Player Character", "Actor": {
"TypeNpc": "Non-Player Character", "character": "Player Character",
"TypeArmy": "Army" "npc": "Non-Player Character",
}, "army": "Army"
"ITEM": { },
"TypeItem": "Item", "Item": {
"TypeArmor": "Armor", "item": "Item",
"TypeWeapon": "Weapon", "armor": "Armor",
"TypeTechnique": "Technique", "weapon": "Weapon",
"TypeProperty": "Property", "technique": "Technique",
"TypePeculiarity": "Peculiarity", "property": "Property",
"TypeAdvancement": "Advancement", "peculiarity": "Peculiarity",
"TypeTitle": "Title", "advancement": "Advancement",
"TypeBond": "Bond", "title": "Title",
"TypeSignature_scroll": "Signature Scroll", "bond": "Bond",
"TypeItem_pattern": "Item Pattern", "signature_scroll": "Signature Scroll",
"TypeArmy_fortification": "Fortification", "item_pattern": "Item Pattern",
"TypeArmy_cohort": "Cohort" "army_fortification": "Fortification",
}, "army_cohort": "Cohort"
"JOURNAL": { },
"TypeJournal": "Journal" "Journal": {
"journal": "Journal"
}
}, },
"l5r5e": { "l5r5e": {
"global": { "global": {
@@ -173,6 +175,7 @@
"monitor": { "monitor": {
"title": "GM Monitor", "title": "GM Monitor",
"switch_view": "Switch View", "switch_view": "Switch View",
"add_selected_tokens": "Add selected tokens",
"honor_glory_status": "H/G/S", "honor_glory_status": "H/G/S",
"focus_vigilance": "Foc./Vig.", "focus_vigilance": "Foc./Vig.",
"mouse_control": "Right click +1, left: -1, middle: reset to 0" "mouse_control": "Right click +1, left: -1, middle: reset to 0"

View File

@@ -19,28 +19,30 @@
"Hint": "Add 'Specificity' technique type to serve as a catch-all." "Hint": "Add 'Specificity' technique type to serve as a catch-all."
} }
}, },
"ACTOR": { "TYPES": {
"TypeCharacter": "Personaje jugador", "Actor": {
"TypeNpc": "Personaje no jugador", "character": "Personaje jugador",
"TypeArmy": "Ejército" "npc": "Personaje no jugador",
}, "army": "Ejército"
"ITEM": { },
"TypeItem": "Objeto", "Item": {
"TypeArmor": "Armadura", "item": "Objeto",
"TypeWeapon": "Arma", "armor": "Armadura",
"TypeTechnique": "Técnica", "weapon": "Arma",
"TypeProperty": "Propiedad", "technique": "Técnica",
"TypePeculiarity": "Peculiaridad", "property": "Propiedad",
"TypeAdvancement": "Mejora", "peculiarity": "Peculiaridad",
"TypeTitle": "Título", "advancement": "Mejora",
"TypeBond": "Vínculo", "title": "Título",
"TypeSignature_scroll": "Pergamino especial", "bond": "Vínculo",
"TypeItem_pattern": "Patrón de objeto", "signature_scroll": "Pergamino especial",
"TypeArmy_fortification": "Fortificación", "item_pattern": "Patrón de objeto",
"TypeArmy_cohort": "Cohorte" "army_fortification": "Fortificación",
}, "army_cohort": "Cohorte"
"JOURNAL": { },
"TypeJournal": "Diario" "Journal": {
"journal": "Diario"
}
}, },
"l5r5e": { "l5r5e": {
"global": { "global": {
@@ -173,6 +175,7 @@
"monitor": { "monitor": {
"title": "Pantalla del DJ", "title": "Pantalla del DJ",
"switch_view": "Cambiar vista", "switch_view": "Cambiar vista",
"add_selected_tokens": "Add selected tokens",
"honor_glory_status": "H/G/E", "honor_glory_status": "H/G/E",
"focus_vigilance": "Con./Ale.", "focus_vigilance": "Con./Ale.",
"mouse_control": "Right click +1, left: -1, middle: reset to 0" "mouse_control": "Right click +1, left: -1, middle: reset to 0"

View File

@@ -19,28 +19,30 @@
"Hint": "Ajoute un type de technique 'Particularités' pour servir de fourre-tout." "Hint": "Ajoute un type de technique 'Particularités' pour servir de fourre-tout."
} }
}, },
"ACTOR": { "TYPES": {
"TypeCharacter": "Personnage Joueur", "Actor": {
"TypeNpc": "Personnage non Joueur", "character": "Personnage Joueur",
"TypeArmy": "Armée" "npc": "Personnage non Joueur",
}, "army": "Armée"
"ITEM": { },
"TypeItem": "Objet", "Item": {
"TypeArmor": "Armure", "item": "Objet",
"TypeWeapon": "Arme", "armor": "Armure",
"TypeTechnique": "Technique", "weapon": "Arme",
"TypeProperty": "Propriété", "technique": "Technique",
"TypePeculiarity": "Particularité", "property": "Propriété",
"TypeAdvancement": "Progression", "peculiarity": "Particularité",
"TypeTitle": "Titre", "advancement": "Progression",
"TypeBond": "Lien", "title": "Titre",
"TypeSignature_scroll": "Rouleau de marque", "bond": "Lien",
"TypeItem_pattern": "Procédé de fabrication", "signature_scroll": "Rouleau de marque",
"TypeArmy_fortification": "Fortification", "item_pattern": "Procédé de fabrication",
"TypeArmy_cohort": "Régiment" "army_fortification": "Fortification",
}, "army_cohort": "Régiment"
"JOURNAL": { },
"TypeJournal": "Journal" "Journal": {
"journal": "Journal"
}
}, },
"l5r5e": { "l5r5e": {
"global": { "global": {
@@ -95,7 +97,7 @@
"void": "Vide" "void": "Vide"
}, },
"sheets": { "sheets": {
"narrative": "Mode Narratif", "narrative": "Narratif",
"experience": "Expérience", "experience": "Expérience",
"family": "Famille", "family": "Famille",
"region": "Région", "region": "Région",
@@ -173,6 +175,7 @@
"monitor": { "monitor": {
"title": "GM Monitor", "title": "GM Monitor",
"switch_view": "Switch View", "switch_view": "Switch View",
"add_selected_tokens": "Ajouter les tokens sélectionnés",
"honor_glory_status": "H/G/S", "honor_glory_status": "H/G/S",
"focus_vigilance": "Att./Vig.", "focus_vigilance": "Att./Vig.",
"mouse_control": "Click Droit +1, Gauche: -1, Milieu: Remise à 0" "mouse_control": "Click Droit +1, Gauche: -1, Milieu: Remise à 0"

View File

@@ -19,28 +19,30 @@
"Hint": "Aggiunge il tipo 'Speciale' come termine generale." "Hint": "Aggiunge il tipo 'Speciale' come termine generale."
} }
}, },
"ACTOR": { "TYPES": {
"TypeCharacter": "Personaggio Giocante", "Actor": {
"TypeNpc": "Personaggio Non Giocante", "character": "Personaggio Giocante",
"TypeArmy": "Esercito" "npc": "Personaggio Non Giocante",
}, "army": "Esercito"
"ITEM": { },
"TypeItem": "Oggetto", "Item": {
"TypeArmor": "Armatura", "item": "Oggetto",
"TypeWeapon": "Arma", "armor": "Armatura",
"TypeTechnique": "Tecnica", "weapon": "Arma",
"TypeProperty": "Proprietà", "technique": "Tecnica",
"TypePeculiarity": "Peculiarità", "property": "Proprietà",
"TypeAdvancement": "Avanzamento", "peculiarity": "Peculiarità",
"TypeTitle": "Titolo", "advancement": "Avanzamento",
"TypeBond": "Legame", "title": "Titolo",
"TypeSignature_scroll": "Signature Scroll", "bond": "Legame",
"TypeItem_pattern": "Item Pattern", "signature_scroll": "Signature Scroll",
"TypeArmy_fortification": "Fortezza", "item_pattern": "Item Pattern",
"TypeArmy_cohort": "Coorte" "army_fortification": "Fortezza",
}, "army_cohort": "Coorte"
"JOURNAL": { },
"TypeJournal": "Diario" "Journal": {
"journal": "Diario"
}
}, },
"l5r5e": { "l5r5e": {
"global": { "global": {
@@ -173,6 +175,7 @@
"monitor": { "monitor": {
"title": "Schermo del GM", "title": "Schermo del GM",
"switch_view": "Cambia vista", "switch_view": "Cambia vista",
"add_selected_tokens": "Add selected tokens",
"honor_glory_status": "O/G/S", "honor_glory_status": "O/G/S",
"focus_vigilance": "Foc./Vig.", "focus_vigilance": "Foc./Vig.",
"mouse_control": "Click destro +1, sinistro: -1, centrale: resetta a 0" "mouse_control": "Click destro +1, sinistro: -1, centrale: resetta a 0"

View File

@@ -5,5 +5,5 @@
{"_id":"dz61B4h3iJwOC0Ob","name":"Draw 5 Ujik names","type":"script","author":"Rv52pj6itbOX14wX","img":"systems/l5r5e/assets/icons/actors/character.svg","scope":"global","command":"game.l5r5e.HelpersL5r5e.drawManyFromPack(\"l5r5e.core-name-tables\", \"d9lU98NE8G2YuN48\", 5);","folder":null,"sort":0,"permission":{"default":0},"flags":{}} {"_id":"dz61B4h3iJwOC0Ob","name":"Draw 5 Ujik names","type":"script","author":"Rv52pj6itbOX14wX","img":"systems/l5r5e/assets/icons/actors/character.svg","scope":"global","command":"game.l5r5e.HelpersL5r5e.drawManyFromPack(\"l5r5e.core-name-tables\", \"d9lU98NE8G2YuN48\", 5);","folder":null,"sort":0,"permission":{"default":0},"flags":{}}
{"_id":"ed0HRLOWSKm6YTUS","name":"Draw 5 Japanese names (male)","type":"script","author":"Rv52pj6itbOX14wX","img":"systems/l5r5e/assets/icons/actors/traditional-japanese-man.svg","scope":"global","command":"game.l5r5e.HelpersL5r5e.drawManyFromPack(\"l5r5e.core-name-tables\", \"L5RCoreTblJpNamM\", 5);","folder":null,"sort":0,"permission":{"default":0},"flags":{}} {"_id":"ed0HRLOWSKm6YTUS","name":"Draw 5 Japanese names (male)","type":"script","author":"Rv52pj6itbOX14wX","img":"systems/l5r5e/assets/icons/actors/traditional-japanese-man.svg","scope":"global","command":"game.l5r5e.HelpersL5r5e.drawManyFromPack(\"l5r5e.core-name-tables\", \"L5RCoreTblJpNamM\", 5);","folder":null,"sort":0,"permission":{"default":0},"flags":{}}
{"_id":"fk2naBrDnz8ZAVHR","name":"Draw 5 Japanese names (female)","type":"script","author":"Rv52pj6itbOX14wX","img":"systems/l5r5e/assets/icons/actors/traditional-japanese-woman.svg","scope":"global","command":"game.l5r5e.HelpersL5r5e.drawManyFromPack(\"l5r5e.core-name-tables\", \"L5RCoreTblJpNamF\", 5);","folder":null,"sort":0,"permission":{"default":0},"flags":{}} {"_id":"fk2naBrDnz8ZAVHR","name":"Draw 5 Japanese names (female)","type":"script","author":"Rv52pj6itbOX14wX","img":"systems/l5r5e/assets/icons/actors/traditional-japanese-woman.svg","scope":"global","command":"game.l5r5e.HelpersL5r5e.drawManyFromPack(\"l5r5e.core-name-tables\", \"L5RCoreTblJpNamF\", 5);","folder":null,"sort":0,"permission":{"default":0},"flags":{}}
{"_id":"ggs1eiqkfVWlm5JM","name":"Draw Names Dialog","type":"script","author":"Rv52pj6itbOX14wX","img":"systems/l5r5e/assets/icons/actors/army.svg","scope":"global","command":"const pack = \"l5r5e.core-name-tables\";\nconst comp = await game.packs.get(pack);\nif (!comp) { console.log(`L5R5E | Pack not found[${pack}]`); return; }\nawait comp.getDocuments();\n\nlet radioTablesHtml = \"\";\ncomp.index.forEach(obj => { radioTablesHtml += `<label><input type=\"radio\" id=\"${obj._id}\" name=\"tableName\" value=\"${obj.name}\" ${radioTablesHtml === \"\" ? 'checked' : ''}> ${obj.name}</label>`; });\n\nnew Dialog({\n title: \"L5R5E Draw Names\",\n content: `\n <form class=\"noflex\" autocomplete=\"off\">\n <div class=\"form-group\">\n <label>${game.i18n.localize('DOCUMENT.RollTable')}:</label>\n <div class=\"form-fields\" style=\"flex-direction: column;align-items: flex-start\">\n ${radioTablesHtml}\n </div>\n </div>\n <hr>\n <div class=\"form-group\">\n <label><i class=\"d6\"></i> ${game.i18n.localize('l5r5e.sheets.quantity')}:</label>\n <div class=\"form-fields\">\n <input type=\"number\" name=\"drawNumber\" value=\"5\" min=\"0\" max=\"99\"/>\n </div>\n </div>\n </form>\n `,\n buttons: {\n no: {\n icon: \"<i class='fas fa-times'></i>\",\n label: game.i18n.localize('Cancel')\n },\n yes: {\n icon: \"<i class='fas fa-check'></i>\",\n label: game.i18n.localize('TABLE.Roll'),\n callback: (html) => {\n const tableName = html.find('input[name=\"tableName\"]:checked')[0]?.value || null;\n const drawNumber = html.find('input[name=\"drawNumber\"]')[0]?.value || null;\n if (!tableName || !drawNumber || drawNumber < 1) {return;}\n game.l5r5e.HelpersL5r5e.drawManyFromPack(pack, tableName, drawNumber);\n }\n },\n },\n default: \"no\"\n}).render(true);","folder":null,"sort":0,"permission":{"default":0},"flags":{}} {"_id":"ggs1eiqkfVWlm5JM","name":"Draw Names Dialog","type":"script","author":"Rv52pj6itbOX14wX","img":"systems/l5r5e/assets/icons/actors/army.svg","scope":"global","command":"const pack = \"l5r5e.core-name-tables\";\nconst comp = await game.packs.get(pack);\nif (!comp) { console.log(`L5R5E | Macro | Pack not found[${pack}]`); return; }\nawait comp.getDocuments();\n\nlet radioTablesHtml = \"\";\ncomp.index.forEach(obj => { radioTablesHtml += `<label><input type=\"radio\" id=\"${obj._id}\" name=\"tableName\" value=\"${obj.name}\" ${radioTablesHtml === \"\" ? 'checked' : ''}> ${obj.name}</label>`; });\n\nnew Dialog({\n title: \"L5R5E Draw Names\",\n content: `\n <form class=\"noflex\" autocomplete=\"off\">\n <div class=\"form-group\">\n <label>${game.i18n.localize('DOCUMENT.RollTable')}:</label>\n <div class=\"form-fields\" style=\"flex-direction: column;align-items: flex-start\">\n ${radioTablesHtml}\n </div>\n </div>\n <hr>\n <div class=\"form-group\">\n <label><i class=\"d6\"></i> ${game.i18n.localize('l5r5e.sheets.quantity')}:</label>\n <div class=\"form-fields\">\n <input type=\"number\" name=\"drawNumber\" value=\"5\" min=\"0\" max=\"99\"/>\n </div>\n </div>\n </form>\n `,\n buttons: {\n no: {\n icon: \"<i class='fas fa-times'></i>\",\n label: game.i18n.localize('Cancel')\n },\n yes: {\n icon: \"<i class='fas fa-check'></i>\",\n label: game.i18n.localize('TABLE.Roll'),\n callback: (html) => {\n const tableName = html.find('input[name=\"tableName\"]:checked')[0]?.value || null;\n const drawNumber = html.find('input[name=\"drawNumber\"]')[0]?.value || null;\n if (!tableName || !drawNumber || drawNumber < 1) {return;}\n game.l5r5e.HelpersL5r5e.drawManyFromPack(pack, tableName, drawNumber);\n }\n },\n },\n default: \"no\"\n}).render(true);","folder":null,"sort":0,"permission":{"default":0},"flags":{}}
{"_id":"hpfDGUS48dA2pkUB","name":"Open Character Sheet (linked actor)","type":"script","author":"Rv52pj6itbOX14wX","img":"systems/l5r5e/assets/icons/actors/character.svg","scope":"global","command":"game.user.character?.sheet.render(true);","folder":null,"sort":0,"permission":{"default":0},"flags":{}} {"_id":"hpfDGUS48dA2pkUB","name":"Open Character Sheet (linked actor)","type":"script","author":"Rv52pj6itbOX14wX","img":"systems/l5r5e/assets/icons/actors/character.svg","scope":"global","command":"game.user.character?.sheet.render(true);","folder":null,"sort":0,"permission":{"default":0},"flags":{}}

View File

@@ -120,7 +120,7 @@ export class ActorL5r5e extends Actor {
// Now using updateDocuments // Now using updateDocuments
return Actor.updateDocuments([docData], context).then(() => { return Actor.updateDocuments([docData], context).then(() => {
// Notify the "Gm Monitor" if this actor is watched // Notify the "Gm Monitor" if this actor is watched
if (game.settings.get("l5r5e", "gm-monitor-actors").find((e) => e === this.id)) { if (game.settings.get(CONFIG.l5r5e.namespace, "gm-monitor-actors").some((uuid) => uuid === this.uuid)) {
game.l5r5e.HelpersL5r5e.refreshLocalAndSocket("l5r5e-gm-monitor"); game.l5r5e.HelpersL5r5e.refreshLocalAndSocket("l5r5e-gm-monitor");
} }
}); });
@@ -337,9 +337,9 @@ export class ActorL5r5e extends Actor {
} }
const cfg = { const cfg = {
character: game.settings.get("l5r5e", "initiative-prepared-character"), character: game.settings.get(CONFIG.l5r5e.namespace, "initiative-prepared-character"),
adversary: game.settings.get("l5r5e", "initiative-prepared-adversary"), adversary: game.settings.get(CONFIG.l5r5e.namespace, "initiative-prepared-adversary"),
minion: game.settings.get("l5r5e", "initiative-prepared-minion"), minion: game.settings.get(CONFIG.l5r5e.namespace, "initiative-prepared-minion"),
}; };
// Prepared is a boolean or if null we get the info in the actor // Prepared is a boolean or if null we get the info in the actor

View File

@@ -161,7 +161,7 @@ export class ArmySheetL5r5e extends BaseSheetL5r5e {
if (!item || item.documentName !== "Item" || !["army_cohort", "army_fortification"].includes(item.type)) { if (!item || item.documentName !== "Item" || !["army_cohort", "army_fortification"].includes(item.type)) {
// actor dual trigger... // actor dual trigger...
if (item?.documentName !== "Actor") { if (item?.documentName !== "Actor") {
console.warn("L5R5E | Characters items are not allowed", item?.type, item); console.warn("L5R5E | AS | Characters items are not allowed", item?.type, item);
} }
return; return;
} }
@@ -221,7 +221,7 @@ export class ArmySheetL5r5e extends BaseSheetL5r5e {
*/ */
async _updateLinkedActorData(type, actor, isInit = false) { async _updateLinkedActorData(type, actor, isInit = false) {
if (!actor || actor.documentName !== "Actor" || !actor.isCharacterType) { if (!actor || actor.documentName !== "Actor" || !actor.isCharacterType) {
console.warn("L5R5E | Wrong actor type", actor?.type, actor); console.warn("L5R5E | AS | Wrong actor type", actor?.type, actor);
return; return;
} }
@@ -252,7 +252,7 @@ export class ArmySheetL5r5e extends BaseSheetL5r5e {
break; break;
default: default:
console.warn("L5R5E | Unknown type", type); console.warn("L5R5E | AS | Unknown type", type);
return; return;
} }
return this.actor.update(actorData); return this.actor.update(actorData);
@@ -276,7 +276,7 @@ export class ArmySheetL5r5e extends BaseSheetL5r5e {
break; break;
default: default:
console.warn("L5R5E | Unknown type", type); console.warn("L5R5E | AS | Unknown type", type);
return; return;
} }
return this.actor.update({ system: actorData }); return this.actor.update({ system: actorData });
@@ -323,7 +323,7 @@ export class ArmySheetL5r5e extends BaseSheetL5r5e {
break; break;
default: default:
console.warn("L5R5E | Unsupported type", type); console.warn("L5R5E | AS | Unsupported type", type);
break; break;
} }
} }

View File

@@ -49,7 +49,7 @@ export class BaseCharacterSheetL5r5e extends BaseSheetL5r5e {
// Build the list order // Build the list order
Array.from(CONFIG.l5r5e.techniques) Array.from(CONFIG.l5r5e.techniques)
.filter(([id, cfg]) => cfg.type !== "custom" || game.settings.get("l5r5e", "techniques-customs")) .filter(([id, cfg]) => cfg.type !== "custom" || game.settings.get(CONFIG.l5r5e.namespace, "techniques-customs"))
.forEach(([id, cfg]) => { .forEach(([id, cfg]) => {
out[id] = []; out[id] = [];
}); });
@@ -60,7 +60,7 @@ export class BaseCharacterSheetL5r5e extends BaseSheetL5r5e {
case "technique": case "technique":
if (!out[item.system.technique_type]) { if (!out[item.system.technique_type]) {
console.warn( console.warn(
`L5R5E | Empty or unknown technique type[${item.system.technique_type}] forced to "kata" in item id[${item._id}], name[${item.name}]` `L5R5E | BCS | Empty or unknown technique type[${item.system.technique_type}] forced to "kata" in item id[${item._id}], name[${item.name}]`
); );
item.system.technique_type = "kata"; item.system.technique_type = "kata";
} }
@@ -73,7 +73,7 @@ export class BaseCharacterSheetL5r5e extends BaseSheetL5r5e {
if (embedItem.type === "technique") { if (embedItem.type === "technique") {
if (!out[embedItem.system.technique_type]) { if (!out[embedItem.system.technique_type]) {
console.warn( console.warn(
`L5R5E | Empty or unknown technique type[${embedItem.system.technique_type}] forced to "kata" in item id[${id}], name[${embedItem.name}], parent: id[${item._id}], name[${item.name}]` `L5R5E | BCS | Empty or unknown technique type[${embedItem.system.technique_type}] forced to "kata" in item id[${id}], name[${embedItem.name}], parent: id[${item._id}], name[${item.name}]`
); );
embedItem.system.technique_type = "kata"; embedItem.system.technique_type = "kata";
} }
@@ -135,14 +135,14 @@ export class BaseCharacterSheetL5r5e extends BaseSheetL5r5e {
async _onDrop(event) { async _onDrop(event) {
// *** Everything below here is only needed if the sheet is editable *** // *** Everything below here is only needed if the sheet is editable ***
if (!this.isEditable || this.actor.system.soft_locked) { if (!this.isEditable || this.actor.system.soft_locked) {
console.log("L5R5E | This sheet is not editable"); console.log("L5R5E | BCS | This sheet is not editable");
return; return;
} }
// Check item type and subtype // Check item type and subtype
const item = await game.l5r5e.HelpersL5r5e.getDragnDropTargetObject(event); const item = await game.l5r5e.HelpersL5r5e.getDragnDropTargetObject(event);
if (!item || !["Item", "JournalEntry"].includes(item.documentName) || item.type === "property") { if (!item || !["Item", "JournalEntry"].includes(item.documentName) || item.type === "property") {
console.log(`L5R5E | Wrong subtype ${item?.type}`, item); console.log(`L5R5E | BCS | Wrong subtype ${item?.type}`, item);
return; return;
} }
@@ -150,7 +150,7 @@ export class BaseCharacterSheetL5r5e extends BaseSheetL5r5e {
if (item.documentName === "JournalEntry") { if (item.documentName === "JournalEntry") {
// npc does not have this // npc does not have this
if (!this.actor.system.identity?.school_curriculum_journal) { if (!this.actor.system.identity?.school_curriculum_journal) {
console.log("L5R5E | NPC won't go to school :'("); console.log("L5R5E | BCS | NPC won't go to school :'(");
return; return;
} }
this.actor.system.identity.school_curriculum_journal = { this.actor.system.identity.school_curriculum_journal = {
@@ -180,7 +180,7 @@ export class BaseCharacterSheetL5r5e extends BaseSheetL5r5e {
return embedItem._id === item._id; return embedItem._id === item._id;
}) })
) { ) {
console.log("L5R5E | This element has been ignored because it already exists in this actor", item.uuid); console.log("L5R5E | BCS | This element has been ignored because it already exists in this actor", item.uuid);
return; return;
} }
@@ -207,7 +207,7 @@ export class BaseCharacterSheetL5r5e extends BaseSheetL5r5e {
switch (itemData.type) { switch (itemData.type) {
case "army_cohort": case "army_cohort":
case "army_fortification": case "army_fortification":
console.warn("L5R5E | Army items are not allowed", item?.type, item); console.warn("L5R5E | BCS | Army items are not allowed", item?.type, item);
return; return;
case "advancement": case "advancement":
@@ -354,7 +354,7 @@ export class BaseCharacterSheetL5r5e extends BaseSheetL5r5e {
const created = await this.actor.createEmbeddedDocuments("Item", [ const created = await this.actor.createEmbeddedDocuments("Item", [
{ {
name: game.i18n.localize(`ITEM.Type${type.capitalize()}`), name: game.i18n.localize(`TYPES.Item.${type.toLowerCase()}`),
type: type, type: type,
img: `${CONFIG.l5r5e.paths.assets}icons/items/${type}.svg`, img: `${CONFIG.l5r5e.paths.assets}icons/items/${type}.svg`,
}, },
@@ -556,7 +556,7 @@ export class BaseCharacterSheetL5r5e extends BaseSheetL5r5e {
break; break;
default: default:
console.warn("L5R5E | Unsupported type", type); console.warn("L5R5E | BCS | Unsupported type", type);
break; break;
} }
} }

View File

@@ -182,7 +182,7 @@ export class BaseSheetL5r5e extends ActorSheet {
const created = await this.actor.createEmbeddedDocuments("Item", [ const created = await this.actor.createEmbeddedDocuments("Item", [
{ {
name: game.i18n.localize(`ITEM.Type${type.capitalize()}`), name: game.i18n.localize(`TYPES.Item.${type.toLowerCase()}`),
type: type, type: type,
img: `${CONFIG.l5r5e.paths.assets}icons/items/${type}.svg`, img: `${CONFIG.l5r5e.paths.assets}icons/items/${type}.svg`,
}, },

View File

@@ -90,7 +90,7 @@ export class CharacterGenerator {
static async _getItemFromPack(packName, id = null) { static async _getItemFromPack(packName, id = null) {
const comp = await game.packs.get(packName); const comp = await game.packs.get(packName);
if (!comp) { if (!comp) {
console.log(`L5R5E | Pack not found[${packName}]`); console.log(`L5R5E | CG | Pack not found[${packName}]`);
return; return;
} }
let document; let document;

View File

@@ -104,19 +104,19 @@ export class TwentyQuestionsDialog extends FormApplication {
new DragDrop({ new DragDrop({
dragSelector: ".item", dragSelector: ".item",
dropSelector: ".items", dropSelector: ".items",
permissions: { dragstart: this._canDragStart.bind(this), drop: this._canDragDrop.bind(this) }, permissions: { dragstart: this.isEditable, drop: this.isEditable },
callbacks: { dragstart: this._onDragStart.bind(this), drop: this._onDropItem.bind(this, "item") }, callbacks: { dragstart: this._onDragStart.bind(this), drop: this._onDropItem.bind(this, "item") },
}), }),
new DragDrop({ new DragDrop({
dragSelector: ".technique", dragSelector: ".technique",
dropSelector: ".techniques", dropSelector: ".techniques",
permissions: { dragstart: this._canDragStart.bind(this), drop: this._canDragDrop.bind(this) }, permissions: { dragstart: this.isEditable, drop: this.isEditable },
callbacks: { dragstart: this._onDragStart.bind(this), drop: this._onDropItem.bind(this, "technique") }, callbacks: { dragstart: this._onDragStart.bind(this), drop: this._onDropItem.bind(this, "technique") },
}), }),
new DragDrop({ new DragDrop({
dragSelector: ".peculiarity", dragSelector: ".peculiarity",
dropSelector: ".peculiarities", dropSelector: ".peculiarities",
permissions: { dragstart: this._canDragStart.bind(this), drop: this._canDragDrop.bind(this) }, permissions: { dragstart: this.isEditable, drop: this.isEditable },
callbacks: { callbacks: {
dragstart: this._onDragStart.bind(this), dragstart: this._onDragStart.bind(this),
drop: this._onDropItem.bind(this, "peculiarity"), drop: this._onDropItem.bind(this, "peculiarity"),
@@ -125,7 +125,7 @@ export class TwentyQuestionsDialog extends FormApplication {
new DragDrop({ new DragDrop({
dragSelector: ".bond", dragSelector: ".bond",
dropSelector: ".bonds", dropSelector: ".bonds",
permissions: { dragstart: this._canDragStart.bind(this), drop: this._canDragDrop.bind(this) }, permissions: { dragstart: this.isEditable, drop: this.isEditable },
callbacks: { callbacks: {
dragstart: this._onDragStart.bind(this), dragstart: this._onDragStart.bind(this),
drop: this._onDropItem.bind(this, "bond"), drop: this._onDropItem.bind(this, "bond"),
@@ -253,14 +253,14 @@ export class TwentyQuestionsDialog extends FormApplication {
} }
const stepKey = $(event.target).data("step"); const stepKey = $(event.target).data("step");
if (!stepKey) { if (!stepKey) {
console.warn("L5R5E | Event stepKey is undefined"); console.warn("L5R5E | 20Q | Event stepKey is undefined");
return; return;
} }
try { try {
// Get item // Get item
const item = await game.l5r5e.HelpersL5r5e.getDragnDropTargetObject(event); const item = await game.l5r5e.HelpersL5r5e.getDragnDropTargetObject(event);
if (item.documentName !== "Item" || !item) { if (item.documentName !== "Item" || !item) {
console.warn(`L5R5E | Forbidden item for this drop zone ${type} : ${item.type}`); console.warn(`L5R5E | 20Q | Forbidden item for this drop zone ${type} : ${item.type}`);
return; return;
} }
@@ -273,7 +273,7 @@ export class TwentyQuestionsDialog extends FormApplication {
(type !== "item" && item.type !== type) || (type !== "item" && item.type !== type) ||
(type === "item" && !["item", "weapon", "armor"].includes(item.type)) (type === "item" && !["item", "weapon", "armor"].includes(item.type))
) { ) {
console.warn(`L5R5E | Forbidden item for this drop zone ${type} : ${item.type}`); console.warn(`L5R5E | 20Q | Forbidden item for this drop zone ${type} : ${item.type}`);
return; return;
} }
@@ -286,7 +286,7 @@ export class TwentyQuestionsDialog extends FormApplication {
if (stepKey === "step3.school_ability") { if (stepKey === "step3.school_ability") {
if (item.system.technique_type !== "school_ability") { if (item.system.technique_type !== "school_ability") {
console.warn( console.warn(
`L5R5E | This technique is not a school ability : ${item.system.technique_type}` `L5R5E | 20Q | This technique is not a school ability : ${item.system.technique_type}`
); );
return; return;
} }
@@ -301,37 +301,37 @@ export class TwentyQuestionsDialog extends FormApplication {
switch (stepKey) { switch (stepKey) {
case "step9.distinction": case "step9.distinction":
if (item.system.peculiarity_type !== "distinction") { if (item.system.peculiarity_type !== "distinction") {
console.warn("L5R5E | Wrong type", item.system.peculiarity_type); console.warn(`L5R5E | 20Q | Wrong type given "${item.system.peculiarity_type}" instead of "distinction"`);
return; return;
} }
break; break;
case "step10.adversity": case "step10.adversity":
if (item.system.peculiarity_type !== "adversity") { if (item.system.peculiarity_type !== "adversity") {
console.warn("L5R5E | Wrong type", item.system.peculiarity_type); console.warn(`L5R5E | 20Q | Wrong type given "${item.system.peculiarity_type}" instead of "adversity"`);
return; return;
} }
break; break;
case "step11.passion": case "step11.passion":
if (item.system.peculiarity_type !== "passion") { if (item.system.peculiarity_type !== "passion") {
console.warn("L5R5E | Wrong type", item.system.peculiarity_type); console.warn(`L5R5E | 20Q | Wrong type given "${item.system.peculiarity_type}" instead of "passion"`);
return; return;
} }
break; break;
case "step12.anxiety": case "step12.anxiety":
if (item.system.peculiarity_type !== "anxiety") { if (item.system.peculiarity_type !== "anxiety") {
console.warn("L5R5E | Wrong type", item.system.peculiarity_type); console.warn(`L5R5E | 20Q | Wrong type given "${item.system.peculiarity_type}" instead of "anxiety"`);
return; return;
} }
break; break;
case "step13.advantage": case "step13.advantage":
if (!["distinction", "passion"].includes(item.system.peculiarity_type)) { if (!["distinction", "passion"].includes(item.system.peculiarity_type)) {
console.warn("L5R5E | Wrong type", item.system.peculiarity_type); console.warn(`L5R5E | 20Q | Wrong type given "${item.system.peculiarity_type}" instead of "distinction" or "passion"`);
return; return;
} }
break; break;
case "step13.disadvantage": case "step13.disadvantage":
if (!["adversity", "anxiety"].includes(item.system.peculiarity_type)) { if (!["adversity", "anxiety"].includes(item.system.peculiarity_type)) {
console.warn("L5R5E | Wrong type", item.system.peculiarity_type); console.warn(`L5R5E | 20Q | Wrong type given "${item.system.peculiarity_type}" instead of "adversity" or "anxiety"`);
return; return;
} }
break; break;
@@ -344,7 +344,7 @@ export class TwentyQuestionsDialog extends FormApplication {
this.submit(); this.submit();
} catch (err) { } catch (err) {
console.warn("L5R5E | ", err); console.warn("L5R5E | 20Q | ", err);
} }
return false; return false;
} }
@@ -430,7 +430,7 @@ export class TwentyQuestionsDialog extends FormApplication {
} }
const item = await game.l5r5e.HelpersL5r5e.getObjectGameOrPack({ id: id, type: "Item" }); const item = await game.l5r5e.HelpersL5r5e.getObjectGameOrPack({ id: id, type: "Item" });
if (!item) { if (!item) {
console.warn(`L5R5E | Unknown item id[${id}]`); console.warn(`L5R5E | 20Q | Unknown item id[${id}]`);
continue; continue;
} }
newStep.push(id); newStep.push(id);

View File

@@ -24,14 +24,14 @@ export class CombatL5r5e extends Combat {
// Get global modifiers // Get global modifiers
const cfg = { const cfg = {
difficulty: game.settings.get("l5r5e", "initiative-difficulty-value"), difficulty: game.settings.get(CONFIG.l5r5e.namespace, "initiative-difficulty-value"),
difficultyHidden: game.settings.get("l5r5e", "initiative-difficulty-hidden"), difficultyHidden: game.settings.get(CONFIG.l5r5e.namespace, "initiative-difficulty-hidden"),
}; };
// SkillId from DicePicker or global // SkillId from DicePicker or global
const skillId = messageOptions.skillId const skillId = messageOptions.skillId
? messageOptions.skillId ? messageOptions.skillId
: CONFIG.l5r5e.initiativeSkills[game.settings.get("l5r5e", "initiative-encounter")]; : CONFIG.l5r5e.initiativeSkills[game.settings.get(CONFIG.l5r5e.namespace, "initiative-encounter")];
const skillCat = CONFIG.l5r5e.skills.get(skillId); const skillCat = CONFIG.l5r5e.skills.get(skillId);
// Get score for each combatant // Get score for each combatant

View File

@@ -1,7 +1,8 @@
export const L5R5E = { export const L5R5E = {
namespace: "l5r5e",
paths: { paths: {
assets: `systems/l5r5e/assets/`, assets: "systems/l5r5e/assets/",
templates: `systems/l5r5e/templates/`, templates: "systems/l5r5e/templates/",
}, },
money: [50, 10], money: [50, 10],
stances: ["earth", "air", "water", "fire", "void"], stances: ["earth", "air", "water", "fire", "void"],

View File

@@ -176,7 +176,7 @@ export class DicePickerDialog extends FormApplication {
// Difficulty // Difficulty
if (!options.difficulty || !this.parseDifficulty(options.difficulty)) { if (!options.difficulty || !this.parseDifficulty(options.difficulty)) {
this.difficulty = game.settings.get("l5r5e", "initiative-difficulty-value"); this.difficulty = game.settings.get(CONFIG.l5r5e.namespace, "initiative-difficulty-value");
} }
// DifficultyHidden // DifficultyHidden
@@ -201,7 +201,7 @@ export class DicePickerDialog extends FormApplication {
*/ */
async refresh() { async refresh() {
if (this._difficultyHiddenIsLock.option) { if (this._difficultyHiddenIsLock.option) {
this.difficulty = game.settings.get("l5r5e", "initiative-difficulty-value"); this.difficulty = game.settings.get(CONFIG.l5r5e.namespace, "initiative-difficulty-value");
this.difficultyHidden = false; this.difficultyHidden = false;
} }
this.render(false); this.render(false);
@@ -246,11 +246,8 @@ export class DicePickerDialog extends FormApplication {
if (!targetToken) { if (!targetToken) {
return; return;
} }
if (!(targetToken instanceof TokenDocument) || !targetToken.isOwner) { if (!(targetToken instanceof TokenDocument)) {
console.warn( console.warn("L5R5E | DP | target rejected : Not a valid TokenDocument instance", targetToken);
"L5R5E | DP | target rejected : Not a valid TokenDocument instance or permission was denied",
targetToken
);
return; return;
} }
this._target = targetToken; this._target = targetToken;
@@ -363,7 +360,7 @@ export class DicePickerDialog extends FormApplication {
*/ */
set difficultyHidden(isHidden) { set difficultyHidden(isHidden) {
// If GM hide, then player choice don't matter // If GM hide, then player choice don't matter
this._difficultyHiddenIsLock.gm = game.settings.get("l5r5e", "initiative-difficulty-hidden"); this._difficultyHiddenIsLock.gm = game.settings.get(CONFIG.l5r5e.namespace, "initiative-difficulty-hidden");
if (this._difficultyHiddenIsLock.gm || this._difficultyHiddenIsLock.option) { if (this._difficultyHiddenIsLock.gm || this._difficultyHiddenIsLock.option) {
isHidden = true; isHidden = true;
} }

View File

@@ -196,21 +196,12 @@ export class RollnKeepDialog extends FormApplication {
new DragDrop({ new DragDrop({
dragSelector: ".dice.draggable", dragSelector: ".dice.draggable",
dropSelector: ".dropbox", dropSelector: ".dropbox",
permissions: { dragstart: this._canDragStart.bind(this), drop: this._canDragDrop.bind(this) }, permissions: { dragstart: this.isEditable, drop: this.isEditable },
callbacks: { dragstart: this._onDragStart.bind(this), drop: this._onDropItem.bind(this) }, callbacks: { dragstart: this._onDragStart.bind(this), drop: this._onDropItem.bind(this) },
}), }),
]; ];
} }
/**
* Define whether a user is able to begin a dragstart workflow for a given drag selector
* @param selector The candidate HTML selector for dragging
* @return Can the current user drag this selector?
*/
_canDragStart(selector) {
return this.options.editable;
}
/** /**
* Callback actions which occur at the beginning of a drag start workflow. * Callback actions which occur at the beginning of a drag start workflow.
* @param {DragEvent} event The originating DragEvent * @param {DragEvent} event The originating DragEvent
@@ -683,7 +674,7 @@ export class RollnKeepDialog extends FormApplication {
} }
// Delete old chat message related to this series // Delete old chat message related to this series
if (game.settings.get("l5r5e", "rnk-deleteOldMessage")) { if (game.settings.get(CONFIG.l5r5e.namespace, "rnk-deleteOldMessage")) {
if (game.user.isFirstGM) { if (game.user.isFirstGM) {
const message = game.messages.get(msgOldId); const message = game.messages.get(msgOldId);
if (message) { if (message) {

View File

@@ -42,7 +42,7 @@ export class GmMonitor extends FormApplication {
buttons.unshift({ buttons.unshift({
label: game.i18n.localize("l5r5e.gm.monitor.switch_view"), label: game.i18n.localize("l5r5e.gm.monitor.switch_view"),
class: "switch-view", class: "switch-view",
icon: "fas fa-users", icon: "fas fa-repeat",
onclick: () => onclick: () =>
game.l5r5e.HelpersL5r5e.debounce( game.l5r5e.HelpersL5r5e.debounce(
"SwitchView-" + this.object.id, "SwitchView-" + this.object.id,
@@ -50,7 +50,21 @@ export class GmMonitor extends FormApplication {
this.object.view = this.object.view === "armies" ? "characters" : "armies"; this.object.view = this.object.view === "armies" ? "characters" : "armies";
this.render(false); this.render(false);
}, },
1000, 500,
true
)(),
});
// Add selected tokens
buttons.unshift({
label: game.i18n.localize("l5r5e.gm.monitor.add_selected_tokens"),
class: "add-selected-token",
icon: "fas fa-users",
onclick: () =>
game.l5r5e.HelpersL5r5e.debounce(
"AddSelectedToken-" + this.object.id,
() => this.#addSelectedTokens(),
500,
true true
)(), )(),
}); });
@@ -84,11 +98,19 @@ export class GmMonitor extends FormApplication {
*/ */
_initialize() { _initialize() {
let actors; let actors;
const ids = game.settings.get("l5r5e", "gm-monitor-actors"); const uuidList = game.settings.get(CONFIG.l5r5e.namespace, "gm-monitor-actors");
if (uuidList.length > 0) {
// Get actors from stored uuids
actors = uuidList
.map(uuid => {
const doc = fromUuidSync(uuid);
if (doc instanceof TokenDocument) {
return doc.actor;
}
return doc;
})
.filter(a => !!a); // skip null
if (ids.length > 0) {
// get actors with stored ids
actors = game.actors.filter((e) => ids.includes(e.id));
} else { } else {
// If empty add pc with owner // If empty add pc with owner
actors = game.actors.filter((actor) => actor.type === "character" && actor.hasPlayerOwnerActive); actors = game.actors.filter((actor) => actor.type === "character" && actor.hasPlayerOwnerActive);
@@ -103,6 +125,27 @@ export class GmMonitor extends FormApplication {
this.object.actors = actors; this.object.actors = actors;
} }
/**
* Add selected token on monitor if not already present
*/
#addSelectedTokens() {
if (canvas.tokens.controlled.length > 0) {
const actors2Add = canvas.tokens.controlled
.map(t => t.actor)
.filter(t => !!t && !this.object.actors.find((a) => a.uuid === t.uuid));
if (actors2Add.length < 1) {
return;
}
this.object.actors = [
...this.object.actors,
...actors2Add
];
this._saveActorsIds().then(() => this.render(false));
}
}
/** /**
* Prevent non GM to render this windows * Prevent non GM to render this windows
* @override * @override
@@ -161,11 +204,11 @@ export class GmMonitor extends FormApplication {
return $(event.currentTarget).data("text"); return $(event.currentTarget).data("text");
} }
const id = $(event.currentTarget).data("actor-id"); const uuid = $(event.currentTarget).data("actor-uuid");
if (!id) { if (!uuid) {
return; return;
} }
const actor = this.object.actors.find((e) => e.id === id); const actor = this.object.actors.find((a) => a.uuid === uuid);
if (!actor) { if (!actor) {
return; return;
} }
@@ -201,11 +244,14 @@ export class GmMonitor extends FormApplication {
return; return;
} }
const actor = game.actors.find((a) => a.uuid === data.uuid); const actor = fromUuidSync(data.uuid);
if (!actor) { if (!actor) {
return; return;
} }
// Switch view to current character type
this.object.view = actor.isArmy ? "armies" : "characters";
this.object.actors.push(actor); this.object.actors.push(actor);
return this._saveActorsIds(); return this._saveActorsIds();
@@ -218,9 +264,9 @@ export class GmMonitor extends FormApplication {
*/ */
async _saveActorsIds() { async _saveActorsIds() {
return game.settings.set( return game.settings.set(
"l5r5e", CONFIG.l5r5e.namespace,
"gm-monitor-actors", "gm-monitor-actors",
this.object.actors.map((e) => e.id) this.object.actors.map((a) => a.uuid)
); );
} }
@@ -234,12 +280,12 @@ export class GmMonitor extends FormApplication {
event.preventDefault(); event.preventDefault();
event.stopPropagation(); event.stopPropagation();
const id = $(event.currentTarget).data("actor-id"); const uuid = $(event.currentTarget).data("actor-uuid");
if (!id) { if (!uuid) {
return; return;
} }
this.object.actors = this.object.actors.filter((e) => e.id !== id); this.object.actors = this.object.actors.filter((a) => a.uuid !== uuid);
return this._saveActorsIds(); return this._saveActorsIds();
} }
@@ -256,17 +302,17 @@ export class GmMonitor extends FormApplication {
const type = $(event.currentTarget).data("type"); const type = $(event.currentTarget).data("type");
if (!type) { if (!type) {
console.warn("L5R5E | type not set", type); console.warn("L5R5E | GMM | type not set", type);
return; return;
} }
const id = $(event.currentTarget).data("actor-id"); const uuid = $(event.currentTarget).data("actor-uuid");
if (!id) { if (!uuid) {
console.warn("L5R5E | actor id not set", type); console.warn("L5R5E | GMM | actor uuid not set", type);
return; return;
} }
const actor = game.actors.get(id); const actor = fromUuidSync(uuid);
if (!actor) { if (!actor) {
console.warn("L5R5E | Actor not found", type); console.warn("L5R5E | GMM | Actor not found", type);
return; return;
} }
@@ -323,7 +369,7 @@ export class GmMonitor extends FormApplication {
break; break;
default: default:
console.warn("L5R5E | Unsupported type", type); console.warn("L5R5E | GMM | Unsupported type", type);
break; break;
} }
if (!foundry.utils.isEmpty(updateData)) { if (!foundry.utils.isEmpty(updateData)) {

View File

@@ -55,8 +55,8 @@ export class GmToolbox extends FormApplication {
*/ */
_initialize() { _initialize() {
this.object = { this.object = {
difficulty: game.settings.get("l5r5e", "initiative-difficulty-value"), difficulty: game.settings.get(CONFIG.l5r5e.namespace, "initiative-difficulty-value"),
difficultyHidden: game.settings.get("l5r5e", "initiative-difficulty-hidden"), difficultyHidden: game.settings.get(CONFIG.l5r5e.namespace, "initiative-difficulty-hidden"),
}; };
} }
@@ -128,7 +128,7 @@ export class GmToolbox extends FormApplication {
event.stopPropagation(); event.stopPropagation();
this.object.difficultyHidden = !this.object.difficultyHidden; this.object.difficultyHidden = !this.object.difficultyHidden;
game.settings game.settings
.set("l5r5e", "initiative-difficulty-hidden", this.object.difficultyHidden) .set(CONFIG.l5r5e.namespace, "initiative-difficulty-hidden", this.object.difficultyHidden)
.then(() => this.submit()); .then(() => this.submit());
}); });
@@ -150,7 +150,7 @@ export class GmToolbox extends FormApplication {
this.object.difficulty = Math.max(0, this.object.difficulty - 1); this.object.difficulty = Math.max(0, this.object.difficulty - 1);
break; break;
} }
game.settings.set("l5r5e", "initiative-difficulty-value", this.object.difficulty).then(() => this.submit()); game.settings.set(CONFIG.l5r5e.namespace, "initiative-difficulty-value", this.object.difficulty).then(() => this.submit());
}); });
// Scene End, Sleep, Void Pts // Scene End, Sleep, Void Pts

View File

@@ -195,7 +195,7 @@ export class HelpersL5r5e {
document.prepareData(); document.prepareData();
} }
} catch (err) { } catch (err) {
console.warn("L5R5E | ", err); console.warn("L5R5E | Helpers | ", err);
} }
return document; return document;
} }
@@ -227,7 +227,7 @@ export class HelpersL5r5e {
break; break;
default: default:
console.log(`L5R5E | createObjectFromCompendium - Unmanaged type ${type}`); console.log(`L5R5E | Helpers | createObjectFromCompendium - Unmanaged type ${type}`);
break; break;
} // swi } // swi
@@ -251,7 +251,7 @@ export class HelpersL5r5e {
if (gameProp) { if (gameProp) {
return { id: gameProp.id, name: gameProp.name }; return { id: gameProp.id, name: gameProp.name };
} else { } else {
console.warn(`L5R5E | Unknown property id[${property.id}]`); console.warn(`L5R5E | Helpers | Unknown property id[${property.id}]`);
} }
return property; return property;
}) })
@@ -741,14 +741,14 @@ export class HelpersL5r5e {
static async drawManyFromPack(pack, tableName, retrieve = 5, opt = { rollMode: "selfroll" }) { static async drawManyFromPack(pack, tableName, retrieve = 5, opt = { rollMode: "selfroll" }) {
const comp = await game.packs.get(pack); const comp = await game.packs.get(pack);
if (!comp) { if (!comp) {
console.log(`L5R5E | Pack not found[${pack}]`); console.log(`L5R5E | Helpers | Pack not found[${pack}]`);
return; return;
} }
await comp.getDocuments(); await comp.getDocuments();
const table = await (/^[a-zA-Z0-9]{16}$/.test(tableName) ? comp.get(tableName) : comp.getName(tableName)); const table = await (/^[a-zA-Z0-9]{16}$/.test(tableName) ? comp.get(tableName) : comp.getName(tableName));
if (!table) { if (!table) {
console.log(`L5R5E | Table not found[${tableName}]`, comp, table); console.log(`L5R5E | Helpers | Table not found[${tableName}]`, comp, table);
return; return;
} }
return await table.drawMany(retrieve, opt); return await table.drawMany(retrieve, opt);
@@ -852,7 +852,7 @@ export class HelpersL5r5e {
)}`; )}`;
choiceDiv.addEventListener("click", (clickEvent) => { choiceDiv.addEventListener("click", (clickEvent) => {
const selectedIndex = clickEvent.target.attributes["data-id"].value; const selectedIndex = clickEvent.target.attributes["data-id"]?.value;
if (!list[selectedIndex]) { if (!list[selectedIndex]) {
return; return;
} }

View File

@@ -95,14 +95,10 @@ export default class HooksL5r5e {
case "settings": case "settings":
// Add Changelog link // Add Changelog link
html.find("#game-details .system").append( html.find("#game-details .system").append(
`<p><a href="${game.system.changelog}" target="_blank">Changelog</a>` + `<span><a href="${game.system.changelog}" target="_blank">Changelog</a>`
` <a href="${game.i18n.localize( + ` <a href="${game.i18n.localize("l5r5e.settings.wiki.link")}" target="_blank">${game.i18n.localize("l5r5e.settings.wiki.title")}</a>`
"l5r5e.settings.wiki.link" + ` <a href="${game.i18n.localize("l5r5e.settings.custom-compendiums.link")}" target="_blank">${game.i18n.localize("l5r5e.settings.custom-compendiums.title")}</a>`
)}" target="_blank">${game.i18n.localize("l5r5e.settings.wiki.title")}</a>` + + `</span>`
` <a href="${game.i18n.localize(
"l5r5e.settings.custom-compendiums.link"
)}" target="_blank">${game.i18n.localize("l5r5e.settings.custom-compendiums.title")}</a>` +
`</p>`
); );
break; break;
} }
@@ -158,14 +154,14 @@ export default class HooksL5r5e {
// *** Conf *** // *** Conf ***
const encounterTypeList = Object.keys(CONFIG.l5r5e.initiativeSkills); const encounterTypeList = Object.keys(CONFIG.l5r5e.initiativeSkills);
const prepared = { const prepared = {
character: game.settings.get("l5r5e", "initiative-prepared-character"), character: game.settings.get(CONFIG.l5r5e.namespace, "initiative-prepared-character"),
adversary: game.settings.get("l5r5e", "initiative-prepared-adversary"), adversary: game.settings.get(CONFIG.l5r5e.namespace, "initiative-prepared-adversary"),
minion: game.settings.get("l5r5e", "initiative-prepared-minion"), minion: game.settings.get(CONFIG.l5r5e.namespace, "initiative-prepared-minion"),
}; };
// *** Template *** // *** Template ***
const tpl = await renderTemplate(`${CONFIG.l5r5e.paths.templates}gm/combat-tracker-bar.html`, { const tpl = await renderTemplate(`${CONFIG.l5r5e.paths.templates}gm/combat-tracker-bar.html`, {
encounterType: game.settings.get("l5r5e", "initiative-encounter"), encounterType: game.settings.get(CONFIG.l5r5e.namespace, "initiative-encounter"),
encounterTypeList, encounterTypeList,
prepared, prepared,
}); });
@@ -186,7 +182,7 @@ export default class HooksL5r5e {
if (!encounterTypeList.includes(encounter)) { if (!encounterTypeList.includes(encounter)) {
return; return;
} }
game.settings.set("l5r5e", "initiative-encounter", encounter); game.settings.set(CONFIG.l5r5e.namespace, "initiative-encounter", encounter);
}); });
html.find(".prepared-control").on("mousedown", (event) => { html.find(".prepared-control").on("mousedown", (event) => {
@@ -202,7 +198,7 @@ export default class HooksL5r5e {
true: rev ? "actor" : "false", true: rev ? "actor" : "false",
actor: rev ? "false" : "true", actor: rev ? "false" : "true",
}; };
game.settings.set("l5r5e", `initiative-prepared-${preparedId}`, nextValue[prepared[preparedId]]); game.settings.set(CONFIG.l5r5e.namespace, `initiative-prepared-${preparedId}`, nextValue[prepared[preparedId]]);
}); });
} }

View File

@@ -43,16 +43,13 @@ export class ItemL5r5e extends Item {
* TODO probably useless if we can add "items" in metadata.embedded, but no clue how to. * TODO probably useless if we can add "items" in metadata.embedded, but no clue how to.
* *
* @param {string} embeddedName The name of the embedded Document type * @param {string} embeddedName The name of the embedded Document type
* @return {Collection} The Collection instance of embedded Documents of the requested type * @return {DocumentCollection} The Collection instance of embedded Documents of the requested type
*/ */
getEmbeddedCollection(embeddedName) { getEmbeddedCollection(embeddedName) {
const collectionName = embeddedName === "Item" ? "items" : this.constructor.metadata.embedded[embeddedName]; if (embeddedName === "Item") {
if (!collectionName) { return this.items;
throw new Error(
`${embeddedName} is not a valid embedded Document within the ${this.documentName} Document`
);
} }
return this[collectionName]; return super.getEmbeddedCollection(embeddedName);
} }
/** /**
@@ -82,7 +79,7 @@ export class ItemL5r5e extends Item {
// **** Embed Items, need to get the parents **** // **** Embed Items, need to get the parents ****
const parentItem = this.getItemFromParentId(); const parentItem = this.getItemFromParentId();
if (!parentItem) { if (!parentItem) {
console.warn(`L5R5E | Embed parentItem not found`); console.warn(`L5R5E | Helpers | Embed parentItem not found`);
return; return;
} }
@@ -198,7 +195,7 @@ export class ItemL5r5e extends Item {
} }
/** /**
* Add a Embed Item * Add an Embed Item
* @param {ItemL5r5e} item Object to add * @param {ItemL5r5e} item Object to add
* @param {boolean} save if we save in db or not (used internally) * @param {boolean} save if we save in db or not (used internally)
* @param {boolean} newId if we change the id * @param {boolean} newId if we change the id
@@ -249,7 +246,7 @@ export class ItemL5r5e extends Item {
} }
/** /**
* Update a Embed Item * Update an Embed Item
* @param {ItemL5r5e} item Object to add * @param {ItemL5r5e} item Object to add
* @param {boolean} save if we save in db or not (used internally) * @param {boolean} save if we save in db or not (used internally)
* @return {Promise<string>} * @return {Promise<string>}

View File

@@ -111,7 +111,7 @@ export class ArmyCohortSheetL5r5e extends ItemSheetL5r5e {
*/ */
async _updateLinkedActorData(actor) { async _updateLinkedActorData(actor) {
if (!actor || actor.documentName !== "Actor" || !actor.isCharacterType) { if (!actor || actor.documentName !== "Actor" || !actor.isCharacterType) {
console.warn("L5R5E | Wrong actor type", actor?.type, actor); console.warn("L5R5E | Army Cohort | Wrong actor type", actor?.type, actor);
return; return;
} }

View File

@@ -101,7 +101,7 @@ export class BaseItemSheetL5r5e extends ItemSheet {
event.preventDefault(); event.preventDefault();
event.stopPropagation(); event.stopPropagation();
const itemId = $(event.currentTarget).data("item-id"); const itemId = $(event.currentTarget).data("item-id");
console.warn("L5R5E | TODO ItemSheetL5r5e._addSubItem()", itemId); // TODO _addSubItem Currently not used, title override it console.warn("L5R5E | BIS | TODO ItemSheetL5r5e._addSubItem()", itemId); // TODO _addSubItem Currently not used, title override it
} }
/** /**

View File

@@ -51,7 +51,7 @@ export class ItemSheetL5r5e extends BaseItemSheetL5r5e {
props.push({ id: gameProp.id, name: gameProp.name }); props.push({ id: gameProp.id, name: gameProp.name });
} else { } else {
// Item not found // Item not found
console.warn(`L5R5E | Unknown property id[${property.id}], name[${property.name}]`); console.warn(`L5R5E | IS | Unknown property id[${property.id}], name[${property.name}]`);
sheetData.data.propertiesList.push({ sheetData.data.propertiesList.push({
id: property.id, id: property.id,
name: property.name, name: property.name,
@@ -87,11 +87,13 @@ export class ItemSheetL5r5e extends BaseItemSheetL5r5e {
* @return {DragDrop[]} An array of DragDrop handlers * @return {DragDrop[]} An array of DragDrop handlers
*/ */
_createDragDropHandlers() { _createDragDropHandlers() {
// "this.isEditable" fail for tooltips (undefined "this.document")
const isEditable = this.options.editable;
return [ return [
new DragDrop({ new DragDrop({
dragSelector: ".property", dragSelector: ".property",
dropSelector: null, dropSelector: null,
permissions: { dragstart: this._canDragStart.bind(this), drop: this._canDragDrop.bind(this) }, permissions: { dragstart: isEditable, drop: isEditable },
callbacks: { dragstart: this._onDragStart.bind(this), drop: this._onDrop.bind(this) }, callbacks: { dragstart: this._onDragStart.bind(this), drop: this._onDrop.bind(this) },
}), }),
]; ];

View File

@@ -21,7 +21,7 @@ export class TechniqueSheetL5r5e extends ItemSheetL5r5e {
// List all available techniques type // List all available techniques type
const types = ["core", "school", "title"]; const types = ["core", "school", "title"];
if (game.settings.get("l5r5e", "techniques-customs")) { if (game.settings.get(CONFIG.l5r5e.namespace, "techniques-customs")) {
types.push("custom"); types.push("custom");
} }
sheetData.data.techniquesList = game.l5r5e.HelpersL5r5e.getTechniquesList({ types }); sheetData.data.techniquesList = game.l5r5e.HelpersL5r5e.getTechniquesList({ types });

View File

@@ -116,7 +116,7 @@ export class TitleSheetL5r5e extends ItemSheetL5r5e {
// Create the new Item // Create the new Item
const itemId = await this.document.addEmbedItem( const itemId = await this.document.addEmbedItem(
new game.l5r5e.ItemL5r5e({ new game.l5r5e.ItemL5r5e({
name: game.i18n.localize(`ITEM.Type${selectedType.capitalize()}`), name: game.i18n.localize(`TYPES.Item.${selectedType.toLowerCase()}`),
type: selectedType, type: selectedType,
img: `${CONFIG.l5r5e.paths.assets}icons/items/${selectedType}.svg`, img: `${CONFIG.l5r5e.paths.assets}icons/items/${selectedType}.svg`,
}) })

View File

@@ -109,94 +109,94 @@ Hooks.once("init", async () => {
// ***** Register custom sheets ***** // ***** Register custom sheets *****
// Actors // Actors
Actors.unregisterSheet("core", ActorSheet); Actors.unregisterSheet("core", ActorSheet);
Actors.registerSheet("l5r5e", CharacterSheetL5r5e, { Actors.registerSheet(L5R5E.namespace, CharacterSheetL5r5e, {
types: ["character"], types: ["character"],
label: "ACTOR.TypeCharacter", label: "TYPES.Actor.character",
makeDefault: true, makeDefault: true,
}); });
Actors.registerSheet("l5r5e", NpcSheetL5r5e, { Actors.registerSheet(L5R5E.namespace, NpcSheetL5r5e, {
types: ["npc"], types: ["npc"],
label: "ACTOR.TypeNpc", label: "TYPES.Actor.npc",
makeDefault: true, makeDefault: true,
}); });
Actors.registerSheet("l5r5e", ArmySheetL5r5e, { Actors.registerSheet(L5R5E.namespace, ArmySheetL5r5e, {
types: ["army"], types: ["army"],
label: "ACTOR.TypeArmy", label: "TYPES.Actor.army",
makeDefault: true, makeDefault: true,
}); });
// Items // Items
Items.unregisterSheet("core", ItemSheet); Items.unregisterSheet("core", ItemSheet);
Items.registerSheet("l5r5e", ItemSheetL5r5e, { Items.registerSheet(L5R5E.namespace, ItemSheetL5r5e, {
types: ["item"], types: ["item"],
label: "ITEM.TypeItem", label: "TYPES.Item.item",
makeDefault: true, makeDefault: true,
}); });
Items.registerSheet("l5r5e", ArmorSheetL5r5e, { Items.registerSheet(L5R5E.namespace, ArmorSheetL5r5e, {
types: ["armor"], types: ["armor"],
label: "ITEM.TypeArmor", label: "TYPES.Item.armor",
makeDefault: true, makeDefault: true,
}); });
Items.registerSheet("l5r5e", WeaponSheetL5r5e, { Items.registerSheet(L5R5E.namespace, WeaponSheetL5r5e, {
types: ["weapon"], types: ["weapon"],
label: "ITEM.TypeWeapon", label: "TYPES.Item.weapon",
makeDefault: true, makeDefault: true,
}); });
Items.registerSheet("l5r5e", TechniqueSheetL5r5e, { Items.registerSheet(L5R5E.namespace, TechniqueSheetL5r5e, {
types: ["technique"], types: ["technique"],
label: "ITEM.TypeTechnique", label: "TYPES.Item.technique",
makeDefault: true, makeDefault: true,
}); });
Items.registerSheet("l5r5e", PropertySheetL5r5e, { Items.registerSheet(L5R5E.namespace, PropertySheetL5r5e, {
types: ["property"], types: ["property"],
label: "ITEM.TypeProperty", label: "TYPES.Item.property",
makeDefault: true, makeDefault: true,
}); });
Items.registerSheet("l5r5e", PeculiaritySheetL5r5e, { Items.registerSheet(L5R5E.namespace, PeculiaritySheetL5r5e, {
types: ["peculiarity"], types: ["peculiarity"],
label: "ITEM.TypePeculiarity", label: "TYPES.Item.peculiarity",
makeDefault: true, makeDefault: true,
}); });
Items.registerSheet("l5r5e", AdvancementSheetL5r5e, { Items.registerSheet(L5R5E.namespace, AdvancementSheetL5r5e, {
types: ["advancement"], types: ["advancement"],
label: "ITEM.TypeAdvancement", label: "TYPES.Item.advancement",
makeDefault: true, makeDefault: true,
}); });
Items.registerSheet("l5r5e", TitleSheetL5r5e, { Items.registerSheet(L5R5E.namespace, TitleSheetL5r5e, {
types: ["title"], types: ["title"],
label: "ITEM.TypeTitle", label: "TYPES.Item.title",
makeDefault: true, makeDefault: true,
}); });
Items.registerSheet("l5r5e", BondSheetL5r5e, { Items.registerSheet(L5R5E.namespace, BondSheetL5r5e, {
types: ["bond"], types: ["bond"],
label: "ITEM.TypeBond", label: "TYPES.Item.bond",
makeDefault: true, makeDefault: true,
}); });
Items.registerSheet("l5r5e", SignatureScrollSheetL5r5e, { Items.registerSheet(L5R5E.namespace, SignatureScrollSheetL5r5e, {
types: ["signature_scroll"], types: ["signature_scroll"],
label: "ITEM.TypeSignature_scroll", label: "TYPES.Item.signature_scroll",
makeDefault: true, makeDefault: true,
}); });
Items.registerSheet("l5r5e", ItemPatternSheetL5r5e, { Items.registerSheet(L5R5E.namespace, ItemPatternSheetL5r5e, {
types: ["item_pattern"], types: ["item_pattern"],
label: "ITEM.TypeItem_pattern", label: "TYPES.Item.item_pattern",
makeDefault: true, makeDefault: true,
}); });
Items.registerSheet("l5r5e", ArmyCohortSheetL5r5e, { Items.registerSheet(L5R5E.namespace, ArmyCohortSheetL5r5e, {
types: ["army_cohort"], types: ["army_cohort"],
label: "ITEM.TypeArmy_cohort", label: "TYPES.Item.army_cohort",
makeDefault: true, makeDefault: true,
}); });
Items.registerSheet("l5r5e", ArmyFortificationSheetL5r5e, { Items.registerSheet(L5R5E.namespace, ArmyFortificationSheetL5r5e, {
types: ["army_fortification"], types: ["army_fortification"],
label: "ITEM.TypeArmy_fortification", label: "TYPES.Item.army_fortification",
makeDefault: true, makeDefault: true,
}); });
// Journal // Journal
Journal.unregisterSheet("core", JournalSheet); Journal.unregisterSheet("core", JournalSheet);
Journal.registerSheet("l5r5e", BaseJournalSheetL5r5e, { Journal.registerSheet(L5R5E.namespace, BaseJournalSheetL5r5e, {
label: "JOURNAL.TypeJournal", label: "TYPES.Journal.journal",
makeDefault: true, makeDefault: true,
}); });
@@ -208,7 +208,7 @@ Hooks.once("init", async () => {
// Override the default Token _drawBar function to allow fatigue bar reversing. // Override the default Token _drawBar function to allow fatigue bar reversing.
Token.prototype._drawBar = function (number, bar, data) { Token.prototype._drawBar = function (number, bar, data) {
const reverseBar = data.attribute === "fatigue" && game.settings.get("l5r5e", "token-reverseFatigueBar"); const reverseBar = data.attribute === "fatigue" && game.settings.get(L5R5E.namespace, "token-reverseFatigueBar");
// Bar value // Bar value
const pct = Math.clamped(Number(data.value), 0, data.max) / data.max; const pct = Math.clamped(Number(data.value), 0, data.max) / data.max;

View File

@@ -14,7 +14,7 @@ export class MigrationL5r5e {
* @return {boolean} * @return {boolean}
*/ */
static needUpdate(version) { static needUpdate(version) {
const currentVersion = game.settings.get("l5r5e", "systemMigrationVersion"); const currentVersion = game.settings.get(CONFIG.l5r5e.namespace, "systemMigrationVersion");
return !currentVersion || foundry.utils.isNewerVersion(version, currentVersion); return !currentVersion || foundry.utils.isNewerVersion(version, currentVersion);
} }
@@ -44,11 +44,11 @@ export class MigrationL5r5e {
try { try {
const updateData = MigrationL5r5e._migrateActorData(actor, options); const updateData = MigrationL5r5e._migrateActorData(actor, options);
if (!foundry.utils.isEmpty(updateData)) { if (!foundry.utils.isEmpty(updateData)) {
console.log(`L5R5E | Migrating Actor document ${actor.name}[${actor._id}]`); console.log(`L5R5E | Migration | Migrating Actor document ${actor.name}[${actor._id}]`);
await actor.update(updateData); await actor.update(updateData);
} }
} catch (err) { } catch (err) {
err.message = `L5R5E | Failed L5R5e system migration for Actor ${actor.name}[${actor._id}]: ${err.message}`; err.message = `L5R5E | Migration | Failed L5R5e system migration for Actor ${actor.name}[${actor._id}]: ${err.message}`;
console.error(err); console.error(err);
} }
} }
@@ -58,11 +58,11 @@ export class MigrationL5r5e {
try { try {
const updateData = MigrationL5r5e._migrateItemData(item, options); const updateData = MigrationL5r5e._migrateItemData(item, options);
if (!foundry.utils.isEmpty(updateData)) { if (!foundry.utils.isEmpty(updateData)) {
console.log(`L5R5E | Migrating Item document ${item.name}[${item._id}]`); console.log(`L5R5E | Migration | Migrating Item document ${item.name}[${item._id}]`);
await item.update(updateData); await item.update(updateData);
} }
} catch (err) { } catch (err) {
err.message = `L5R5E | Failed L5R5e system migration for Item ${item.name}[${item._id}]: ${err.message}`; err.message = `L5R5E | Migration | Failed L5R5e system migration for Item ${item.name}[${item._id}]: ${err.message}`;
console.error(err); console.error(err);
} }
} }
@@ -72,14 +72,14 @@ export class MigrationL5r5e {
try { try {
const updateData = MigrationL5r5e._migrateSceneData(scene, options); const updateData = MigrationL5r5e._migrateSceneData(scene, options);
if (!foundry.utils.isEmpty(updateData)) { if (!foundry.utils.isEmpty(updateData)) {
console.log(`L5R5E | Migrating Scene document ${scene.name}[${scene._id}]`); console.log(`L5R5E | Migration | Migrating Scene document ${scene.name}[${scene._id}]`);
await scene.update(updateData); await scene.update(updateData);
// If we do not do this, then synthetic token actors remain in cache // If we do not do this, then synthetic token actors remain in cache
// with the un-updated actorData. // with the un-updated actorData.
scene.tokens.contents.forEach((t) => (t._actor = null)); scene.tokens.contents.forEach((t) => (t._actor = null));
} }
} catch (err) { } catch (err) {
err.message = `L5R5E | Failed L5R5e system migration for Scene ${scene.name}[${scene._id}]: ${err.message}`; err.message = `L5R5E | Migration | Failed L5R5e system migration for Scene ${scene.name}[${scene._id}]: ${err.message}`;
console.error(err); console.error(err);
} }
} }
@@ -104,16 +104,16 @@ export class MigrationL5r5e {
} }
// Save all the modified entries at once // Save all the modified entries at once
if (updatedChatList.length > 0) { if (updatedChatList.length > 0) {
console.log(`L5R5E | Migrating ${updatedChatList.length} ChatMessage documents`); console.log(`L5R5E | Migration | Migrating ${updatedChatList.length} ChatMessage documents`);
await ChatMessage.updateDocuments(updatedChatList); await ChatMessage.updateDocuments(updatedChatList);
} }
} catch (err) { } catch (err) {
err.message = `L5R5E | Failed L5R5e system migration for ChatMessage`; err.message = `L5R5E | Migration | Failed L5R5e system migration for ChatMessage`;
console.error(err); console.error(err);
} }
// Set the migration as complete // Set the migration as complete
await game.settings.set("l5r5e", "systemMigrationVersion", game.system.version); await game.settings.set(CONFIG.l5r5e.namespace, "systemMigrationVersion", game.system.version);
ui.notifications.info(`L5R5e System Migration to version ${game.system.version} completed!`, { ui.notifications.info(`L5R5e System Migration to version ${game.system.version} completed!`, {
permanent: true, permanent: true,
}); });
@@ -160,9 +160,7 @@ export class MigrationL5r5e {
updateData["_id"] = doc._id; updateData["_id"] = doc._id;
updateDatasList.push(updateData); updateDatasList.push(updateData);
console.log( console.log(`L5R5E | Migration | Migrating ${docType} document ${doc.name}[${doc._id}] in Compendium ${pack.collection}`);
`L5R5E | Migrating ${docType} document ${doc.name}[${doc._id}] in Compendium ${pack.collection}`
);
} }
// Save the modified entries // Save the modified entries
@@ -171,13 +169,13 @@ export class MigrationL5r5e {
} }
} catch (err) { } catch (err) {
// Handle migration failures // Handle migration failures
err.message = `L5R5E | Failed system migration for documents ${docType} in pack ${pack.collection}: ${err.message}`; err.message = `L5R5E | Migration | Failed system migration for documents ${docType} in pack ${pack.collection}: ${err.message}`;
console.error(err); console.error(err);
} }
// Apply the original locked status for the pack // Apply the original locked status for the pack
await pack.configure({ locked: wasLocked }); await pack.configure({ locked: wasLocked });
console.log(`L5R5E | Migrated all ${docType} contents from Compendium ${pack.collection}`); console.log(`L5R5E | Migration | Migrated all ${docType} contents from Compendium ${pack.collection}`);
} }
/** /**
@@ -191,12 +189,12 @@ export class MigrationL5r5e {
const tokens = scene.tokens.map((token) => { const tokens = scene.tokens.map((token) => {
const t = token.toJSON(); const t = token.toJSON();
if (!t.actorId || t.actorLink) { if (!t.actorId || t.actorLink) {
t.actorData = {}; t.delta = {};
} else if (!game.actors.has(t.actorId)) { } else if (!game.actors.has(t.actorId)) {
t.actorId = null; t.actorId = null;
t.actorData = {}; t.delta = {};
} else if (!t.actorLink) { } else if (!t.actorLink) {
const actorData = foundry.utils.duplicate(t.actorData); const actorData = foundry.utils.duplicate(t.delta);
actorData.type = token.actor?.type; actorData.type = token.actor?.type;
const update = MigrationL5r5e._migrateActorData(actorData, options); const update = MigrationL5r5e._migrateActorData(actorData, options);
["items", "effects"].forEach((embeddedName) => { ["items", "effects"].forEach((embeddedName) => {
@@ -204,7 +202,7 @@ export class MigrationL5r5e {
return; return;
} }
const updates = new Map(update[embeddedName].map((u) => [u._id, u])); const updates = new Map(update[embeddedName].map((u) => [u._id, u]));
t.actorData[embeddedName].forEach((original) => { t.delta[embeddedName].forEach((original) => {
const update = updates.get(original._id); const update = updates.get(original._id);
if (update) { if (update) {
foundry.utils.mergeObject(original, update); foundry.utils.mergeObject(original, update);
@@ -213,7 +211,7 @@ export class MigrationL5r5e {
delete update[embeddedName]; delete update[embeddedName];
}); });
foundry.utils.mergeObject(t.actorData, update); foundry.utils.mergeObject(t.delta, update);
} }
return t; return t;
}); });
@@ -223,7 +221,7 @@ export class MigrationL5r5e {
/** /**
* Migrate a single Actor document to incorporate latest data model changes * Migrate a single Actor document to incorporate latest data model changes
* Return an Object of updateData to be applied * Return an Object of updateData to be applied
* @param {ActorL5r5e|Object} actor The actor, or the TokenDocument.actorData to Update * @param {ActorL5r5e|Object} actor The actor, or the TokenDocument.delta to Update
* @param options * @param options
* @return {Object} The updateData to apply * @return {Object} The updateData to apply
*/ */

View File

@@ -5,7 +5,7 @@ export const RegisterSettings = function () {
/* ------------------------------------ */ /* ------------------------------------ */
/* User settings */ /* User settings */
/* ------------------------------------ */ /* ------------------------------------ */
game.settings.register("l5r5e", "rnk-deleteOldMessage", { game.settings.register(CONFIG.l5r5e.namespace, "rnk-deleteOldMessage", {
name: "SETTINGS.RollNKeep.DeleteOldMessage", name: "SETTINGS.RollNKeep.DeleteOldMessage",
hint: "SETTINGS.RollNKeep.DeleteOldMessageHint", hint: "SETTINGS.RollNKeep.DeleteOldMessageHint",
scope: "world", scope: "world",
@@ -13,7 +13,7 @@ export const RegisterSettings = function () {
default: true, default: true,
type: Boolean, type: Boolean,
}); });
game.settings.register("l5r5e", "initiative-setTn1OnTypeChange", { game.settings.register(CONFIG.l5r5e.namespace, "initiative-setTn1OnTypeChange", {
name: "SETTINGS.Initiative.SetTn1OnTypeChange", name: "SETTINGS.Initiative.SetTn1OnTypeChange",
hint: "SETTINGS.Initiative.SetTn1OnTypeChangeHint", hint: "SETTINGS.Initiative.SetTn1OnTypeChangeHint",
scope: "world", scope: "world",
@@ -21,14 +21,14 @@ export const RegisterSettings = function () {
type: Boolean, type: Boolean,
default: true, default: true,
}); });
game.settings.register("l5r5e", "token-reverseFatigueBar", { game.settings.register(CONFIG.l5r5e.namespace, "token-reverseFatigueBar", {
name: "SETTINGS.ReverseFatigueBar", name: "SETTINGS.ReverseFatigueBar",
scope: "world", scope: "world",
config: true, config: true,
type: Boolean, type: Boolean,
default: false, default: false,
}); });
game.settings.register("l5r5e", "techniques-customs", { game.settings.register(CONFIG.l5r5e.namespace, "techniques-customs", {
name: "SETTINGS.CustomTechniques.Title", name: "SETTINGS.CustomTechniques.Title",
hint: "SETTINGS.CustomTechniques.Hint", hint: "SETTINGS.CustomTechniques.Hint",
scope: "world", scope: "world",
@@ -40,7 +40,7 @@ export const RegisterSettings = function () {
/* ------------------------------------ */ /* ------------------------------------ */
/* Update */ /* Update */
/* ------------------------------------ */ /* ------------------------------------ */
game.settings.register("l5r5e", "systemMigrationVersion", { game.settings.register(CONFIG.l5r5e.namespace, "systemMigrationVersion", {
name: "System Migration Version", name: "System Migration Version",
scope: "world", scope: "world",
config: false, config: false,
@@ -51,7 +51,7 @@ export const RegisterSettings = function () {
/* ------------------------------------ */ /* ------------------------------------ */
/* Initiative Roll Dialog (GM only) */ /* Initiative Roll Dialog (GM only) */
/* ------------------------------------ */ /* ------------------------------------ */
game.settings.register("l5r5e", "initiative-difficulty-hidden", { game.settings.register(CONFIG.l5r5e.namespace, "initiative-difficulty-hidden", {
name: "Initiative difficulty is hidden", name: "Initiative difficulty is hidden",
scope: "world", scope: "world",
config: false, config: false,
@@ -59,7 +59,7 @@ export const RegisterSettings = function () {
default: false, default: false,
onChange: () => game.l5r5e.HelpersL5r5e.notifyDifficultyChange(), onChange: () => game.l5r5e.HelpersL5r5e.notifyDifficultyChange(),
}); });
game.settings.register("l5r5e", "initiative-difficulty-value", { game.settings.register(CONFIG.l5r5e.namespace, "initiative-difficulty-value", {
name: "Initiative difficulty value", name: "Initiative difficulty value",
scope: "world", scope: "world",
config: false, config: false,
@@ -67,20 +67,20 @@ export const RegisterSettings = function () {
default: 2, default: 2,
onChange: () => game.l5r5e.HelpersL5r5e.notifyDifficultyChange(), onChange: () => game.l5r5e.HelpersL5r5e.notifyDifficultyChange(),
}); });
game.settings.register("l5r5e", "initiative-encounter", { game.settings.register(CONFIG.l5r5e.namespace, "initiative-encounter", {
name: "Initiative encounter type", name: "Initiative encounter type",
scope: "world", scope: "world",
config: false, config: false,
type: String, type: String,
default: "skirmish", default: "skirmish",
onChange: () => { onChange: () => {
if (game.settings.get("l5r5e", "initiative-setTn1OnTypeChange")) { if (game.settings.get(CONFIG.l5r5e.namespace, "initiative-setTn1OnTypeChange")) {
game.settings.set("l5r5e", "initiative-difficulty-value", 1); game.settings.set(CONFIG.l5r5e.namespace, "initiative-difficulty-value", 1);
} }
ui.combat.render(true); ui.combat.render(true);
}, },
}); });
game.settings.register("l5r5e", "initiative-prepared-character", { game.settings.register(CONFIG.l5r5e.namespace, "initiative-prepared-character", {
name: "Initiative PC prepared or not", name: "Initiative PC prepared or not",
scope: "world", scope: "world",
config: false, config: false,
@@ -91,7 +91,7 @@ export const RegisterSettings = function () {
ui.combat.render(true); ui.combat.render(true);
}, },
}); });
game.settings.register("l5r5e", "initiative-prepared-adversary", { game.settings.register(CONFIG.l5r5e.namespace, "initiative-prepared-adversary", {
name: "Initiative NPC adversary are prepared or not", name: "Initiative NPC adversary are prepared or not",
scope: "world", scope: "world",
config: false, config: false,
@@ -102,7 +102,7 @@ export const RegisterSettings = function () {
ui.combat.render(true); ui.combat.render(true);
}, },
}); });
game.settings.register("l5r5e", "initiative-prepared-minion", { game.settings.register(CONFIG.l5r5e.namespace, "initiative-prepared-minion", {
name: "Initiative NPC minion are prepared or not", name: "Initiative NPC minion are prepared or not",
scope: "world", scope: "world",
config: false, config: false,
@@ -117,7 +117,7 @@ export const RegisterSettings = function () {
/* ------------------------------------ */ /* ------------------------------------ */
/* GM Monitor windows (GM only) */ /* GM Monitor windows (GM only) */
/* ------------------------------------ */ /* ------------------------------------ */
game.settings.register("l5r5e", "gm-monitor-actors", { game.settings.register(CONFIG.l5r5e.namespace, "gm-monitor-actors", {
name: "Gm Monitor", name: "Gm Monitor",
scope: "world", scope: "world",
config: false, config: false,

View File

@@ -34,7 +34,7 @@ export class SocketHandlerL5r5e {
break; break;
default: default:
console.warn(new Error("L5R5E | This socket event is not supported"), payload); console.warn(new Error("L5R5E | SH | This socket event is not supported"), payload);
break; break;
} }
}); });
@@ -54,7 +54,7 @@ export class SocketHandlerL5r5e {
_onDeleteChatMessage(payload) { _onDeleteChatMessage(payload) {
// Only delete the message if the user is a GM (otherwise it has no real effect) // Only delete the message if the user is a GM (otherwise it has no real effect)
// Currently only used in RnK // Currently only used in RnK
if (!game.user.isFirstGM || !game.settings.get("l5r5e", "rnk-deleteOldMessage")) { if (!game.user.isFirstGM || !game.settings.get(CONFIG.l5r5e.namespace, "rnk-deleteOldMessage")) {
return; return;
} }
game.messages.get(payload.messageId)?.delete(); game.messages.get(payload.messageId)?.delete();
@@ -118,27 +118,27 @@ export class SocketHandlerL5r5e {
* } * }
* }); * });
* *
* @param {User[]} users Users list to trigger the DP (will be reduce to id for network perf.) * @param {User[]} users Users list to trigger the DP (will be reduced to id for network perf.)
* @param {Actor[]} actors Actors list to trigger the DP (will be reduce to uuid for network perf.) * @param {Actor[]} actors Actors list to trigger the DP (will be reduced to uuid for network perf.)
* @param {Object} dpOptions Any DicePickerDialog.options * @param {Object} dpOptions Any DicePickerDialog.options
*/ */
openDicePicker({ users = [], actors = [], dpOptions = {} }) { openDicePicker({ users = [], actors = [], dpOptions = {} }) {
// At least one user or one actor // At least one user or one actor
if (foundry.utils.isEmpty(users) && foundry.utils.isEmpty(actors)) { if (foundry.utils.isEmpty(users) && foundry.utils.isEmpty(actors)) {
console.error("L5R5E | openDicePicker - 'users' and 'actors' are both empty, use at least one."); console.error("L5R5E | SH | openDicePicker - 'users' and 'actors' are both empty, use at least one.");
return; return;
} }
// Fail if dpOptions.actor* provided // Fail if dpOptions.actor* provided
if (!foundry.utils.isEmpty(dpOptions?.actorName)) { if (!foundry.utils.isEmpty(dpOptions?.actorName)) {
console.error("L5R5E | openDicePicker - Do not use 'dpOptions.actorName', use 'actors' list instead."); console.error("L5R5E | SH | openDicePicker - Do not use 'dpOptions.actorName', use 'actors' list instead.");
return; return;
} }
if (!foundry.utils.isEmpty(dpOptions?.actorId)) { if (!foundry.utils.isEmpty(dpOptions?.actorId)) {
console.error("L5R5E | openDicePicker - Do not use 'dpOptions.actorId', use 'actors' list instead."); console.error("L5R5E | SH | openDicePicker - Do not use 'dpOptions.actorId', use 'actors' list instead.");
return; return;
} }
if (!foundry.utils.isEmpty(dpOptions?.actor)) { if (!foundry.utils.isEmpty(dpOptions?.actor)) {
console.error("L5R5E | openDicePicker - Do not use 'dpOptions.actor', use 'actors' list instead."); console.error("L5R5E | SH | openDicePicker - Do not use 'dpOptions.actor', use 'actors' list instead.");
return; return;
} }

File diff suppressed because one or more lines are too long

View File

@@ -14,6 +14,10 @@ button {
.system { .system {
overflow: auto; overflow: auto;
border-bottom: 1px solid var(--color-border-light-highlight); border-bottom: 1px solid var(--color-border-light-highlight);
.system-title {
white-space: break-spaces;
}
} }
} }

View File

@@ -7,11 +7,11 @@
"changelog": "https://gitlab.com/teaml5r/l5r5e/-/blob/master/CHANGELOG.md", "changelog": "https://gitlab.com/teaml5r/l5r5e/-/blob/master/CHANGELOG.md",
"license": "https://gitlab.com/teaml5r/l5r5e/-/blob/master/LICENSE.md", "license": "https://gitlab.com/teaml5r/l5r5e/-/blob/master/LICENSE.md",
"manifest": "https://gitlab.com/teaml5r/l5r5e/-/raw/master/system/system.json", "manifest": "https://gitlab.com/teaml5r/l5r5e/-/raw/master/system/system.json",
"download": "https://gitlab.com/teaml5r/l5r5e/-/jobs/artifacts/v1.9.6/raw/l5r5e.zip?job=build", "download": "https://gitlab.com/teaml5r/l5r5e/-/jobs/artifacts/v1.10.0/raw/l5r5e.zip?job=build",
"version": "1.9.6", "version": "1.10.0",
"compatibility": { "compatibility": {
"minimum": 10, "minimum": 11,
"verified": "10.291" "verified": "11.301"
}, },
"manifestPlusVersion": "1.2.0", "manifestPlusVersion": "1.2.0",
"socket": true, "socket": true,
@@ -33,8 +33,87 @@
], ],
"background": "systems/l5r5e/assets/l5r-header.webp", "background": "systems/l5r5e/assets/l5r-header.webp",
"scripts": [], "scripts": [],
"esmodules": ["./scripts/main-l5r5e.js"], "esmodules": [
"styles": ["./styles/l5r5e.css"], "./scripts/main-l5r5e.js"
],
"styles": [
"./styles/l5r5e.css"
],
"packFolders": [
{
"name": "L5R5e System",
"color": "#9a0909",
"sorting": "m",
"folders": [
{
"name": "Character related",
"color": "#019806",
"sorting": "m",
"packs": [
"core-peculiarities-distinctions",
"core-peculiarities-passions",
"core-peculiarities-adversities",
"core-peculiarities-anxieties",
"core-bonds",
"core-titles",
"core-journal-school-curriculum",
"core-journal-great-clans-presentation"
]
},
{
"name": "Techniques",
"color": "#4b1eb3",
"sorting": "m",
"packs": [
"core-techniques-kata",
"core-techniques-kiho",
"core-techniques-inversions",
"core-techniques-invocations",
"core-techniques-rituals",
"core-techniques-shuji",
"core-techniques-maho",
"core-techniques-ninjutsu",
"core-techniques-mantra",
"core-techniques-school",
"core-techniques-mastery"
]
},
{
"name": "Objects related",
"color": "#0985ae",
"sorting": "m",
"packs": [
"core-properties",
"core-item-patterns",
"core-items",
"core-armors",
"core-weapons",
"core-signature-scrolls",
"core-celestial-implement-boons"
]
},
{
"name": "Helpers",
"color": "#6b3d1f",
"sorting": "m",
"packs": [
"core-journal-conditions",
"core-journal-terrain-qualities",
"core-journal-opportunities"
]
},
{
"name": "Tools",
"color": "#834949",
"sorting": "m",
"packs": [
"core-name-tables",
"core-macros"
]
}
]
}
],
"packs": [ "packs": [
{ {
"name": "core-properties", "name": "core-properties",

View File

@@ -52,7 +52,7 @@
<section class="sheet-body"> <section class="sheet-body">
{{!-- Sheet Tab Navigation --}} {{!-- Sheet Tab Navigation --}}
<nav class="sheet-tabs tabs" data-group="primary"> <nav class="sheet-tabs tabs" data-group="primary">
<a class="item" data-tab="army">{{localize 'ACTOR.TypeArmy'}}</a> <a class="item" data-tab="army">{{localize 'TYPES.Actor.army'}}</a>
<a class="item" data-tab="cohort">{{localize 'l5r5e.army.cohort.tab'}}</a> <a class="item" data-tab="cohort">{{localize 'l5r5e.army.cohort.tab'}}</a>
<a class="item" data-tab="fortification">{{localize 'l5r5e.army.fortification.tab'}}</a> <a class="item" data-tab="fortification">{{localize 'l5r5e.army.fortification.tab'}}</a>
<a class="item" data-tab="others">{{localize 'l5r5e.sheets.notes'}}</a> <a class="item" data-tab="others">{{localize 'l5r5e.sheets.notes'}}</a>

View File

@@ -1,8 +1,8 @@
<ul class="effects"> <ul class="effects">
{{#each actor.effects as |effect|}} {{#each actor.effects as |effect|}}
<li class="effect-container" title="{{label}}"> <li class="effect-container" title="{{name}}">
<div class="effect-icon" style="background-image: url({{effect.icon}})"></div> <div class="effect-icon" style="background-image: url({{effect.icon}})"></div>
<div class="effect-name"><label>{{label}}</label></div> <div class="effect-name"><label>{{name}}</label></div>
</li> </li>
{{/each}} {{/each}}
</ul> </ul>

View File

@@ -1,8 +1,8 @@
<ul class="effects"> <ul class="effects">
{{#each actor.effects as |effect|}} {{#each actor.effects as |effect|}}
<li class="effect-container" title="{{label}}"> <li class="effect-container" title="{{name}}">
<div class="effect-icon" style="background-image: url({{effect.icon}})"></div> <div class="effect-icon" style="background-image: url({{effect.icon}})"></div>
<div class="effect-name"><label>{{label}}</label></div> <div class="effect-name"><label>{{name}}</label></div>
</li> </li>
{{/each}} {{/each}}
</ul> </ul>

View File

@@ -26,17 +26,17 @@
{{#if actor.system.attitude}}<p>({{actor.system.attitude}})</p>{{/if}} {{#if actor.system.attitude}}<p>({{actor.system.attitude}})</p>{{/if}}
</td> </td>
<td> <td>
<a data-actor-id="{{actor.id}}" data-type="stance" class="actor-modify-control"> <a data-actor-uuid="{{actor.uuid}}" data-type="stance" class="actor-modify-control">
<i data-type="text" data-text="<h2>{{localize 'l5r5e.conflict.stance'}} ({{localizeRing actor.system.stance}} - {{lookup actor.system.rings actor.system.stance}})</h2>{{localizeStanceTip actor.system.stance}}" class="i_{{actor.system.stance}} actor-infos-control"></i> <i data-type="text" data-text="<h2>{{localize 'l5r5e.conflict.stance'}} ({{localizeRing actor.system.stance}} - {{lookup actor.system.rings actor.system.stance}})</h2>{{localizeStanceTip actor.system.stance}}" class="i_{{actor.system.stance}} actor-infos-control"></i>
</a> </a>
</td> </td>
<td> <td>
<a data-actor-id="{{actor.id}}" data-type="prepared" class="actor-modify-control"> <a data-actor-uuid="{{actor.uuid}}" data-type="prepared" class="actor-modify-control">
<i data-type="text" data-text="<h2>{{localize 'l5r5e.conflict.initiative.title'}} : {{localize (localize 'l5r5e.conflict.initiative.prepared_{value}' value=actor.isPrepared)}}</h2>" class="fa fas prepared-icon-{{actor.isPrepared}} {{#ifCond actor.isPrepared '==' 'false'}}badvalue{{/ifCond}} actor-infos-control"></i> <i data-type="text" data-text="<h2>{{localize 'l5r5e.conflict.initiative.title'}} : {{localize (localize 'l5r5e.conflict.initiative.prepared_{value}' value=actor.isPrepared)}}</h2>" class="fa fas prepared-icon-{{actor.isPrepared}} {{#ifCond actor.isPrepared '==' 'false'}}badvalue{{/ifCond}} actor-infos-control"></i>
</a> </a>
</td> </td>
<td>{{#if actor.haveWeaponEquipped}}<i data-type="weapons" data-actor-id="{{actor.id}}" class="fas fa-fan actor-infos-control {{#if actor.haveWeaponReadied}}badvalue{{/if}}"></i>{{/if}}</td> <td>{{#if actor.haveWeaponEquipped}}<i data-type="weapons" data-actor-uuid="{{actor.uuid}}" class="fas fa-fan actor-infos-control {{#if actor.haveWeaponReadied}}badvalue{{/if}}"></i>{{/if}}</td>
<td>{{#if actor.haveArmorEquipped}}<i data-type="armors" data-actor-id="{{actor.id}}" class="fas fa-user-shield actor-infos-control"></i>{{/if}}</td> <td>{{#if actor.haveArmorEquipped}}<i data-type="armors" data-actor-uuid="{{actor.uuid}}" class="fas fa-user-shield actor-infos-control"></i>{{/if}}</td>
<td> <td>
<p> <p>
{{#if actor.system.identity.school_rank}} {{#if actor.system.identity.school_rank}}
@@ -56,13 +56,13 @@
</p> </p>
</td> </td>
<td> <td>
<a title="{{localize 'l5r5e.gm.monitor.mouse_control'}}" data-actor-id="{{actor.id}}" data-type="fatigue" class="actor-modify-control"> <a title="{{localize 'l5r5e.gm.monitor.mouse_control'}}" data-actor-uuid="{{actor.uuid}}" data-type="fatigue" class="actor-modify-control">
<span class="{{#ifCond actor.system.fatigue.value '>' actor.system.fatigue.max}}badvalue{{/ifCond}}">{{actor.system.fatigue.value}}</span> <span class="{{#ifCond actor.system.fatigue.value '>' actor.system.fatigue.max}}badvalue{{/ifCond}}">{{actor.system.fatigue.value}}</span>
/ {{actor.system.fatigue.max}} / {{actor.system.fatigue.max}}
</a> </a>
</td> </td>
<td> <td>
<a title="{{localize 'l5r5e.gm.monitor.mouse_control'}}" data-actor-id="{{actor.id}}" data-type="strife" class="actor-modify-control"> <a title="{{localize 'l5r5e.gm.monitor.mouse_control'}}" data-actor-uuid="{{actor.uuid}}" data-type="strife" class="actor-modify-control">
<span class="{{#ifCond actor.system.strife.value '>' actor.system.strife.max}}badvalue{{/ifCond}}">{{actor.system.strife.value}}</span> <span class="{{#ifCond actor.system.strife.value '>' actor.system.strife.max}}badvalue{{/ifCond}}">{{actor.system.strife.value}}</span>
/ {{actor.system.strife.max}} / {{actor.system.strife.max}}
</a> </a>
@@ -72,13 +72,13 @@
/ {{#if actor.system.is_compromised}}<span class="badvalue">1</span>{{else}}{{actor.system.vigilance}}{{/if}} / {{#if actor.system.is_compromised}}<span class="badvalue">1</span>{{else}}{{actor.system.vigilance}}{{/if}}
</td> </td>
<td> <td>
<a title="{{localize 'l5r5e.gm.monitor.mouse_control'}}" data-actor-id="{{actor.id}}" data-type="void_points" class="actor-modify-control"> <a title="{{localize 'l5r5e.gm.monitor.mouse_control'}}" data-actor-uuid="{{actor.uuid}}" data-type="void_points" class="actor-modify-control">
{{actor.system.void_points.value}} {{actor.system.void_points.value}}
/ {{actor.system.void_points.max}} / {{actor.system.void_points.max}}
</a> </a>
</td> </td>
<td><i data-actor-id="{{actor.id}}" data-type="global" class="fas fa-question-circle actor-infos-control"></i></td> <td><i data-actor-uuid="{{actor.uuid}}" data-type="global" class="fas fa-question-circle actor-infos-control"></i></td>
<td><span data-actor-id="{{actor.id}}" class="actor-remove-control pointer" title="{{localize 'Delete'}}"><i class="fas fa-trash"></i></span></td> <td><span data-actor-uuid="{{actor.uuid}}" class="actor-remove-control pointer" title="{{localize 'Delete'}}"><i class="fas fa-trash"></i></span></td>
</tr> </tr>
{{/each}} {{/each}}
</tbody> </tbody>
@@ -109,13 +109,13 @@
{{/if}} {{/if}}
</td> </td>
<td> <td>
<a title="{{localize 'l5r5e.gm.monitor.mouse_control'}}" data-actor-id="{{actor.id}}" data-type="casualties" class="actor-modify-control"> <a title="{{localize 'l5r5e.gm.monitor.mouse_control'}}" data-actor-uuid="{{actor.uuid}}" data-type="casualties" class="actor-modify-control">
<span class="{{#ifCond actor.system.battle_readiness.casualties_strength.value '>' actor.system.battle_readiness.casualties_strength.max}}badvalue{{/ifCond}}">{{actor.system.battle_readiness.casualties_strength.value}}</span> <span class="{{#ifCond actor.system.battle_readiness.casualties_strength.value '>' actor.system.battle_readiness.casualties_strength.max}}badvalue{{/ifCond}}">{{actor.system.battle_readiness.casualties_strength.value}}</span>
/ {{actor.system.battle_readiness.casualties_strength.max}} / {{actor.system.battle_readiness.casualties_strength.max}}
</a> </a>
</td> </td>
<td> <td>
<a title="{{localize 'l5r5e.gm.monitor.mouse_control'}}" data-actor-id="{{actor.id}}" data-type="panic" class="actor-modify-control"> <a title="{{localize 'l5r5e.gm.monitor.mouse_control'}}" data-actor-uuid="{{actor.uuid}}" data-type="panic" class="actor-modify-control">
<span class="{{#ifCond actor.system.battle_readiness.panic_discipline.value '>' actor.system.battle_readiness.panic_discipline.max}}badvalue{{/ifCond}}">{{actor.system.battle_readiness.panic_discipline.value}}</span> <span class="{{#ifCond actor.system.battle_readiness.panic_discipline.value '>' actor.system.battle_readiness.panic_discipline.max}}badvalue{{/ifCond}}">{{actor.system.battle_readiness.panic_discipline.value}}</span>
/ {{actor.system.battle_readiness.panic_discipline.max}} / {{actor.system.battle_readiness.panic_discipline.max}}
</a> </a>
@@ -131,8 +131,8 @@
/ <span class="{{#ifCond actor.system.commander_standing.glory '>' 64}}goodvalue{{/ifCond}}{{#ifCond actor.system.commander_standing.glory '<' 20}}badvalue{{/ifCond}}">{{actor.system.commander_standing.glory}}</span> / <span class="{{#ifCond actor.system.commander_standing.glory '>' 64}}goodvalue{{/ifCond}}{{#ifCond actor.system.commander_standing.glory '<' 20}}badvalue{{/ifCond}}">{{actor.system.commander_standing.glory}}</span>
/ {{actor.system.commander_standing.status}} / {{actor.system.commander_standing.status}}
</td> </td>
<td><i data-actor-id="{{actor.id}}" data-type="global" class="fas fa-question-circle actor-infos-control"></i></td> <td><i data-actor-uuid="{{actor.uuid}}" data-type="global" class="fas fa-question-circle actor-infos-control"></i></td>
<td><span data-actor-id="{{actor.id}}" class="actor-remove-control pointer" title="{{localize 'Delete'}}"><i class="fas fa-trash"></i></span></td> <td><span data-actor-uuid="{{actor.uuid}}" class="actor-remove-control pointer" title="{{localize 'Delete'}}"><i class="fas fa-trash"></i></span></td>
</tr> </tr>
{{/each}} {{/each}}
</tbody> </tbody>

View File

@@ -1,5 +1,5 @@
<section> <section>
<h2>{{localize 'ACTOR.TypeArmy'}}</h2> <h2>{{localize 'TYPES.Actor.army'}}</h2>
<ul> <ul>
{{!-- warlord --}} {{!-- warlord --}}
<li><b>{{localize 'l5r5e.army.allies_backers'}}</b> : {{actorData.system.allies_backers}}</li> <li><b>{{localize 'l5r5e.army.allies_backers'}}</b> : {{actorData.system.allies_backers}}</li>