Datamodel + Appv2 migration, WIP
This commit is contained in:
39
module/applications/sheets/item-sheet.mjs
Normal file
39
module/applications/sheets/item-sheet.mjs
Normal file
@@ -0,0 +1,39 @@
|
||||
import BoLBaseItemSheet from "./base-item-sheet.mjs"
|
||||
|
||||
/**
|
||||
* Item Sheet for "item" type items (equipment, weapons, etc.)
|
||||
* @extends {BoLBaseItemSheet}
|
||||
*/
|
||||
export default class BoLItemSheet extends BoLBaseItemSheet {
|
||||
|
||||
/** @override */
|
||||
static DEFAULT_OPTIONS = {
|
||||
...super.DEFAULT_OPTIONS,
|
||||
classes: [...super.DEFAULT_OPTIONS.classes, "item-type-item"],
|
||||
}
|
||||
|
||||
/** @override */
|
||||
static PARTS = {
|
||||
main: {
|
||||
template: "systems/bol/templates/item/item-sheet.hbs",
|
||||
},
|
||||
}
|
||||
|
||||
/** @override */
|
||||
async _prepareContext() {
|
||||
const context = await super._prepareContext()
|
||||
|
||||
// Add item-specific context
|
||||
context.isItem = true
|
||||
context.isEquipment = context.category === "equipment"
|
||||
context.isWeapon = context.category === "weapon"
|
||||
context.isProtection = context.category === "protection"
|
||||
context.isSpell = context.category === "spell"
|
||||
context.isAlchemy = context.category === "alchemy"
|
||||
context.isCapacity = context.category === "capacity"
|
||||
context.isMagical = context.category === "magical"
|
||||
context.isVehicle = context.category === "vehicle"
|
||||
|
||||
return context
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user