Import initial
This commit is contained in:
@@ -0,0 +1,33 @@
|
||||
import LesOubliesActorSheet from "./base-actor-sheet.mjs"
|
||||
|
||||
export default class LesOubliesCompagnieSheet extends LesOubliesActorSheet {
|
||||
static DEFAULT_OPTIONS = {
|
||||
...super.DEFAULT_OPTIONS,
|
||||
classes: [...super.DEFAULT_OPTIONS.classes, "compagnie"],
|
||||
window: {
|
||||
...super.DEFAULT_OPTIONS.window,
|
||||
title: "TYPES.Actor.compagnie",
|
||||
},
|
||||
}
|
||||
|
||||
static PARTS = {
|
||||
sheet: {
|
||||
template: "systems/fvtt-les-oublies/templates/actor-compagnie-sheet.hbs",
|
||||
},
|
||||
}
|
||||
|
||||
async _prepareContext() {
|
||||
const context = await super._prepareContext()
|
||||
context.members = (this.document.system.memberIds ?? []).map((id) => game.actors.get(id)).filter(Boolean)
|
||||
context.captain = this.document.system.captainId ? game.actors.get(this.document.system.captainId) : null
|
||||
context.shadow = this.document.system.ombreDuTourmentId ? game.actors.get(this.document.system.ombreDuTourmentId) : null
|
||||
context.powers = this.document.getEmbeddedItems("pouvoircompagnie")
|
||||
context.primaryPower = context.powers[0] ?? null
|
||||
context.links = (this.document.system.links ?? []).map((link) => ({
|
||||
...link,
|
||||
sourceLabel: game.actors.get(link.sourceId)?.name ?? link.sourceId,
|
||||
targetLabel: game.actors.get(link.targetId)?.name ?? link.targetId,
|
||||
}))
|
||||
return context
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user