diff --git a/module/actor/actor.js b/module/actor/actor.js index 2968b14..f35e908 100644 --- a/module/actor/actor.js +++ b/module/actor/actor.js @@ -3647,17 +3647,16 @@ export class MothershipActor extends Actor { // Print the item description into the chat. chatDesc(item) { + let swapNameDesc = false; + let swapName = ''; let itemName = item.name?.charAt(0).toUpperCase() + item.name?.toLowerCase().slice(1); if (!item.name && isNaN(itemName)) itemName = item.charAt(0)?.toUpperCase() + item.toLowerCase().slice(1); - var rollInsert = ''; - if(item.system.roll){ let r = new Roll(item.system.roll, {}); r.evaluate({async: false}); - rollInsert = '\
Patch
' || item.system.description === 'Trinket
' || item.system.description === 'Maintenance Issue
') { + swapNameDesc = true; + swapName = item.system.description.replaceAll('','').replaceAll('
',''); + } + var templateData = { actor: this, stat: { @@ -3673,6 +3678,8 @@ export class MothershipActor extends Actor { item: item, insert: rollInsert, onlyDesc: true, + swapNameDesc: swapNameDesc, + swapName: swapName }; let chatData = { diff --git a/templates/chat/itemRoll.html b/templates/chat/itemRoll.html index 71d2714..e08d7fe 100644 --- a/templates/chat/itemRoll.html +++ b/templates/chat/itemRoll.html @@ -4,12 +4,8 @@Patch
')}} -Trinket
')}} -Maintenance Issue
')}} -Trinket
')}} + {{#if swapNameDesc}}Patch
')}} -Maintenance Issue
')}} + {{else if (compare 'str' item.system.type '===' 'repair')}}