accomodate for changes to roll type in v12

This commit is contained in:
Chris Schmalz
2024-08-12 19:14:43 -07:00
parent 7521dfcdf8
commit ec43f1451a
2 changed files with 12 additions and 2 deletions
+10
View File
@@ -1419,6 +1419,7 @@ export class MothershipActor extends Actor {
let msgDesc = ``;
let flavorText = ``;
let woundText = ``;
let tableResultType = ``;
let tableResultEdited = ``;
let tableResultFooter = ``;
let chatId = (game.release.generation >= 12 ? foundry.utils.randomID(): randomID())
@@ -1701,11 +1702,20 @@ export class MothershipActor extends Actor {
if (specialRoll === 'maintenanceCheck' && useCalm && parsedRollResult.success && parsedRollResult.critical) {
flavorText = flavorText + ` Gain 1d10 Calm.<br><br>@UUID[Compendium.mosh.macros_triggered_1e.k2TtLFOG9mGaWVx3]{+1d10 Calm}`;
}
//set table result type (using first value)
if (tableResult[0].type === 0 || tableResult[0].type === 'text') {
tableResultType = `text`;
} else if (tableResult[0].type === 1 || tableResult[0].type === 'document') {
tableResultType = `document`;
} else {
tableResultType = `unknown`;
}
//generate chat message
//prepare data
let messageData = {
actor: this,
tableResult: tableResult,
tableResultType: tableResultType,
tableResultEdited: tableResultEdited,
tableResultFooter: tableResultFooter,
parsedRollResult: parsedRollResult,
+2 -2
View File
@@ -27,7 +27,7 @@
{{#if woundText}}
{{{woundText}}}<br><br>
{{/if}}
{{#if (compare 'int' tableResult.[0].type '===' 1)}}
{{#if (compare 'str' tableResultType '===' 'document')}}
<ol class="table-results">
{{#each tableResult}}
<li class="table-result flexrow" data-result-id="{{{this._id}}}">
@@ -37,7 +37,7 @@
{{/each}}
</ol>
{{/if}}
{{#if (compare 'int' tableResult.[0].type '===' 0)}}
{{#if (compare 'str' tableResultType '===' 'text')}}
{{#if tableResultEdited}}
<div class="description" style="margin-bottom : 20px;">{{{tableResultEdited}}}{{{tableResultFooter}}}</div>
{{else}}