Implement Mob Sheet
This commit is contained in:
parent
c257e4e5ee
commit
028b8629fe
10 changed files with 202 additions and 1 deletions
40
module/sheets/MobSheet.mjs
Normal file
40
module/sheets/MobSheet.mjs
Normal file
|
|
@ -0,0 +1,40 @@
|
|||
import { ActorHandler } from "../documents/Actor/Handler.mjs";
|
||||
import { GenericActorSheet } from "./GenericActorSheet.mjs";
|
||||
|
||||
export class MobSheet extends GenericActorSheet {
|
||||
static get defaultOptions() {
|
||||
let opts = mergeObject(
|
||||
super.defaultOptions,
|
||||
{
|
||||
template: `systems/dotdungeon/templates/actors/mobs/main.hbs`,
|
||||
width: 300,
|
||||
height: 360,
|
||||
}
|
||||
);
|
||||
opts.classes.push(`dotdungeon`);
|
||||
return opts;
|
||||
};
|
||||
|
||||
activateListeners(html) {
|
||||
super.activateListeners(html);
|
||||
|
||||
if (this.document.isEmbedded) return;
|
||||
if (!this.isEditable) return;
|
||||
console.debug(`.dungeon | Adding event listeners for Mob: ${this.id}`);
|
||||
};
|
||||
|
||||
async getData() {
|
||||
const ctx = await super.getData();
|
||||
/** @type {ActorHandler} */
|
||||
const actor = this.actor;
|
||||
|
||||
ctx.system = actor.system;
|
||||
ctx.flags = actor.flags;
|
||||
ctx.items = this.actor.itemTypes;
|
||||
|
||||
ctx.computed = {};
|
||||
|
||||
console.log(actor.uuid, `context:`, ctx)
|
||||
return ctx;
|
||||
};
|
||||
};
|
||||
Loading…
Add table
Add a link
Reference in a new issue