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
e273124f
Commit
e273124f
authored
Mar 18, 2023
by
Chunchi Che
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
optimize waiting hint
parent
65264fb4
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
20 additions
and
3 deletions
+20
-3
neos.config.json
neos.config.json
+3
-0
neos.config.prod.json
neos.config.prod.json
+3
-0
src/ui/Duel/hintNotification.tsx
src/ui/Duel/hintNotification.tsx
+13
-1
src/ui/Duel/status.tsx
src/ui/Duel/status.tsx
+1
-2
No files found.
neos.config.json
View file @
e273124f
...
@@ -66,6 +66,9 @@
...
@@ -66,6 +66,9 @@
"avatarSize"
:
40
,
"avatarSize"
:
40
,
"meAvatarColor"
:
"#0e63e1"
,
"meAvatarColor"
:
"#0e63e1"
,
"opAvatarColor"
:
"#e10e68"
"opAvatarColor"
:
"#e10e68"
},
"hint"
:
{
"waitingDuration"
:
1.5
}
}
}
}
}
}
neos.config.prod.json
View file @
e273124f
...
@@ -66,6 +66,9 @@
...
@@ -66,6 +66,9 @@
"avatarSize"
:
40
,
"avatarSize"
:
40
,
"meAvatarColor"
:
"#0e63e1"
,
"meAvatarColor"
:
"#0e63e1"
,
"opAvatarColor"
:
"#e10e68"
"opAvatarColor"
:
"#e10e68"
},
"hint"
:
{
"waitingDuration"
:
1.5
}
}
}
}
}
}
src/ui/Duel/hintNotification.tsx
View file @
e273124f
...
@@ -3,15 +3,17 @@ import { useAppSelector } from "../../hook";
...
@@ -3,15 +3,17 @@ import { useAppSelector } from "../../hook";
import
{
selectMeHint
,
selectOpHint
}
from
"
../../reducers/duel/hintSlice
"
;
import
{
selectMeHint
,
selectOpHint
}
from
"
../../reducers/duel/hintSlice
"
;
import
{
selectCurrentPhase
}
from
"
../../reducers/duel/phaseSlice
"
;
import
{
selectCurrentPhase
}
from
"
../../reducers/duel/phaseSlice
"
;
import
{
notification
}
from
"
antd
"
;
import
{
notification
}
from
"
antd
"
;
import
{
selectDuelResult
}
from
"
../../reducers/duel/mod
"
;
import
{
selectDuelResult
,
selectWaiting
}
from
"
../../reducers/duel/mod
"
;
import
{
useNavigate
}
from
"
react-router-dom
"
;
import
{
useNavigate
}
from
"
react-router-dom
"
;
import
{
ygopro
}
from
"
../../api/ocgcore/idl/ocgcore
"
;
import
{
ygopro
}
from
"
../../api/ocgcore/idl/ocgcore
"
;
import
MsgWin
=
ygopro
.
StocGameMessage
.
MsgWin
;
import
MsgWin
=
ygopro
.
StocGameMessage
.
MsgWin
;
import
NeosConfig
from
"
../../../neos.config.json
"
;
const
HintNotification
=
()
=>
{
const
HintNotification
=
()
=>
{
const
meHint
=
useAppSelector
(
selectMeHint
);
const
meHint
=
useAppSelector
(
selectMeHint
);
const
opHint
=
useAppSelector
(
selectOpHint
);
const
opHint
=
useAppSelector
(
selectOpHint
);
const
currentPhase
=
useAppSelector
(
selectCurrentPhase
);
const
currentPhase
=
useAppSelector
(
selectCurrentPhase
);
const
waiting
=
useAppSelector
(
selectWaiting
);
const
result
=
useAppSelector
(
selectDuelResult
);
const
result
=
useAppSelector
(
selectDuelResult
);
const
navigate
=
useNavigate
();
const
navigate
=
useNavigate
();
...
@@ -43,6 +45,16 @@ const HintNotification = () => {
...
@@ -43,6 +45,16 @@ const HintNotification = () => {
}
}
},
[
currentPhase
]);
},
[
currentPhase
]);
useEffect
(()
=>
{
if
(
waiting
)
{
api
.
info
({
message
:
"
...等待对方行动中...
"
,
placement
:
"
top
"
,
duration
:
NeosConfig
.
ui
.
hint
.
waitingDuration
,
});
}
},
[
waiting
]);
useEffect
(()
=>
{
useEffect
(()
=>
{
if
(
result
)
{
if
(
result
)
{
const
message
=
const
message
=
...
...
src/ui/Duel/status.tsx
View file @
e273124f
...
@@ -19,14 +19,13 @@ const OP_VALUE = "opponent";
...
@@ -19,14 +19,13 @@ const OP_VALUE = "opponent";
const
PlayerStatus
=
()
=>
{
const
PlayerStatus
=
()
=>
{
const
meInfo
=
useAppSelector
(
selectMeInitInfo
);
const
meInfo
=
useAppSelector
(
selectMeInitInfo
);
const
opInfo
=
useAppSelector
(
selectOpInitInfo
);
const
opInfo
=
useAppSelector
(
selectOpInitInfo
);
const
myTurn
=
useAppSelector
(
selectCurrentPlayerIsMe
);
const
waiting
=
useAppSelector
(
selectWaiting
)
||
false
;
const
waiting
=
useAppSelector
(
selectWaiting
)
||
false
;
return
(
return
(
<
CheckCard
.
Group
<
CheckCard
.
Group
bordered
bordered
style=
{
{
height
:
`${NeosConfig.ui.layout.header.height}`
}
}
style=
{
{
height
:
`${NeosConfig.ui.layout.header.height}`
}
}
value=
{
myTurn
||
!
waiting
?
ME_VALUE
:
OP
_VALUE
}
value=
{
waiting
?
OP_VALUE
:
ME
_VALUE
}
>
>
<
CheckCard
<
CheckCard
avatar=
{
avatar=
{
...
...
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