Commit 540efd5a authored by Chunchi Che's avatar Chunchi Che

fix clear idle cmds

parent d70ae0ee
Pipeline #27001 passed with stages
in 11 minutes and 35 seconds
......@@ -22,6 +22,7 @@ import {
displaySimpleSelectCardsModal,
} from "../../Message";
import {
clearAllIdleInteractivities,
clearSelectInfo,
interactTypeToIcon,
interactTypeToString,
......@@ -161,6 +162,7 @@ export const Card: React.FC<{ idx: number }> = React.memo(({ idx }) => {
// 单卡: 直接召唤/特殊召唤/...
const card = cards[0];
sendSelectIdleCmdResponse(getNonEffectResponse(action, card));
clearAllIdleInteractivities();
} else {
// 场地: 选择卡片
// TODO: hint
......@@ -171,7 +173,10 @@ export const Card: React.FC<{ idx: number }> = React.memo(({ idx }) => {
response: getNonEffectResponse(action, card),
})),
});
if (option.length > 0) {
sendSelectIdleCmdResponse(option[0].response!);
clearAllIdleInteractivities();
}
}
},
}),
......
......@@ -26,20 +26,15 @@ import {
sendSurrender,
ygopro,
} from "@/api";
import { cardStore, ChainSetting, matStore } from "@/stores";
import { ChainSetting, matStore } from "@/stores";
import { IconFont } from "@/ui/Shared";
import styles from "./index.module.scss";
import PhaseType = ygopro.StocGameMessage.MsgNewPhase.PhaseType;
import { clearSelectInfo } from "../../utils";
import { clearAllIdleInteractivities, clearSelectInfo } from "../../utils";
import { openChatBox } from "../ChatBox";
const { useToken } = theme;
const clearAllIdleInteractivities = () => {
for (const card of cardStore.inner) {
card.idleInteractivities = [];
}
};
const FINISH_CANCEL_RESPONSE = -1;
......
import { cardStore } from "@/stores";
export function clearAllIdleInteractivities() {
for (const card of cardStore.inner) {
card.idleInteractivities = [];
}
}
export * from "./clearAllIdleInteractivities";
export * from "./clearSelectInfo";
export * from "./groupBy";
export * from "./interactTypeToStringIcon";
......
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