Files
fvtt-oath-hammer/module/applications/sheets/skillnpc-sheet.mjs

38 lines
1.2 KiB
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
import OathHammerItemSheet from "./base-item-sheet.mjs"
import { SYSTEM } from "../../config/system.mjs"
export default class OathHammerSkillNPCSheet extends OathHammerItemSheet {
/** @override */
static DEFAULT_OPTIONS = {
classes: ["skillnpc"],
position: { width: 460 },
window: { contentClasses: ["skillnpc-content"] },
}
/** @override */
static PARTS = {
main: { template: "systems/fvtt-oath-hammer/templates/item/skillnpc-sheet.hbs" },
}
/** @override */
async _prepareContext() {
const context = await super._prepareContext()
// Build dicePool selector (020)
context.dicePoolChoices = Object.fromEntries(
Array.from({ length: 21 }, (_, i) => [i, String(i)])
)
// Color choices (localized labels)
context.colorChoices = Object.fromEntries(
Object.entries(SYSTEM.DICE_COLOR_TYPES).map(([k, v]) => [k, game.i18n.localize(v)])
)
// Skill reference choices (optional)
context.skillRefChoices = {
"": `${game.i18n.localize("OATHHAMMER.Label.None")}`,
...Object.fromEntries(
Object.entries(SYSTEM.SKILLS).map(([k, v]) => [k, game.i18n.localize(v.label)])
)
}
return context
}
}