ENH: Blind roll fixed

master
U~man 2020-07-31 11:22:40 +02:00
parent fb232dfa81
commit 1eaf480c5b
3 changed files with 16 additions and 8 deletions

View File

@ -29,6 +29,12 @@ export const addChatMessageContextOptions = function(html, options) {
/* -------------------------------------------- */ /* -------------------------------------------- */
export const addChatMessageButtons = function(msg, html, data) { export const addChatMessageButtons = function(msg, html, data) {
// Hide blind rolls
let blindable = html.find('.blindable');
if (msg.data.blind && !game.user.isGM && blindable && blindable.data('blind') === true) {
blindable.replaceWith("<div class='dice-roll'><div class='dice-result'><div class='dice-formula'>???</div></div></div>");
}
// Buttons
let roll = html.find('.damage-roll'); let roll = html.find('.damage-roll');
if (roll.length > 0) { if (roll.length > 0) {
let total = roll.find('.dice-total'); let total = roll.find('.dice-total');

View File

@ -76,8 +76,8 @@ export class OseDice {
rollMode = form ? form.rollMode.value : rollMode; rollMode = form ? form.rollMode.value : rollMode;
// Force blind roll (ability formulas) // Force blind roll (ability formulas)
if (data.blindroll) { if (data.roll.blindroll) {
rollMode = "blindroll"; rollMode = game.user.isGM ? "selfroll" : "blindroll";
} }
if (["gmroll", "blindroll"].includes(rollMode)) if (["gmroll", "blindroll"].includes(rollMode))

View File

@ -8,11 +8,13 @@
<div class="chat-img" style="background-image:url('{{data.actor.img}}')"></div> <div class="chat-img" style="background-image:url('{{data.actor.img}}')"></div>
{{/if}} {{/if}}
</div> </div>
{{#if result.details}}<div class="chat-details">{{{result.details}}}</div>{{/if}} <div class="blindable" data-blind="{{data.roll.blindroll}}">
{{#if result.isFailure}}<div class='roll-result roll-fail'><b>{{localize 'OSE.Failure'}}</b> ({{result.target}}) {{#if result.details}}<div class="chat-details">{{{result.details}}}</div>{{/if}}
</div>{{/if}} {{#if result.isFailure}}<div class='roll-result roll-fail'><b>{{localize 'OSE.Failure'}}</b> ({{result.target}})
{{#if result.isSuccess}}<div class='roll-result roll-success'><b>{{localize 'OSE.Success'}}</b> </div>{{/if}}
({{result.target}})</div>{{/if}} {{#if result.isSuccess}}<div class='roll-result roll-success'><b>{{localize 'OSE.Success'}}</b>
{{#if rollOSE}}<div>{{{rollOSE}}}</div>{{/if}} ({{result.target}})</div>{{/if}}
{{#if rollOSE}}<div>{{{rollOSE}}}</div>{{/if}}
</div>
</div> </div>
</section> </section>