diff --git a/.gitea/workflows/release.yaml b/.gitea/workflows/release.yaml new file mode 100644 index 0000000..f03fa2b --- /dev/null +++ b/.gitea/workflows/release.yaml @@ -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}}" diff --git a/fvtt-hamalron.mjs b/fvtt-hamalron.mjs index 17f1fd4..72b7089 100644 --- a/fvtt-hamalron.mjs +++ b/fvtt-hamalron.mjs @@ -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 }) }) diff --git a/lang/fr.json b/lang/fr.json index c543279..45b0019 100644 --- a/lang/fr.json +++ b/lang/fr.json @@ -556,6 +556,7 @@ "total": "Total", "player": "Joueur", "gm": "MJ", + "opposant": "Opposant", "totalScore": "Score total", "totalValue": "Valeur totale", "cardValue": "Valeur de la carte", diff --git a/module/applications/tarot-deck-manager.mjs b/module/applications/tarot-deck-manager.mjs index 920145d..9ed1f1d 100644 --- a/module/applications/tarot-deck-manager.mjs +++ b/module/applications/tarot-deck-manager.mjs @@ -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 }) diff --git a/templates/chat-tension.hbs b/templates/chat-tension.hbs index 7edcb4d..52eea93 100644 --- a/templates/chat-tension.hbs +++ b/templates/chat-tension.hbs @@ -13,8 +13,8 @@
{{joueurName}}
VS
-
-
{{localize "HAMALRON.Label.gm"}}
+
+
{{#if isSousTension}}{{localize "HAMALRON.Label.gm"}}{{else}}{{localize "HAMALRON.Label.opposant"}}{{/if}}
{{mjScore}}
{{mjCard}}