Working on the spells panel, which resulted in a lot of weird structural changes that aren't *really* functional yet
This commit is contained in:
parent
227029ffcd
commit
dfc51a5899
31 changed files with 499 additions and 84 deletions
42
module/sheets/GenericItemSheet.mjs
Normal file
42
module/sheets/GenericItemSheet.mjs
Normal file
|
|
@ -0,0 +1,42 @@
|
|||
import { preloadIcons } from "../handlebars.mjs";
|
||||
|
||||
export class GenericItemSheet extends ItemSheet {
|
||||
_expanded = new Set();
|
||||
|
||||
#propogatedSettings = [
|
||||
`devMode`,
|
||||
`showAvatarOnSheet`,
|
||||
`playersCanChangeGroup`,
|
||||
`resourcesOrSupplies`,
|
||||
];
|
||||
|
||||
activateListeners(html) {
|
||||
super.activateListeners(html);
|
||||
|
||||
if (this.document.isEmbedded) return;
|
||||
if (!this.isEditable) return;
|
||||
console.debug(`.dungeon | Adding event listeners for Generic Item: ${this.id}`);
|
||||
};
|
||||
|
||||
async getData() {
|
||||
const ctx = {};
|
||||
const item = this.item.toObject(false);
|
||||
|
||||
// Send all of the settings that sheets need into their context
|
||||
ctx.settings = {};
|
||||
for (const setting of this.#propogatedSettings) {
|
||||
ctx.settings[setting] = game.settings.get(`dotdungeon`, setting);
|
||||
};
|
||||
|
||||
ctx.isGM = game.users.current.hasRole(CONST.USER_ROLES.ASSISTANT);
|
||||
|
||||
ctx.meta = {
|
||||
expanded: this._expanded,
|
||||
idp: this.actor.uuid,
|
||||
};
|
||||
|
||||
ctx.icons = await preloadIcons();
|
||||
|
||||
return ctx;
|
||||
};
|
||||
};
|
||||
Loading…
Add table
Add a link
Reference in a new issue