Added chat distinction for roll using target (@T:) with min or max for non disclose the target to players

This commit is contained in:
Vlyan
2022-07-31 15:29:12 +02:00
parent f8e45c1e32
commit ad427d99e4
7 changed files with 19 additions and 5 deletions

View File

@@ -7,6 +7,7 @@ __! Be certain to carefully back up any critical user data before installing thi
- Updated the initiative behaviour, he now open the DicePicker for connected players. - Updated the initiative behaviour, he now open the DicePicker for connected players.
- Added a `game.user.isFirstGM` property for some traitements (socket and migration) to prevent multiple executions with multiple GM connected. - Added a `game.user.isFirstGM` property for some traitements (socket and migration) to prevent multiple executions with multiple GM connected.
- Added socket API `openDicePicker` to remotely open the DicePicker (see usage below). - Added socket API `openDicePicker` to remotely open the DicePicker (see usage below).
- Added chat distinction for roll using target (`@T:`) with `min` or `max` for non disclose the target to players.
- Added a distinction when clicking on the dice icon on Chat tab : - Added a distinction when clicking on the dice icon on Chat tab :
- Left clic, open the DP locally (as usual). - Left clic, open the DP locally (as usual).
- Right clic (GM only), now open the DP for players with all skills in list. - Right clic (GM only), now open the DP for players with all skills in list.

View File

@@ -128,7 +128,8 @@
"initiative_roll": "Initiative roll", "initiative_roll": "Initiative roll",
"success_text": "Success!", "success_text": "Success!",
"bonus_text": "bonus successes", "bonus_text": "bonus successes",
"fail_text": "Fail!" "fail_text": "Fail!",
"unknown_target": "Unknown target"
}, },
"dicepicker": { "dicepicker": {
"title": "Dice Picker", "title": "Dice Picker",

View File

@@ -128,7 +128,8 @@
"initiative_roll": "Tirada de Iniciativa", "initiative_roll": "Tirada de Iniciativa",
"success_text": "¡Éxito!", "success_text": "¡Éxito!",
"bonus_text": "Éxitos adicionales", "bonus_text": "Éxitos adicionales",
"fail_text": "¡Fallo!" "fail_text": "¡Fallo!",
"unknown_target": "Unknown target"
}, },
"dicepicker": { "dicepicker": {
"title": "Dice Picker", "title": "Dice Picker",

View File

@@ -128,7 +128,8 @@
"initiative_roll": "Jet d'initiative", "initiative_roll": "Jet d'initiative",
"success_text": "Succès !", "success_text": "Succès !",
"bonus_text": "succès bonus", "bonus_text": "succès bonus",
"fail_text": "Échec !" "fail_text": "Échec !",
"unknown_target": "Cible inconnue"
}, },
"dicepicker": { "dicepicker": {
"title": "Dice Picker", "title": "Dice Picker",

View File

@@ -128,7 +128,8 @@
"initiative_roll": "Tiro Iniziativa", "initiative_roll": "Tiro Iniziativa",
"success_text": "Successo!", "success_text": "Successo!",
"bonus_text": "successi bonus", "bonus_text": "successi bonus",
"fail_text": "Fallimento!" "fail_text": "Fallimento!",
"unknown_target": "Unknown target"
}, },
"dicepicker": { "dicepicker": {
"title": "Selezione dadi", "title": "Selezione dadi",

View File

@@ -290,6 +290,9 @@ export class RollL5r5e extends Roll {
tooltip: isPrivate ? "" : await this.getTooltip({ from: "render" }), tooltip: isPrivate ? "" : await this.getTooltip({ from: "render" }),
total: isPrivate ? "?" : this.total, total: isPrivate ? "?" : this.total,
profileImg: this.l5r5e.actor?.img || "icons/svg/mystery-man.svg", profileImg: this.l5r5e.actor?.img || "icons/svg/mystery-man.svg",
noTargetDisclosure:
this.l5r5e.item?.system?.difficulty?.startsWith("@T:") &&
/\|m(in|ax)/.test(this.l5r5e.item.system.difficulty),
l5r5e: isPrivate l5r5e: isPrivate
? {} ? {}
: { : {

View File

@@ -38,10 +38,16 @@
{{/if}} {{/if}}
{{#if l5r5e.target.uuid}} {{#if l5r5e.target.uuid}}
<div class="l5r5e target"> <div class="l5r5e target {{#if noTargetDisclosure}}gm-only{{/if}}">
<div class="profile"><img class="profile-img" src="{{l5r5e.target.texture.src}}" alt="{{l5r5e.target.name}}" /></div> <div class="profile"><img class="profile-img" src="{{l5r5e.target.texture.src}}" alt="{{l5r5e.target.name}}" /></div>
<div class="name"> &nbsp; @UUID[{{l5r5e.target.actor.uuid}}]&#123;{{l5r5e.target.name}}&#125;</div> <div class="name"> &nbsp; @UUID[{{l5r5e.target.actor.uuid}}]&#123;{{l5r5e.target.name}}&#125;</div>
</div> </div>
{{#if noTargetDisclosure}}
<div class="l5r5e target player-only">
<div class="profile"><img class="profile-img" src="icons/svg/mystery-man.svg" alt="{{localize 'l5r5e.dice.chat.unknown_target'}}" /></div>
<div class="name"> &nbsp; {{localize 'l5r5e.dice.chat.unknown_target'}}</div>
</div>
{{/if}}
{{/if}} {{/if}}
{{#if l5r5e.item.uuid}} {{#if l5r5e.item.uuid}}