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
4
Merge Requests
4
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
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
Pipeline
#19765
passed with stages
in 4 minutes and 52 seconds
Changes
4
Pipelines
1
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<
// 更新卡牌列表数据
export
const
setCardListModalInfoImpl
:
CaseReducer
<
DuelState
,
PayloadAction
<
{
name
?:
string
;
desc
?:
string
;
imgUrl
?:
string
}[]
>
PayloadAction
<
{
name
?:
string
;
desc
?:
string
;
imgUrl
?:
string
;
interactivies
:
{
desc
:
string
;
response
:
number
}[];
}[]
>
>
=
(
state
,
action
)
=>
{
const
list
=
action
.
payload
;
...
...
src/reducers/duel/modal/mod.ts
View file @
fa4add3a
...
...
@@ -16,6 +16,7 @@ export interface ModalState {
name
?:
string
;
desc
?:
string
;
imgUrl
?:
string
;
interactivies
:
{
desc
:
string
;
response
:
number
}[];
}[];
};
// 卡牌选择弹窗
...
...
src/ui/Duel/cardListModal.tsx
View file @
fa4add3a
...
...
@@ -5,10 +5,13 @@ import {
selectCardListModalIsOpen
,
selectCardListModalInfo
,
}
from
"
../../reducers/duel/modal/mod
"
;
import
{
setCardListModalIsOpen
}
from
"
../../reducers/duel/mod
"
;
import
{
Modal
,
List
,
Popover
,
Card
}
from
"
antd
"
;
import
{
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
CardListModal
=
()
=>
{
...
...
@@ -26,21 +29,30 @@ const CardListModal = () => {
itemLayout=
"horizontal"
dataSource=
{
list
}
renderItem=
{
(
item
)
=>
(
<
Popover
content=
{
<
Card
hoverable
style=
{
{
width
:
CARD_WIDTH
}
}
cover=
{
<
img
alt=
{
item
.
name
}
src=
{
item
.
imgUrl
}
/>
}
<
List
.
Item
actions=
{
item
.
interactivies
.
map
((
interactivy
,
idx
)
=>
(
<
Button
key=
{
idx
}
onClick=
{
()
=>
{
sendSelectIdleCmdResponse
(
interactivy
.
response
);
dispatch
(
setCardListModalIsOpen
(
false
));
dispatch
(
clearAllIdleInteractivities
(
0
));
dispatch
(
clearAllIdleInteractivities
(
1
));
}
}
>
<
Meta
title=
{
item
.
name
}
/>
</
Card
>
{
interactivy
.
desc
}
</
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
>
</
Popover
>
<
List
.
Item
.
Meta
title=
{
item
.
name
}
description=
{
item
.
desc
}
/>
</
List
.
Item
>
)
}
></
List
>
</
Modal
>
...
...
src/ui/Duel/singleSlot.tsx
View file @
fa4add3a
...
...
@@ -8,6 +8,7 @@ import {
setCardListModalInfo
,
setCardListModalIsOpen
,
}
from
"
../../reducers/duel/mod
"
;
import
{
interactTypeToString
}
from
"
./util
"
;
const
shape
=
CONFIG
.
SingleSlotShape
;
export
const
Depth
=
0.005
;
...
...
@@ -20,8 +21,8 @@ const SingleSlot = (props: {
const
boxRef
=
useRef
(
null
);
const
dispatch
=
store
.
dispatch
;
const
edgeRender
=
props
.
state
.
find
(
(
item
)
=>
item
.
placeInteractivities
||
item
.
idleInteractivities
.
length
>
0
props
.
state
.
find
(
(
item
)
=>
item
===
undefined
?
false
:
item
.
idleInteractivities
.
length
>
0
)
!==
undefined
;
const
edgesWidth
=
2.0
;
...
...
@@ -39,6 +40,12 @@ const SingleSlot = (props: {
name
:
item
.
occupant
?.
text
.
name
,
desc
:
item
.
occupant
?.
text
.
desc
,
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