First iteration over items
This commit is contained in:
@@ -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
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user