First iteration over items
This commit is contained in:
@@ -24,6 +24,8 @@ export default class PrismRPGArmorSheet extends PrismRPGItemSheet {
|
||||
async _prepareContext() {
|
||||
const context = await super._prepareContext()
|
||||
context.enrichedDescription = await foundry.applications.ux.TextEditor.implementation.enrichHTML(this.document.system.description, { async: true })
|
||||
context.enrichedPassiveDescription = await foundry.applications.ux.TextEditor.implementation.enrichHTML(this.document.system.passiveDescription, { async: true })
|
||||
context.enrichedAugmentDescription = await foundry.applications.ux.TextEditor.implementation.enrichHTML(this.document.system.augmentDescription, { async: true })
|
||||
return context
|
||||
}
|
||||
|
||||
|
||||
@@ -45,9 +45,11 @@ export default class PrismRPGCharacterSheet extends PrismRPGActorSheet {
|
||||
spells: {
|
||||
template: "systems/fvtt-prism-rpg/templates/character-spells.hbs",
|
||||
},
|
||||
/* Miracles disabled - Legacy from Lethal Fantasy
|
||||
miracles: {
|
||||
template: "systems/fvtt-prism-rpg/templates/character-miracles.hbs",
|
||||
},
|
||||
*/
|
||||
biography: {
|
||||
template: "systems/fvtt-prism-rpg/templates/character-biography.hbs",
|
||||
},
|
||||
@@ -72,9 +74,11 @@ export default class PrismRPGCharacterSheet extends PrismRPGActorSheet {
|
||||
if (this.actor.system.biodata.magicUser) {
|
||||
tabs.spells = { id: "spells", group: "sheet", icon: "fa-sharp-duotone fa-solid fa-wand-magic-sparkles", label: "PRISMRPG.Label.spells" }
|
||||
}
|
||||
/* Miracles disabled - Legacy from Lethal Fantasy
|
||||
if (this.actor.system.biodata.clericUser) {
|
||||
tabs.miracles = { id: "miracles", group: "sheet", icon: "fa-sharp-duotone fa-solid fa-hands-praying", label: "PRISMRPG.Label.miracles" }
|
||||
}
|
||||
*/
|
||||
for (const v of Object.values(tabs)) {
|
||||
v.active = this.tabGroups[v.group] === v.id
|
||||
v.cssClass = v.active ? "active" : ""
|
||||
@@ -99,7 +103,7 @@ export default class PrismRPGCharacterSheet extends PrismRPGActorSheet {
|
||||
case "skills":
|
||||
context.tab = context.tabs.skills
|
||||
context.skills = doc.itemTypes.skill
|
||||
context.gifts = doc.itemTypes.gift
|
||||
context.racialAbilities = doc.itemTypes["racial-ability"]
|
||||
context.vulnerabilities = doc.itemTypes.vulnerability
|
||||
break
|
||||
case "spells":
|
||||
@@ -107,11 +111,13 @@ export default class PrismRPGCharacterSheet extends PrismRPGActorSheet {
|
||||
context.spells = doc.itemTypes.spell
|
||||
context.hasSpells = context.spells.length > 0
|
||||
break
|
||||
/* Miracles disabled - Legacy from Lethal Fantasy
|
||||
case "miracles":
|
||||
context.tab = context.tabs.miracles
|
||||
context.miracles = doc.itemTypes.miracle
|
||||
context.hasMiracles = context.miracles.length > 0
|
||||
break
|
||||
*/
|
||||
case "combat":
|
||||
context.tab = context.tabs.combat
|
||||
context.weapons = doc.itemTypes.weapon
|
||||
|
||||
@@ -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
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
import PrismRPGItemSheet from "./base-item-sheet.mjs"
|
||||
|
||||
export default class PrismRPGRaceSheet extends PrismRPGItemSheet {
|
||||
/** @override */
|
||||
static DEFAULT_OPTIONS = {
|
||||
classes: ["race"],
|
||||
position: {
|
||||
width: 650,
|
||||
},
|
||||
window: {
|
||||
contentClasses: ["race-content"],
|
||||
},
|
||||
}
|
||||
|
||||
/** @override */
|
||||
static PARTS = {
|
||||
main: {
|
||||
template: "systems/fvtt-prism-rpg/templates/race.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.enrichedRacialPassiveDescription = await foundry.applications.ux.TextEditor.implementation.enrichHTML(this.document.system.racialPassiveDescription, { async: true })
|
||||
context.enrichedSubraceAbilityDescription = await foundry.applications.ux.TextEditor.implementation.enrichHTML(this.document.system.subraceAbilityDescription, { async: true })
|
||||
context.enrichedNotes = await foundry.applications.ux.TextEditor.implementation.enrichHTML(this.document.system.notes, { async: true })
|
||||
return context
|
||||
}
|
||||
}
|
||||
+4
-4
@@ -1,21 +1,21 @@
|
||||
import PrismRPGItemSheet from "./base-item-sheet.mjs"
|
||||
|
||||
export default class PrismRPGGiftSheet extends PrismRPGItemSheet {
|
||||
export default class PrismRPGRacialAbilitySheet extends PrismRPGItemSheet {
|
||||
/** @override */
|
||||
static DEFAULT_OPTIONS = {
|
||||
classes: ["gift"],
|
||||
classes: ["racial-ability"],
|
||||
position: {
|
||||
width: 600,
|
||||
},
|
||||
window: {
|
||||
contentClasses: ["gift-content"],
|
||||
contentClasses: ["racial-ability-content"],
|
||||
},
|
||||
}
|
||||
|
||||
/** @override */
|
||||
static PARTS = {
|
||||
main: {
|
||||
template: "systems/fvtt-prism-rpg/templates/gift.hbs",
|
||||
template: "systems/fvtt-prism-rpg/templates/racial-ability.hbs",
|
||||
},
|
||||
}
|
||||
|
||||
@@ -23,6 +23,7 @@ export default class PrismRPGShieldSheet extends PrismRPGItemSheet {
|
||||
async _prepareContext() {
|
||||
const context = await super._prepareContext()
|
||||
context.enrichedDescription = await foundry.applications.ux.TextEditor.implementation.enrichHTML(this.document.system.description, { async: true })
|
||||
context.enrichedBlockAugmentDescription = await foundry.applications.ux.TextEditor.implementation.enrichHTML(this.document.system.blockAugmentDescription, { async: true })
|
||||
return context
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import PrismRPGItemSheet from "./base-item-sheet.mjs"
|
||||
import { SYSTEM } from "../../config/system.mjs"
|
||||
|
||||
export default class PrismRPGSkillSheet extends PrismRPGItemSheet {
|
||||
/** @override */
|
||||
@@ -22,7 +23,9 @@ export default class PrismRPGSkillSheet extends PrismRPGItemSheet {
|
||||
/** @override */
|
||||
async _prepareContext() {
|
||||
const context = await super._prepareContext()
|
||||
context.config = SYSTEM
|
||||
context.enrichedDescription = await foundry.applications.ux.TextEditor.implementation.enrichHTML(this.document.system.description, { async: true })
|
||||
context.enrichedNotes = await foundry.applications.ux.TextEditor.implementation.enrichHTML(this.document.system.notes, { async: true })
|
||||
return context
|
||||
}
|
||||
}
|
||||
|
||||
@@ -23,6 +23,8 @@ export default class PrismRPGSpellSheet extends PrismRPGItemSheet {
|
||||
async _prepareContext() {
|
||||
const context = await super._prepareContext()
|
||||
context.enrichedDescription = await foundry.applications.ux.TextEditor.implementation.enrichHTML(this.document.system.description, { async: true })
|
||||
context.enrichedColorEffect = await foundry.applications.ux.TextEditor.implementation.enrichHTML(this.document.system.colorEffect, { async: true })
|
||||
context.enrichedAscensionEffect = await foundry.applications.ux.TextEditor.implementation.enrichHTML(this.document.system.ascensionEffect, { async: true })
|
||||
return context
|
||||
}
|
||||
|
||||
|
||||
@@ -23,6 +23,8 @@ export default class PrismRPGWeaponSheet extends PrismRPGItemSheet {
|
||||
async _prepareContext() {
|
||||
const context = await super._prepareContext()
|
||||
context.enrichedDescription = await foundry.applications.ux.TextEditor.implementation.enrichHTML(this.document.system.description, { async: true })
|
||||
context.enrichedPassiveDescription = await foundry.applications.ux.TextEditor.implementation.enrichHTML(this.document.system.passiveDescription, { async: true })
|
||||
context.enrichedManeuverDescription = await foundry.applications.ux.TextEditor.implementation.enrichHTML(this.document.system.maneuverDescription, { async: true })
|
||||
return context
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user