Add basic displaying for ActiveEffects and dropdown support

This commit is contained in:
Oliver-Akins 2024-04-20 23:14:16 -06:00
parent c466e0e539
commit d479ef7559
4 changed files with 45 additions and 3 deletions

View file

@ -41,6 +41,7 @@ import DOTDUNGEON from "./config.mjs";
Hooks.once(`init`, async () => {
console.debug(`.dungeon | Initializing`);
CONFIG.ActiveEffect.legacyTransferral = false;
loadSettings();

View file

@ -30,6 +30,7 @@ export class GenericItemSheet extends ItemSheet {
ctx.item = this.item;
ctx.system = this.item.system;
ctx.flags = this.item.flags;
ctx.effects = this.item.effects;
ctx.config = DOTDUNGEON;
ctx.icons = {};

View file

@ -57,6 +57,21 @@ export class UntypedItemSheet extends GenericItemSheet {
if (!this.isEditable) return;
console.debug(`.dungeon | Adding event listeners for Untyped Item: ${this.item.id}`);
new GenericContextMenu(html, `.effect.panel`, [
{
name: localizer(`dotdungeon.common.edit`),
callback: async (html) => {
(await fromUuid(html.closest(`.effect`)[0].dataset.embeddedId))?.sheet.render(true);
},
},
{
name: localizer(`dotdungeon.common.delete`),
callback: async () => {
(await fromUuid(html.closest(`.effect`)[0].dataset.embeddedId))?.delete(true);
},
}
]);
};
async getData() {