Commit 44ee48ca authored by Chunchi Che's avatar Chunchi Che

add response in monster ui

parent 00ec60e9
......@@ -3,6 +3,7 @@ import * as CONFIG from "../../config/ui";
import { Monster } from "../../reducers/duel/util";
import { clearMonsterSelectInfo } from "../../reducers/duel/mod";
import { store } from "../../store";
import { sendSelectPlaceResponse } from "../../api/ocgcore/ocgHelper";
export default (monsters: Monster[], scene: BABYLON.Scene) => {
const left = -2.15;
......@@ -83,9 +84,11 @@ function setupMonsterAction(
new BABYLON.ExecuteCodeAction(
BABYLON.ActionManager.OnPickTrigger,
(_event) => {
// TODO: send response
dispatch(clearMonsterSelectInfo(0));
dispatch(clearMonsterSelectInfo(1));
if (state.selectInfo) {
sendSelectPlaceResponse(state.selectInfo.response);
dispatch(clearMonsterSelectInfo(0));
dispatch(clearMonsterSelectInfo(1));
}
}
)
);
......
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