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:
@@ -0,0 +1,48 @@
|
||||
name: Release Creation
|
||||
|
||||
on:
|
||||
release:
|
||||
types: [published]
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- run: echo "💡 The ${{ gitea.repository }} repository will cloned to the runner."
|
||||
|
||||
- uses: https://github.com/RouxAntoine/checkout@v3.5.4
|
||||
|
||||
- name: Extract tag version number
|
||||
id: get_version
|
||||
uses: https://github.com/battila7/get-version-action@v2
|
||||
|
||||
- name: Substitute Manifest and Download Links For Versioned Ones
|
||||
id: sub_manifest_link_version
|
||||
uses: https://github.com/microsoft/variable-substitution@v1
|
||||
with:
|
||||
files: "system.json"
|
||||
env:
|
||||
version: ${{steps.get_version.outputs.version-without-v}}
|
||||
url: https://www.uberwald.me/gitea/${{gitea.repository}}
|
||||
manifest: https://www.uberwald.me/gitea/public/fvtt-hamalron/releases/download/latest/system.json
|
||||
download: https://www.uberwald.me/gitea/public/fvtt-hamalron/releases/download/${{github.event.release.tag_name}}/fvtt-hamalron.zip
|
||||
|
||||
- run: |
|
||||
apt update -y
|
||||
apt install -y zip
|
||||
|
||||
- run: zip -r ./fvtt-hamalron.zip system.json README.md LICENSE assets/ css/ lang/ module/ packs-system/ scripts/ templates/ fvtt-hamalron.mjs
|
||||
|
||||
- name: setup go
|
||||
uses: https://github.com/actions/setup-go@v4
|
||||
with:
|
||||
go-version: ">=1.20.1"
|
||||
|
||||
- name: Use Go Action
|
||||
id: use-go-action
|
||||
uses: https://gitea.com/actions/release-action@main
|
||||
with:
|
||||
files: |-
|
||||
./fvtt-hamalron.zip
|
||||
system.json
|
||||
api_key: "${{secrets.ALLOW_PUSH_RELEASE}}"
|
||||
+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 })
|
||||
})
|
||||
|
||||
|
||||
@@ -556,6 +556,7 @@
|
||||
"total": "Total",
|
||||
"player": "Joueur",
|
||||
"gm": "MJ",
|
||||
"opposant": "Opposant",
|
||||
"totalScore": "Score total",
|
||||
"totalValue": "Valeur totale",
|
||||
"cardValue": "Valeur de la carte",
|
||||
|
||||
@@ -5,7 +5,6 @@ export default class HamalronTarotDeckManager extends HandlebarsApplicationMixin
|
||||
super(options)
|
||||
this.deck = []
|
||||
this.discard = []
|
||||
this.loadDeckState().catch(e => console.warn("Deck init error:", e))
|
||||
}
|
||||
|
||||
/** @override */
|
||||
@@ -719,7 +718,7 @@ export default class HamalronTarotDeckManager extends HandlebarsApplicationMixin
|
||||
* Open the Tarot Deck Manager application
|
||||
* @returns {HamalronTarotDeckManager}
|
||||
*/
|
||||
static openManager() {
|
||||
static async openManager() {
|
||||
if (!game.user.isGM) {
|
||||
ui.notifications.warn("HAMALRON.TarotDeck.GMOnly", { localize: true })
|
||||
return
|
||||
@@ -728,6 +727,7 @@ export default class HamalronTarotDeckManager extends HandlebarsApplicationMixin
|
||||
// Singleton pattern - reuse existing instance or create new one
|
||||
if (!HamalronTarotDeckManager._instance) {
|
||||
HamalronTarotDeckManager._instance = new HamalronTarotDeckManager()
|
||||
await HamalronTarotDeckManager._instance.loadDeckState()
|
||||
}
|
||||
|
||||
HamalronTarotDeckManager._instance.render(true, { focus: true })
|
||||
|
||||
@@ -13,8 +13,8 @@
|
||||
<div class="tension-side-name">{{joueurName}}</div>
|
||||
</div>
|
||||
<div class="tension-vs">VS</div>
|
||||
<div class="tension-side {{#if isMJ}}tension-winner{{/if}}">
|
||||
<div class="tension-side-label">{{localize "HAMALRON.Label.gm"}}</div>
|
||||
<div class="tension-side {{#if isOpponentWinning}}tension-winner{{/if}}">
|
||||
<div class="tension-side-label">{{#if isSousTension}}{{localize "HAMALRON.Label.gm"}}{{else}}{{localize "HAMALRON.Label.opposant"}}{{/if}}</div>
|
||||
<div class="tension-side-value">{{mjScore}}</div>
|
||||
<div class="tension-side-name">{{mjCard}}</div>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user