From d14ed8023f12aadf0213940224e89f7fc2f957b3 Mon Sep 17 00:00:00 2001 From: Vlyan Date: Mon, 25 Apr 2022 18:44:40 +0200 Subject: [PATCH] Added a different view for hidden roll in ChatMessage (GM/Players). --- CHANGELOG.md | 5 +++-- system/scripts/hooks.js | 9 ++++++++- system/system.json | 4 ++-- system/templates/dice/chat-roll.html | 22 ++++++++++------------ 4 files changed, 23 insertions(+), 17 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0d495c5..504063f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,9 +1,10 @@ # Changelog Date format : day/month/year -## 1.7.2 - ??/??/2022 - ? +## 1.8.0 - ??/??/2022 - Compendiums Update - Added 179 Japanese' style villages name table. -- Added Rōnin icon tag symbol (thanks to TesserWract). +- Added Rōnin icon and tag symbol (Thanks to TesserWract). +- Added a different view for hidden roll in ChatMessage (GM/Players). - Fixed : Missing translation for EN and ES - "Armors, Weapons, and Items" in Npc Generator dialog. - Compendiums : - Added CR missing "Agasha Pattern" Pattern and Property (Thanks to KitCat). diff --git a/system/scripts/hooks.js b/system/scripts/hooks.js index 7491d72..75bd5cc 100644 --- a/system/scripts/hooks.js +++ b/system/scripts/hooks.js @@ -68,10 +68,17 @@ export default class HooksL5r5e { * Chat Message */ static renderChatMessage(message, html, data) { - // Add a extra CSS class to roll if (message.isRoll) { + // Add an extra CSS class to roll html.addClass("roll"); html.on("click", ".chat-dice-rnk", game.l5r5e.RollnKeepDialog.onChatAction.bind(this)); + + // Remove specific elements + if (game.user.isGM) { + html.find(".player-only").remove(); + } else { + html.find(".gm-only").remove(); + } } } diff --git a/system/system.json b/system/system.json index db42e26..b8dd84a 100644 --- a/system/system.json +++ b/system/system.json @@ -6,8 +6,8 @@ "readme": "https://gitlab.com/teaml5r/l5r5e/-/blob/master/README.md", "changelog": "https://gitlab.com/teaml5r/l5r5e/-/blob/master/CHANGELOG.md", "manifest": "https://gitlab.com/teaml5r/l5r5e/-/raw/master/system/system.json", - "download": "https://gitlab.com/teaml5r/l5r5e/-/jobs/artifacts/v1.7.2/raw/l5r5e.zip?job=build", - "version": "1.7.2", + "download": "https://gitlab.com/teaml5r/l5r5e/-/jobs/artifacts/v1.8.0/raw/l5r5e.zip?job=build", + "version": "1.8.0", "minimumCoreVersion": "9", "compatibleCoreVersion": "9", "manifestPlusVersion": "1.0.0", diff --git a/system/templates/dice/chat-roll.html b/system/templates/dice/chat-roll.html index 91bab5f..d4bd82d 100644 --- a/system/templates/dice/chat-roll.html +++ b/system/templates/dice/chat-roll.html @@ -22,10 +22,9 @@ {{#if l5r5e.difficultyHidden}} - {{localize 'l5r5e.dice.chat.difficulty'}} {{localize 'l5r5e.dice.chat.difficulty_hidden'}} - {{else}} - {{localize 'l5r5e.dice.chat.difficulty'}} {{l5r5e.difficulty}} + {{localize 'l5r5e.dice.chat.difficulty'}} {{localize 'l5r5e.dice.chat.difficulty_hidden'}} {{/if}} + {{localize 'l5r5e.dice.chat.difficulty'}} {{l5r5e.difficulty}}
{{#if l5r5e.voidPointUsed}} @@ -86,18 +85,17 @@ {{!-- Result text --}} {{#if ../l5r5e.difficultyHidden}} -
+
{{totalSuccess}} {{localize 'l5r5e.dice.chat.successes'}}
- {{else}} -
- {{#ifCond totalSuccess '>=' ../l5r5e.difficulty}} - {{localize "l5r5e.dice.chat.success_text"}} ({{totalBonus}} {{localize "l5r5e.dice.chat.bonus_text"}}) - {{else}} - {{localize "l5r5e.dice.chat.fail_text"}} - {{/ifCond}} -
{{/if}} +
+ {{#ifCond totalSuccess '>=' ../l5r5e.difficulty}} + {{localize "l5r5e.dice.chat.success_text"}} ({{totalBonus}} {{localize "l5r5e.dice.chat.bonus_text"}}) + {{else}} + {{localize "l5r5e.dice.chat.fail_text"}} + {{/ifCond}} +
{{/l5r5e.summary}}
{{/if}}