Commit eb51fd10 authored by Chunchi Che's avatar Chunchi Che

fix small

parent 05f29ab5
Pipeline #21740 passed with stages
in 13 minutes and 45 seconds
import { ygopro } from "@/api";
import { sleep } from "@/infra";
import { fetchEsHintMeta, matStore } from "@/stores";
import { zip } from "@/ui/Duel/utils";
export default (draw: ygopro.StocGameMessage.MsgDraw) => {
export default async (draw: ygopro.StocGameMessage.MsgDraw) => {
fetchEsHintMeta({ originMsg: "玩家抽卡时" });
const deckLength = matStore.decks.of(draw.player).length;
......@@ -19,9 +20,9 @@ export default (draw: ygopro.StocGameMessage.MsgDraw) => {
.of(draw.player)
.add(data, ygopro.CardPosition.FACEUP_ATTACK, true);
setTimeout(() => {
for (const hand of matStore.hands.of(draw.player)) {
hand.focus = false;
}
}, 500);
await sleep(500);
for (const hand of matStore.hands.of(draw.player)) {
hand.focus = false;
}
};
......@@ -70,7 +70,7 @@ export default async function handleGameMsg(pb: ygopro.YgoStocMsg) {
break;
}
case "draw": {
onMsgDraw(msg.draw);
await onMsgDraw(msg.draw);
break;
}
......
......@@ -110,10 +110,7 @@ export default async (move: MsgMove) => {
);
await sleep(NeosConfig.ui.moveDelay);
// 因为手牌可能会洗牌,sequence就对不上了,所以这里把所有手牌的focus字段都设置成false
for (const hand of matStore.in(to.location).of(to.controler)) {
hand.focus = false;
}
matStore.in(to.location).of(to.controler)[to.sequence].focus = false;
}
break;
}
......
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