First iteration over items

This commit is contained in:
2025-11-06 23:30:37 +01:00
parent 6b883f8126
commit 4a9f026a2a
109 changed files with 1535 additions and 715 deletions
@@ -0,0 +1,39 @@
import PrismRPGItemSheet from "./base-item-sheet.mjs"
export default class PrismRPGClassSheet extends PrismRPGItemSheet {
/** @override */
static DEFAULT_OPTIONS = {
classes: ["class"],
position: {
width: 700,
height: 800,
},
window: {
contentClasses: ["class-content"],
},
}
/** @override */
static PARTS = {
main: {
template: "systems/fvtt-prism-rpg/templates/class.hbs",
},
}
/** @override */
async _prepareContext() {
const context = await super._prepareContext()
context.enrichedDescription = await foundry.applications.ux.TextEditor.implementation.enrichHTML(this.document.system.description, { async: true })
context.enrichedAttributeBonuses = await foundry.applications.ux.TextEditor.implementation.enrichHTML(this.document.system.attributeBonuses, { async: true })
context.enrichedNotes = await foundry.applications.ux.TextEditor.implementation.enrichHTML(this.document.system.notes, { async: true })
// Enrich all feature levels
context.enrichedFeatures = {}
for (let i = 1; i <= 10; i++) {
const key = `level${i}`
context.enrichedFeatures[key] = await foundry.applications.ux.TextEditor.implementation.enrichHTML(this.document.system.features[key], { async: true })
}
return context
}
}