First row of tests and fixes
This commit is contained in:
@@ -27,12 +27,12 @@ export default class AwECharacterSheet extends AwEActorSheet {
|
||||
header: {
|
||||
template: "systems/fvtt-adventures-with-emmy/templates/character-header.hbs"
|
||||
},
|
||||
main: {
|
||||
template: "systems/fvtt-adventures-with-emmy/templates/character-main.hbs"
|
||||
},
|
||||
tabs: {
|
||||
template: "templates/generic/tab-navigation.hbs"
|
||||
},
|
||||
main: {
|
||||
template: "systems/fvtt-adventures-with-emmy/templates/character-main.hbs"
|
||||
},
|
||||
biography: {
|
||||
template: "systems/fvtt-adventures-with-emmy/templates/character-biography.hbs"
|
||||
},
|
||||
|
||||
@@ -6,7 +6,7 @@ export default class AwECreatureSheet extends AwEActorSheet {
|
||||
classes: ["creature"],
|
||||
position: {
|
||||
width: 700,
|
||||
height: "auto"
|
||||
height: 700
|
||||
},
|
||||
window: {
|
||||
contentClasses: ["creature-content"]
|
||||
@@ -15,17 +15,64 @@ export default class AwECreatureSheet extends AwEActorSheet {
|
||||
|
||||
/** @override */
|
||||
static PARTS = {
|
||||
header: {
|
||||
template: "systems/fvtt-adventures-with-emmy/templates/creature-header.hbs"
|
||||
},
|
||||
tabs: {
|
||||
template: "templates/generic/tab-navigation.hbs"
|
||||
},
|
||||
main: {
|
||||
template: "systems/fvtt-adventures-with-emmy/templates/creature-main.hbs"
|
||||
},
|
||||
description: {
|
||||
template: "systems/fvtt-adventures-with-emmy/templates/creature-description.hbs"
|
||||
},
|
||||
eureka: {
|
||||
template: "systems/fvtt-adventures-with-emmy/templates/creature-eureka.hbs"
|
||||
}
|
||||
}
|
||||
|
||||
/** @override */
|
||||
tabGroups = {
|
||||
sheet: "main"
|
||||
}
|
||||
|
||||
#getTabs() {
|
||||
const tabs = {
|
||||
main: { id: "main", group: "sheet", icon: "fa-solid fa-dragon", label: "AWEMMY.Sheet.Tab.Main" },
|
||||
description: { id: "description", group: "sheet", icon: "fa-solid fa-scroll", label: "AWEMMY.Sheet.Tab.Description" },
|
||||
eureka: { id: "eureka", group: "sheet", icon: "fa-solid fa-lightbulb", label: "AWEMMY.Sheet.Tab.Eureka" }
|
||||
}
|
||||
for (const v of Object.values(tabs)) {
|
||||
v.active = this.tabGroups[v.group] === v.id
|
||||
v.cssClass = v.active ? "active" : ""
|
||||
}
|
||||
return tabs
|
||||
}
|
||||
|
||||
/** @override */
|
||||
async _prepareContext() {
|
||||
const context = await super._prepareContext()
|
||||
context.tabs = this.#getTabs()
|
||||
context.enrichedDescription = await foundry.applications.ux.TextEditor.implementation.enrichHTML(
|
||||
this.document.system.description, { async: true }
|
||||
)
|
||||
return context
|
||||
}
|
||||
|
||||
/** @override */
|
||||
async _preparePartContext(partId, context) {
|
||||
switch (partId) {
|
||||
case "main":
|
||||
context.tab = context.tabs.main
|
||||
break
|
||||
case "description":
|
||||
context.tab = context.tabs.description
|
||||
break
|
||||
case "eureka":
|
||||
context.tab = context.tabs.eureka
|
||||
break
|
||||
}
|
||||
return context
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user