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
c8efde57
Commit
c8efde57
authored
Apr 29, 2023
by
Chunchi Che
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add onFieldClick
parent
585d0098
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
43 additions
and
24 deletions
+43
-24
src/ui/Duel/PlayMat2/Mat.tsx
src/ui/Duel/PlayMat2/Mat.tsx
+43
-24
No files found.
src/ui/Duel/PlayMat2/Mat.tsx
View file @
c8efde57
...
...
@@ -103,7 +103,15 @@ export const Mat = () => {
vertical=
{
card
.
location
.
zone
==
YgoZone
.
HAND
}
highlight=
{
card
.
idleInteractivities
.
length
>
0
}
opponent=
{
card
.
opponent
}
onClick=
{
onCardClick
(
card
)
}
onClick=
{
card
.
location
.
zone
==
YgoZone
.
SZONE
||
card
.
location
.
zone
==
YgoZone
.
MZONE
||
card
.
location
.
zone
==
YgoZone
.
HAND
?
onCardClick
(
card
)
:
card
.
location
.
zone
==
YgoZone
.
DECK
?
()
=>
{}
:
onFieldClick
(
renderCards
,
card
.
location
.
zone
)
}
/>
))
}
</
div
>
...
...
@@ -227,30 +235,41 @@ function CardStateToFaceDown(state: RenderCard): boolean {
}
const
onCardClick
=
(
state
:
CardState
)
=>
()
=>
{
const
zone
=
state
.
location
.
zone
;
if
(
zone
==
YgoZone
.
HAND
||
zone
==
YgoZone
.
MZONE
||
zone
==
YgoZone
.
SZONE
)
{
const
occupant
=
state
.
occupant
;
if
(
occupant
)
{
// 中央弹窗展示选中卡牌信息
messageStore
.
cardModal
.
meta
=
occupant
;
messageStore
.
cardModal
.
interactivies
=
state
.
idleInteractivities
.
map
(
(
interactivity
)
=>
({
desc
:
interactTypeToString
(
interactivity
.
interactType
),
response
:
interactivity
.
response
,
})
);
messageStore
.
cardModal
.
counters
=
state
.
counters
;
messageStore
.
cardModal
.
isOpen
=
true
;
const
occupant
=
state
.
occupant
;
if
(
occupant
)
{
// 中央弹窗展示选中卡牌信息
messageStore
.
cardModal
.
meta
=
occupant
;
messageStore
.
cardModal
.
interactivies
=
state
.
idleInteractivities
.
map
(
(
interactivity
)
=>
({
desc
:
interactTypeToString
(
interactivity
.
interactType
),
response
:
interactivity
.
response
,
})
);
messageStore
.
cardModal
.
counters
=
state
.
counters
;
messageStore
.
cardModal
.
isOpen
=
true
;
// 侧边栏展示超量素材信息
if
(
state
.
overlay_materials
&&
state
.
overlay_materials
.
length
>
0
)
{
messageStore
.
cardListModal
.
list
=
state
.
overlay_materials
?.
map
((
overlay
)
=>
({
meta
:
overlay
,
interactivies
:
[],
}))
||
[];
messageStore
.
cardListModal
.
isOpen
=
true
;
}
// 侧边栏展示超量素材信息
if
(
state
.
overlay_materials
&&
state
.
overlay_materials
.
length
>
0
)
{
messageStore
.
cardListModal
.
list
=
state
.
overlay_materials
?.
map
((
overlay
)
=>
({
meta
:
overlay
,
interactivies
:
[],
}))
||
[];
messageStore
.
cardListModal
.
isOpen
=
true
;
}
}
};
const
onFieldClick
=
(
states
:
Array
<
CardState
>
,
zone
:
YgoZone
)
=>
()
=>
{
const
displayStates
=
states
.
filter
((
state
)
=>
state
.
location
.
zone
==
zone
);
messageStore
.
cardListModal
.
list
=
displayStates
.
map
((
item
)
=>
({
meta
:
item
.
occupant
,
interactivies
:
item
.
idleInteractivities
.
map
((
interactivy
)
=>
({
desc
:
interactTypeToString
(
interactivy
.
interactType
),
response
:
interactivy
.
response
,
})),
}));
messageStore
.
cardListModal
.
isOpen
=
true
;
};
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