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