Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
N
Neos
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
1
Issues
1
List
Boards
Labels
Service Desk
Milestones
Merge Requests
2
Merge Requests
2
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Packages
Packages
List
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issues
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
MyCard
Neos
Commits
b6e201c0
Commit
b6e201c0
authored
Mar 11, 2023
by
Chunchi Che
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update cardModal
parent
c13934a8
Pipeline
#20571
passed with stages
in 6 minutes and 34 seconds
Changes
6
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
25 additions
and
57 deletions
+25
-57
src/reducers/duel/mod.ts
src/reducers/duel/mod.ts
+3
-6
src/reducers/duel/modal/cardModalSlice.ts
src/reducers/duel/modal/cardModalSlice.ts
+6
-21
src/reducers/duel/modal/mod.ts
src/reducers/duel/modal/mod.ts
+2
-3
src/ui/Duel/cardModal.tsx
src/ui/Duel/cardModal.tsx
+8
-6
src/ui/Duel/fixedSlot.tsx
src/ui/Duel/fixedSlot.tsx
+2
-13
src/ui/Duel/hands.tsx
src/ui/Duel/hands.tsx
+4
-8
No files found.
src/reducers/duel/mod.ts
View file @
b6e201c0
...
@@ -27,8 +27,7 @@ import { HintState, hintCase } from "./hintSlice";
...
@@ -27,8 +27,7 @@ import { HintState, hintCase } from "./hintSlice";
import
{
import
{
ModalState
,
ModalState
,
setCardModalIsOpenImpl
,
setCardModalIsOpenImpl
,
setCardModalTextImpl
,
setCardModalMetaImpl
,
setCardModalImgUrlImpl
,
setCardModalInteractiviesImpl
,
setCardModalInteractiviesImpl
,
setCardListModalIsOpenImpl
,
setCardListModalIsOpenImpl
,
setCardListModalInfoImpl
,
setCardListModalInfoImpl
,
...
@@ -227,8 +226,7 @@ const duelSlice = createSlice({
...
@@ -227,8 +226,7 @@ const duelSlice = createSlice({
// UI相关`Reducer`
// UI相关`Reducer`
setCardModalIsOpen
:
setCardModalIsOpenImpl
,
setCardModalIsOpen
:
setCardModalIsOpenImpl
,
setCardModalText
:
setCardModalTextImpl
,
setCardModalMeta
:
setCardModalMetaImpl
,
setCardModalImgUrl
:
setCardModalImgUrlImpl
,
setCardModalInteractivies
:
setCardModalInteractiviesImpl
,
setCardModalInteractivies
:
setCardModalInteractiviesImpl
,
setCardListModalIsOpen
:
setCardListModalIsOpenImpl
,
setCardListModalIsOpen
:
setCardListModalIsOpenImpl
,
setCardListModalInfo
:
setCardListModalInfoImpl
,
setCardListModalInfo
:
setCardListModalInfoImpl
,
...
@@ -288,8 +286,7 @@ export const {
...
@@ -288,8 +286,7 @@ export const {
addHandsIdleInteractivity
,
addHandsIdleInteractivity
,
updateTimeLimit
,
updateTimeLimit
,
setCardModalIsOpen
,
setCardModalIsOpen
,
setCardModalText
,
setCardModalMeta
,
setCardModalImgUrl
,
setCardModalInteractivies
,
setCardModalInteractivies
,
initMonsters
,
initMonsters
,
addMonsterPlaceInteractivities
,
addMonsterPlaceInteractivities
,
...
...
src/reducers/duel/modal/cardModalSlice.ts
View file @
b6e201c0
import
{
PayloadAction
,
CaseReducer
}
from
"
@reduxjs/toolkit
"
;
import
{
PayloadAction
,
CaseReducer
}
from
"
@reduxjs/toolkit
"
;
import
{
DuelState
}
from
"
../mod
"
;
import
{
DuelState
}
from
"
../mod
"
;
import
{
RootState
}
from
"
../../../store
"
;
import
{
RootState
}
from
"
../../../store
"
;
import
{
CardMeta
}
from
"
../../../api/cards
"
;
// 更新卡牌弹窗打开状态
// 更新卡牌弹窗打开状态
export
const
setCardModalIsOpenImpl
:
CaseReducer
<
export
const
setCardModalIsOpenImpl
:
CaseReducer
<
...
@@ -11,23 +12,11 @@ export const setCardModalIsOpenImpl: CaseReducer<
...
@@ -11,23 +12,11 @@ export const setCardModalIsOpenImpl: CaseReducer<
};
};
// 更新卡牌弹窗文本
// 更新卡牌弹窗文本
export
const
setCardModal
Text
Impl
:
CaseReducer
<
export
const
setCardModal
Meta
Impl
:
CaseReducer
<
DuelState
,
DuelState
,
PayloadAction
<
[
string
?,
string
?]
>
PayloadAction
<
CardMeta
>
>
=
(
state
,
action
)
=>
{
>
=
(
state
,
action
)
=>
{
const
name
=
action
.
payload
[
0
];
state
.
modalState
.
cardModal
.
meta
=
action
.
payload
;
const
desc
=
action
.
payload
[
1
];
state
.
modalState
.
cardModal
.
name
=
name
;
state
.
modalState
.
cardModal
.
desc
=
desc
;
};
// 更新卡牌弹窗图片Url
export
const
setCardModalImgUrlImpl
:
CaseReducer
<
DuelState
,
PayloadAction
<
string
>
>
=
(
state
,
action
)
=>
{
state
.
modalState
.
cardModal
.
imgUrl
=
action
.
payload
;
};
};
// 更新卡牌弹窗互动选项
// 更新卡牌弹窗互动选项
...
@@ -40,11 +29,7 @@ export const setCardModalInteractiviesImpl: CaseReducer<
...
@@ -40,11 +29,7 @@ export const setCardModalInteractiviesImpl: CaseReducer<
export
const
selectCardModalIsOpen
=
(
state
:
RootState
)
=>
export
const
selectCardModalIsOpen
=
(
state
:
RootState
)
=>
state
.
duel
.
modalState
.
cardModal
.
isOpen
;
state
.
duel
.
modalState
.
cardModal
.
isOpen
;
export
const
selectCardModalName
=
(
state
:
RootState
)
=>
export
const
selectCardModalMeta
=
(
state
:
RootState
)
=>
state
.
duel
.
modalState
.
cardModal
.
name
;
state
.
duel
.
modalState
.
cardModal
.
meta
;
export
const
selectCardModalDesc
=
(
state
:
RootState
)
=>
state
.
duel
.
modalState
.
cardModal
.
desc
;
export
const
selectCardModalImgUrl
=
(
state
:
RootState
)
=>
state
.
duel
.
modalState
.
cardModal
.
imgUrl
;
export
const
selectCardModalInteractivies
=
(
state
:
RootState
)
=>
export
const
selectCardModalInteractivies
=
(
state
:
RootState
)
=>
state
.
duel
.
modalState
.
cardModal
.
interactivies
;
state
.
duel
.
modalState
.
cardModal
.
interactivies
;
src/reducers/duel/modal/mod.ts
View file @
b6e201c0
import
{
CardMeta
}
from
"
../../../api/cards
"
;
import
{
ygopro
}
from
"
../../../api/ocgcore/idl/ocgcore
"
;
import
{
ygopro
}
from
"
../../../api/ocgcore/idl/ocgcore
"
;
export
interface
ModalState
{
export
interface
ModalState
{
// 卡牌弹窗
// 卡牌弹窗
cardModal
:
{
cardModal
:
{
isOpen
:
boolean
;
isOpen
:
boolean
;
name
?:
string
;
meta
?:
CardMeta
;
desc
?:
string
;
imgUrl
?:
string
;
interactivies
:
{
desc
:
string
;
response
:
number
}[];
interactivies
:
{
desc
:
string
;
response
:
number
}[];
};
};
// 卡牌列表弹窗
// 卡牌列表弹窗
...
...
src/ui/Duel/cardModal.tsx
View file @
b6e201c0
...
@@ -3,10 +3,8 @@ import { useAppSelector } from "../../hook";
...
@@ -3,10 +3,8 @@ import { useAppSelector } from "../../hook";
import
{
store
}
from
"
../../store
"
;
import
{
store
}
from
"
../../store
"
;
import
{
import
{
selectCardModalIsOpen
,
selectCardModalIsOpen
,
selectCardModalName
,
selectCardModalDesc
,
selectCardModalImgUrl
,
selectCardModalInteractivies
,
selectCardModalInteractivies
,
selectCardModalMeta
,
}
from
"
../../reducers/duel/modal/mod
"
;
}
from
"
../../reducers/duel/modal/mod
"
;
import
{
import
{
setCardModalIsOpen
,
setCardModalIsOpen
,
...
@@ -14,6 +12,7 @@ import {
...
@@ -14,6 +12,7 @@ import {
}
from
"
../../reducers/duel/mod
"
;
}
from
"
../../reducers/duel/mod
"
;
import
{
Modal
,
Card
,
Button
}
from
"
antd
"
;
import
{
Modal
,
Card
,
Button
}
from
"
antd
"
;
import
{
sendSelectIdleCmdResponse
}
from
"
../../api/ocgcore/ocgHelper
"
;
import
{
sendSelectIdleCmdResponse
}
from
"
../../api/ocgcore/ocgHelper
"
;
import
NeosConfig
from
"
../../../neos.config.json
"
;
const
{
Meta
}
=
Card
;
const
{
Meta
}
=
Card
;
const
CARD_WIDTH
=
240
;
const
CARD_WIDTH
=
240
;
...
@@ -21,9 +20,12 @@ const CARD_WIDTH = 240;
...
@@ -21,9 +20,12 @@ const CARD_WIDTH = 240;
const
CardModal
=
()
=>
{
const
CardModal
=
()
=>
{
const
dispatch
=
store
.
dispatch
;
const
dispatch
=
store
.
dispatch
;
const
isOpen
=
useAppSelector
(
selectCardModalIsOpen
);
const
isOpen
=
useAppSelector
(
selectCardModalIsOpen
);
const
name
=
useAppSelector
(
selectCardModalName
);
const
meta
=
useAppSelector
(
selectCardModalMeta
);
const
desc
=
useAppSelector
(
selectCardModalDesc
);
const
name
=
meta
?.
text
.
name
;
const
imgUrl
=
useAppSelector
(
selectCardModalImgUrl
);
const
desc
=
meta
?.
text
.
desc
;
const
imgUrl
=
meta
?.
id
?
`
${
NeosConfig
.
cardImgUrl
}
/
${
meta
.
id
}
.jpg`
:
undefined
;
const
interactivies
=
useAppSelector
(
selectCardModalInteractivies
);
const
interactivies
=
useAppSelector
(
selectCardModalInteractivies
);
const
handleOkOrCancel
=
()
=>
{
const
handleOkOrCancel
=
()
=>
{
...
...
src/ui/Duel/fixedSlot.tsx
View file @
b6e201c0
...
@@ -6,10 +6,9 @@ import { useClick } from "./hook";
...
@@ -6,10 +6,9 @@ import { useClick } from "./hook";
import
{
sendSelectPlaceResponse
}
from
"
../../api/ocgcore/ocgHelper
"
;
import
{
sendSelectPlaceResponse
}
from
"
../../api/ocgcore/ocgHelper
"
;
import
{
ygopro
}
from
"
../../api/ocgcore/idl/ocgcore
"
;
import
{
ygopro
}
from
"
../../api/ocgcore/idl/ocgcore
"
;
import
{
import
{
setCardModalImgUrl
,
setCardModalInteractivies
,
setCardModalInteractivies
,
setCardModalIsOpen
,
setCardModalIsOpen
,
setCardModal
Text
,
setCardModal
Meta
,
}
from
"
../../reducers/duel/mod
"
;
}
from
"
../../reducers/duel/mod
"
;
import
{
ActionCreatorWithPayload
}
from
"
@reduxjs/toolkit
"
;
import
{
ActionCreatorWithPayload
}
from
"
@reduxjs/toolkit
"
;
import
{
interactTypeToString
}
from
"
./util
"
;
import
{
interactTypeToString
}
from
"
./util
"
;
...
@@ -55,17 +54,7 @@ const FixedSlot = (props: {
...
@@ -55,17 +54,7 @@ const FixedSlot = (props: {
dispatch
(
props
.
clearPlaceInteractivitiesAction
(
0
));
dispatch
(
props
.
clearPlaceInteractivitiesAction
(
0
));
dispatch
(
props
.
clearPlaceInteractivitiesAction
(
1
));
dispatch
(
props
.
clearPlaceInteractivitiesAction
(
1
));
}
else
if
(
props
.
state
.
occupant
)
{
}
else
if
(
props
.
state
.
occupant
)
{
dispatch
(
dispatch
(
setCardModalMeta
(
props
.
state
.
occupant
));
setCardModalText
([
props
.
state
.
occupant
.
text
.
name
,
props
.
state
.
occupant
.
text
.
desc
,
])
);
dispatch
(
setCardModalImgUrl
(
`
${
NeosConfig
.
cardImgUrl
}
/
${
props
.
state
.
occupant
.
id
}
.jpg`
)
);
dispatch
(
dispatch
(
setCardModalInteractivies
(
setCardModalInteractivies
(
props
.
state
.
idleInteractivities
.
map
((
interactivity
)
=>
{
props
.
state
.
idleInteractivities
.
map
((
interactivity
)
=>
{
...
...
src/ui/Duel/hands.tsx
View file @
b6e201c0
...
@@ -3,9 +3,8 @@ import { useAppSelector } from "../../hook";
...
@@ -3,9 +3,8 @@ import { useAppSelector } from "../../hook";
import
{
selectMeHands
,
selectOpHands
}
from
"
../../reducers/duel/handsSlice
"
;
import
{
selectMeHands
,
selectOpHands
}
from
"
../../reducers/duel/handsSlice
"
;
import
{
CardState
}
from
"
../../reducers/duel/generic
"
;
import
{
CardState
}
from
"
../../reducers/duel/generic
"
;
import
{
import
{
setCardModalImgUrl
,
setCardModalIsOpen
,
setCardModalIsOpen
,
setCardModal
Text
,
setCardModal
Meta
,
setCardModalInteractivies
,
setCardModalInteractivies
,
}
from
"
../../reducers/duel/mod
"
;
}
from
"
../../reducers/duel/mod
"
;
import
{
store
}
from
"
../../store
"
;
import
{
store
}
from
"
../../store
"
;
...
@@ -112,12 +111,9 @@ const CHand = (props: {
...
@@ -112,12 +111,9 @@ const CHand = (props: {
useClick
(
useClick
(
()
=>
{
()
=>
{
dispatch
(
if
(
state
.
occupant
)
{
setCardModalText
([
state
.
occupant
?.
text
.
name
,
state
.
occupant
?.
text
.
desc
])
dispatch
(
setCardModalMeta
(
state
.
occupant
));
);
}
dispatch
(
setCardModalImgUrl
(
`
${
NeosConfig
.
cardImgUrl
}
/
${
state
.
occupant
?.
id
}.
jpg
`)
);
dispatch
(
dispatch
(
setCardModalInteractivies
(
setCardModalInteractivies
(
state
.
idleInteractivities
.
map
((
interactive
)
=>
{
state
.
idleInteractivities
.
map
((
interactive
)
=>
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment