From eda727c4871fddfd917040b4b58a02befa6ff542 Mon Sep 17 00:00:00 2001 From: syuilo Date: Tue, 9 Jan 2024 20:09:47 +0900 Subject: [PATCH] wip --- locales/index.d.ts | 2 ++ locales/ja-JP.yml | 2 ++ packages/frontend/src/pages/drop-and-fusion.vue | 13 ++++++++----- .../frontend/src/scripts/drop-and-fusion-engine.ts | 2 +- 4 files changed, 13 insertions(+), 6 deletions(-) diff --git a/locales/index.d.ts b/locales/index.d.ts index 96bc9099d..32921ca17 100644 --- a/locales/index.d.ts +++ b/locales/index.d.ts @@ -1195,6 +1195,8 @@ export interface Locale { "bubbleGame": string; "sfx": string; "soundWillBePlayed": string; + "replay": string; + "replaying": string; "_announcement": { "forExistingUsers": string; "forExistingUsersDescription": string; diff --git a/locales/ja-JP.yml b/locales/ja-JP.yml index c28fde56c..463b229d6 100644 --- a/locales/ja-JP.yml +++ b/locales/ja-JP.yml @@ -1192,6 +1192,8 @@ enableQuickAddMfmFunction: "高度なMFMのピッカーを表示する" bubbleGame: "バブルゲーム" sfx: "効果音" soundWillBePlayed: "サウンドが再生されます" +replay: "リプレイ" +replaying: "リプレイ中" _announcement: forExistingUsers: "既存ユーザーのみ" diff --git a/packages/frontend/src/pages/drop-and-fusion.vue b/packages/frontend/src/pages/drop-and-fusion.vue index d790d0f0e..622214a2d 100644 --- a/packages/frontend/src/pages/drop-and-fusion.vue +++ b/packages/frontend/src/pages/drop-and-fusion.vue @@ -97,13 +97,13 @@ SPDX-License-Identifier: AGPL-3.0-only
SCORE:
MAX CHAIN:
- Restart - Replay - Share + {{ i18n.ts.ok }} + {{ i18n.ts.replay }} + {{ i18n.ts.share }}
-
REPLAYING
+
{{ i18n.ts.replaying }}
@@ -573,7 +573,10 @@ function attachGameEvents() { }); game.addListener('gameOver', () => { - if (replaying.value) return; + if (replaying.value) { + endReplay(); + return; + } logs = game.getLogs(); currentPick.value = null; diff --git a/packages/frontend/src/scripts/drop-and-fusion-engine.ts b/packages/frontend/src/scripts/drop-and-fusion-engine.ts index 67ce270f6..741668a45 100644 --- a/packages/frontend/src/scripts/drop-and-fusion-engine.ts +++ b/packages/frontend/src/scripts/drop-and-fusion-engine.ts @@ -408,7 +408,7 @@ export class DropAndFusionGame extends EventEmitter<{ Matter.Engine.update(this.engine, this.TICK_DELTA); - window.requestAnimationFrame(playTick); + this.tickRaf = window.requestAnimationFrame(playTick); }; playTick();