Commit 190bf880 authored by Chunchi Che's avatar Chunchi Che

udpate select idle cmd service

parent 4c983063
Pipeline #19763 failed with stages
in 1 minute and 43 seconds
......@@ -2,14 +2,13 @@ import { ygopro } from "../../api/ocgcore/idl/ocgcore";
import { AppDispatch } from "../../store";
import { Interactivity, InteractType } from "../../reducers/duel/generic";
import {
clearHandsIdleInteractivity,
addHandsIdleInteractivity,
addMonsterIdleInteractivities,
addMagicIdleInteractivities,
clearMonsterIdleInteractivities,
clearMagicIdleInteractivities,
setEnableBp,
setEnableEp,
addCemeteryIdleInteractivities,
clearAllIdleInteractivities,
} from "../../reducers/duel/mod";
import MsgSelectIdleCmd = ygopro.StocGameMessage.MsgSelectIdleCmd;
import { ActionCreatorWithPayload } from "@reduxjs/toolkit";
......@@ -19,9 +18,7 @@ export default (selectIdleCmd: MsgSelectIdleCmd, dispatch: AppDispatch) => {
const cmds = selectIdleCmd.idle_cmds;
// 先清掉之前的互动性
dispatch(clearHandsIdleInteractivity(player));
dispatch(clearMonsterIdleInteractivities(player));
dispatch(clearMagicIdleInteractivities(player));
dispatch(clearAllIdleInteractivities(player));
const dispatcher = (
idleData: MsgSelectIdleCmd.IdleCmd.IdleData,
......@@ -83,7 +80,13 @@ export default (selectIdleCmd: MsgSelectIdleCmd, dispatch: AppDispatch) => {
break;
}
case ygopro.CardZone.GRAVE: {
dispatcher(data, interactType, addCemeteryIdleInteractivities);
break;
}
default: {
console.log(`Unhandled zone type: ${cardInfo.location}`);
}
}
});
......
......@@ -10,7 +10,7 @@ import {
} from "../../reducers/duel/modal/mod";
import {
setCardModalIsOpen,
clearHandsIdleInteractivity,
clearAllIdleInteractivities,
} from "../../reducers/duel/mod";
import { Modal, Card, Button } from "antd";
import { sendSelectIdleCmdResponse } from "../../api/ocgcore/ocgHelper";
......@@ -47,7 +47,8 @@ const CardModal = () => {
onClick={() => {
sendSelectIdleCmdResponse(interactive.response);
dispatch(setCardModalIsOpen(false));
dispatch(clearHandsIdleInteractivity(0));
dispatch(clearAllIdleInteractivities(0));
dispatch(clearAllIdleInteractivities(1));
}}
>
{interactive.desc}
......
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