IMplémentation de la ajorité des remarques de Nepherius

This commit is contained in:
2026-04-06 17:48:30 +02:00
parent a3f7b11f82
commit 1022597bf8
51 changed files with 1900 additions and 443 deletions

View File

@@ -17,6 +17,7 @@ export default class CelestopolCharacterSheet extends CelestopolActorSheet {
resetAnomalyUses: CelestopolCharacterSheet.#onResetAnomalyUses,
depenseXp: CelestopolCharacterSheet.#onDepenseXp,
supprimerXpLog: CelestopolCharacterSheet.#onSupprimerXpLog,
rollMoonDie: CelestopolCharacterSheet.#onRollMoonDie,
},
}
@@ -93,15 +94,46 @@ export default class CelestopolCharacterSheet extends CelestopolActorSheet {
case "factions":
context.tab = context.tabs.factions
context.factionRows = Object.entries(SYSTEM.FACTIONS).map(([id, fDef]) => {
const val = this.document.system.factions[id]?.value ?? 0
return {
id,
label: fDef.label,
value: val,
valueStr: val > 0 ? `+${val}` : `${val}`,
dots: Array.from({ length: 9 }, (_, i) => ({
index: i,
filled: i <= val + 4,
type: i < 4 ? "neg" : i === 4 ? "neutral" : "pos",
})),
}
})
context.factionCustom = ["perso1", "perso2"].map(id => {
const f = this.document.system.factions[id]
const val = f?.value ?? 0
return {
id,
label: f?.label ?? "",
value: val,
valueStr: val > 0 ? `+${val}` : `${val}`,
dots: Array.from({ length: 9 }, (_, i) => ({
index: i,
filled: i <= val + 4,
type: i < 4 ? "neg" : i === 4 ? "neutral" : "pos",
})),
}
})
break
case "biography":
context.tab = context.tabs.biography
context.xpLogEmpty = (doc.system.xp?.log?.length ?? 0) === 0
context.enrichedDescription = await foundry.applications.ux.TextEditor.implementation.enrichHTML(
doc.system.description, { async: true })
context.enrichedDescriptionPhysique = await foundry.applications.ux.TextEditor.implementation.enrichHTML(
doc.system.descriptionPhysique, { relativeTo: this.document })
context.enrichedDescriptionPsychologique = await foundry.applications.ux.TextEditor.implementation.enrichHTML(
doc.system.descriptionPsychologique, { relativeTo: this.document })
context.enrichedNotes = await foundry.applications.ux.TextEditor.implementation.enrichHTML(
doc.system.notes, { async: true })
doc.system.notes, { relativeTo: this.document })
break
case "equipement":
@@ -235,4 +267,10 @@ export default class CelestopolCharacterSheet extends CelestopolActorSheet {
"system.xp.log": log,
})
}
/** Lance le Dé de la Lune de façon autonome depuis le header de la fiche. */
static async #onRollMoonDie() {
const { CelestopolRoll } = await import("../../documents/roll.mjs")
await CelestopolRoll.rollMoonStandalone(this.document)
}
}