Commit a1f9891e authored by Chunchi Che's avatar Chunchi Che

finish selectSum

parent 32c15388
Pipeline #20892 passed with stages
in 20 minutes and 20 seconds
......@@ -10,6 +10,7 @@ import MsgSelectCard = ygopro.StocGameMessage.MsgSelectCard;
* */
export default (data: Uint8Array) => {
// FIXME: handle it correctly
const reader = new BufferReaderExt(data);
const player = reader.inner.readUint8();
......
......@@ -60,6 +60,7 @@ import {
setCheckCardModalV3ResponseAbleImpl,
resetCheckCardModalV3Impl,
setCheckCardModalV3SelectedImpl,
checkCardModalV3Case,
} from "./modal/mod";
import {
MonsterState,
......@@ -310,6 +311,7 @@ const duelSlice = createSlice({
YesNoModalCase(builder);
optionModalCase(builder);
checkCardModalV2Case(builder);
checkCardModalV3Case(builder);
},
});
......
......@@ -91,6 +91,7 @@ export interface ModalState {
level2: number;
response: number;
}[];
// TODO: remove this prop
selectedList: {
meta: CardMeta;
level1: number;
......
import { ygopro } from "../../api/ocgcore/idl/ocgcore";
import {
setCheckCardModalV3AllLevel,
setCheckCardModalV3IsOpen,
setCheckCardModalV3MinMax,
setCheckCardModalV3OverFlow,
} from "../../reducers/duel/mod";
......@@ -26,4 +27,5 @@ export default (selectSum: MsgSelectSum, dispatch: AppDispatch) => {
options: selectSum.selectable_cards,
})
);
dispatch(setCheckCardModalV3IsOpen(true));
};
import React from "react";
import React, { useState } from "react";
import { useAppSelector } from "../../hook";
import { store } from "../../store";
import { Modal, Button, Card, Row, Col } from "antd";
......@@ -8,7 +8,6 @@ import {
resetCheckCardModalV3,
setCheckCardModalV3IsOpen,
setCheckCardModalV3ResponseAble,
setCheckCardModalV3Selected,
} from "../../reducers/duel/mod";
import NeosConfig from "../../../neos.config.json";
import { selectCheckCardModalV3 } from "../../reducers/duel/modal/checkCardModalV3Slice";
......@@ -21,7 +20,7 @@ const CheckCardModalV3 = () => {
const max = state.selectMax || 0;
const mustSelectOptions = state.mustSelectList;
const selectAbleOptions = state.selectAbleList;
const selectedOptions = state.selectedList;
const [selectedOptions, setSelectedOptions] = useState(state.selectedList);
const overflow = state.overflow;
const LevelSum = state.allLevel;
const Level1Sum = mustSelectOptions
......@@ -68,7 +67,8 @@ const CheckCardModalV3 = () => {
size="small"
multiple={true}
onChange={(values: any) => {
setCheckCardModalV3Selected(values);
console.log(values);
setSelectedOptions(values);
}}
>
<Row>
......@@ -95,7 +95,7 @@ const CheckCardModalV3 = () => {
</CheckCard.Group>
<p>必须选择的卡片</p>
<Row>
{selectedOptions.map((option, idx) => {
{mustSelectOptions.map((option, idx) => {
return (
<Col span={4} key={idx}>
<Card
......
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