12.0.27 - Les vêtements d'Astrobazzarh #730

Merged
uberwald merged 23 commits from VincentVk/foundryvtt-reve-de-dragon:v11 into v11 2024-12-09 23:02:10 +01:00
2 changed files with 14 additions and 8 deletions
Showing only changes of commit 23b3be246b - Show all commits

View File

@ -176,7 +176,7 @@ export class RdDTMRDialog extends Dialog {
}
bringSubDialogToTop() {
if (this.subdialog?.bringToTop && this.subdialog?.element[0]) {
if (this.subdialog?.bringToTop && this.subdialog?.element && this.subdialog?.element[0]) {
this.subdialog.bringToTop();
}
}
@ -245,6 +245,7 @@ export class RdDTMRDialog extends Dialog {
/* -------------------------------------------- */
updateTokens() {
this._removeTokens(t => true);
this.allTokens = []
this.loadRencontres();
this.loadCasesSpeciales();
this._createTokens();
@ -1133,6 +1134,14 @@ export class RdDTMRDialog extends Dialog {
return tmr;
}
getTokensDetails(coordTMR) {
const tmrTooltip = `${coordTMR}: ${TMRUtility.getTMRLabel(coordTMR)}`
const tokenTooltips = this.allTokens
.filter(token => token.coordTMR() == coordTMR)
.map(token => token.tooltip);
return [tmrTooltip, ...tokenTooltips].reduce(Misc.joining('\n'))
}
/* -------------------------------------------- */
_removeTokens(filter = it => true) {
this.allTokens.filter(filter).forEach(token => this.pixiTMR.removeToken(token))
@ -1144,7 +1153,7 @@ export class RdDTMRDialog extends Dialog {
return
}
if (this.demiReve === token && this.isDemiReveCache()) {
return;
return
}
this.pixiTMR.positionToken(token);
if (!this.allTokens.includes(token)) {

View File

@ -184,12 +184,9 @@ export class PixiTMR {
const coordTMR = TMRUtility.oddqToCoordTMR(oddq);
const tmr = TMRUtility.getTMR(coordTMR)
if (tmr) {
const tmrTooltip = `${coordTMR}: ${TMRUtility.getTMRLabel(coordTMR)}`;
const tokenTooltips = this.tmrDialog.allTokens
.filter(token => token.coordTMR() == coordTMR)
.map(token => token.tooltip);
return [tmrTooltip, ...tokenTooltips].reduce(Misc.joining('\n'))
return this.tmrDialog.getTokensDetails(coordTMR)
}
return undefined
}
computeEventOddq(event) {