Commit 24d62791 authored by chechunchi's avatar chechunchi

fix small

parent 7d31ef65
...@@ -104,7 +104,7 @@ async function _handleGameMsg(pb: ygopro.YgoStocMsg) { ...@@ -104,7 +104,7 @@ async function _handleGameMsg(pb: ygopro.YgoStocMsg) {
break; break;
} }
case "hint": { case "hint": {
onMsgHint(msg.hint); await onMsgHint(msg.hint);
break; break;
} }
......
...@@ -7,10 +7,10 @@ import { ...@@ -7,10 +7,10 @@ import {
import MsgHint = ygopro.StocGameMessage.MsgHint; import MsgHint = ygopro.StocGameMessage.MsgHint;
export default (hint: MsgHint) => { export default async (hint: MsgHint) => {
switch (hint.hint_type) { switch (hint.hint_type) {
case MsgHint.HintType.HINT_EVENT: { case MsgHint.HintType.HINT_EVENT: {
fetchEsHintMeta({ originMsg: hint.hint_data }); await fetchEsHintMeta({ originMsg: hint.hint_data });
break; break;
} }
case MsgHint.HintType.HINT_MESSAGE: { case MsgHint.HintType.HINT_MESSAGE: {
...@@ -18,7 +18,7 @@ export default (hint: MsgHint) => { ...@@ -18,7 +18,7 @@ export default (hint: MsgHint) => {
break; break;
} }
case MsgHint.HintType.HINT_SELECTMSG: { case MsgHint.HintType.HINT_SELECTMSG: {
fetchSelectHintMeta({ await fetchSelectHintMeta({
selectHintData: hint.hint_data, selectHintData: hint.hint_data,
esHint: "", esHint: "",
}); });
......
...@@ -63,7 +63,7 @@ export default async (selectChain: MsgSelectChain) => { ...@@ -63,7 +63,7 @@ export default async (selectChain: MsgSelectChain) => {
case 2: // 处理多张 case 2: // 处理多张
case 3: { case 3: {
// 处理强制发动的卡 // 处理强制发动的卡
fetchSelectHintMeta({ await fetchSelectHintMeta({
selectHintData: 203, selectHintData: 203,
}); });
const { selecteds, mustSelects, selectables } = await fetchCheckCardMeta( const { selecteds, mustSelects, selectables } = await fetchCheckCardMeta(
......
...@@ -72,8 +72,8 @@ export const SelectCardsModal: React.FC<SelectCardsModalProps> = ({ ...@@ -72,8 +72,8 @@ export const SelectCardsModal: React.FC<SelectCardsModalProps> = ({
const [submitable, setSubmitable] = useState(false); const [submitable, setSubmitable] = useState(false);
const hint = useSnapshot(matStore.hint); const hint = useSnapshot(matStore.hint);
const preHintMsg = hint?.esHint || ""; const preHintMsg = hint.esHint || "";
const selectHintMsg = hint?.esSelectHint || "请选择卡片"; const selectHintMsg = hint.esSelectHint || "请选择卡片";
const minMaxText = min === max ? min : `${min}-${max}`; const minMaxText = min === max ? min : `${min}-${max}`;
......
...@@ -6,20 +6,9 @@ import classnames from "classnames"; ...@@ -6,20 +6,9 @@ import classnames from "classnames";
import React, { type CSSProperties, useEffect, useState } from "react"; import React, { type CSSProperties, useEffect, useState } from "react";
import { proxy, useSnapshot } from "valtio"; import { proxy, useSnapshot } from "valtio";
import { import { getCardStr, sendSelectIdleCmdResponse, ygopro } from "@/api";
fetchStrings,
getCardStr,
sendSelectIdleCmdResponse,
ygopro,
} from "@/api";
import { eventbus, Task } from "@/infra"; import { eventbus, Task } from "@/infra";
import { import { cardStore, CardType, Interactivity, InteractType } from "@/stores";
cardStore,
CardType,
Interactivity,
InteractType,
matStore,
} from "@/stores";
import { showCardModal as displayCardModal } from "@/ui/Duel/Message/CardModal"; import { showCardModal as displayCardModal } from "@/ui/Duel/Message/CardModal";
import { YgoCard } from "@/ui/Shared"; import { YgoCard } from "@/ui/Shared";
...@@ -297,12 +286,7 @@ const handleDropdownMenu = (cards: CardType[], isField: boolean) => { ...@@ -297,12 +286,7 @@ const handleDropdownMenu = (cards: CardType[], isField: boolean) => {
sendSelectIdleCmdResponse(getNonEffectResponse(action, card)); sendSelectIdleCmdResponse(getNonEffectResponse(action, card));
} else { } else {
// 场地: 选择卡片 // 场地: 选择卡片
// TODO: hint
// 更新hint
matStore.hint = {
code: 0,
esSelectHint: fetchStrings("!system", 509),
};
const option = await displaySimpleSelectCardsModal({ const option = await displaySimpleSelectCardsModal({
selectables: cards.map((card) => ({ selectables: cards.map((card) => ({
meta: card.meta, meta: card.meta,
...@@ -335,11 +319,7 @@ const handleDropdownMenu = (cards: CardType[], isField: boolean) => { ...@@ -335,11 +319,7 @@ const handleDropdownMenu = (cards: CardType[], isField: boolean) => {
card = cards[0]; card = cards[0];
} else { } else {
// 场地: 选择卡片 // 场地: 选择卡片
// 更新hint // TODO: hint
matStore.hint = {
code: 0,
esSelectHint: fetchStrings("!system", 566),
};
const option = await displaySimpleSelectCardsModal({ const option = await displaySimpleSelectCardsModal({
selectables: cards selectables: cards
// 过滤掉不能发效果的卡 // 过滤掉不能发效果的卡
......
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