Fixes for RnK visibility
This commit is contained in:
@@ -6,6 +6,9 @@
|
||||
- Fixed Compendium entries thanks to TesserWract :
|
||||
- Utaku Battle Maiden: Replace "Striking as Air" with "Courtier's Resolve".
|
||||
- Weapons: Chair, lute, sake bottle and cups, and scroll case use the "Unarmed skill" and changed the umbrella's stab grip to be 2-handed.
|
||||
- Fixes for RnK :
|
||||
- Visibility mode is now consistent with the 1st message (public, private, gm...).
|
||||
- DiceSoNice will now not show the new dice(s) for explosive in non-public mode.
|
||||
- Minor fixe on editable state.
|
||||
|
||||
## 1.3.2 - Ronin's Bubble
|
||||
|
||||
@@ -88,7 +88,7 @@ export class CombatL5r5e extends Combat {
|
||||
if (messageOptions.rnkRoll instanceof game.l5r5e.RollL5r5e && ids.length === 1) {
|
||||
// Specific RnK
|
||||
roll = messageOptions.rnkRoll;
|
||||
rnkMessage = await roll.toMessage({ flavor });
|
||||
rnkMessage = await roll.toMessage({ flavor }, { rollMode: messageOptions.rollMode || null });
|
||||
} else {
|
||||
// Regular
|
||||
roll = new game.l5r5e.RollL5r5e(formula);
|
||||
|
||||
@@ -512,7 +512,13 @@ export class RollnKeepDialog extends FormApplication {
|
||||
|
||||
// Show DsN dice for the new roll
|
||||
if (game.dice3d !== undefined) {
|
||||
game.dice3d.showForRoll(roll, game.user, true);
|
||||
game.dice3d.showForRoll(
|
||||
roll,
|
||||
game.user,
|
||||
true,
|
||||
this._message.data.whisper.length === 0 ? null : this._message.data.whisper,
|
||||
this._message.data.blind
|
||||
);
|
||||
}
|
||||
|
||||
roll.terms.forEach((term) => {
|
||||
@@ -617,6 +623,7 @@ export class RollnKeepDialog extends FormApplication {
|
||||
if (this.roll.l5r5e.isInitiativeRoll) {
|
||||
let msgOptions = {
|
||||
rnkRoll: this.roll,
|
||||
rollMode: game.l5r5e.HelpersL5r5e.getRollMode(this._message.data),
|
||||
};
|
||||
|
||||
await this.roll.l5r5e.actor.rollInitiative({
|
||||
@@ -630,7 +637,10 @@ export class RollnKeepDialog extends FormApplication {
|
||||
delete msgOptions.rnkMessage;
|
||||
} else {
|
||||
// Send it to chat, switch to new message
|
||||
this.message = await this.roll.toMessage();
|
||||
this.message = await this.roll.toMessage(
|
||||
{},
|
||||
{ rollMode: game.l5r5e.HelpersL5r5e.getRollMode(this._message.data) }
|
||||
);
|
||||
}
|
||||
|
||||
// Refresh viewers
|
||||
|
||||
@@ -302,8 +302,8 @@ export class RollL5r5e extends Roll {
|
||||
|
||||
// RollMode
|
||||
const rMode = rollMode || messageData.rollMode || game.settings.get("core", "rollMode");
|
||||
if (rollMode) {
|
||||
ChatMessage.applyRollMode(messageData, rMode);
|
||||
if (rMode) {
|
||||
messageData = ChatMessage.applyRollMode(messageData, rMode);
|
||||
}
|
||||
|
||||
// Prepare chat data
|
||||
@@ -336,8 +336,8 @@ export class RollL5r5e extends Roll {
|
||||
static fromData(data) {
|
||||
const roll = super.fromData(data);
|
||||
|
||||
roll.data = duplicate(data.data);
|
||||
roll.l5r5e = duplicate(data.l5r5e);
|
||||
roll.data = foundry.utils.duplicate(data.data);
|
||||
roll.l5r5e = foundry.utils.duplicate(data.l5r5e);
|
||||
|
||||
// get real Actor object
|
||||
if (data.l5r5e.actor) {
|
||||
|
||||
@@ -511,4 +511,22 @@ export class HelpersL5r5e {
|
||||
content: `<div class="l5r5e-chat-item">${tpl}${link ? `<hr>` + link : ""}</div>`,
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the RollMode for this ChatData
|
||||
* @param {object} chatData
|
||||
* @return {string}
|
||||
*/
|
||||
static getRollMode(chatData) {
|
||||
if (chatData.whisper.length === 1 && chatData.whisper[0] === game.user.id) {
|
||||
return "selfroll";
|
||||
}
|
||||
if (chatData.blind) {
|
||||
return "blindroll";
|
||||
}
|
||||
if (chatData.whisper.length > 1) {
|
||||
return "gmroll";
|
||||
}
|
||||
return "roll";
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user