Fix: problème de contexte WebGL
WARNING: Too many active WebGL contexts. Oldest context will be lost. Semble lié à la destruction incorrecte de l'Application PIXI des TMR, en cas de nombreuses ouvertures/fermetures
This commit is contained in:
@ -86,16 +86,13 @@ export class RdDTMRDialog extends Dialog {
|
||||
this._tellToGM(this.actor.name + " monte dans les terres médianes (" + tmrData.mode + ")");
|
||||
}
|
||||
this.callbacksOnAnimate = [];
|
||||
this.resizePixiTMR(
|
||||
TMR_DISPLAY_SIZE.clamp(game.settings.get(SYSTEM_RDD, TMR_DISPLAY_SIZE.code) ?? TMR_DISPLAY_SIZE.def)
|
||||
)
|
||||
const displaySize = TMR_DISPLAY_SIZE.clamp(game.settings.get(SYSTEM_RDD, TMR_DISPLAY_SIZE.code) ?? TMR_DISPLAY_SIZE.def);
|
||||
this.pixiTMR = new PixiTMR(this, displaySize);
|
||||
this.resizePixiTMR(displaySize)
|
||||
}
|
||||
|
||||
resizePixiTMR(displaySize) {
|
||||
if (displaySize != this.displaySize) {
|
||||
if (!this.pixiTMR) {
|
||||
this.pixiTMR = new PixiTMR(this, displaySize);
|
||||
}
|
||||
this.displaySize = displaySize
|
||||
this.pixiTMR.resizeTMR(displaySize);
|
||||
this._removeTokens()
|
||||
@ -334,13 +331,10 @@ export class RdDTMRDialog extends Dialog {
|
||||
|
||||
/* -------------------------------------------- */
|
||||
async close() {
|
||||
|
||||
if (this.subdialog) {
|
||||
return this.forceTMRContinueAction()
|
||||
}
|
||||
|
||||
this.descenteTMR = true;
|
||||
this.pixiTMR.close()
|
||||
if (this.actor.tmrApp) {
|
||||
this.actor.tmrApp = undefined; // Cleanup reference
|
||||
if (!this.viewOnly) {
|
||||
@ -348,9 +342,11 @@ export class RdDTMRDialog extends Dialog {
|
||||
this._tellToGM(this.actor.name + " a quitté les terres médianes");
|
||||
}
|
||||
await this.actor.santeIncDec((ReglesOptionnelles.isUsing("appliquer-fatigue") ? "fatigue" : "endurance"),
|
||||
this.cumulFatigue)
|
||||
this.cumulFatigue)
|
||||
}
|
||||
await super.close();
|
||||
this.pixiTMR.close()
|
||||
this.pixiTMR = undefined
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
|
Reference in New Issue
Block a user