Gestion TMR caché, WIP #135

This commit is contained in:
2021-04-28 00:48:39 +02:00
parent d486fa7aff
commit 4ecc8826f6
17 changed files with 170 additions and 21 deletions

View File

@ -1217,9 +1217,31 @@ export class RdDActor extends Actor {
async montreTMR( ) {
await this.update({ 'data.reve.tmrpos.cache': false });
}
async isTMRCache( ) {
isTMRCache( ) {
return this.data.data.reve.tmrpos.cache;
}
/* -------------------------------------------- */
async cacheTMRetMessage() {
await this.reinsertionAleatoire();
await this.cacheTMR();
game.socket.emit("system.foundryvtt-reve-de-dragon", {
msg: "msg_tmr_move", data: {
actorId: this.data._id,
tmrPos: this.data.data.reve.tmrpos
}
});
}
/* -------------------------------------------- */
async afficheTMRetMessage() {
await this.montreTMR();
game.socket.emit("system.foundryvtt-reve-de-dragon", {
msg: "msg_tmr_move", data: {
actorId: this.data._id,
tmrPos: this.data.data.reve.tmrpos
}
});
}
/* -------------------------------------------- */
async reinsertionAleatoire(raison) {
@ -2739,7 +2761,7 @@ export class RdDActor extends Actor {
refreshTMRView(tmrData) {
console.log("REFRESH !!!!");
if (this.currentTMR) {
this.currentTMR.forceDemiRevePositionView();
this.currentTMR.externalRefresh( tmrData)
}
}