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
d5800458
Commit
d5800458
authored
Apr 08, 2023
by
timel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: timing of ai mode in waitroom
parent
489aea76
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
14 deletions
+13
-14
src/ui/WaitRoom.tsx
src/ui/WaitRoom.tsx
+13
-14
No files found.
src/ui/WaitRoom.tsx
View file @
d5800458
...
...
@@ -90,20 +90,7 @@ const WaitRoom = () => {
await
rustInit
(
url
);
};
/** 如果是开发者模式下的人机对战,应该自动选择卡组,并自动准备和开始 */
const
runAiMode
=
async
()
=>
{
await
new
Promise
((
resolve
)
=>
setTimeout
(
resolve
,
500
));
await
handleChoseDeck
(
defaultDeck
!
);
handleChoseReady
();
handleChoseStart
();
};
(
async
()
=>
{
await
init
();
if
(
isAiMode
)
{
await
runAiMode
();
}
})();
init
();
}
},
[]);
...
...
@@ -181,6 +168,18 @@ const WaitRoom = () => {
useEffect
(()
=>
{
if
(
joined
)
{
api
.
info
({
message
:
"
成功加入房间!
"
,
placement
:
"
top
"
});
/** 如果是开发者模式下的人机对战,应该自动选择卡组,并自动准备和开始 */
const
runAiMode
=
async
()
=>
{
await
new
Promise
((
resolve
)
=>
setTimeout
(
resolve
,
500
));
await
handleChoseDeck
(
defaultDeck
!
);
handleChoseReady
();
handleChoseStart
();
};
(
async
()
=>
{
if
(
isAiMode
)
{
await
runAiMode
();
}
})();
}
},
[
joined
]);
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