From f6cc3015cb067ded0728fa10b317f404ac99b7c6 Mon Sep 17 00:00:00 2001 From: Vlyan Date: Mon, 6 Dec 2021 11:11:45 +0100 Subject: [PATCH] GM Monitor : Cohorts & fortification list in general tooltip --- system/lang/en-en.json | 2 +- system/lang/es-es.json | 2 +- system/lang/fr-fr.json | 2 +- system/scripts/gm/gm-monitor.js | 4 +- system/templates/actors/army-sheet.html | 4 +- .../gm/monitor-tooltips/global-armies.html | 44 ++++++++++++++----- 6 files changed, 41 insertions(+), 17 deletions(-) diff --git a/system/lang/en-en.json b/system/lang/en-en.json index 2589c95..7637293 100644 --- a/system/lang/en-en.json +++ b/system/lang/en-en.json @@ -388,7 +388,7 @@ "past_battles": "Past Battles", "cohort": { "tab": "Cohorts", - "title": "Cohorts", + "title": "Cohort", "leader": "Leader", "abilities": "Abilities" }, diff --git a/system/lang/es-es.json b/system/lang/es-es.json index 263ba6d..f5ae14e 100644 --- a/system/lang/es-es.json +++ b/system/lang/es-es.json @@ -388,7 +388,7 @@ "past_battles": "Past Battles", "cohort": { "tab": "Cohorts", - "title": "Cohorts", + "title": "Cohort", "leader": "Leader", "abilities": "Abilities" }, diff --git a/system/lang/fr-fr.json b/system/lang/fr-fr.json index 8a7f32e..80f78d8 100644 --- a/system/lang/fr-fr.json +++ b/system/lang/fr-fr.json @@ -394,7 +394,7 @@ }, "fortification": { "tab": "Fortifications", - "title": "Fortifications", + "title": "Fortification", "difficulty": "Difficulté", "attrition_reduction": "Usure" } diff --git a/system/scripts/gm/gm-monitor.js b/system/scripts/gm/gm-monitor.js index 19666a0..ab70d12 100644 --- a/system/scripts/gm/gm-monitor.js +++ b/system/scripts/gm/gm-monitor.js @@ -277,11 +277,11 @@ export class GmMonitor extends FormApplication { * @private */ async _getTooltipArmiesGlobal(actor) { - const data = actor.data.data; + const actorData = (await actor.sheet?.getData()) || actor.data; // *** Template *** return renderTemplate(`${CONFIG.l5r5e.paths.templates}gm/monitor-tooltips/global-armies.html`, { - actorData: data, + actorData: actorData.data, }); } diff --git a/system/templates/actors/army-sheet.html b/system/templates/actors/army-sheet.html index f0f1e06..c42332c 100644 --- a/system/templates/actors/army-sheet.html +++ b/system/templates/actors/army-sheet.html @@ -31,8 +31,8 @@ {{!-- Sheet Tab Navigation --}} diff --git a/system/templates/gm/monitor-tooltips/global-armies.html b/system/templates/gm/monitor-tooltips/global-armies.html index b003ae5..7c94735 100644 --- a/system/templates/gm/monitor-tooltips/global-armies.html +++ b/system/templates/gm/monitor-tooltips/global-armies.html @@ -1,21 +1,45 @@
+

{{localize 'ACTOR.TypeArmy'}}

-

{{{actorData.description}}}

+ {{!-- description --}} +

{{{actorData.data.description}}}

- {{json actorData.items}} - - {{localize 'l5r5e.army.cohort.title'}} + {{!-- Cohorts --}} + {{#if actorData.splitItemsList.army_cohort}} +

{{localize 'l5r5e.army.cohort.tab'}}

+ {{/if}} + + {{!-- Fortifications --}} + {{#if actorData.splitItemsList.army_fortification}} +

{{localize 'l5r5e.army.fortification.tab'}}

+ + {{/if}}
\ No newline at end of file