Commit 2d979aae authored by Chunchi Che's avatar Chunchi Che

ReplayIgnoreMsg

parent fd6866ae
Pipeline #22619 passed with stages
in 11 minutes and 28 seconds
import { ygopro } from "@/api"; import { ygopro } from "@/api";
import { sleep } from "@/infra"; import { sleep } from "@/infra";
import { matStore } from "@/stores";
import { showWaiting } from "@/ui/Duel/Message"; import { showWaiting } from "@/ui/Duel/Message";
import onAnnounce from "./announce"; import onAnnounce from "./announce";
...@@ -69,6 +70,24 @@ const ActiveList = [ ...@@ -69,6 +70,24 @@ const ActiveList = [
"select_yes_no", "select_yes_no",
]; ];
const ReplayIgnoreMsg = [
"select_idle_cmd",
"select_place",
"select_card",
"select_chain",
"select_effect_yn",
"select_position",
"select_option",
"select_battle_cmd",
"select_unselect_card",
"select_yes_no",
"select_tribute",
"select_counter",
"rock_paper_scissors",
"sort_card",
"announce",
];
let animation: Promise<unknown> = new Promise<void>((rs) => rs()); let animation: Promise<unknown> = new Promise<void>((rs) => rs());
export default async function handleGameMsg(pb: ygopro.YgoStocMsg) { export default async function handleGameMsg(pb: ygopro.YgoStocMsg) {
...@@ -83,6 +102,8 @@ async function _handleGameMsg(pb: ygopro.YgoStocMsg) { ...@@ -83,6 +102,8 @@ async function _handleGameMsg(pb: ygopro.YgoStocMsg) {
showWaiting(false); showWaiting(false);
} }
if (matStore.isReplay && ReplayIgnoreMsg.includes(msg.gameMsg)) return;
switch (msg.gameMsg) { switch (msg.gameMsg) {
case "start": { case "start": {
await onMsgStart(msg.start); await onMsgStart(msg.start);
......
...@@ -66,7 +66,7 @@ const ReplayModal: React.FC = () => { ...@@ -66,7 +66,7 @@ const ReplayModal: React.FC = () => {
await rustInit(url); await rustInit(url);
// 初始化额外卡组 // 初始化额外卡组
// FIXME: 这样写肯定不对 // FIXME: 这样写应该不对,有空来修
window.myExtraDeckCodes = []; window.myExtraDeckCodes = [];
// 初始化sqlite // 初始化sqlite
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment