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
b3d2d4b3
Commit
b3d2d4b3
authored
Apr 29, 2023
by
Chunchi Che
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add card onClick
parent
c85f3045
Pipeline
#21444
passed with stages
in 13 minutes and 41 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
36 additions
and
1 deletion
+36
-1
src/ui/Duel/PlayMat2/Mat.tsx
src/ui/Duel/PlayMat2/Mat.tsx
+36
-1
No files found.
src/ui/Duel/PlayMat2/Mat.tsx
View file @
b3d2d4b3
...
...
@@ -4,8 +4,9 @@ import React from "react";
import
{
useSnapshot
}
from
"
valtio
"
;
import
{
ygopro
}
from
"
@/api
"
;
import
{
CardState
,
DuelFieldState
,
matStore
}
from
"
@/stores
"
;
import
{
CardState
,
DuelFieldState
,
matStore
,
messageStore
}
from
"
@/stores
"
;
import
{
interactTypeToString
}
from
"
../utils
"
;
import
{
BlockRow
,
ExtraBlockRow
}
from
"
./Block
"
;
import
{
Card
}
from
"
./Card
"
;
import
{
Menu
}
from
"
./Menu
"
;
...
...
@@ -59,6 +60,39 @@ export const Mat = () => {
renderCards
.
sort
((
card_a
,
card_b
)
=>
(
card_a
.
uuid
>
card_b
.
uuid
?
1
:
0
));
const
onClick
=
(
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
;
// 侧边栏展示超量素材信息
if
(
state
.
overlay_materials
&&
state
.
overlay_materials
.
length
>
0
)
{
messageStore
.
cardListModal
.
list
=
state
.
overlay_materials
?.
map
((
overlay
)
=>
({
meta
:
overlay
,
interactivies
:
[],
}))
||
[];
messageStore
.
cardListModal
.
isOpen
=
true
;
}
}
}
};
return
(
<>
<
Menu
/>
...
...
@@ -102,6 +136,7 @@ export const Mat = () => {
vertical=
{
card
.
location
.
zone
==
YgoZone
.
HAND
}
highlight=
{
card
.
idleInteractivities
.
length
>
0
}
opponent=
{
card
.
opponent
}
onClick=
{
onClick
(
card
)
}
/>
))
}
</
div
>
...
...
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