RC-68 | Sheet Setup

This commit is contained in:
Oliver-Akins 2025-01-01 15:19:50 -07:00
parent a792ee40dd
commit 26025b2de3
17 changed files with 157 additions and 14 deletions

View file

@ -0,0 +1,52 @@
import { filePath } from "../../consts.mjs";
import { gameTerms } from "../../gameTerms.mjs";
import { GenericAppMixin } from "../GenericApp.mjs";
import { localizer } from "../../utils/Localizer.mjs";
import { Logger } from "../../utils/Logger.mjs";
const { HandlebarsApplicationMixin } = foundry.applications.api;
const { ActorSheetV2 } = foundry.applications.sheets;
export class HeroSkillsCardV1 extends GenericAppMixin(HandlebarsApplicationMixin(ActorSheetV2)) {
// #region Options
static DEFAULT_OPTIONS = {
classes: [
`ripcrypt--actor`,
`ripcrypt--HeroSkillsCardV1`,
],
position: {
width: `auto`,
height: `auto`,
},
window: {
resizable: false,
},
actions: {
},
form: {
submitOnChange: true,
closeOnSubmit: false,
},
};
static PARTS = {
content: {
template: filePath(`Apps/HeroSkillsCardV1/content.hbs`),
},
};
// #endregion
// #region Lifecycle
async _preparePartContext(partId, ctx, opts) {
ctx = await super._preparePartContext(partId, ctx, opts);
ctx.actor = this.document;
Logger.debug(`Context:`, ctx);
return ctx;
};
// #endregion
// #region Actions
// #endregion
};

View file

@ -18,6 +18,10 @@ export function GenericAppMixin(HandlebarsApp) {
roll: this.rollDice,
},
};
static themes = {
dark: `SETTINGS.UI.FIELDS.colorScheme.dark`,
};
// #endregion
// #region Lifecycle

View file

@ -1,4 +1,5 @@
// Applications
import { HeroSkillsCardV1 } from "../Apps/ActorSheets/HeroSkillsCardV1.mjs";
import { HeroSummaryCardV1 } from "../Apps/ActorSheets/HeroSummaryCardV1.mjs";
// Data Models
@ -38,6 +39,12 @@ Hooks.once(`init`, () => {
makeDefault: true,
types: [`hero`],
label: `RipCrypt.sheet-names.HeroSummaryCardV1`,
themes: HeroSummaryCardV1.themes,
});
Actors.registerSheet(game.system.id, HeroSkillsCardV1, {
types: [`hero`],
label: `RipCrypt.sheet-names.HeroSkillsCardV1`,
themes: HeroSkillsCardV1.themes,
});
// #endregion
// #endregion