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
b201cb28
Commit
b201cb28
authored
Jul 14, 2023
by
Chunchi Che
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
migrate
parent
632dbdbb
Pipeline
#22688
passed with stages
in 16 minutes and 50 seconds
Changes
6
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
12 additions
and
25 deletions
+12
-25
src/service/duel/gameMsg.ts
src/service/duel/gameMsg.ts
+1
-1
src/service/duel/win.ts
src/service/duel/win.ts
+7
-5
src/stores/matStore/types.ts
src/stores/matStore/types.ts
+0
-5
src/ui/Duel/Main.tsx
src/ui/Duel/Main.tsx
+2
-0
src/ui/Duel/Message/EndModal/index.tsx
src/ui/Duel/Message/EndModal/index.tsx
+2
-2
src/ui/Duel/Message/HintNotification/index.tsx
src/ui/Duel/Message/HintNotification/index.tsx
+0
-12
No files found.
src/service/duel/gameMsg.ts
View file @
b201cb28
...
...
@@ -203,7 +203,7 @@ async function _handleGameMsg(pb: ygopro.YgoStocMsg) {
break
;
}
case
"
win
"
:
{
onMsgWin
(
msg
.
win
);
await
onMsgWin
(
msg
.
win
);
break
;
}
...
...
src/service/duel/win.ts
View file @
b201cb28
import
{
fetchStrings
,
ygopro
}
from
"
@/api
"
;
import
{
matStore
}
from
"
@/stores
"
;
import
{
displayEndModal
}
from
"
@/ui/Duel/Message
"
;
import
MsgWin
=
ygopro
.
StocGameMessage
.
MsgWin
;
export
default
(
win
:
MsgWin
)
=>
{
export
default
async
(
win
:
MsgWin
)
=>
{
const
{
win_player
,
reason
}
=
win
;
matStore
.
result
=
{
isWin
:
matStore
.
isMe
(
win_player
),
reason
:
fetchStrings
(
"
!victory
"
,
`0x
${
reason
.
toString
(
16
)}
`
),
};
await
displayEndModal
(
matStore
.
isMe
(
win_player
),
fetchStrings
(
"
!victory
"
,
`0x
${
reason
.
toString
(
16
)}
`
)
);
};
src/stores/matStore/types.ts
View file @
b201cb28
...
...
@@ -30,11 +30,6 @@ export interface MatState {
isReplay
:
boolean
;
// 是否是回放模式
result
?:
{
isWin
:
boolean
;
reason
:
string
;
};
unimplemented
:
number
;
// 未处理的`Message`
tossResult
?:
string
;
// 骰子/硬币结果
...
...
src/ui/Duel/Main.tsx
View file @
b201cb28
...
...
@@ -6,6 +6,7 @@ import {
CardListModal
,
CardModal
,
CheckCounterModal
,
EndModal
,
HintNotification
,
OptionModal
,
PositionModal
,
...
...
@@ -34,6 +35,7 @@ const NeosDuel = () => {
<
SortCardModal
/>
<
AnnounceModal
/>
<
SimpleSelectCardsModal
/>
<
EndModal
/>
</>
);
};
...
...
src/ui/Duel/Message/EndModal/index.tsx
View file @
b201cb28
...
...
@@ -4,7 +4,7 @@ import React from "react";
import
{
proxy
,
useSnapshot
}
from
"
valtio
"
;
import
{
fetchStrings
}
from
"
@/api
"
;
import
{
replayStore
}
from
"
@/stores
"
;
import
{
matStore
,
replayStore
}
from
"
@/stores
"
;
import
{
NeosModal
}
from
"
../NeosModal
"
;
...
...
@@ -44,7 +44,7 @@ export const EndModal: React.FC = () => {
>
<
p
>
{
isWin
?
"
Win
"
:
"
Defeated
"
}
</
p
>
<
p
>
{
reason
}
</
p
>
<
p
>
{
fetchStrings
(
"
!system
"
,
1340
)
}
</
p
>
{
matStore
.
isReplay
?
<></>
:
<
p
>
{
fetchStrings
(
"
!system
"
,
1340
)
}
</
p
>
}
</
NeosModal
>
);
};
...
...
src/ui/Duel/Message/HintNotification/index.tsx
View file @
b201cb28
...
...
@@ -24,7 +24,6 @@ export const HintNotification = () => {
const
toss
=
snap
.
tossResult
;
const
handResults
=
snap
.
handResults
;
const
currentPhase
=
snap
.
phase
.
currentPhase
;
const
result
=
snap
.
result
;
const
[
notify
,
notifyContextHolder
]
=
notification
.
useNotification
({
maxCount
:
NeosConfig
.
ui
.
hint
.
maxCount
,
...
...
@@ -85,17 +84,6 @@ export const HintNotification = () => {
}
},
[
currentPhase
]);
useEffect
(()
=>
{
if
(
result
)
{
const
message
=
result
.
isWin
?
"
Win
"
:
"
Defeated
"
+
"
"
+
result
.
reason
;
notify
.
open
({
message
,
placement
:
"
bottom
"
,
style
:
style
,
});
}
},
[
result
]);
return
(
<>
{
notifyContextHolder
}
...
...
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