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
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
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
love_飞影
Neos
Commits
fa4add3a
Commit
fa4add3a
authored
Jan 22, 2023
by
Chunchi Che
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
udpate singleSlot.tsx and cardListModal.tsx
parent
05ed6e30
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
45 additions
and
18 deletions
+45
-18
src/reducers/duel/modal/cardListModalSlice.ts
src/reducers/duel/modal/cardListModalSlice.ts
+8
-1
src/reducers/duel/modal/mod.ts
src/reducers/duel/modal/mod.ts
+1
-0
src/ui/Duel/cardListModal.tsx
src/ui/Duel/cardListModal.tsx
+27
-15
src/ui/Duel/singleSlot.tsx
src/ui/Duel/singleSlot.tsx
+9
-2
No files found.
src/reducers/duel/modal/cardListModalSlice.ts
View file @
fa4add3a
...
@@ -13,7 +13,14 @@ export const setCardListModalIsOpenImpl: CaseReducer<
...
@@ -13,7 +13,14 @@ export const setCardListModalIsOpenImpl: CaseReducer<
// 更新卡牌列表数据
// 更新卡牌列表数据
export
const
setCardListModalInfoImpl
:
CaseReducer
<
export
const
setCardListModalInfoImpl
:
CaseReducer
<
DuelState
,
DuelState
,
PayloadAction
<
{
name
?:
string
;
desc
?:
string
;
imgUrl
?:
string
}[]
>
PayloadAction
<
{
name
?:
string
;
desc
?:
string
;
imgUrl
?:
string
;
interactivies
:
{
desc
:
string
;
response
:
number
}[];
}[]
>
>
=
(
state
,
action
)
=>
{
>
=
(
state
,
action
)
=>
{
const
list
=
action
.
payload
;
const
list
=
action
.
payload
;
...
...
src/reducers/duel/modal/mod.ts
View file @
fa4add3a
...
@@ -16,6 +16,7 @@ export interface ModalState {
...
@@ -16,6 +16,7 @@ export interface ModalState {
name
?:
string
;
name
?:
string
;
desc
?:
string
;
desc
?:
string
;
imgUrl
?:
string
;
imgUrl
?:
string
;
interactivies
:
{
desc
:
string
;
response
:
number
}[];
}[];
}[];
};
};
// 卡牌选择弹窗
// 卡牌选择弹窗
...
...
src/ui/Duel/cardListModal.tsx
View file @
fa4add3a
...
@@ -5,10 +5,13 @@ import {
...
@@ -5,10 +5,13 @@ import {
selectCardListModalIsOpen
,
selectCardListModalIsOpen
,
selectCardListModalInfo
,
selectCardListModalInfo
,
}
from
"
../../reducers/duel/modal/mod
"
;
}
from
"
../../reducers/duel/modal/mod
"
;
import
{
setCardListModalIsOpen
}
from
"
../../reducers/duel/mod
"
;
import
{
import
{
Modal
,
List
,
Popover
,
Card
}
from
"
antd
"
;
clearAllIdleInteractivities
,
setCardListModalIsOpen
,
}
from
"
../../reducers/duel/mod
"
;
import
{
Modal
,
List
,
Button
}
from
"
antd
"
;
import
{
sendSelectIdleCmdResponse
}
from
"
../../api/ocgcore/ocgHelper
"
;
const
{
Meta
}
=
Card
;
const
CARD_WIDTH
=
100
;
const
CARD_WIDTH
=
100
;
const
CardListModal
=
()
=>
{
const
CardListModal
=
()
=>
{
...
@@ -26,21 +29,30 @@ const CardListModal = () => {
...
@@ -26,21 +29,30 @@ const CardListModal = () => {
itemLayout=
"horizontal"
itemLayout=
"horizontal"
dataSource=
{
list
}
dataSource=
{
list
}
renderItem=
{
(
item
)
=>
(
renderItem=
{
(
item
)
=>
(
<
Popover
<
List
.
Item
content=
{
actions=
{
item
.
interactivies
.
map
((
interactivy
,
idx
)
=>
(
<
Card
<
Button
hoverable
key=
{
idx
}
style=
{
{
width
:
CARD_WIDTH
}
}
onClick=
{
()
=>
{
cover=
{
<
img
alt=
{
item
.
name
}
src=
{
item
.
imgUrl
}
/>
}
sendSelectIdleCmdResponse
(
interactivy
.
response
);
dispatch
(
setCardListModalIsOpen
(
false
));
dispatch
(
clearAllIdleInteractivities
(
0
));
dispatch
(
clearAllIdleInteractivities
(
1
));
}
}
>
>
<
Meta
title=
{
item
.
name
}
/>
{
interactivy
.
desc
}
</
Card
>
</
Button
>
))
}
extra=
{
<
img
alt=
{
item
.
name
}
src=
{
item
.
imgUrl
}
style=
{
{
width
:
CARD_WIDTH
}
}
/>
}
}
>
>
<
List
.
Item
>
<
List
.
Item
.
Meta
title=
{
item
.
name
}
description=
{
item
.
desc
}
/>
<
List
.
Item
.
Meta
title=
{
item
.
name
}
description=
{
item
.
desc
}
/>
</
List
.
Item
>
</
List
.
Item
>
</
Popover
>
)
}
)
}
></
List
>
></
List
>
</
Modal
>
</
Modal
>
...
...
src/ui/Duel/singleSlot.tsx
View file @
fa4add3a
...
@@ -8,6 +8,7 @@ import {
...
@@ -8,6 +8,7 @@ import {
setCardListModalInfo
,
setCardListModalInfo
,
setCardListModalIsOpen
,
setCardListModalIsOpen
,
}
from
"
../../reducers/duel/mod
"
;
}
from
"
../../reducers/duel/mod
"
;
import
{
interactTypeToString
}
from
"
./util
"
;
const
shape
=
CONFIG
.
SingleSlotShape
;
const
shape
=
CONFIG
.
SingleSlotShape
;
export
const
Depth
=
0.005
;
export
const
Depth
=
0.005
;
...
@@ -20,8 +21,8 @@ const SingleSlot = (props: {
...
@@ -20,8 +21,8 @@ const SingleSlot = (props: {
const
boxRef
=
useRef
(
null
);
const
boxRef
=
useRef
(
null
);
const
dispatch
=
store
.
dispatch
;
const
dispatch
=
store
.
dispatch
;
const
edgeRender
=
const
edgeRender
=
props
.
state
.
find
(
props
.
state
.
find
(
(
item
)
=>
(
item
)
=>
item
.
placeInteractivities
||
item
.
idleInteractivities
.
length
>
0
item
===
undefined
?
false
:
item
.
idleInteractivities
.
length
>
0
)
!==
undefined
;
)
!==
undefined
;
const
edgesWidth
=
2.0
;
const
edgesWidth
=
2.0
;
...
@@ -39,6 +40,12 @@ const SingleSlot = (props: {
...
@@ -39,6 +40,12 @@ const SingleSlot = (props: {
name
:
item
.
occupant
?.
text
.
name
,
name
:
item
.
occupant
?.
text
.
name
,
desc
:
item
.
occupant
?.
text
.
desc
,
desc
:
item
.
occupant
?.
text
.
desc
,
imgUrl
:
`https://cdn02.moecube.com:444/images/ygopro-images-zh-CN/
${
item
.
occupant
?.
id
}.
jpg
`,
imgUrl
:
`https://cdn02.moecube.com:444/images/ygopro-images-zh-CN/
${
item
.
occupant
?.
id
}.
jpg
`,
interactivies: item.idleInteractivities.map((interactivy) => {
return {
desc: interactTypeToString(interactivy.interactType),
response: interactivy.response,
};
}),
};
};
})
})
)
)
...
...
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