fix: 3 bugs suite revue — race condition ensureDeck, label MJ/Opposant, rename isMJ
- tarot-deck-manager: supprime appel auto loadDeckState() du constructeur - ensureDeck: appelle explicitement dm.loadDeckState() après création - openManager: devient async, appelle loadDeckState() sur nouvelle instance - chat-tension.hbs: utilise isSousTension pour afficher MJ ou Opposant - fvtt-hamalron.mjs: renomme isMJ → isOpponentWinning (clarifie intention) - lang/fr.json: ajoute clé opposant - .gitea/workflows/release.yaml: workflow release Gitea
This commit is contained in:
+3
-2
@@ -292,6 +292,7 @@ async function ensureDeck() {
|
||||
const DM = game.system.api.applications.HamalronTarotDeckManager
|
||||
dm = new DM()
|
||||
DM._instance = dm
|
||||
await dm.loadDeckState()
|
||||
}
|
||||
if (dm.deck.length === 0) {
|
||||
await dm.resetDeck()
|
||||
@@ -330,7 +331,7 @@ $(document).on("click", "[data-action='sousTension']", async function () {
|
||||
"systems/fvtt-hamalron/templates/chat-tension.hbs",
|
||||
{ cssClass: "fvtt-hamalron tension-roll", icon: "fa-bolt", label: game.i18n.localize("HAMALRON.Label.sousTension"),
|
||||
joueurName: actorName, joueurScore: totalJoueur, mjCard: `${card.name} (${valeurMJ})`, mjScore: valeurMJ,
|
||||
isSuccess: successA, isMJ: totalJoueur < valeurMJ, isSousTension: true })
|
||||
isSuccess: successA, isOpponentWinning: totalJoueur < valeurMJ, isSousTension: true })
|
||||
ChatMessage.create({ content, style: CONST.CHAT_MESSAGE_STYLES.OTHER })
|
||||
})
|
||||
|
||||
@@ -360,7 +361,7 @@ $(document).on("click", "[data-action='oppose']", async function () {
|
||||
"systems/fvtt-hamalron/templates/chat-tension.hbs",
|
||||
{ cssClass: "fvtt-hamalron tension-roll", icon: "fa-shield-halved", label: game.i18n.localize("HAMALRON.Label.oppose"),
|
||||
joueurName: actorName, joueurScore: totalJoueur, mjCard: `${card.name} (${valeurOpposant})`, mjScore: valeurOpposant,
|
||||
isSuccess: successB, isMJ: totalJoueur < valeurOpposant, isSousTension: false })
|
||||
isSuccess: successB, isOpponentWinning: totalJoueur < valeurOpposant, isSousTension: false })
|
||||
ChatMessage.create({ content, style: CONST.CHAT_MESSAGE_STYLES.OTHER })
|
||||
})
|
||||
|
||||
|
||||
Reference in New Issue
Block a user