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