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
3906d069
Commit
3906d069
authored
Aug 17, 2023
by
Chunchi Che
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
integrate side
parent
31f9205a
Pipeline
#23181
passed with stages
in 10 minutes and 27 seconds
Changes
6
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
42 additions
and
13 deletions
+42
-13
src/service/duel/start.ts
src/service/duel/start.ts
+13
-1
src/service/room/duelStart.ts
src/service/room/duelStart.ts
+5
-1
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
+1
-3
src/ui/NeosRouter.tsx
src/ui/NeosRouter.tsx
+0
-4
src/ui/Side/index.tsx
src/ui/Side/index.tsx
+21
-4
No files found.
src/service/duel/start.ts
View file @
3906d069
...
@@ -6,7 +6,14 @@ import PlayerType = ygopro.StocGameMessage.MsgStart.PlayerType;
...
@@ -6,7 +6,14 @@ import PlayerType = ygopro.StocGameMessage.MsgStart.PlayerType;
import
{
fetchCard
,
ygopro
}
from
"
@/api
"
;
import
{
fetchCard
,
ygopro
}
from
"
@/api
"
;
import
{
useConfig
}
from
"
@/config
"
;
import
{
useConfig
}
from
"
@/config
"
;
import
{
sleep
}
from
"
@/infra
"
;
import
{
sleep
}
from
"
@/infra
"
;
import
{
cardStore
,
CardType
,
matStore
,
RoomStage
,
roomStore
}
from
"
@/stores
"
;
import
{
cardStore
,
CardType
,
matStore
,
RoomStage
,
roomStore
,
sideStore
,
}
from
"
@/stores
"
;
import
{
replayStart
}
from
"
@/ui/Match/ReplayModal
"
;
import
{
replayStart
}
from
"
@/ui/Match/ReplayModal
"
;
const
TOKEN_SIZE
=
13
;
// 每人场上最多就只可能有13个token
const
TOKEN_SIZE
=
13
;
// 每人场上最多就只可能有13个token
...
@@ -23,6 +30,11 @@ export default async (start: ygopro.StocGameMessage.MsgStart) => {
...
@@ -23,6 +30,11 @@ export default async (start: ygopro.StocGameMessage.MsgStart) => {
// 这行在该函数中的位置不能随便放,否则可能会block住
// 这行在该函数中的位置不能随便放,否则可能会block住
roomStore
.
stage
=
RoomStage
.
DUEL_START
;
roomStore
.
stage
=
RoomStage
.
DUEL_START
;
// 关闭side
sideStore
.
siding
=
false
;
sideStore
.
waiting
=
false
;
sideStore
.
ready
=
false
;
matStore
.
initInfo
.
set
(
0
,
{
matStore
.
initInfo
.
set
(
0
,
{
life
:
start
.
life1
,
life
:
start
.
life1
,
deckSize
:
start
.
deckSize1
,
deckSize
:
start
.
deckSize1
,
...
...
src/service/room/duelStart.ts
View file @
3906d069
import
{
ygopro
}
from
"
@/api
"
;
import
{
ygopro
}
from
"
@/api
"
;
import
{
RoomStage
,
roomStore
}
from
"
@/stores
"
;
import
{
RoomStage
,
roomStore
,
sideStore
}
from
"
@/stores
"
;
export
default
function
handleDuelStart
(
_pb
:
ygopro
.
YgoStocMsg
)
{
export
default
function
handleDuelStart
(
_pb
:
ygopro
.
YgoStocMsg
)
{
roomStore
.
stage
=
RoomStage
.
MORA
;
roomStore
.
stage
=
RoomStage
.
MORA
;
if
(
sideStore
.
siding
)
{
// 副卡组更换完毕
sideStore
.
ready
=
true
;
}
}
}
src/ui/Duel/Main.tsx
View file @
3906d069
import
React
from
"
react
"
;
import
React
from
"
react
"
;
import
{
SideModal
}
from
"
../Side
"
;
import
{
import
{
Alert
,
Alert
,
AnnounceModal
,
AnnounceModal
,
...
@@ -37,6 +38,7 @@ export const Component: React.FC = () => {
...
@@ -37,6 +38,7 @@ export const Component: React.FC = () => {
<
AnnounceModal
/>
<
AnnounceModal
/>
<
SimpleSelectCardsModal
/>
<
SimpleSelectCardsModal
/>
<
EndModal
/>
<
EndModal
/>
<
SideModal
/>
</>
</>
);
);
};
};
...
...
src/ui/Duel/Message/EndModal/index.tsx
View file @
3906d069
import
React
,
{
CSSProperties
}
from
"
react
"
;
import
React
,
{
CSSProperties
}
from
"
react
"
;
import
{
useNavigate
}
from
"
react-router-dom
"
;
import
{
proxy
,
useSnapshot
}
from
"
valtio
"
;
import
{
proxy
,
useSnapshot
}
from
"
valtio
"
;
import
{
fetchStrings
,
Region
}
from
"
@/api
"
;
import
{
fetchStrings
,
Region
}
from
"
@/api
"
;
...
@@ -25,11 +24,10 @@ export const EndModal: React.FC = () => {
...
@@ -25,11 +24,10 @@ export const EndModal: React.FC = () => {
const
{
isOpen
,
isWin
,
reason
}
=
useSnapshot
(
localStore
);
const
{
isOpen
,
isWin
,
reason
}
=
useSnapshot
(
localStore
);
const
{
isReplay
}
=
useSnapshot
(
matStore
);
const
{
isReplay
}
=
useSnapshot
(
matStore
);
const
navigate
=
useNavigate
();
const
onReturn
=
()
=>
{
const
onReturn
=
()
=>
{
resetUniverse
();
resetUniverse
();
rs
();
rs
();
navigate
(
"
/match
"
);
// TODO: 这里暂时不自动跳转,决斗结束后让玩家自己手动选择回到主页
};
};
return
(
return
(
...
...
src/ui/NeosRouter.tsx
View file @
3906d069
...
@@ -28,10 +28,6 @@ const router = createBrowserRouter([
...
@@ -28,10 +28,6 @@ const router = createBrowserRouter([
path
:
"
/duel
"
,
path
:
"
/duel
"
,
lazy
:
()
=>
import
(
"
./Duel/Main
"
),
lazy
:
()
=>
import
(
"
./Duel/Main
"
),
},
},
{
path
:
"
/side
"
,
lazy
:
()
=>
import
(
"
./Side
"
),
},
],
],
},
},
]);
]);
...
...
src/ui/Side/index.tsx
View file @
3906d069
...
@@ -2,23 +2,40 @@ import { App, Button, Modal } from "antd";
...
@@ -2,23 +2,40 @@ import { App, Button, Modal } from "antd";
import
React
from
"
react
"
;
import
React
from
"
react
"
;
import
{
DndProvider
}
from
"
react-dnd
"
;
import
{
DndProvider
}
from
"
react-dnd
"
;
import
{
HTML5Backend
}
from
"
react-dnd-html5-backend
"
;
import
{
HTML5Backend
}
from
"
react-dnd-html5-backend
"
;
import
{
useSnapshot
}
from
"
valtio
"
;
import
{
deckStore
}
from
"
@/stores
"
;
import
{
CardMeta
,
sendUpdateDeck
}
from
"
@/api
"
;
import
{
deckStore
,
sideStore
}
from
"
@/stores
"
;
import
{
DeckEditor
}
from
"
../BuildDeck
"
;
import
{
DeckEditor
}
from
"
../BuildDeck
"
;
import
{
editDeckStore
}
from
"
../BuildDeck/store
"
;
import
{
editDeckStore
}
from
"
../BuildDeck/store
"
;
import
{
iDeckToEditingDeck
}
from
"
../BuildDeck/utils
"
;
import
{
iDeckToEditingDeck
}
from
"
../BuildDeck/utils
"
;
import
{
Background
}
from
"
../Shared
"
;
import
{
Background
}
from
"
../Shared
"
;
export
const
Component
:
React
.
FC
=
()
=>
{
export
const
SideModal
:
React
.
FC
=
()
=>
{
const
deck
=
deckStore
.
decks
[
0
];
const
deck
=
deckStore
.
decks
[
0
];
const
{
message
}
=
App
.
useApp
();
const
{
message
}
=
App
.
useApp
();
const
{
deckName
,
main
,
extra
,
side
}
=
editDeckStore
;
const
{
siding
}
=
useSnapshot
(
sideStore
);
const
cardMeta2Id
=
(
meta
:
CardMeta
)
=>
meta
.
id
;
const
handleSummit
=
()
=>
{
const
newDeck
=
{
deckName
:
deckName
,
main
:
main
.
map
(
cardMeta2Id
),
extra
:
extra
.
map
(
cardMeta2Id
),
side
:
side
.
map
(
cardMeta2Id
),
};
sendUpdateDeck
(
newDeck
);
editDeckStore
.
edited
=
false
;
};
return
(
return
(
<
Modal
<
Modal
title=
"请选择更换副卡组"
title=
"请选择更换副卡组"
open=
{
true
}
open=
{
siding
}
width=
{
700
}
width=
{
700
}
footer=
{
<
Button
onClick=
{
()
=>
{}
}
>
副卡组更换完毕
</
Button
>
}
footer=
{
<
Button
onClick=
{
handleSummit
}
>
副卡组更换完毕
</
Button
>
}
>
>
<
DndProvider
backend=
{
HTML5Backend
}
>
<
DndProvider
backend=
{
HTML5Backend
}
>
<
Background
/>
<
Background
/>
...
...
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