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
8d1d656b
Commit
8d1d656b
authored
Jun 08, 2023
by
chechunchi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Revert "refactor: store"
This reverts commit
d65485b1
.
parent
d65485b1
Pipeline
#22166
passed with stages
in 16 minutes and 52 seconds
Changes
4
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
24 additions
and
21 deletions
+24
-21
src/service/duel/start.ts
src/service/duel/start.ts
+2
-2
src/stores/index.ts
src/stores/index.ts
+12
-7
src/ui/Duel/PlayMat/Card/index.tsx
src/ui/Duel/PlayMat/Card/index.tsx
+1
-1
src/ui/WaitRoom.tsx
src/ui/WaitRoom.tsx
+9
-11
No files found.
src/service/duel/start.ts
View file @
8d1d656b
...
...
@@ -6,8 +6,8 @@ import { subscribeKey } from "valtio/utils";
import
{
fetchCard
,
ygopro
}
from
"
@/api
"
;
import
{
useConfig
}
from
"
@/config
"
;
import
{
sleep
}
from
"
@/infra
"
;
import
{
cardStore
,
CardType
,
matS
tore
}
from
"
@/stores
"
;
import
{
cardStore
,
CardType
,
s
tore
}
from
"
@/stores
"
;
const
{
matStore
}
=
store
;
const
TOKEN_SIZE
=
13
;
// 每人场上最多就只可能有13个token
export
default
async
(
start
:
ygopro
.
StocGameMessage
.
MsgStart
)
=>
{
...
...
src/stores/index.ts
View file @
8d1d656b
...
...
@@ -7,6 +7,7 @@ export * from "./methods";
export
*
from
"
./moraStore
"
;
export
*
from
"
./placeStore
"
;
import
{
proxy
}
from
"
valtio
"
;
import
{
devtools
}
from
"
valtio/utils
"
;
import
{
cardStore
}
from
"
./cardStore
"
;
...
...
@@ -17,10 +18,14 @@ import { messageStore } from "./messageStore";
import
{
moraStore
}
from
"
./moraStore
"
;
import
{
placeStore
}
from
"
./placeStore
"
;
devtools
(
chatStore
,
{
name
:
"
chat store
"
,
enabled
:
true
});
devtools
(
joinStore
,
{
name
:
"
join store
"
,
enabled
:
true
});
devtools
(
moraStore
,
{
name
:
"
mora store
"
,
enabled
:
true
});
devtools
(
matStore
,
{
name
:
"
mat store
"
,
enabled
:
true
});
devtools
(
messageStore
,
{
name
:
"
message store
"
,
enabled
:
true
});
devtools
(
cardStore
,
{
name
:
"
card store
"
,
enabled
:
true
});
devtools
(
placeStore
,
{
name
:
"
place store
"
,
enabled
:
true
});
export
const
store
=
proxy
({
chatStore
,
joinStore
,
moraStore
,
matStore
,
// 决斗盘
messageStore
,
// 决斗的信息,包括模态框
cardStore
,
placeStore
,
});
devtools
(
store
,
{
name
:
"
valtio store
"
,
enabled
:
true
});
src/ui/Duel/PlayMat/Card/index.tsx
View file @
8d1d656b
...
...
@@ -94,7 +94,7 @@ export const Card: FC<{ idx: number }> = React.memo(({ idx }) => {
useEffect
(()
=>
{
setHighlight
(
!!
snap
.
idleInteractivities
.
length
);
},
[
snap
.
idleInteractivities
.
length
]);
},
[
snap
.
idleInteractivities
]);
return
(
<
animated
.
div
...
...
src/ui/WaitRoom.tsx
View file @
8d1d656b
...
...
@@ -30,7 +30,7 @@ import { DeckManager, fetchDeck, type IDeck } from "@/api/deck";
import
{
useConfig
}
from
"
@/config
"
;
import
socketMiddleWare
,
{
socketCmd
}
from
"
@/middleware/socket
"
;
import
sqliteMiddleWare
,
{
sqliteCmd
}
from
"
@/middleware/sqlite
"
;
import
{
chatStore
,
joinStore
,
matStore
,
moraS
tore
}
from
"
@/stores
"
;
import
{
s
tore
}
from
"
@/stores
"
;
const
NeosConfig
=
useConfig
();
...
...
@@ -42,10 +42,8 @@ const {
}
=
useConfig
();
const
WaitRoom
=
()
=>
{
const
snapJoin
=
useSnapshot
(
joinStore
);
const
snapChat
=
useSnapshot
(
chatStore
);
const
snapMat
=
useSnapshot
(
matStore
);
const
snapMora
=
useSnapshot
(
moraStore
);
const
state
=
store
;
const
snap
=
useSnapshot
(
state
);
const
params
=
useParams
<
{
player
?:
string
;
passWd
?:
string
;
...
...
@@ -91,12 +89,12 @@ const WaitRoom = () => {
const
[
api
,
contextHolder
]
=
notification
.
useNotification
();
const
joined
=
snap
Join
.
value
;
const
chat
=
snap
Chat
.
message
;
const
isHost
=
snap
Mat
.
isHost
;
const
player0
=
snap
Mat
.
player
[
0
];
const
player1
=
snap
Mat
.
player
[
1
];
const
duelStart
=
snap
Mora
.
duelStart
;
const
joined
=
snap
.
joinStore
.
value
;
const
chat
=
snap
.
chatStore
.
message
;
const
isHost
=
snap
.
matStore
.
isHost
;
const
player0
=
snap
.
matStore
.
player
[
0
];
const
player1
=
snap
.
matStore
.
player
[
1
];
const
duelStart
=
snap
.
moraStore
.
duelStart
;
// FIXME: 这些数据应该从`store`中获取
// TODO: 云卡组
...
...
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