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
9f7c37a8
Commit
9f7c37a8
authored
Aug 07, 2023
by
Chunchi Che
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
optimize NewWaitRoom
parent
4525f1bb
Pipeline
#22935
failed with stages
in 10 minutes and 58 seconds
Changes
5
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
40 additions
and
21 deletions
+40
-21
src/service/duel/sibylName.ts
src/service/duel/sibylName.ts
+8
-2
src/service/mora/deckCount.ts
src/service/mora/deckCount.ts
+17
-10
src/stores/roomStore.ts
src/stores/roomStore.ts
+4
-4
src/ui/Duel/PlayMat/LifeBar/index.tsx
src/ui/Duel/PlayMat/LifeBar/index.tsx
+2
-2
src/ui/NewWaitRoom/index.tsx
src/ui/NewWaitRoom/index.tsx
+9
-3
No files found.
src/service/duel/sibylName.ts
View file @
9f7c37a8
...
...
@@ -3,6 +3,12 @@ import { roomStore } from "@/stores";
type
MsgSibylName
=
ygopro
.
StocGameMessage
.
MsgSibylName
;
export
default
(
sibylName
:
MsgSibylName
)
=>
{
roomStore
.
getMePlayer
().
name
=
sibylName
.
name_0
;
roomStore
.
getOpPlayer
().
name
=
sibylName
.
name_1
;
const
me
=
roomStore
.
getMePlayer
();
const
op
=
roomStore
.
getOpPlayer
();
if
(
me
)
{
me
.
name
=
sibylName
.
name_0
;
}
if
(
op
)
{
op
.
name
=
sibylName
.
name_1
;
}
};
src/service/mora/deckCount.ts
View file @
9f7c37a8
...
...
@@ -5,15 +5,22 @@ import { roomStore } from "@/stores";
export
default
function
handleDeckCount
(
pb
:
ygopro
.
YgoStocMsg
)
{
const
deckCount
=
pb
.
stoc_deck_count
;
roomStore
.
getMePlayer
().
deckInfo
=
{
const
me
=
roomStore
.
getMePlayer
();
const
op
=
roomStore
.
getOpPlayer
();
if
(
me
)
{
me
.
deckInfo
=
{
mainSize
:
deckCount
.
meMain
,
extraSize
:
deckCount
.
meExtra
,
sideSize
:
deckCount
.
meSide
,
};
}
roomStore
.
getOpPlayer
().
deckInfo
=
{
if
(
op
)
{
op
.
deckInfo
=
{
mainSize
:
deckCount
.
opMain
,
extraSize
:
deckCount
.
opExtra
,
sideSize
:
deckCount
.
opSide
,
};
}
}
src/stores/roomStore.ts
View file @
9f7c37a8
...
...
@@ -37,12 +37,12 @@ class RoomStore implements NeosStore {
stage
:
RoomStage
=
RoomStage
.
WAITING
;
getMePlayer
()
{
if
(
this
.
selfType
==
SelfType
.
PLAYER1
)
return
this
.
players
[
0
]
;
return
this
.
players
[
1
]
;
if
(
this
.
selfType
==
SelfType
.
PLAYER1
)
return
this
.
players
.
at
(
0
)
;
return
this
.
players
.
at
(
1
)
;
}
getOpPlayer
()
{
if
(
this
.
selfType
==
SelfType
.
PLAYER1
)
return
this
.
players
[
1
]
;
return
this
.
players
[
0
]
;
if
(
this
.
selfType
==
SelfType
.
PLAYER1
)
return
this
.
players
.
at
(
1
)
;
return
this
.
players
.
at
(
0
)
;
}
reset
():
void
{
...
...
src/ui/Duel/PlayMat/LifeBar/index.tsx
View file @
9f7c37a8
...
...
@@ -59,14 +59,14 @@ export const LifeBar: React.FC = () => {
<
div
className=
{
styles
.
container
}
>
<
LifeBarItem
active=
{
!
matStore
.
isMe
(
currentPlayer
)
}
name=
{
snapPlayer
.
getOpPlayer
().
name
??
"
?
"
}
name=
{
snapPlayer
.
getOpPlayer
()
?
.
name
??
"
?
"
}
life=
{
opLife
}
timeLimit=
{
opTimeLimit
}
isMe=
{
false
}
/>
<
LifeBarItem
active=
{
matStore
.
isMe
(
currentPlayer
)
}
name=
{
snapPlayer
.
getMePlayer
().
name
??
"
?
"
}
name=
{
snapPlayer
.
getMePlayer
()
?
.
name
??
"
?
"
}
life=
{
meLife
}
timeLimit=
{
myTimeLimit
}
isMe=
{
true
}
...
...
src/ui/NewWaitRoom/index.tsx
View file @
9f7c37a8
...
...
@@ -95,12 +95,12 @@ export const Component: React.FC = () => {
size=
"large"
className=
{
styles
[
"
btn-join
"
]
}
onClick=
{
()
=>
{
room
.
getMePlayer
()
.
state
==
PlayerState
.
NO_READY
room
.
getMePlayer
()
?.
state
=
==
PlayerState
.
NO_READY
?
sendHsReady
()
:
sendHsNotReady
();
}
}
>
{
room
.
getMePlayer
()
.
state
==
PlayerState
.
NO_READY
{
room
.
getMePlayer
()
?.
state
=
==
PlayerState
.
NO_READY
?
"
决斗准备
"
:
"
取消准备
"
}
</
Button
>
...
...
@@ -235,7 +235,13 @@ const PlayerZone: React.FC<{
<
OrderPopup
open=
{
false
}
>
<
div
style=
{
{
position
:
"
relative
"
}
}
>
<
Avatar
src=
{
avatar
??
`${NeosConfig.assetsPath}/default-avatar.png`
}
src=
{
avatar
?
avatar
:
player
?
`${NeosConfig.assetsPath}/default-avatar.png`
:
""
}
size=
{
48
}
/>
{
player
?.
state
===
PlayerState
.
READY
&&
(
...
...
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