Avancement messages défense & oeuvres

This commit is contained in:
2025-09-27 01:43:49 +02:00
parent d26ab59c51
commit 2741fc3fbf
31 changed files with 954 additions and 220 deletions

View File

@@ -53,7 +53,23 @@ export class RollPart {
}
restore(rollData) { }
store(rollData, targetData) { }
storeClean(rollData, targetData) {
this.store(rollData, targetData)
if (rollData.selected[this.code]) {
const toDelete = Object.entries(rollData.selected[this.code])
.map(([k, v]) => v == undefined ? k : undefined)
.filter(k => k != undefined)
toDelete.forEach(k => delete rollData.selected[this.code][k])
if (Object.keys(rollData.selected[this.code]).length == 0) {
delete rollData.selected[this.code]
}
}
}
store(rollData, targetData) {
this.setSaved(targetData, { key: this.getCurrent(rollData).key })
}
/**
* le texte à ajouter dans la barre de titre
@@ -92,4 +108,14 @@ export class RollPart {
async _onRender(rollDialog, context, options) { }
addResult(rollData) {
const result = this.getResult(rollData)
if (result){
rollData.result[this.code] = result
}
}
getResult(rollData){
return undefined
}
}