forked from public/foundryvtt-reve-de-dragon
Compare commits
3 Commits
b160ce78bc
...
12.0.27
Author | SHA1 | Date | |
---|---|---|---|
979d49f96e | |||
22cab26908 | |||
23b3be246b |
@ -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();
|
||||
}
|
||||
}
|
||||
@ -241,10 +241,11 @@ export class RdDTMRDialog extends Dialog {
|
||||
this._getTokensRencontres().forEach(t => this._trackToken(t))
|
||||
this._getTokensSortsReserve().forEach(t => this._trackToken(t))
|
||||
}
|
||||
|
||||
|
||||
/* -------------------------------------------- */
|
||||
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)) {
|
||||
|
@ -15,6 +15,7 @@ export class CarteTmr extends Draconique {
|
||||
name: 'Carte des TMR',
|
||||
hint: "Choix de l'image de la carte des TMR",
|
||||
scope: "client",
|
||||
requiresReload: true,
|
||||
config: true,
|
||||
choices: {
|
||||
[TMR_V3_COULEUR]: "TMR Scriptarium v3 couleur",
|
||||
|
@ -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) {
|
||||
|
Reference in New Issue
Block a user