From 5dc5bc9b030a7ea60e31a502fa432f81821a134c Mon Sep 17 00:00:00 2001 From: wyrmisis Date: Fri, 7 Oct 2022 15:50:09 -0400 Subject: [PATCH 1/2] feature: Delete a monster's loot table by right clicking on it --- src/module/actor/monster-sheet.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/module/actor/monster-sheet.js b/src/module/actor/monster-sheet.js index 4881eba9..c9ba9693 100644 --- a/src/module/actor/monster-sheet.js +++ b/src/module/actor/monster-sheet.js @@ -303,6 +303,13 @@ export class OseActorSheetMonster extends OseActorSheet { actorObject.rollAppearing({ event: ev, check: check }); }); + html.find(".treasure-table a").contextmenu((ev) => { + const treasureTableKey = isNewerVersion(game.version, "10.264") + ? "system.details.treasure.table" + : "data.details.treasure.table"; //v9-compatibility + this.actor.update({ [treasureTableKey]: null }); + }); + // Everything below here is only needed if the sheet is editable if (!this.options.editable) return; From 9885a030a088456dd374f6f8ca370299da6369a6 Mon Sep 17 00:00:00 2001 From: wyrmisis Date: Fri, 7 Oct 2022 15:52:12 -0400 Subject: [PATCH 2/2] fix: Loot tables should display on monsters --- src/module/actor/monster-sheet.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/module/actor/monster-sheet.js b/src/module/actor/monster-sheet.js index c9ba9693..a4206930 100644 --- a/src/module/actor/monster-sheet.js +++ b/src/module/actor/monster-sheet.js @@ -155,8 +155,9 @@ export class OseActorSheetMonster extends OseActorSheet { // Settings data.config.morale = game.settings.get(game.system.id, "morale"); - monsterData.details.treasure.link = TextEditor.enrichHTML( - monsterData.details.treasure.table + monsterData.details.treasure.link = await TextEditor.enrichHTML( + monsterData.details.treasure.table, + { async: true } ); data.isNew = this.actor.isNew(); @@ -224,7 +225,7 @@ export class OseActorSheetMonster extends OseActorSheet { .index.filter((el) => el._id === data.id); link = `@Compendium[${data.pack}.${data.id}]{${tableData[0].name}}`; } else { - link = `@RollTable[${data.id}]`; + link = `@UUID[${data.uuid}]`; } const treasureTableKey = isNewerVersion(game.version, "10.264") ? "system.details.treasure.table"