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
13a02f31
Commit
13a02f31
authored
Jul 15, 2023
by
timel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: disabled dropdown as need
parent
ad72505b
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
18 additions
and
3 deletions
+18
-3
src/ui/Duel/PlayMat/Card/index.scss
src/ui/Duel/PlayMat/Card/index.scss
+4
-0
src/ui/Duel/PlayMat/Card/index.tsx
src/ui/Duel/PlayMat/Card/index.tsx
+14
-3
No files found.
src/ui/Duel/PlayMat/Card/index.scss
View file @
13a02f31
...
@@ -133,3 +133,7 @@ section#mat {
...
@@ -133,3 +133,7 @@ section#mat {
}
}
text-align
:
center
;
text-align
:
center
;
}
}
.card-dropdown-disabled
{
display
:
none
;
}
src/ui/Duel/PlayMat/Card/index.tsx
View file @
13a02f31
...
@@ -118,6 +118,9 @@ export const Card: React.FC<{ idx: number }> = React.memo(({ idx }) => {
...
@@ -118,6 +118,9 @@ export const Card: React.FC<{ idx: number }> = React.memo(({ idx }) => {
items
:
[]
as
DropdownItem
[],
items
:
[]
as
DropdownItem
[],
}
);
}
);
// 是否禁用下拉菜单
const [dropdownMenuDisabled, setDropdownMenuDisabled] = useState(false);
// 发动效果
// 发动效果
// 1. 下拉菜单里面选择[召唤 / 特殊召唤 /.../效果发动]
// 1. 下拉菜单里面选择[召唤 / 特殊召唤 /.../效果发动]
// 2. 如果是非效果发动,那么直接选择哪张卡(单张卡直接选择那张)
// 2. 如果是非效果发动,那么直接选择哪张卡(单张卡直接选择那张)
...
@@ -132,6 +135,13 @@ export const Card: React.FC<{ idx: number }> = React.memo(({ idx }) => {
...
@@ -132,6 +135,13 @@ export const Card: React.FC<{ idx: number }> = React.memo(({ idx }) => {
map
.
get
(
interactType
)?.
push
(
card
);
map
.
get
(
interactType
)?.
push
(
card
);
});
});
});
});
if
(
!
map
.
size
)
{
setDropdownMenuDisabled
(
true
);
return
;
}
else
{
setDropdownMenuDisabled
(
false
);
}
const
actions
=
[...
map
.
entries
()];
const
actions
=
[...
map
.
entries
()];
const
nonEffectActions
=
actions
.
filter
(
const
nonEffectActions
=
actions
.
filter
(
([
action
])
=>
action
!==
InteractType
.
ACTIVATE
([
action
])
=>
action
!==
InteractType
.
ACTIVATE
...
@@ -226,7 +236,7 @@ export const Card: React.FC<{ idx: number }> = React.memo(({ idx }) => {
...
@@ -226,7 +236,7 @@ export const Card: React.FC<{ idx: number }> = React.memo(({ idx }) => {
// 中央弹窗展示选中卡牌信息
// 中央弹窗展示选中卡牌信息
// TODO: 同一张卡片,是否重复点击会关闭CardModal?
// TODO: 同一张卡片,是否重复点击会关闭CardModal?
displayCardModal
(
card
);
displayCardModal
(
card
);
if
(
card
.
idleInteractivities
.
length
)
handleDropdownMenu
([
card
],
false
);
handleDropdownMenu
([
card
],
false
);
// 侧边栏展示超量素材信息
// 侧边栏展示超量素材信息
const
overlayMaterials
=
cardStore
.
findOverlay
(
const
overlayMaterials
=
cardStore
.
findOverlay
(
...
@@ -289,10 +299,11 @@ export const Card: React.FC<{ idx: number }> = React.memo(({ idx }) => {
...
@@ -289,10 +299,11 @@ export const Card: React.FC<{ idx: number }> = React.memo(({ idx }) => {
<
Dropdown
<
Dropdown
menu=
{
dropdownMenu
}
menu=
{
dropdownMenu
}
placement=
"top"
placement=
"top"
overlayClassName=
"card-dropdown"
overlayClassName=
{
classnames
(
"
card-dropdown
"
,
{
"
card-dropdown-disabled
"
:
dropdownMenuDisabled
,
})
}
arrow
arrow
trigger=
{
[
"
click
"
]
}
trigger=
{
[
"
click
"
]
}
// disabled={!highlight} // TODO: 这里的disable要考虑到field的情况,比如额外卡组
>
>
<
div
className=
{
classnames
(
"
card-img-wrap
"
,
{
focus
:
classFocus
})
}
>
<
div
className=
{
classnames
(
"
card-img-wrap
"
,
{
focus
:
classFocus
})
}
>
<
YgoCard
<
YgoCard
...
...
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