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
bb9cecc2
Commit
bb9cecc2
authored
May 31, 2023
by
timel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: remove players' names in matStore
parent
1a692983
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
9 additions
and
14 deletions
+9
-14
src/service/duel/start.ts
src/service/duel/start.ts
+0
-5
src/stores/matStore/store.ts
src/stores/matStore/store.ts
+1
-5
src/stores/matStore/types.ts
src/stores/matStore/types.ts
+0
-1
src/ui/Duel/PlayMat/LifeBar/index.tsx
src/ui/Duel/PlayMat/LifeBar/index.tsx
+8
-3
No files found.
src/service/duel/start.ts
View file @
bb9cecc2
...
...
@@ -16,18 +16,13 @@ export default (start: ygopro.StocGameMessage.MsgStart) => {
?
1
:
0
;
const
meName
=
playerStore
.
getMePlayer
().
name
;
const
opName
=
playerStore
.
getOpPlayer
().
name
;
matStore
.
initInfo
.
set
(
0
,
{
life
:
start
.
life1
,
name
:
opponent
==
0
?
opName
:
meName
,
deckSize
:
start
.
deckSize1
,
extraSize
:
start
.
extraSize1
,
});
matStore
.
initInfo
.
set
(
1
,
{
life
:
start
.
life2
,
name
:
opponent
==
1
?
opName
:
meName
,
deckSize
:
start
.
deckSize2
,
extraSize
:
start
.
extraSize2
,
});
...
...
src/stores/matStore/store.ts
View file @
bb9cecc2
...
...
@@ -52,10 +52,6 @@ const initInfo: MatState["initInfo"] = (() => {
});
})();
const
hint
:
MatState
[
"
hint
"
]
=
proxy
({
code
:
-
1
,
});
/**
* 💡 决斗盘状态仓库,本文件核心,
* 具体介绍可以点进`MatState`去看
...
...
@@ -76,7 +72,7 @@ export const matStore: MatState = proxy<MatState>({
initInfo
,
selfType
:
ygopro
.
StocTypeChange
.
SelfType
.
UNKNOWN
,
hint
,
hint
:
{
code
:
-
1
}
,
currentPlayer
:
-
1
,
phase
:
{
currentPhase
:
ygopro
.
StocGameMessage
.
MsgNewPhase
.
PhaseType
.
UNKNOWN
,
// TODO 当前的阶段 应该改成enum
...
...
src/stores/matStore/types.ts
View file @
bb9cecc2
...
...
@@ -40,7 +40,6 @@ export interface MatState {
export
interface
InitInfo
{
masterRule
?:
string
;
name
:
string
;
life
:
number
;
deckSize
:
number
;
extraSize
:
number
;
...
...
src/ui/Duel/PlayMat/LifeBar/index.tsx
View file @
bb9cecc2
...
...
@@ -3,15 +3,20 @@ import "./index.scss";
import
React
from
"
react
"
;
import
{
useSnapshot
}
from
"
valtio
"
;
import
{
matStore
}
from
"
@/stores
"
;
import
{
matStore
,
playerStore
}
from
"
@/stores
"
;
export
const
LifeBar
:
React
.
FC
=
()
=>
{
const
snap
=
useSnapshot
(
matStore
.
initInfo
);
const
snapPlayer
=
useSnapshot
(
playerStore
);
return
(
<
div
id=
"life-bar-container"
>
<
div
id=
"life-bar"
>
{
`${snap.me.name}: ${snap.me.life}`
}
</
div
>
<
div
id=
"life-bar"
>
{
`${snap.op.name}: ${snap.op.life}`
}
</
div
>
<
div
id=
"life-bar"
>
{
`${snapPlayer.getMePlayer().name}: ${
snap.me.life
}`
}
</
div
>
<
div
id=
"life-bar"
>
{
`${snapPlayer.getOpPlayer().name}: ${
snap.op.life
}`
}
</
div
>
</
div
>
);
};
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