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
15da6884
Commit
15da6884
authored
May 28, 2023
by
timel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: animation sequence
parent
dd7fce9d
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
3 deletions
+13
-3
src/ui/Duel/NewPlayMat/Card/index.tsx
src/ui/Duel/NewPlayMat/Card/index.tsx
+13
-3
No files found.
src/ui/Duel/NewPlayMat/Card/index.tsx
View file @
15da6884
...
@@ -32,7 +32,7 @@ export const Card: FC<{ idx: number }> = React.memo(({ idx }) => {
...
@@ -32,7 +32,7 @@ export const Card: FC<{ idx: number }> = React.memo(({ idx }) => {
height
:
0
,
height
:
0
,
}));
}));
const
reload
=
async
(
zone
:
ygopro
.
CardZone
)
=>
{
const
move
=
async
(
zone
:
ygopro
.
CardZone
)
=>
{
switch
(
zone
)
{
switch
(
zone
)
{
case
MZONE
:
case
MZONE
:
case
SZONE
:
case
SZONE
:
...
@@ -53,14 +53,24 @@ export const Card: FC<{ idx: number }> = React.memo(({ idx }) => {
...
@@ -53,14 +53,24 @@ export const Card: FC<{ idx: number }> = React.memo(({ idx }) => {
}
}
};
};
useEffect
(()
=>
{
useEffect
(()
=>
{
reload
(
state
.
zone
);
move
(
state
.
zone
);
},
[]);
},
[]);
const
[
highlight
,
setHighlight
]
=
useState
(
false
);
const
[
highlight
,
setHighlight
]
=
useState
(
false
);
const
[
shadowOpacity
,
setShadowOpacity
]
=
useState
(
0
);
const
[
shadowOpacity
,
setShadowOpacity
]
=
useState
(
0
);
/** 动画序列的promise,当不是undefined,就说明现在这个卡有动画 */
let
animation
:
Promise
<
void
>
|
undefined
=
undefined
;
eventBus
.
on
(
Report
.
Move
,
(
uuid
)
=>
{
eventBus
.
on
(
Report
.
Move
,
(
uuid
)
=>
{
if
(
uuid
===
state
.
uuid
)
reload
(
state
.
zone
);
if
(
uuid
===
state
.
uuid
)
{
if
(
animation
)
{
// 当前有动画,move等当前动画完成之后再播放
animation
=
animation
.
then
(()
=>
move
(
state
.
zone
));
}
else
{
animation
=
move
(
state
.
zone
);
}
}
});
});
useEffect
(()
=>
{
useEffect
(()
=>
{
...
...
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