From 4b1573ab8b29e15551ee284abbd0aaa7323c890e Mon Sep 17 00:00:00 2001 From: Vincent Vandemeulebrouck Date: Wed, 21 Sep 2022 02:09:19 +0200 Subject: [PATCH 1/6] =?UTF-8?q?R=C3=A9tablissement=20des=20ic=C3=B4nes=20R?= =?UTF-8?q?dD=20des=20onglets=20Foundry?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Perdus avec le changement d'entrée FontAwsome --- styles/simple.css | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/styles/simple.css b/styles/simple.css index 275c3375..7b121391 100644 --- a/styles/simple.css +++ b/styles/simple.css @@ -1146,9 +1146,16 @@ ul, li { } -#sidebar #sidebar-tabs i.fa-comments:before, #sidebar #sidebar-tabs i.fa-fist-raised:before, #sidebar #sidebar-tabs i.fa-users:before, #sidebar #sidebar-tabs i.fa-map:before, #sidebar #sidebar-tabs i.fa-suitcase:before, #sidebar #sidebar-tabs i.fa-book-open:before, #sidebar #sidebar-tabs i.fa-th-list:before, #sidebar #sidebar-tabs i.fa-music:before, #sidebar #sidebar-tabs i.fa-atlas:before, #sidebar #sidebar-tabs i.fa-cogs:before {content: "";} +#sidebar #sidebar-tabs i:is( + .fa-comments, .fa-fist-raised, .fa-swords, + .fa-users, .fa-user, .fa-map, .fa-suitcase, + .fa-book-open, .fa-th-list, .fa-music, + .fa-atlas,.fa-cogs +):before {content: "";} #sidebar #sidebar-tabs i.fa-comments {background: url("img/ui/icon_sidebar_chat.svg") no-repeat;} #sidebar #sidebar-tabs i.fa-fist-raised {background: url("img/ui/icon_sidebar_fight.svg") no-repeat;} +#sidebar #sidebar-tabs i.fa-swords {background: url("img/ui/icon_sidebar_fight.svg") no-repeat;} +#sidebar #sidebar-tabs i.fa-user {background: url("img/ui/icon_sidebar_actor.svg") no-repeat;} #sidebar #sidebar-tabs i.fa-users {background: url("img/ui/icon_sidebar_actor.svg") no-repeat;} #sidebar #sidebar-tabs i.fa-map {background: url("img/ui/icon_sidebar_scene.svg") no-repeat;} #sidebar #sidebar-tabs i.fa-suitcase {background: url("img/ui/icon_sidebar_item.svg") no-repeat;} From c76bf912d14b79dad806b9eb153816744806b4e7 Mon Sep 17 00:00:00 2001 From: Vincent Vandemeulebrouck Date: Wed, 21 Sep 2022 14:13:43 +0200 Subject: [PATCH 2/6] Fix compteur d'utilisations d'esquive --- module/rdd-combat.js | 2 +- templates/chat-demande-defense.html | 7 ++++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/module/rdd-combat.js b/module/rdd-combat.js index 09a9acbd..3c7f2ca8 100644 --- a/module/rdd-combat.js +++ b/module/rdd-combat.js @@ -833,7 +833,7 @@ export class RdDCombat { // # utilisation esquive const corpsACorps = this.defender.getCompetence("Corps à corps", { onMessage: it => console.info(it, this.defender) }); const esquives = duplicate(this.defender.getCompetences("esquive", { onMessage: it => console.info(it, this.defender) })) - esquives.forEach(e => e.usages = e?.id ? this.defender.getItemUse(e.id) : 0); + esquives.forEach(e => e.system.nbUsage = e?._id ? this.defender.getItemUse(e._id) : 0); const paramChatDefense = { passeArme: attackerRoll.passeArme, diff --git a/templates/chat-demande-defense.html b/templates/chat-demande-defense.html index 2cab97b3..30d37d91 100644 --- a/templates/chat-demande-defense.html +++ b/templates/chat-demande-defense.html @@ -50,10 +50,11 @@
{{/if}} {{#if (ne attaqueCategorie 'tir')}} - {{#each esquives as |esq key|}} + {{#each esquives as |esquive key|}} - {{esq.name}} à {{../diffLibre}} {{#if esq.usage}} (Utilisations : {{esq.usage}}){{/if}} + data-compid='{{esquive._id}}' data-competence='{{esquive.name}}'> + {{log 'esquive' esquive}} + {{esquive.name}} à {{../diffLibre}} {{#if esquive.system.nbUsage}} (Utilisations : {{esquive.system.nbUsage}}){{/if}}
{{/each}} From e69fb222c3174cd8fd1932ac6e4d0c147a66cc70 Mon Sep 17 00:00:00 2001 From: Vincent Vandemeulebrouck Date: Wed, 21 Sep 2022 16:46:09 +0200 Subject: [PATCH 3/6] =?UTF-8?q?Affiche=20le=20type=20de=20case=20si=20TMR?= =?UTF-8?q?=20cach=C3=A9es?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- templates/actor-sheet.html | 25 +++++++++++-------------- 1 file changed, 11 insertions(+), 14 deletions(-) diff --git a/templates/actor-sheet.html b/templates/actor-sheet.html index 5e46beee..0c37d61d 100644 --- a/templates/actor-sheet.html +++ b/templates/actor-sheet.html @@ -464,24 +464,21 @@ {{/if}}
  • + Demi rêve : {{#if options.isGM}} - Demi rêve : - {{caseTmr-label system.reve.tmrpos.coord}} - - + {{caseTmr-label system.reve.tmrpos.coord}} + - - + {{else if hautreve.cacheTMR}} + {{caseTmr-type system.reve.tmrpos.coord}} + + ?? {{else}} - Demi rêve : - {{#unless hautreve.cacheTMR}} - {{caseTmr-label system.reve.tmrpos.coord}} - {{/unless}} - - - {{#if hautreve.cacheTMR}}??{{else}}{{system.reve.tmrpos.coord}}{{/if}} - + {{caseTmr-label system.reve.tmrpos.coord}} + + {{system.reve.tmrpos.coord}} {{/if}} +
  • {{/if}}
  • From ca893088d22516adb43d040a5e48c666f2b47275 Mon Sep 17 00:00:00 2001 From: Vincent Vandemeulebrouck Date: Wed, 21 Sep 2022 16:46:41 +0200 Subject: [PATCH 4/6] =?UTF-8?q?D=C3=A9tails=20de=20case=20pour=20les=20sor?= =?UTF-8?q?ts=20en=20r=C3=A9serve?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- templates/item-sortreserve-sheet.html | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/templates/item-sortreserve-sheet.html b/templates/item-sortreserve-sheet.html index 144751c1..53d9a7ce 100644 --- a/templates/item-sortreserve-sheet.html +++ b/templates/item-sortreserve-sheet.html @@ -21,6 +21,10 @@ +
    + + +
    From c37c68e6db53b7a4b98e5a9f3e86c3f3d3a71412 Mon Sep 17 00:00:00 2001 From: Vincent Vandemeulebrouck Date: Wed, 21 Sep 2022 16:47:34 +0200 Subject: [PATCH 5/6] =?UTF-8?q?Fix=20erreur=20quand=20la=20fen=C3=AAtre=20?= =?UTF-8?q?est=20ferm=C3=A9e?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Erreur dans les logs, par exemple, suite à une rencontre --- module/rdd-tmr-dialog.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/module/rdd-tmr-dialog.js b/module/rdd-tmr-dialog.js index 7ff6d0c3..d39e9bd6 100644 --- a/module/rdd-tmr-dialog.js +++ b/module/rdd-tmr-dialog.js @@ -250,6 +250,9 @@ export class RdDTMRDialog extends Dialog { /* -------------------------------------------- */ async updateValuesDisplay() { + if (!this.rendered) { + return; + } const coord = this._getActorCoord(); HtmlUtility._showControlWhen($(".lire-signe-draconique"), this.actor.isResonanceSigneDraconique(coord)); From 21fc62b302a5a4aa54d831fa4d64138124c193c2 Mon Sep 17 00:00:00 2001 From: Vincent Vandemeulebrouck Date: Thu, 22 Sep 2022 00:33:50 +0200 Subject: [PATCH 6/6] =?UTF-8?q?Fix=20de=20la=20s=C3=A9quence=20TMR?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Lors d'une rencontre/case humide/conquête/..., le haut rêvant déclenchait tout de même les sorts en réserve --- module/rdd-tmr-dialog.js | 67 ++++++++++++------------------ module/rdd-tmr-rencontre-dialog.js | 2 +- 2 files changed, 27 insertions(+), 42 deletions(-) diff --git a/module/rdd-tmr-dialog.js b/module/rdd-tmr-dialog.js index d39e9bd6..7d7d03d0 100644 --- a/module/rdd-tmr-dialog.js +++ b/module/rdd-tmr-dialog.js @@ -214,24 +214,12 @@ export class RdDTMRDialog extends Dialog { this.actor.rollLireSigneDraconique(this._getActorCoord()); }); - html.find('#dir-top').click((event) => { - this.moveFromKey("top"); - }); - html.find('#dir-top-left').click((event) => { - this.moveFromKey("top-left"); - }); - html.find('#dir-top-right').click((event) => { - this.moveFromKey("top-right"); - }); - html.find('#dir-bottom-left').click((event) => { - this.moveFromKey("bottom-left"); - }); - html.find('#dir-bottom-right').click((event) => { - this.moveFromKey("bottom-right"); - }); - html.find('#dir-bottom').click((event) => { - this.moveFromKey("bottom"); - }); + html.find('#dir-top').click((event) => this.moveFromKey("top")); + html.find('#dir-top-left').click((event) => this.moveFromKey("top-left")); + html.find('#dir-top-right').click((event) => this.moveFromKey("top-right")); + html.find('#dir-bottom-left').click((event) => this.moveFromKey("bottom-left")); + html.find('#dir-bottom-right').click((event) => this.moveFromKey("bottom-right")); + html.find('#dir-bottom').click((event) => this.moveFromKey("bottom")); // Gestion du cout de montée en points de rêve let reveCout = ((this.tmrdata.isRapide && !EffetsDraconiques.isDeplacementAccelere(this.actor)) ? -2 : -1) - this.actor.countMonteeLaborieuse(); @@ -243,9 +231,7 @@ export class RdDTMRDialog extends Dialog { // Le reste... this.updateValuesDisplay(); let tmr = TMRUtility.getTMR(this._getActorCoord()); - await this.manageRencontre(tmr, () => { - this.postRencontre(tmr); - }); + await this.manageRencontre(tmr); } /* -------------------------------------------- */ @@ -281,6 +267,7 @@ export class RdDTMRDialog extends Dialog { /* -------------------------------------------- */ async close() { + this.descenteTMR = true; if (this.actor.tmrApp) { this.actor.tmrApp = undefined; // Cleanup reference if (!this.viewOnly) { @@ -486,12 +473,13 @@ export class RdDTMRDialog extends Dialog { } /* -------------------------------------------- */ - async manageRencontre(tmr, postRencontre) { + async manageRencontre(tmr) { if (this.viewOnly) { return; } + this.descenteTMR = false; this.currentRencontre = undefined; - if (this._presentCite(tmr, postRencontre)) { + if (this._presentCite(tmr)) { return; } let rencontre = await this._jetDeRencontre(tmr); @@ -501,27 +489,27 @@ export class RdDTMRDialog extends Dialog { console.log("manageRencontre", rencontre); this.currentRencontre = duplicate(rencontre); - let dialog = new RdDTMRRencontreDialog("", this, this.currentRencontre, postRencontre); + let dialog = new RdDTMRRencontreDialog(this, this.currentRencontre, () => this.postRencontre(tmr)); dialog.render(true); } else { - postRencontre(); + this.postRencontre(tmr); } } /* -------------------------------------------- */ - _presentCite(tmr, postRencontre) { + _presentCite(tmr) { const presentCite = this.casesSpeciales.find(c => EffetsDraconiques.presentCites.isCase(c, tmr.coord)); if (presentCite) { this.minimize(); const caseData = presentCite; - EffetsDraconiques.presentCites.choisirUnPresent(caseData, (type => this._utiliserPresentCite(presentCite, type, tmr, postRencontre))); + EffetsDraconiques.presentCites.choisirUnPresent(caseData, (type => this._utiliserPresentCite(presentCite, type, tmr))); } return presentCite; } /* -------------------------------------------- */ - async _utiliserPresentCite(presentCite, typeRencontre, tmr, postRencontre) { + async _utiliserPresentCite(presentCite, typeRencontre, tmr) { this.currentRencontre = TMRRencontres.getRencontre(typeRencontre); await TMRRencontres.evaluerForceRencontre(this.currentRencontre); await EffetsDraconiques.presentCites.ouvrirLePresent(this.actor, presentCite); @@ -540,7 +528,7 @@ export class RdDTMRDialog extends Dialog { await this._tentativeMaitrise(rencontreData); this.maximize(); - postRencontre(); + this.postRencontre(tmr); } /* -------------------------------------------- */ @@ -611,7 +599,6 @@ export class RdDTMRDialog extends Dialog { async _resultatMaitriseCaseHumide(rollData) { await this.souffleSiEchecTotal(rollData); - this.toclose = rollData.rolled.isEchec; if (rollData.rolled.isSuccess && rollData.double) { rollData.previous = { rolled: rollData.rolled, ajustements: rollData.ajustements }; rollData.double = undefined; @@ -624,7 +611,7 @@ export class RdDTMRDialog extends Dialog { content: await renderTemplate(`systems/foundryvtt-reve-de-dragon/templates/chat-resultat-maitrise-tmr.html`, rollData) }); if (rollData.rolled.isEchec) { - this.close(); + await this.close(); } } @@ -734,8 +721,6 @@ export class RdDTMRDialog extends Dialog { if (rollData.rolled.isETotal) { rollData.souffle = await this.actor.ajouterSouffle({ chat: false }); } - this.toclose = rollData.rolled.isEchec; - rollData.poesie = await Poetique.getExtrait(); ChatMessage.create({ whisper: ChatUtility.getWhisperRecipientsAndGMs(game.user.name), @@ -982,7 +967,7 @@ export class RdDTMRDialog extends Dialog { this.actor.notifyRefreshTMR(); if (deplacementType == 'normal') { // Pas de rencontres après un saut de type passeur/changeur/... - await this.manageRencontre(tmr, () => this.postRencontre(tmr)); + await this.manageRencontre(tmr); } else { await this.postRencontre(tmr); @@ -1002,13 +987,13 @@ export class RdDTMRDialog extends Dialog { async postRencontre(tmr) { if (!(this.viewOnly || this.currentRencontre)) { // TODO: vérifier que la méthode s'arrête en cas de non-maîtrise - await this.manageCaseHumide(tmr); - await this.conquerirCiteFermee(tmr); - await this.purifierPeriple(tmr); - await this.conquerirTMR(tmr); - await this.validerVisite(tmr); - await this.declencheSortEnReserve(tmr.coord); - await this.actor.checkSoufflePeage(tmr); + if (!this.descenteTMR) await this.manageCaseHumide(tmr); + if (!this.descenteTMR) await this.conquerirCiteFermee(tmr); + if (!this.descenteTMR) await this.purifierPeriple(tmr); + if (!this.descenteTMR) await this.conquerirTMR(tmr); + if (!this.descenteTMR) await this.validerVisite(tmr); + if (!this.descenteTMR) await this.declencheSortEnReserve(tmr.coord); + if (!this.descenteTMR) await this.actor.checkSoufflePeage(tmr); } } diff --git a/module/rdd-tmr-rencontre-dialog.js b/module/rdd-tmr-rencontre-dialog.js index 50b03df2..ac21f161 100644 --- a/module/rdd-tmr-rencontre-dialog.js +++ b/module/rdd-tmr-rencontre-dialog.js @@ -2,7 +2,7 @@ export class RdDTMRRencontreDialog extends Dialog { /* -------------------------------------------- */ - constructor(html, tmrApp, rencontre, postRencontre) { + constructor(tmrApp, rencontre, postRencontre) { const dialogConf = { title: "Rencontre en TMR!", content: "Vous rencontrez un " + rencontre.name + " de force " + rencontre.force + "
    ",