- DataModels (character, npc, anomaly, aspect, attribute, equipment) - ApplicationV2 sheets (character 5 tabs, npc 3 tabs, 4 item sheets) - DialogV2 pour les jets de dés avec phase de lune - Templates Handlebars complets (fiches PJ/PNJ, items, jet, chat) - Styles LESS → CSS compilé (thème vert foncé / orange CopaseticNF) - i18n fr.json complet (clés CELESTOPOL.*) - Point d'entrée fvtt-celestopol.mjs avec hooks init/ready - Assets : polices CopaseticNF, images UI, icônes items - Mise à jour copilot-instructions.md avec l'architecture réelle Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
40 lines
1.2 KiB
JavaScript
40 lines
1.2 KiB
JavaScript
const { HandlebarsApplicationMixin } = foundry.applications.api
|
|
|
|
export default class CelestopolItemSheet extends HandlebarsApplicationMixin(foundry.applications.sheets.ItemSheetV2) {
|
|
/** @override */
|
|
static DEFAULT_OPTIONS = {
|
|
classes: ["fvtt-celestopol", "item"],
|
|
position: { width: 580, height: "auto" },
|
|
form: { submitOnChange: true },
|
|
window: { resizable: true },
|
|
actions: {
|
|
editImage: CelestopolItemSheet.#onEditImage,
|
|
},
|
|
}
|
|
|
|
/** @override */
|
|
async _prepareContext() {
|
|
return {
|
|
fields: this.document.schema.fields,
|
|
systemFields: this.document.system.schema.fields,
|
|
item: this.document,
|
|
system: this.document.system,
|
|
source: this.document.toObject(),
|
|
isEditable: this.isEditable,
|
|
}
|
|
}
|
|
|
|
static async #onEditImage(event, target) {
|
|
const attr = target.dataset.edit
|
|
const current = foundry.utils.getProperty(this.document, attr)
|
|
const fp = new FilePicker({
|
|
current,
|
|
type: "image",
|
|
callback: (path) => this.document.update({ [attr]: path }),
|
|
top: this.position.top + 40,
|
|
left: this.position.left + 10,
|
|
})
|
|
return fp.browse()
|
|
}
|
|
}
|