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
baichixing
Neos
Commits
f7b96892
Commit
f7b96892
authored
Apr 15, 2023
by
timel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
style: eslint autofix import
parent
85fe308f
Changes
167
Hide whitespace changes
Inline
Side-by-side
Showing
167 changed files
with
924 additions
and
722 deletions
+924
-722
src/api/cards.ts
src/api/cards.ts
+1
-0
src/api/ocgcore/ocgAdapter/adapter.ts
src/api/ocgcore/ocgAdapter/adapter.ts
+12
-12
src/api/ocgcore/ocgAdapter/bufferIO.ts
src/api/ocgcore/ocgAdapter/bufferIO.ts
+2
-1
src/api/ocgcore/ocgAdapter/ctos/ctosGameMsgResponse/mod.ts
src/api/ocgcore/ocgAdapter/ctos/ctosGameMsgResponse/mod.ts
+5
-5
src/api/ocgcore/ocgAdapter/ctos/ctosGameMsgResponse/selectBattleCmd.ts
...re/ocgAdapter/ctos/ctosGameMsgResponse/selectBattleCmd.ts
+2
-1
src/api/ocgcore/ocgAdapter/ctos/ctosGameMsgResponse/selectCard.ts
...ocgcore/ocgAdapter/ctos/ctosGameMsgResponse/selectCard.ts
+2
-1
src/api/ocgcore/ocgAdapter/ctos/ctosGameMsgResponse/selectChain.ts
...cgcore/ocgAdapter/ctos/ctosGameMsgResponse/selectChain.ts
+2
-1
src/api/ocgcore/ocgAdapter/ctos/ctosGameMsgResponse/selectCounter.ts
...core/ocgAdapter/ctos/ctosGameMsgResponse/selectCounter.ts
+2
-1
src/api/ocgcore/ocgAdapter/ctos/ctosGameMsgResponse/selectEffectYn.ts
...ore/ocgAdapter/ctos/ctosGameMsgResponse/selectEffectYn.ts
+2
-1
src/api/ocgcore/ocgAdapter/ctos/ctosGameMsgResponse/selectIdleCmd.ts
...core/ocgAdapter/ctos/ctosGameMsgResponse/selectIdleCmd.ts
+2
-1
src/api/ocgcore/ocgAdapter/ctos/ctosGameMsgResponse/selectOption.ts
...gcore/ocgAdapter/ctos/ctosGameMsgResponse/selectOption.ts
+2
-1
src/api/ocgcore/ocgAdapter/ctos/ctosGameMsgResponse/selectPlace.ts
...cgcore/ocgAdapter/ctos/ctosGameMsgResponse/selectPlace.ts
+2
-1
src/api/ocgcore/ocgAdapter/ctos/ctosGameMsgResponse/selectPosition.ts
...ore/ocgAdapter/ctos/ctosGameMsgResponse/selectPosition.ts
+2
-1
src/api/ocgcore/ocgAdapter/ctos/ctosGameMsgResponse/selectUnselectCard.ts
...ocgAdapter/ctos/ctosGameMsgResponse/selectUnselectCard.ts
+2
-2
src/api/ocgcore/ocgAdapter/ctos/ctosGameMsgResponse/sortCard.ts
...i/ocgcore/ocgAdapter/ctos/ctosGameMsgResponse/sortCard.ts
+2
-1
src/api/ocgcore/ocgAdapter/stoc/stocChat.ts
src/api/ocgcore/ocgAdapter/stoc/stocChat.ts
+1
-1
src/api/ocgcore/ocgAdapter/stoc/stocDeckCount.ts
src/api/ocgcore/ocgAdapter/stoc/stocDeckCount.ts
+1
-1
src/api/ocgcore/ocgAdapter/stoc/stocDuelStart.ts
src/api/ocgcore/ocgAdapter/stoc/stocDuelStart.ts
+1
-1
src/api/ocgcore/ocgAdapter/stoc/stocGameMsg/damage.ts
src/api/ocgcore/ocgAdapter/stoc/stocGameMsg/damage.ts
+2
-1
src/api/ocgcore/ocgAdapter/stoc/stocGameMsg/draw.ts
src/api/ocgcore/ocgAdapter/stoc/stocGameMsg/draw.ts
+2
-1
src/api/ocgcore/ocgAdapter/stoc/stocGameMsg/hint.ts
src/api/ocgcore/ocgAdapter/stoc/stocGameMsg/hint.ts
+2
-1
src/api/ocgcore/ocgAdapter/stoc/stocGameMsg/mod.ts
src/api/ocgcore/ocgAdapter/stoc/stocGameMsg/mod.ts
+19
-19
src/api/ocgcore/ocgAdapter/stoc/stocGameMsg/newPhase.ts
src/api/ocgcore/ocgAdapter/stoc/stocGameMsg/newPhase.ts
+2
-1
src/api/ocgcore/ocgAdapter/stoc/stocGameMsg/newTurn.ts
src/api/ocgcore/ocgAdapter/stoc/stocGameMsg/newTurn.ts
+2
-1
src/api/ocgcore/ocgAdapter/stoc/stocGameMsg/penetrate.ts
src/api/ocgcore/ocgAdapter/stoc/stocGameMsg/penetrate.ts
+2
-2
src/api/ocgcore/ocgAdapter/stoc/stocGameMsg/recover.ts
src/api/ocgcore/ocgAdapter/stoc/stocGameMsg/recover.ts
+2
-1
src/api/ocgcore/ocgAdapter/stoc/stocGameMsg/selectOption.ts
src/api/ocgcore/ocgAdapter/stoc/stocGameMsg/selectOption.ts
+2
-1
src/api/ocgcore/ocgAdapter/stoc/stocGameMsg/selectPlace.ts
src/api/ocgcore/ocgAdapter/stoc/stocGameMsg/selectPlace.ts
+2
-1
src/api/ocgcore/ocgAdapter/stoc/stocGameMsg/selectPosition.ts
...api/ocgcore/ocgAdapter/stoc/stocGameMsg/selectPosition.ts
+2
-1
src/api/ocgcore/ocgAdapter/stoc/stocGameMsg/win.ts
src/api/ocgcore/ocgAdapter/stoc/stocGameMsg/win.ts
+2
-1
src/api/ocgcore/ocgAdapter/stoc/stocHsPlayerChange.ts
src/api/ocgcore/ocgAdapter/stoc/stocHsPlayerChange.ts
+1
-1
src/api/ocgcore/ocgAdapter/stoc/stocHsPlayerEnter.ts
src/api/ocgcore/ocgAdapter/stoc/stocHsPlayerEnter.ts
+2
-2
src/api/ocgcore/ocgAdapter/stoc/stocHsWatchChange.ts
src/api/ocgcore/ocgAdapter/stoc/stocHsWatchChange.ts
+1
-1
src/api/ocgcore/ocgAdapter/stoc/stocJoinGame.ts
src/api/ocgcore/ocgAdapter/stoc/stocJoinGame.ts
+1
-1
src/api/ocgcore/ocgAdapter/stoc/stocSelectHand.ts
src/api/ocgcore/ocgAdapter/stoc/stocSelectHand.ts
+1
-1
src/api/ocgcore/ocgAdapter/stoc/stocSelectTp.ts
src/api/ocgcore/ocgAdapter/stoc/stocSelectTp.ts
+1
-1
src/api/ocgcore/ocgAdapter/stoc/stocTimeLimit.ts
src/api/ocgcore/ocgAdapter/stoc/stocTimeLimit.ts
+3
-2
src/api/ocgcore/ocgAdapter/stoc/stocTypeChange.ts
src/api/ocgcore/ocgAdapter/stoc/stocTypeChange.ts
+1
-1
src/api/ocgcore/ocgHelper.ts
src/api/ocgcore/ocgHelper.ts
+10
-9
src/api/strings.ts
src/api/strings.ts
+2
-1
src/config/env.ts
src/config/env.ts
+1
-0
src/hook/useApp.ts
src/hook/useApp.ts
+2
-1
src/hook/useMeshClick.ts
src/hook/useMeshClick.ts
+5
-5
src/main.tsx
src/main.tsx
+5
-4
src/middleware/socket.ts
src/middleware/socket.ts
+1
-1
src/middleware/sqlite.ts
src/middleware/sqlite.ts
+3
-1
src/reducers/chatSlice.ts
src/reducers/chatSlice.ts
+1
-0
src/reducers/duel/cemeretySlice.ts
src/reducers/duel/cemeretySlice.ts
+11
-9
src/reducers/duel/commonSlice.ts
src/reducers/duel/commonSlice.ts
+1
-0
src/reducers/duel/deckSlice.ts
src/reducers/duel/deckSlice.ts
+7
-5
src/reducers/duel/exclusionSlice.ts
src/reducers/duel/exclusionSlice.ts
+11
-9
src/reducers/duel/extraDeckSlice.ts
src/reducers/duel/extraDeckSlice.ts
+2
-0
src/reducers/duel/generic.ts
src/reducers/duel/generic.ts
+2
-0
src/reducers/duel/handsSlice.ts
src/reducers/duel/handsSlice.ts
+10
-8
src/reducers/duel/hintSlice.ts
src/reducers/duel/hintSlice.ts
+8
-6
src/reducers/duel/initInfoSlice.ts
src/reducers/duel/initInfoSlice.ts
+3
-1
src/reducers/duel/magicSlice.ts
src/reducers/duel/magicSlice.ts
+10
-8
src/reducers/duel/mod.ts
src/reducers/duel/mod.ts
+85
-83
src/reducers/duel/modal/cardListModalSlice.ts
src/reducers/duel/modal/cardListModalSlice.ts
+5
-3
src/reducers/duel/modal/cardModalSlice.ts
src/reducers/duel/modal/cardModalSlice.ts
+5
-3
src/reducers/duel/modal/checkCardModalSlice.ts
src/reducers/duel/modal/checkCardModalSlice.ts
+6
-4
src/reducers/duel/modal/checkCardModalV2Slice.ts
src/reducers/duel/modal/checkCardModalV2Slice.ts
+5
-3
src/reducers/duel/modal/checkCardModalV3Slice.ts
src/reducers/duel/modal/checkCardModalV3Slice.ts
+5
-3
src/reducers/duel/modal/checkCounterModalSlice.ts
src/reducers/duel/modal/checkCounterModalSlice.ts
+4
-2
src/reducers/duel/modal/mod.ts
src/reducers/duel/modal/mod.ts
+4
-4
src/reducers/duel/modal/optionModalSlice.ts
src/reducers/duel/modal/optionModalSlice.ts
+5
-3
src/reducers/duel/modal/positionModalSlice.ts
src/reducers/duel/modal/positionModalSlice.ts
+4
-2
src/reducers/duel/modal/sortCardModalSlice.ts
src/reducers/duel/modal/sortCardModalSlice.ts
+2
-0
src/reducers/duel/modal/yesNoModalSlice.ts
src/reducers/duel/modal/yesNoModalSlice.ts
+4
-2
src/reducers/duel/monstersSlice.ts
src/reducers/duel/monstersSlice.ts
+13
-11
src/reducers/duel/phaseSlice.ts
src/reducers/duel/phaseSlice.ts
+3
-1
src/reducers/duel/timeLimit.ts
src/reducers/duel/timeLimit.ts
+2
-1
src/reducers/duel/turnSlice.ts
src/reducers/duel/turnSlice.ts
+3
-1
src/reducers/duel/util.ts
src/reducers/duel/util.ts
+3
-1
src/reducers/joinSlice.ts
src/reducers/joinSlice.ts
+1
-0
src/reducers/moraSlice.ts
src/reducers/moraSlice.ts
+1
-0
src/reducers/playerSlice.ts
src/reducers/playerSlice.ts
+1
-0
src/service/duel/draw.ts
src/service/duel/draw.ts
+1
-1
src/service/duel/gameMsg.ts
src/service/duel/gameMsg.ts
+30
-29
src/service/duel/hint.ts
src/service/duel/hint.ts
+1
-1
src/service/duel/move.ts
src/service/duel/move.ts
+11
-10
src/service/duel/newPhase.ts
src/service/duel/newPhase.ts
+1
-1
src/service/duel/newTurn.ts
src/service/duel/newTurn.ts
+1
-1
src/service/duel/selectBattleCmd.ts
src/service/duel/selectBattleCmd.ts
+1
-0
src/service/duel/selectCard.ts
src/service/duel/selectCard.ts
+1
-1
src/service/duel/selectChain.ts
src/service/duel/selectChain.ts
+1
-0
src/service/duel/selectEffectYn.ts
src/service/duel/selectEffectYn.ts
+1
-0
src/service/duel/selectIdleCmd.ts
src/service/duel/selectIdleCmd.ts
+6
-6
src/service/duel/selectPlace.ts
src/service/duel/selectPlace.ts
+1
-1
src/service/duel/start.ts
src/service/duel/start.ts
+4
-4
src/service/duel/timeLimit.ts
src/service/duel/timeLimit.ts
+2
-2
src/service/duel/unimplemented.ts
src/service/duel/unimplemented.ts
+1
-0
src/service/mora/deckCount.ts
src/service/mora/deckCount.ts
+1
-1
src/service/mora/selectHand.ts
src/service/mora/selectHand.ts
+1
-1
src/service/mora/selectTp.ts
src/service/mora/selectTp.ts
+1
-1
src/service/onSocketMessage.ts
src/service/onSocketMessage.ts
+11
-10
src/service/onSocketOpen.ts
src/service/onSocketOpen.ts
+1
-0
src/service/room/hsPlayerChange.ts
src/service/room/hsPlayerChange.ts
+4
-4
src/service/room/hsPlayerEnter.ts
src/service/room/hsPlayerEnter.ts
+1
-1
src/service/room/joinGame.ts
src/service/room/joinGame.ts
+1
-1
src/service/room/typeChange.ts
src/service/room/typeChange.ts
+1
-1
src/store.ts
src/store.ts
+4
-3
src/ui/Duel/Layout.tsx
src/ui/Duel/Layout.tsx
+2
-1
src/ui/Duel/Main.tsx
src/ui/Duel/Main.tsx
+25
-24
src/ui/Duel/Message/Alert.tsx
src/ui/Duel/Message/Alert.tsx
+2
-1
src/ui/Duel/Message/CardListModal.tsx
src/ui/Duel/Message/CardListModal.tsx
+9
-7
src/ui/Duel/Message/CardModal.tsx
src/ui/Duel/Message/CardModal.tsx
+15
-13
src/ui/Duel/Message/CheckCardModal.tsx
src/ui/Duel/Message/CheckCardModal.tsx
+15
-13
src/ui/Duel/Message/CheckCardModalV2.tsx
src/ui/Duel/Message/CheckCardModalV2.tsx
+12
-10
src/ui/Duel/Message/CheckCardModalV3.tsx
src/ui/Duel/Message/CheckCardModalV3.tsx
+8
-6
src/ui/Duel/Message/CheckCounterModal.tsx
src/ui/Duel/Message/CheckCounterModal.tsx
+4
-2
src/ui/Duel/Message/DragModal.tsx
src/ui/Duel/Message/DragModal.tsx
+1
-1
src/ui/Duel/Message/HintNotification.tsx
src/ui/Duel/Message/HintNotification.tsx
+5
-4
src/ui/Duel/Message/OptionModal.tsx
src/ui/Duel/Message/OptionModal.tsx
+7
-5
src/ui/Duel/Message/Phase.tsx
src/ui/Duel/Message/Phase.tsx
+13
-11
src/ui/Duel/Message/PositionModal.tsx
src/ui/Duel/Message/PositionModal.tsx
+11
-9
src/ui/Duel/Message/SendBox.tsx
src/ui/Duel/Message/SendBox.tsx
+3
-2
src/ui/Duel/Message/SortCardModal.tsx
src/ui/Duel/Message/SortCardModal.tsx
+10
-8
src/ui/Duel/Message/Status.tsx
src/ui/Duel/Message/Status.tsx
+5
-3
src/ui/Duel/Message/TimeLine.tsx
src/ui/Duel/Message/TimeLine.tsx
+3
-2
src/ui/Duel/Message/YesNoModal.tsx
src/ui/Duel/Message/YesNoModal.tsx
+7
-5
src/ui/Duel/Message/alert.tsx
src/ui/Duel/Message/alert.tsx
+2
-1
src/ui/Duel/Message/cardListModal.tsx
src/ui/Duel/Message/cardListModal.tsx
+9
-7
src/ui/Duel/Message/cardModal.tsx
src/ui/Duel/Message/cardModal.tsx
+15
-13
src/ui/Duel/Message/checkCardModal.tsx
src/ui/Duel/Message/checkCardModal.tsx
+15
-13
src/ui/Duel/Message/checkCardModalV2.tsx
src/ui/Duel/Message/checkCardModalV2.tsx
+12
-10
src/ui/Duel/Message/checkCardModalV3.tsx
src/ui/Duel/Message/checkCardModalV3.tsx
+8
-6
src/ui/Duel/Message/checkCounterModal.tsx
src/ui/Duel/Message/checkCounterModal.tsx
+4
-2
src/ui/Duel/Message/dragModal.tsx
src/ui/Duel/Message/dragModal.tsx
+1
-1
src/ui/Duel/Message/hintNotification.tsx
src/ui/Duel/Message/hintNotification.tsx
+5
-4
src/ui/Duel/Message/optionModal.tsx
src/ui/Duel/Message/optionModal.tsx
+7
-5
src/ui/Duel/Message/phase.tsx
src/ui/Duel/Message/phase.tsx
+13
-11
src/ui/Duel/Message/positionModal.tsx
src/ui/Duel/Message/positionModal.tsx
+11
-9
src/ui/Duel/Message/sendBox.tsx
src/ui/Duel/Message/sendBox.tsx
+3
-2
src/ui/Duel/Message/sortCardModal.tsx
src/ui/Duel/Message/sortCardModal.tsx
+10
-8
src/ui/Duel/Message/status.tsx
src/ui/Duel/Message/status.tsx
+5
-3
src/ui/Duel/Message/timeLine.tsx
src/ui/Duel/Message/timeLine.tsx
+3
-2
src/ui/Duel/Message/yesNoModal.tsx
src/ui/Duel/Message/yesNoModal.tsx
+7
-5
src/ui/Duel/PlayMat/BanishedZone.tsx
src/ui/Duel/PlayMat/BanishedZone.tsx
+3
-1
src/ui/Duel/PlayMat/Deck.tsx
src/ui/Duel/PlayMat/Deck.tsx
+4
-2
src/ui/Duel/PlayMat/ExtraDeck.tsx
src/ui/Duel/PlayMat/ExtraDeck.tsx
+3
-1
src/ui/Duel/PlayMat/Field.tsx
src/ui/Duel/PlayMat/Field.tsx
+4
-2
src/ui/Duel/PlayMat/FixedSlot.tsx
src/ui/Duel/PlayMat/FixedSlot.tsx
+8
-6
src/ui/Duel/PlayMat/Graveyard.tsx
src/ui/Duel/PlayMat/Graveyard.tsx
+5
-3
src/ui/Duel/PlayMat/Hands.tsx
src/ui/Duel/PlayMat/Hands.tsx
+8
-6
src/ui/Duel/PlayMat/Magics.tsx
src/ui/Duel/PlayMat/Magics.tsx
+6
-4
src/ui/Duel/PlayMat/Monsters.tsx
src/ui/Duel/PlayMat/Monsters.tsx
+8
-5
src/ui/Duel/PlayMat/SingleSlot.tsx
src/ui/Duel/PlayMat/SingleSlot.tsx
+6
-4
src/ui/Duel/PlayMat/deck.tsx
src/ui/Duel/PlayMat/deck.tsx
+4
-2
src/ui/Duel/PlayMat/extraDeck.tsx
src/ui/Duel/PlayMat/extraDeck.tsx
+3
-1
src/ui/Duel/PlayMat/field.tsx
src/ui/Duel/PlayMat/field.tsx
+4
-2
src/ui/Duel/PlayMat/fixedSlot.tsx
src/ui/Duel/PlayMat/fixedSlot.tsx
+8
-6
src/ui/Duel/PlayMat/hands.tsx
src/ui/Duel/PlayMat/hands.tsx
+8
-6
src/ui/Duel/PlayMat/index.ts
src/ui/Duel/PlayMat/index.ts
+2
-2
src/ui/Duel/PlayMat/magics.tsx
src/ui/Duel/PlayMat/magics.tsx
+6
-4
src/ui/Duel/PlayMat/monsters.tsx
src/ui/Duel/PlayMat/monsters.tsx
+8
-5
src/ui/Duel/PlayMat/singleSlot.tsx
src/ui/Duel/PlayMat/singleSlot.tsx
+6
-4
src/ui/Duel/layout.tsx
src/ui/Duel/layout.tsx
+2
-1
src/ui/Duel/main.tsx
src/ui/Duel/main.tsx
+25
-24
src/ui/Duel/spring/animated.ts
src/ui/Duel/spring/animated.ts
+2
-1
src/ui/Duel/spring/index.ts
src/ui/Duel/spring/index.ts
+5
-3
src/ui/Duel/utils/cardSlot.ts
src/ui/Duel/utils/cardSlot.ts
+2
-1
src/ui/Duel/utils/index.ts
src/ui/Duel/utils/index.ts
+2
-2
src/ui/Login.tsx
src/ui/Login.tsx
+6
-3
src/ui/Mora.tsx
src/ui/Mora.tsx
+11
-10
src/ui/Neos.tsx
src/ui/Neos.tsx
+2
-1
src/ui/WaitRoom.tsx
src/ui/WaitRoom.tsx
+34
-32
No files found.
src/api/cards.ts
View file @
f7b96892
import
axios
from
"
axios
"
;
import
sqliteMiddleWare
,
{
sqliteCmd
}
from
"
@/middleware/sqlite
"
;
export
interface
CardMeta
{
...
...
src/api/ocgcore/ocgAdapter/adapter.ts
View file @
f7b96892
import
{
YgoProPacket
}
from
"
./packet
"
;
import
{
ygopro
}
from
"
../idl/ocgcore
"
;
import
{
YgoProPacket
}
from
"
./packet
"
;
import
{
STOC_CHAT
,
STOC_DECK_COUNT
,
STOC_DUEL_START
,
STOC_GAME_MSG
,
STOC_HAND_RESULT
,
STOC_HS_PLAYER_CHANGE
,
STOC_HS_PLAYER_ENTER
,
STOC_HS_WATCH_CHANGE
,
STOC_JOIN_GAME
,
STOC_TYPE_CHANGE
,
STOC_SELECT_HAND
,
STOC_SELECT_TP
,
STOC_HAND_RESULT
,
STOC_DECK_COUNT
,
STOC_DUEL_START
,
STOC_GAME_MSG
,
STOC_TIME_LIMIT
,
STOC_TYPE_CHANGE
,
}
from
"
./protoDecl
"
;
import
StocChat
from
"
./stoc/stocChat
"
;
import
StocJoinGame
from
"
./stoc/stocJoinGame
"
;
import
StocHsPlayerEnter
from
"
./stoc/stocHsPlayerEnter
"
;
import
StocDeckCount
from
"
./stoc/stocDeckCount
"
;
import
StocDuelStart
from
"
./stoc/stocDuelStart
"
;
import
StocGameMsg
from
"
./stoc/stocGameMsg/mod
"
;
import
StocHsPlayerChange
from
"
./stoc/stocHsPlayerChange
"
;
import
StocHsPlayerEnter
from
"
./stoc/stocHsPlayerEnter
"
;
import
StocHsWatchChange
from
"
./stoc/stocHsWatchChange
"
;
import
Stoc
TypeChange
from
"
./stoc/stocTypeChang
e
"
;
import
Stoc
JoinGame
from
"
./stoc/stocJoinGam
e
"
;
import
StocSelectHand
from
"
./stoc/stocSelectHand
"
;
import
StocSelectTp
from
"
./stoc/stocSelectTp
"
;
import
StocDeckCount
from
"
./stoc/stocDeckCount
"
;
import
StocTimeLimit
from
"
./stoc/stocTimeLimit
"
;
import
StocGameMsg
from
"
./stoc/stocGameMsg/mod
"
;
import
StocDuelStart
from
"
./stoc/stocDuelStart
"
;
import
StocTypeChange
from
"
./stoc/stocTypeChange
"
;
/*
* 将[`ygoProPacket`]对象转换成[`ygopro.YgoStocMsg`]对象
...
...
src/api/ocgcore/ocgAdapter/bufferIO.ts
View file @
f7b96892
import
{
BufferReader
}
from
"
rust-src
"
;
import
{
ygopro
}
from
"
../idl/ocgcore
"
;
import
{
numberToCardPosition
,
numberToCardZone
}
from
"
./util
"
;
import
{
BufferReader
}
from
"
rust-src
"
;
const
LOCATION_OVERLAY
=
0x80
;
...
...
src/api/ocgcore/ocgAdapter/ctos/ctosGameMsgResponse/mod.ts
View file @
f7b96892
import
{
ygopro
}
from
"
../../../idl/ocgcore
"
;
import
{
YgoProPacket
}
from
"
../../packet
"
;
import
{
CTOS_RESPONSE
}
from
"
../../protoDecl
"
;
import
adaptSelectIdleCmdResponse
from
"
./selectIdleCmd
"
;
import
adaptSelectPlaceResponse
from
"
./selectPlace
"
;
import
adaptSelectBattleCmdResponse
from
"
./selectBattleCmd
"
;
import
adaptSelectCardResponse
from
"
./selectCard
"
;
import
adaptSelectChainResponse
from
"
./selectChain
"
;
import
adaptSelectCounterResponse
from
"
./selectCounter
"
;
import
adaptSelectEffectYnResponse
from
"
./selectEffectYn
"
;
import
adaptSelect
PositionResponse
from
"
./selectPosition
"
;
import
adaptSelect
IdleCmdResponse
from
"
./selectIdleCmd
"
;
import
adaptSelectOptionResponse
from
"
./selectOption
"
;
import
adaptSelectBattleCmdResponse
from
"
./selectBattleCmd
"
;
import
adaptSelectPlaceResponse
from
"
./selectPlace
"
;
import
adaptSelectPositionResponse
from
"
./selectPosition
"
;
import
adaptSelectUnselectCardResponse
from
"
./selectUnselectCard
"
;
import
adaptSelectCounterResponse
from
"
./selectCounter
"
;
import
adaptSortCardResponse
from
"
./sortCard
"
;
/*
...
...
src/api/ocgcore/ocgAdapter/ctos/ctosGameMsgResponse/selectBattleCmd.ts
View file @
f7b96892
import
{
ygopro
}
from
"
../../../idl/ocgcore
"
;
import
{
BufferWriter
}
from
"
rust-src
"
;
import
{
ygopro
}
from
"
../../../idl/ocgcore
"
;
export
default
(
response
:
ygopro
.
CtosGameMsgResponse
.
SelectBattleCmdResponse
)
=>
{
...
...
src/api/ocgcore/ocgAdapter/ctos/ctosGameMsgResponse/selectCard.ts
View file @
f7b96892
import
{
ygopro
}
from
"
../../../idl/ocgcore
"
;
import
{
BufferWriter
}
from
"
rust-src
"
;
import
{
ygopro
}
from
"
../../../idl/ocgcore
"
;
export
default
(
response
:
ygopro
.
CtosGameMsgResponse
.
SelectCardResponse
)
=>
{
const
writer
=
new
BufferWriter
();
...
...
src/api/ocgcore/ocgAdapter/ctos/ctosGameMsgResponse/selectChain.ts
View file @
f7b96892
import
{
ygopro
}
from
"
../../../idl/ocgcore
"
;
import
{
BufferWriter
}
from
"
rust-src
"
;
import
{
ygopro
}
from
"
../../../idl/ocgcore
"
;
export
default
(
response
:
ygopro
.
CtosGameMsgResponse
.
SelectChainResponse
)
=>
{
const
writer
=
new
BufferWriter
();
...
...
src/api/ocgcore/ocgAdapter/ctos/ctosGameMsgResponse/selectCounter.ts
View file @
f7b96892
import
{
ygopro
}
from
"
../../../idl/ocgcore
"
;
import
{
BufferWriter
}
from
"
rust-src
"
;
import
{
ygopro
}
from
"
../../../idl/ocgcore
"
;
export
default
(
response
:
ygopro
.
CtosGameMsgResponse
.
SelectCounterResponse
)
=>
{
const
writer
=
new
BufferWriter
();
...
...
src/api/ocgcore/ocgAdapter/ctos/ctosGameMsgResponse/selectEffectYn.ts
View file @
f7b96892
import
{
ygopro
}
from
"
../../../idl/ocgcore
"
;
import
{
BufferWriter
}
from
"
rust-src
"
;
import
{
ygopro
}
from
"
../../../idl/ocgcore
"
;
export
default
(
response
:
ygopro
.
CtosGameMsgResponse
.
SelectEffectYnResponse
)
=>
{
...
...
src/api/ocgcore/ocgAdapter/ctos/ctosGameMsgResponse/selectIdleCmd.ts
View file @
f7b96892
import
{
ygopro
}
from
"
../../../idl/ocgcore
"
;
import
{
BufferWriter
}
from
"
rust-src
"
;
import
{
ygopro
}
from
"
../../../idl/ocgcore
"
;
export
default
(
response
:
ygopro
.
CtosGameMsgResponse
.
SelectIdleCmdResponse
)
=>
{
const
writer
=
new
BufferWriter
();
...
...
src/api/ocgcore/ocgAdapter/ctos/ctosGameMsgResponse/selectOption.ts
View file @
f7b96892
import
{
ygopro
}
from
"
../../../idl/ocgcore
"
;
import
{
BufferWriter
}
from
"
rust-src
"
;
import
{
ygopro
}
from
"
../../../idl/ocgcore
"
;
export
default
(
response
:
ygopro
.
CtosGameMsgResponse
.
SelectOptionResponse
)
=>
{
const
writer
=
new
BufferWriter
();
...
...
src/api/ocgcore/ocgAdapter/ctos/ctosGameMsgResponse/selectPlace.ts
View file @
f7b96892
import
{
ygopro
}
from
"
../../../idl/ocgcore
"
;
import
{
BufferWriter
}
from
"
rust-src
"
;
import
{
ygopro
}
from
"
../../../idl/ocgcore
"
;
import
{
cardZoneToNumber
}
from
"
../../util
"
;
export
default
(
response
:
ygopro
.
CtosGameMsgResponse
.
SelectPlaceResponse
)
=>
{
...
...
src/api/ocgcore/ocgAdapter/ctos/ctosGameMsgResponse/selectPosition.ts
View file @
f7b96892
import
{
ygopro
}
from
"
../../../idl/ocgcore
"
;
import
{
BufferWriter
}
from
"
rust-src
"
;
import
{
ygopro
}
from
"
../../../idl/ocgcore
"
;
export
default
(
response
:
ygopro
.
CtosGameMsgResponse
.
SelectPositionResponse
)
=>
{
...
...
src/api/ocgcore/ocgAdapter/ctos/ctosGameMsgResponse/selectUnselectCard.ts
View file @
f7b96892
import
{
ygopro
}
from
"
../../../idl/ocgcore
"
;
import
{
BufferWriter
}
from
"
rust-src
"
;
import
{
ygopro
}
from
"
../../../idl/ocgcore
"
;
export
default
(
response
:
ygopro
.
CtosGameMsgResponse
.
SelectUnselectCardResponse
)
=>
{
...
...
src/api/ocgcore/ocgAdapter/ctos/ctosGameMsgResponse/sortCard.ts
View file @
f7b96892
import
{
ygopro
}
from
"
../../../idl/ocgcore
"
;
import
{
BufferWriter
}
from
"
rust-src
"
;
import
{
ygopro
}
from
"
../../../idl/ocgcore
"
;
export
default
(
response
:
ygopro
.
CtosGameMsgResponse
.
SortCardResponse
)
=>
{
const
writer
=
new
BufferWriter
();
...
...
src/api/ocgcore/ocgAdapter/stoc/stocChat.ts
View file @
f7b96892
import
{
ygopro
}
from
"
../../idl/ocgcore
"
;
import
{
YgoProPacket
,
StocAdapter
}
from
"
../packet
"
;
import
{
StocAdapter
,
YgoProPacket
}
from
"
../packet
"
;
/*
* STOC Chat
...
...
src/api/ocgcore/ocgAdapter/stoc/stocDeckCount.ts
View file @
f7b96892
import
{
ygopro
}
from
"
../../idl/ocgcore
"
;
import
{
YgoProPacket
,
StocAdapter
}
from
"
../packet
"
;
import
{
StocAdapter
,
YgoProPacket
}
from
"
../packet
"
;
const
LITTLE_ENDIAN
=
true
;
const
INT16_BYTE_OFFSET
=
2
;
...
...
src/api/ocgcore/ocgAdapter/stoc/stocDuelStart.ts
View file @
f7b96892
import
{
ygopro
}
from
"
../../idl/ocgcore
"
;
import
{
YgoProPacket
,
StocAdapter
}
from
"
../packet
"
;
import
{
StocAdapter
,
YgoProPacket
}
from
"
../packet
"
;
/*
* STOC DuelStart
...
...
src/api/ocgcore/ocgAdapter/stoc/stocGameMsg/damage.ts
View file @
f7b96892
import
{
ygopro
}
from
"
../../../idl/ocgcore
"
;
import
{
ocgDamageAdapter
}
from
"
rust-src
"
;
import
{
ygopro
}
from
"
../../../idl/ocgcore
"
;
/*
* Msg Damage
*
...
...
src/api/ocgcore/ocgAdapter/stoc/stocGameMsg/draw.ts
View file @
f7b96892
import
{
ygopro
}
from
"
../../../idl/ocgcore
"
;
import
{
BufferReader
}
from
"
rust-src
"
;
import
{
ygopro
}
from
"
../../../idl/ocgcore
"
;
/*
* MSG Draw
*
...
...
src/api/ocgcore/ocgAdapter/stoc/stocGameMsg/hint.ts
View file @
f7b96892
import
{
ygopro
}
from
"
../../../idl/ocgcore
"
;
import
{
BufferReader
}
from
"
rust-src
"
;
import
{
ygopro
}
from
"
../../../idl/ocgcore
"
;
/*
* Msg Hint
*
...
...
src/api/ocgcore/ocgAdapter/stoc/stocGameMsg/mod.ts
View file @
f7b96892
...
...
@@ -4,35 +4,35 @@
* */
import
{
ygopro
}
from
"
../../../idl/ocgcore
"
;
import
{
YgoProPacket
,
StocAdapter
}
from
"
../../packet
"
;
import
{
StocAdapter
,
YgoProPacket
}
from
"
../../packet
"
;
import
*
as
GAME_MSG
from
"
../../protoDecl
"
;
import
MsgStartAdapter
from
"
./start
"
;
import
MsgAddCounter
from
"
./addCounter
"
;
import
MsgDamage
from
"
./damage
"
;
import
MsgDrawAdapter
from
"
./draw
"
;
import
MsgNewTurnAdapter
from
"
./newTurn
"
;
import
MsgNewPhaseAdapter
from
"
./newPhase
"
;
import
MsgHintAdapter
from
"
./hint
"
;
import
MsgSelectIdleCmdAdapter
from
"
./selectIdleCmd
"
;
import
MsgSelectPlaceAdapter
from
"
./selectPlace
"
;
import
MsgNewPhaseAdapter
from
"
./newPhase
"
;
import
MsgNewTurnAdapter
from
"
./newTurn
"
;
import
PENETRATE
from
"
./penetrate
"
;
import
MsgRecover
from
"
./recover
"
;
import
MsgReloadFieldAdapter
from
"
./reloadField
"
;
import
MsgRemoveCounter
from
"
./removeCounter
"
;
import
MsgSelectBattleCmdAdapter
from
"
./selectBattleCmd
"
;
import
MsgSelectCardAdapter
from
"
./selectCard
"
;
import
MsgSelectTributeAdapter
from
"
./selectTribute
"
;
import
MsgSelectChainAdapter
from
"
./selectChain
"
;
import
MsgSelectCounter
from
"
./selectCounter
"
;
import
MsgSelectEffectYnAdapter
from
"
./selectEffectYn
"
;
import
MsgSelect
PositionAdapter
from
"
./selectPosition
"
;
import
MsgSelect
IdleCmdAdapter
from
"
./selectIdleCmd
"
;
import
MsgSelectOptionAdapter
from
"
./selectOption
"
;
import
MsgSelectBattleCmdAdapter
from
"
./selectBattleCmd
"
;
import
MsgSelectPlaceAdapter
from
"
./selectPlace
"
;
import
MsgSelectPositionAdapter
from
"
./selectPosition
"
;
import
MsgSelectSum
from
"
./selectSum
"
;
import
MsgSelectTributeAdapter
from
"
./selectTribute
"
;
import
MsgSelectUnselectCardAdapter
from
"
./selectUnselectCard
"
;
import
MsgSortCard
from
"
./sortCard
"
;
import
MsgStartAdapter
from
"
./start
"
;
import
MsgUpdateDataAdapter
from
"
./updateData
"
;
import
MsgWaitAdapter
from
"
./wait
"
;
import
MsgDamage
from
"
./damage
"
;
import
MsgRecover
from
"
./recover
"
;
import
MsgWin
from
"
./win
"
;
import
MsgUpdateDataAdapter
from
"
./updateData
"
;
import
MsgReloadFieldAdapter
from
"
./reloadField
"
;
import
MsgSelectSum
from
"
./selectSum
"
;
import
MsgAddCounter
from
"
./addCounter
"
;
import
MsgRemoveCounter
from
"
./removeCounter
"
;
import
MsgSelectCounter
from
"
./selectCounter
"
;
import
MsgSortCard
from
"
./sortCard
"
;
import
PENETRATE
from
"
./penetrate
"
;
/*
* STOC GameMsg
...
...
src/api/ocgcore/ocgAdapter/stoc/stocGameMsg/newPhase.ts
View file @
f7b96892
import
{
ygopro
}
from
"
../../../idl/ocgcore
"
;
import
{
BufferReader
}
from
"
rust-src
"
;
import
{
ygopro
}
from
"
../../../idl/ocgcore
"
;
/*
* Msg New Phase
*
...
...
src/api/ocgcore/ocgAdapter/stoc/stocGameMsg/newTurn.ts
View file @
f7b96892
import
{
ygopro
}
from
"
../../../idl/ocgcore
"
;
import
{
BufferReader
}
from
"
rust-src
"
;
import
{
ygopro
}
from
"
../../../idl/ocgcore
"
;
/*
* MSG New Turn
*
...
...
src/api/ocgcore/ocgAdapter/stoc/stocGameMsg/penetrate.ts
View file @
f7b96892
//! 透传协议
import
PenetrateData
from
"
./penetrate.json
"
;
import
{
BufferReaderExt
}
from
"
../../bufferIO
"
;
import
{
ygopro
}
from
"
../../../idl/ocgcore
"
;
import
{
BufferReaderExt
}
from
"
../../bufferIO
"
;
import
{
numberToCardPosition
}
from
"
../../util
"
;
import
PenetrateData
from
"
./penetrate.json
"
;
type
Constructor
<
T
=
any
>
=
new
(...
args
:
any
[])
=>
T
;
...
...
src/api/ocgcore/ocgAdapter/stoc/stocGameMsg/recover.ts
View file @
f7b96892
import
{
ygopro
}
from
"
../../../idl/ocgcore
"
;
import
{
BufferReader
}
from
"
rust-src
"
;
import
{
ygopro
}
from
"
../../../idl/ocgcore
"
;
/*
* Msg Recover
*
...
...
src/api/ocgcore/ocgAdapter/stoc/stocGameMsg/selectOption.ts
View file @
f7b96892
import
{
ygopro
}
from
"
../../../idl/ocgcore
"
;
import
{
BufferReader
}
from
"
rust-src
"
;
import
{
ygopro
}
from
"
../../../idl/ocgcore
"
;
import
MsgSelectOption
=
ygopro
.
StocGameMessage
.
MsgSelectOption
;
/*
...
...
src/api/ocgcore/ocgAdapter/stoc/stocGameMsg/selectPlace.ts
View file @
f7b96892
import
{
ygopro
}
from
"
../../../idl/ocgcore
"
;
import
{
BufferReader
}
from
"
rust-src
"
;
import
{
ygopro
}
from
"
../../../idl/ocgcore
"
;
import
MsgSelectPlace
=
ygopro
.
StocGameMessage
.
MsgSelectPlace
;
/*
...
...
src/api/ocgcore/ocgAdapter/stoc/stocGameMsg/selectPosition.ts
View file @
f7b96892
import
{
ygopro
}
from
"
../../../idl/ocgcore
"
;
import
{
BufferReader
}
from
"
rust-src
"
;
import
{
ygopro
}
from
"
../../../idl/ocgcore
"
;
import
MsgSelectPosition
=
ygopro
.
StocGameMessage
.
MsgSelectPosition
;
/*
...
...
src/api/ocgcore/ocgAdapter/stoc/stocGameMsg/win.ts
View file @
f7b96892
import
{
ygopro
}
from
"
../../../idl/ocgcore
"
;
import
{
BufferReader
}
from
"
rust-src
"
;
import
{
ygopro
}
from
"
../../../idl/ocgcore
"
;
import
MsgWin
=
ygopro
.
StocGameMessage
.
MsgWin
;
/*
...
...
src/api/ocgcore/ocgAdapter/stoc/stocHsPlayerChange.ts
View file @
f7b96892
import
{
ygopro
}
from
"
../../idl/ocgcore
"
;
import
{
YgoProPacket
,
StocAdapter
}
from
"
../packet
"
;
import
{
StocAdapter
,
YgoProPacket
}
from
"
../packet
"
;
/*
* STOC HsPlayerChange
...
...
src/api/ocgcore/ocgAdapter/stoc/stocHsPlayerEnter.ts
View file @
f7b96892
import
{
ygopro
}
from
"
../../idl/ocgcore
"
;
import
{
YgoProPacket
,
StocAdapter
}
from
"
../packet
"
;
import
{
UTF16_BUFFER_MAX_LEN
,
_cutoff_name
}
from
"
../util
"
;
import
{
StocAdapter
,
YgoProPacket
}
from
"
../packet
"
;
import
{
_cutoff_name
,
UTF16_BUFFER_MAX_LEN
}
from
"
../util
"
;
const
UINT8_PER_UINT16
=
2
;
...
...
src/api/ocgcore/ocgAdapter/stoc/stocHsWatchChange.ts
View file @
f7b96892
import
{
ygopro
}
from
"
../../idl/ocgcore
"
;
import
{
YgoProPacket
,
StocAdapter
}
from
"
../packet
"
;
import
{
StocAdapter
,
YgoProPacket
}
from
"
../packet
"
;
/*
* STOC HsWatchChange
...
...
src/api/ocgcore/ocgAdapter/stoc/stocJoinGame.ts
View file @
f7b96892
import
{
ygopro
}
from
"
../../idl/ocgcore
"
;
import
{
YgoProPacket
,
StocAdapter
}
from
"
../packet
"
;
import
{
StocAdapter
,
YgoProPacket
}
from
"
../packet
"
;
/*
* STOC JoinGame
...
...
src/api/ocgcore/ocgAdapter/stoc/stocSelectHand.ts
View file @
f7b96892
import
{
ygopro
}
from
"
../../idl/ocgcore
"
;
import
{
YgoProPacket
,
StocAdapter
}
from
"
../packet
"
;
import
{
StocAdapter
,
YgoProPacket
}
from
"
../packet
"
;
/*
* STOC SelectHand
...
...
src/api/ocgcore/ocgAdapter/stoc/stocSelectTp.ts
View file @
f7b96892
import
{
ygopro
}
from
"
../../idl/ocgcore
"
;
import
{
YgoProPacket
,
StocAdapter
}
from
"
../packet
"
;
import
{
StocAdapter
,
YgoProPacket
}
from
"
../packet
"
;
/*
* STOC SelectTp
...
...
src/api/ocgcore/ocgAdapter/stoc/stocTimeLimit.ts
View file @
f7b96892
import
{
ygopro
}
from
"
../../idl/ocgcore
"
;
import
{
YgoProPacket
,
StocAdapter
}
from
"
../packet
"
;
import
{
BufferReader
}
from
"
rust-src
"
;
import
{
ygopro
}
from
"
../../idl/ocgcore
"
;
import
{
StocAdapter
,
YgoProPacket
}
from
"
../packet
"
;
/*
* STOC TimeLimit
*
...
...
src/api/ocgcore/ocgAdapter/stoc/stocTypeChange.ts
View file @
f7b96892
import
{
ygopro
}
from
"
../../idl/ocgcore
"
;
import
{
YgoProPacket
,
StocAdapter
}
from
"
../packet
"
;
import
{
StocAdapter
,
YgoProPacket
}
from
"
../packet
"
;
/*
* STOC TypeChange
...
...
src/api/ocgcore/ocgHelper.ts
View file @
f7b96892
...
...
@@ -2,20 +2,21 @@
* 一些发ygopro协议数据包的辅助函数,用于简化业务代码。
*
* */
import
{
ygopro
}
from
"
./idl/ocgcore
"
;
import
socketMiddleWare
,
{
socketCmd
}
from
"
@/middleware/socket
"
;
import
{
IDeck
}
from
"
../deck
"
;
import
PlayerInfoAdapter
from
"
./ocgAdapter/ctos/ctosPlayerInfo
"
;
import
JoinGameAdapter
from
"
./ocgAdapter/ctos/ctosJoinGame
"
;
import
UpdateDeckAdapter
from
"
./ocgAdapter/ctos/ctosUpdateDeck
"
;
import
{
ygopro
}
from
"
./idl/ocgcore
"
;
import
Chat
from
"
./ocgAdapter/ctos/ctosChat
"
;
import
GameMsgResponse
from
"
./ocgAdapter/ctos/ctosGameMsgResponse/mod
"
;
import
HandResult
from
"
./ocgAdapter/ctos/ctosHandResult
"
;
import
HsReadyAdapter
from
"
./ocgAdapter/ctos/ctosHsReady
"
;
import
HsStartAdapter
from
"
./ocgAdapter/ctos/ctosHsStart
"
;
import
HandResult
from
"
./ocgAdapter/ctos/ctosHandResult
"
;
import
TpResult
from
"
./ocgAdapter/ctos/ctosTpResult
"
;
import
TimeConfirm
from
"
./ocgAdapter/ctos/ctosTimeConfirm
"
;
import
JoinGameAdapter
from
"
./ocgAdapter/ctos/ctosJoinGame
"
;
import
PlayerInfoAdapter
from
"
./ocgAdapter/ctos/ctosPlayerInfo
"
;
import
Surrender
from
"
./ocgAdapter/ctos/ctosSurrender
"
;
import
GameMsgResponse
from
"
./ocgAdapter/ctos/ctosGameMsgResponse/mod
"
;
import
Chat
from
"
./ocgAdapter/ctos/ctosChat
"
;
import
TimeConfirm
from
"
./ocgAdapter/ctos/ctosTimeConfirm
"
;
import
TpResult
from
"
./ocgAdapter/ctos/ctosTpResult
"
;
import
UpdateDeckAdapter
from
"
./ocgAdapter/ctos/ctosUpdateDeck
"
;
export
function
sendUpdateDeck
(
deck
:
IDeck
)
{
const
updateDeck
=
new
ygopro
.
YgoCtosMsg
({
...
...
src/api/strings.ts
View file @
f7b96892
import
axios
from
"
axios
"
;
import
NeosConfig
from
"
../../neos.config.json
"
;
import
{
getCardStr
,
fetchCard
}
from
"
./cards
"
;
import
{
fetchCard
,
getCardStr
}
from
"
./cards
"
;
export
const
DESCRIPTION_LIMIT
=
10000
;
...
...
src/config/env.ts
View file @
f7b96892
import
{
useEnv
}
from
"
@/hook
"
;
import
NeosDevConfig
from
"
../../neos.config.json
"
;
import
NeosProdConfig
from
"
../../neos.config.prod.json
"
;
...
...
src/hook/useApp.ts
View file @
f7b96892
import
{
TypedUseSelectorHook
,
useDispatch
,
useSelector
}
from
"
react-redux
"
;
import
type
{
RootState
,
AppDispatch
}
from
"
@/store
"
;
import
type
{
AppDispatch
,
RootState
}
from
"
@/store
"
;
// Use throughout your app instead of plain `useDispatch` and `useSelector`
export
const
useAppDispatch
:
()
=>
AppDispatch
=
useDispatch
;
...
...
src/hook/useMeshClick.ts
View file @
f7b96892
// 一些自定义`Hook`
import
{
ActionEvent
}
from
"
@babylonjs/core
"
;
import
{
MutableRefObject
,
useEffect
,
useRef
}
from
"
react
"
;
import
{
Nullable
}
from
"
@babylonjs/core/types.js
"
;
import
{
Mesh
}
from
"
@babylonjs/core/Meshes/mesh.js
"
;
import
{
AbstractMesh
}
from
"
@babylonjs/core/Meshes/abstractMesh.js
"
;
import
{
ActionManager
}
from
"
@babylonjs/core/Actions/actionManager.js
"
;
import
{
IAction
}
from
"
@babylonjs/core/Actions/action.js
"
;
import
{
ActionManager
}
from
"
@babylonjs/core/Actions/actionManager.js
"
;
import
{
ExecuteCodeAction
}
from
"
@babylonjs/core/Actions/directActions.js
"
;
import
{
AbstractMesh
}
from
"
@babylonjs/core/Meshes/abstractMesh.js
"
;
import
{
Mesh
}
from
"
@babylonjs/core/Meshes/mesh.js
"
;
import
{
Nullable
}
from
"
@babylonjs/core/types.js
"
;
import
{
MutableRefObject
,
useEffect
,
useRef
}
from
"
react
"
;
export
interface
MeshEventType
{
(
env
:
ActionEvent
):
void
;
...
...
src/main.tsx
View file @
f7b96892
...
...
@@ -19,14 +19,15 @@
* 在进行代码开发的时候需要注意这点。
*
* */
import
{
ConfigProvider
,
theme
}
from
"
antd
"
;
import
zhCN
from
"
antd/locale/zh_CN
"
;
import
React
from
"
react
"
;
import
ReactDOM
from
"
react-dom/client
"
;
import
Neos
from
"
./ui/Neos
"
;
import
{
BrowserRouter
}
from
"
react-router-dom
"
;
import
{
Provider
}
from
"
react-redux
"
;
import
{
BrowserRouter
}
from
"
react-router-dom
"
;
import
{
store
}
from
"
./store
"
;
import
{
ConfigProvider
,
theme
}
from
"
antd
"
;
import
zhCN
from
"
antd/locale/zh_CN
"
;
import
Neos
from
"
./ui/Neos
"
;
const
root
=
ReactDOM
.
createRoot
(
document
.
getElementById
(
"
root
"
)
as
HTMLElement
...
...
src/middleware/socket.ts
View file @
f7b96892
...
...
@@ -4,8 +4,8 @@
* 所有长连接/Websocket相关的逻辑都应该收敛在这里。
*
* */
import
handleSocketOpen
from
"
../service/onSocketOpen
"
;
import
handleSocketMessage
from
"
../service/onSocketMessage
"
;
import
handleSocketOpen
from
"
../service/onSocketOpen
"
;
export
enum
socketCmd
{
// 建立长连接
...
...
src/middleware/sqlite.ts
View file @
f7b96892
...
...
@@ -6,7 +6,9 @@
* */
import
initSqlJs
,
{
Database
}
from
"
sql.js
"
;
import
{
CardMeta
,
CardData
,
CardText
}
from
"
@/api/cards
"
;
import
{
CardData
,
CardMeta
,
CardText
}
from
"
@/api/cards
"
;
import
NeosConfig
from
"
../../neos.config.json
"
;
export
enum
sqliteCmd
{
...
...
src/reducers/chatSlice.ts
View file @
f7b96892
...
...
@@ -3,6 +3,7 @@
*
* */
import
{
createSlice
,
PayloadAction
}
from
"
@reduxjs/toolkit
"
;
import
{
RootState
}
from
"
@/store
"
;
export
interface
chatState
{
...
...
src/reducers/duel/cemeretySlice.ts
View file @
f7b96892
import
{
judgeSelf
}
from
"
./util
"
;
import
{
PayloadAction
,
CaseReducer
,
ActionReducerMapBuilder
,
CaseReducer
,
PayloadAction
,
}
from
"
@reduxjs/toolkit
"
;
import
{
DuelState
}
from
"
./mod
"
;
import
{
RootState
}
from
"
@/store
"
;
import
{
ygopro
}
from
"
@/api/ocgcore/idl/ocgcore
"
;
import
{
RootState
}
from
"
@/store
"
;
import
{
createAsyncMetaThunk
,
DuelFieldState
,
extendState
,
extendMeta
,
removeCard
,
DuelReducer
,
Interactivity
,
extendIdleInteractivities
,
extendMeta
,
extendState
,
Interactivity
,
removeCard
,
}
from
"
./generic
"
;
import
{
DuelState
}
from
"
./mod
"
;
import
{
judgeSelf
}
from
"
./util
"
;
export
interface
CemeteryState
extends
DuelFieldState
{}
...
...
src/reducers/duel/commonSlice.ts
View file @
f7b96892
import
{
ygopro
}
from
"
@/api/ocgcore/idl/ocgcore
"
;
import
{
clearIdleInteractivities
,
clearPlaceInteractivities
,
...
...
src/reducers/duel/deckSlice.ts
View file @
f7b96892
import
{
judgeSelf
}
from
"
./util
"
;
import
{
PayloadAction
,
CaseReducer
}
from
"
@reduxjs/toolkit
"
;
import
{
DuelState
}
from
"
./mod
"
;
import
{
RootState
}
from
"
@/store
"
;
import
{
CaseReducer
,
PayloadAction
}
from
"
@reduxjs/toolkit
"
;
import
{
ygopro
}
from
"
@/api/ocgcore/idl/ocgcore
"
;
import
{
DuelFieldState
,
CardState
}
from
"
./generic
"
;
import
{
RootState
}
from
"
@/store
"
;
import
{
CardState
,
DuelFieldState
}
from
"
./generic
"
;
import
{
DuelState
}
from
"
./mod
"
;
import
{
judgeSelf
}
from
"
./util
"
;
export
interface
DeckState
extends
DuelFieldState
{}
...
...
src/reducers/duel/exclusionSlice.ts
View file @
f7b96892
import
{
judgeSelf
}
from
"
./util
"
;
import
{
PayloadAction
,
CaseReducer
,
ActionReducerMapBuilder
,
CaseReducer
,
PayloadAction
,
}
from
"
@reduxjs/toolkit
"
;
import
{
DuelState
}
from
"
./mod
"
;
import
{
RootState
}
from
"
@/store
"
;
import
{
ygopro
}
from
"
@/api/ocgcore/idl/ocgcore
"
;
import
{
RootState
}
from
"
@/store
"
;
import
{
createAsyncMetaThunk
,
DuelFieldState
,
extendState
,
extendMeta
,
removeCard
,
DuelReducer
,
Interactivity
,
extendIdleInteractivities
,
extendMeta
,
extendState
,
Interactivity
,
removeCard
,
}
from
"
./generic
"
;
import
{
DuelState
}
from
"
./mod
"
;
import
{
judgeSelf
}
from
"
./util
"
;
export
interface
ExclusionState
extends
DuelFieldState
{}
...
...
src/reducers/duel/extraDeckSlice.ts
View file @
f7b96892
import
{
ActionReducerMapBuilder
}
from
"
@reduxjs/toolkit
"
;
import
{
ygopro
}
from
"
@/api/ocgcore/idl/ocgcore
"
;
import
{
RootState
}
from
"
@/store
"
;
import
{
createAsyncMetaThunk
,
createAsyncRepeatedMetaThunk
,
...
...
src/reducers/duel/generic.ts
View file @
f7b96892
...
...
@@ -4,8 +4,10 @@ import {
createAsyncThunk
,
PayloadAction
,
}
from
"
@reduxjs/toolkit
"
;
import
{
CardMeta
,
fetchCard
}
from
"
@/api/cards
"
;
import
{
ygopro
}
from
"
@/api/ocgcore/idl/ocgcore
"
;
import
{
DuelState
}
from
"
./mod
"
;
import
ReloadFieldAction
=
ygopro
.
StocGameMessage
.
MsgReloadField
.
ZoneAction
;
type
UpdateDataAction
=
ReturnType
<
...
...
src/reducers/duel/handsSlice.ts
View file @
f7b96892
...
...
@@ -3,20 +3,22 @@ import {
CaseReducer
,
PayloadAction
,
}
from
"
@reduxjs/toolkit
"
;
import
{
DuelState
}
from
"
./mod
"
;
import
{
ygopro
}
from
"
@/api/ocgcore/idl/ocgcore
"
;
import
{
RootState
}
from
"
@/store
"
;
import
{
judgeSelf
}
from
"
./util
"
;
import
{
Interactivity
,
DuelFieldState
,
removeCard
,
createAsyncMetaThunk
,
insertCard
,
extendMeta
,
createAsyncRepeatedMetaThunk
,
DuelFieldState
,
extendMeta
,
insertCard
,
Interactivity
,
removeCard
,
updateCardMeta
,
}
from
"
./generic
"
;
import
{
ygopro
}
from
"
@/api/ocgcore/idl/ocgcore
"
;
import
{
DuelState
}
from
"
./mod
"
;
import
{
judgeSelf
}
from
"
./util
"
;
export
interface
HandState
extends
DuelFieldState
{}
...
...
src/reducers/duel/hintSlice.ts
View file @
f7b96892
import
{
createAsyncThunk
,
ActionReducerMapBuilder
}
from
"
@reduxjs/toolkit
"
;
import
{
DuelState
}
from
"
./mod
"
;
import
{
RootState
}
from
"
@/store
"
;
import
{
DESCRIPTION_LIMIT
,
fetchStrings
,
getStrings
}
from
"
@/api/strings
"
;
import
{
findCardByLocation
}
from
"
./util
"
;
import
{
ActionReducerMapBuilder
,
createAsyncThunk
}
from
"
@reduxjs/toolkit
"
;
import
{
fetchCard
}
from
"
@/api/cards
"
;
import
{
DuelReducer
}
from
"
./generic
"
;
import
{
ygopro
}
from
"
@/api/ocgcore/idl/ocgcore
"
;
import
{
DESCRIPTION_LIMIT
,
fetchStrings
,
getStrings
}
from
"
@/api/strings
"
;
import
{
RootState
}
from
"
@/store
"
;
import
{
DuelReducer
}
from
"
./generic
"
;
import
{
DuelState
}
from
"
./mod
"
;
import
{
findCardByLocation
}
from
"
./util
"
;
export
interface
HintState
{
code
:
number
;
...
...
src/reducers/duel/initInfoSlice.ts
View file @
f7b96892
import
{
PayloadAction
,
CaseReducer
}
from
"
@reduxjs/toolkit
"
;
import
{
CaseReducer
,
PayloadAction
}
from
"
@reduxjs/toolkit
"
;
import
{
ygopro
}
from
"
@/api/ocgcore/idl/ocgcore
"
;
import
{
RootState
}
from
"
@/store
"
;
import
{
DuelState
}
from
"
./mod
"
;
import
{
judgeSelf
}
from
"
./util
"
;
import
MsgUpdateHp
=
ygopro
.
StocGameMessage
.
MsgUpdateHp
;
...
...
src/reducers/duel/magicSlice.ts
View file @
f7b96892
import
{
judgeSelf
}
from
"
./util
"
;
import
{
PayloadAction
,
CaseReducer
,
ActionReducerMapBuilder
,
CaseReducer
,
PayloadAction
,
}
from
"
@reduxjs/toolkit
"
;
import
{
DuelState
}
from
"
./mod
"
;
import
{
ygopro
}
from
"
@/api/ocgcore/idl/ocgcore
"
;
import
{
RootState
}
from
"
@/store
"
;
import
{
clearIdleInteractivities
,
clearPlaceInteractivities
,
createAsyncMetaThunk
,
DuelFieldState
,
extendIdleInteractivities
,
extendOccupant
,
extendPlaceInteractivity
,
clearPlaceInteractivities
,
removeOccupant
,
Interactivity
,
extendIdleInteractivities
,
clearIdleInteractivities
,
removeOccupant
,
setPosition
,
}
from
"
./generic
"
;
import
{
DuelState
}
from
"
./mod
"
;
import
{
judgeSelf
}
from
"
./util
"
;
export
interface
MagicState
extends
DuelFieldState
{}
...
...
src/reducers/duel/mod.ts
View file @
f7b96892
...
...
@@ -3,121 +3,123 @@
*
* */
import
{
ygopro
}
from
"
@/api/ocgcore/idl/ocgcore
"
;
import
{
createSlice
,
PayloadAction
}
from
"
@reduxjs/toolkit
"
;
import
{
InitInfo
,
infoInitImpl
,
updateHpImpl
}
from
"
./initInfoSlice
"
;
import
{
TimeLimit
,
updateTimeLimitImpl
}
from
"
./timeLimit
"
;
import
{
ygopro
}
from
"
@/api/ocgcore/idl/ocgcore
"
;
import
{
RootState
}
from
"
@/store
"
;
import
{
addCemeteryIdleInteractivitiesImpl
,
cemeteryCase
,
CemeteryState
,
initCemeteryImpl
,
removeCemeteryImpl
,
}
from
"
./cemeretySlice
"
;
import
{
clearAllIdleInteractivitiesImpl
,
clearAllPlaceInteractivitiesImpl
,
reloadFieldImpl
,
updateFieldDataImpl
,
}
from
"
./commonSlice
"
;
import
{
DeckState
,
initDeckImpl
}
from
"
./deckSlice
"
;
import
{
addExclusionIdleInteractivitiesImpl
,
exclusionCase
,
ExclusionState
,
initExclusionImpl
,
removeExclusionImpl
,
}
from
"
./exclusionSlice
"
;
import
{
addExtraDeckIdleInteractivitiesImpl
,
extraDeckCase
,
ExtraDeckState
,
removeExtraDeckImpl
,
}
from
"
./extraDeckSlice
"
;
import
{
HandState
,
handsCase
,
clearHandsIdleInteractivityImpl
,
addHandsIdleInteractivityImpl
,
clearHandsIdleInteractivityImpl
,
handsCase
,
HandState
,
removeHandImpl
,
}
from
"
./handsSlice
"
;
import
{
newTurnImpl
}
from
"
./turnSlice
"
;
import
{
hintCase
,
HintState
,
initHintImpl
}
from
"
./hintSlice
"
;
import
{
infoInitImpl
,
InitInfo
,
updateHpImpl
}
from
"
./initInfoSlice
"
;
import
{
newPhaseImpl
,
PhaseState
,
setEnableBpImpl
,
setEnableM2Impl
,
setEnableEpImpl
,
}
from
"
./phaseSlice
"
;
import
{
RootState
}
from
"
@/store
"
;
import
{
HintState
,
hintCase
,
initHintImpl
}
from
"
./hintSlice
"
;
addMagicIdleInteractivitiesImpl
,
addMagicPlaceInteractivitiesImpl
,
clearMagicIdleInteractivitiesImpl
,
clearMagicPlaceInteractivitiesImpl
,
initMagicsImpl
,
magicCase
,
MagicState
,
removeMagicImpl
,
setMagicPositionImpl
,
}
from
"
./magicSlice
"
;
import
{
checkCardModalCase
,
checkCardModalV2Case
,
checkCardModalV3Case
,
clearCheckCounterImpl
,
ModalState
,
optionModalCase
,
resetCheckCardModalImpl
,
resetCheckCardModalV2Impl
,
resetCheckCardModalV3Impl
,
resetOptionModalImpl
,
resetPositionModalImpl
,
resetSortCardModalImpl
,
setCardListModalInfoImpl
,
setCardListModalIsOpenImpl
,
setCardModalCountersImpl
,
setCardModalInteractiviesImpl
,
setCardModalIsOpenImpl
,
setCardModalMetaImpl
,
setCardModalInteractiviesImpl
,
setCardListModalIsOpenImpl
,
setCardListModalInfoImpl
,
setCheckCardMOdalCancelAbleImpl
,
setCheckCardModalCancelResponseImpl
,
setCheckCardModalIsOpenImpl
,
setCheckCardModalMinMaxImpl
,
setCheckCardModalOnSubmitImpl
,
setCheckCardMOdalCancelAbleImpl
,
setCheckCardModalCancelResponseImpl
,
resetCheckCardModalImpl
,
setYesNoModalIsOpenImpl
,
checkCardModalCase
,
YesNoModalCase
,
setPositionModalIsOpenImpl
,
setPositionModalPositionsImpl
,
resetPositionModalImpl
,
setOptionModalIsOpenImpl
,
resetOptionModalImpl
,
optionModalCase
,
setCheckCardModalV2IsOpenImpl
,
setCheckCardModalV2CancelAbleImpl
,
setCheckCardModalV2MinMaxImpl
,
setCheckCardModalV2FinishAbleImpl
,
resetCheckCardModalV2Impl
,
setCheckCardModalV2IsOpenImpl
,
setCheckCardModalV2MinMaxImpl
,
setCheckCardModalV2ResponseAbleImpl
,
checkCardModalV2Case
,
setCheckCardModalV3AllLevelImpl
,
setCheckCardModalV3IsOpenImpl
,
setCheckCardModalV3MinMaxImpl
,
setCheckCardModalV3AllLevelImpl
,
setCheckCardModalV3OverFlowImpl
,
setCheckCardModalV3ResponseAbleImpl
,
resetCheckCardModalV3Impl
,
checkCardModalV3Case
,
setCardModalCountersImpl
,
setCheckCounterImpl
,
clearCheckCounterImpl
,
setOptionModalIsOpenImpl
,
setPositionModalIsOpenImpl
,
setPositionModalPositionsImpl
,
setSortCardModalIsOpenImpl
,
resetSortCardModal
Impl
,
setYesNoModalIsOpen
Impl
,
sortCardModalCase
,
YesNoModalCase
,
}
from
"
./modal/mod
"
;
import
{
MonsterState
,
initMonstersImpl
,
addMonsterPlaceInteractivitiesImpl
,
clearMonsterPlaceInteractivitiesImpl
,
addMonsterIdleInteractivitiesImpl
,
addMonsterPlaceInteractivitiesImpl
,
clearMonsterIdleInteractivitiesImpl
,
clearMonsterPlaceInteractivitiesImpl
,
initMonstersImpl
,
monsterCase
,
MonsterState
,
removeMonsterImpl
,
setMonsterPositionImpl
,
removeOverlayImpl
,
setMonsterPositionImpl
,
updateMonsterCountersImpl
,
monsterCase
,
}
from
"
./monstersSlice
"
;
import
{
MagicState
,
initMagicsImpl
,
addMagicPlaceInteractivitiesImpl
,
clearMagicPlaceInteractivitiesImpl
,
addMagicIdleInteractivitiesImpl
,
clearMagicIdleInteractivitiesImpl
,
removeMagicImpl
,
setMagicPositionImpl
,
magicCase
,
}
from
"
./magicSlice
"
;
import
{
CemeteryState
,
initCemeteryImpl
,
removeCemeteryImpl
,
cemeteryCase
,
addCemeteryIdleInteractivitiesImpl
,
}
from
"
./cemeretySlice
"
;
import
{
ExclusionState
,
initExclusionImpl
,
removeExclusionImpl
,
exclusionCase
,
addExclusionIdleInteractivitiesImpl
,
}
from
"
./exclusionSlice
"
;
import
{
DeckState
,
initDeckImpl
}
from
"
./deckSlice
"
;
import
{
clearAllIdleInteractivitiesImpl
,
clearAllPlaceInteractivitiesImpl
,
updateFieldDataImpl
,
reloadFieldImpl
,
}
from
"
./commonSlice
"
;
import
{
ExtraDeckState
,
extraDeckCase
,
removeExtraDeckImpl
,
addExtraDeckIdleInteractivitiesImpl
,
}
from
"
./extraDeckSlice
"
;
newPhaseImpl
,
PhaseState
,
setEnableBpImpl
,
setEnableEpImpl
,
setEnableM2Impl
,
}
from
"
./phaseSlice
"
;
import
{
TimeLimit
,
updateTimeLimitImpl
}
from
"
./timeLimit
"
;
import
{
newTurnImpl
}
from
"
./turnSlice
"
;
import
MsgWin
=
ygopro
.
StocGameMessage
.
MsgWin
;
export
interface
DuelState
{
...
...
src/reducers/duel/modal/cardListModalSlice.ts
View file @
f7b96892
import
{
PayloadAction
,
CaseReducer
}
from
"
@reduxjs/toolkit
"
;
import
{
DuelState
}
from
"
../mod
"
;
import
{
RootState
}
from
"
@/store
"
;
import
{
CaseReducer
,
PayloadAction
}
from
"
@reduxjs/toolkit
"
;
import
{
CardMeta
}
from
"
@/api/cards
"
;
import
{
RootState
}
from
"
@/store
"
;
import
{
DuelState
}
from
"
../mod
"
;
// 更新卡牌列表弹窗打开状态
export
const
setCardListModalIsOpenImpl
:
CaseReducer
<
...
...
src/reducers/duel/modal/cardModalSlice.ts
View file @
f7b96892
import
{
PayloadAction
,
CaseReducer
}
from
"
@reduxjs/toolkit
"
;
import
{
DuelState
}
from
"
../mod
"
;
import
{
RootState
}
from
"
@/store
"
;
import
{
CaseReducer
,
PayloadAction
}
from
"
@reduxjs/toolkit
"
;
import
{
CardMeta
}
from
"
@/api/cards
"
;
import
{
RootState
}
from
"
@/store
"
;
import
{
DuelState
}
from
"
../mod
"
;
// 更新卡牌弹窗打开状态
export
const
setCardModalIsOpenImpl
:
CaseReducer
<
...
...
src/reducers/duel/modal/checkCardModalSlice.ts
View file @
f7b96892
import
{
PayloadAction
,
ActionReducerMapBuilder
,
CaseReducer
,
createAsyncThunk
,
ActionReducerMapBuilder
,
PayloadAction
,
}
from
"
@reduxjs/toolkit
"
;
import
{
fetchCard
,
getCardStr
}
from
"
@/api/cards
"
;
import
{
ygopro
}
from
"
@/api/ocgcore/idl/ocgcore
"
;
import
{
RootState
}
from
"
@/store
"
;
import
{
DuelState
}
from
"
../mod
"
;
import
{
cmpCardLocation
,
findCardByLocation
,
judgeSelf
}
from
"
../util
"
;
import
{
fetchCard
,
getCardStr
}
from
"
@/api/cards
"
;
import
{
ygopro
}
from
"
@/api/ocgcore/idl/ocgcore
"
;
// 更新卡牌选择弹窗打开状态
export
const
setCheckCardModalIsOpenImpl
:
CaseReducer
<
...
...
src/reducers/duel/modal/checkCardModalV2Slice.ts
View file @
f7b96892
import
{
DuelState
}
from
"
../mod
"
;
import
{
DuelReducer
}
from
"
../generic
"
;
import
{
ActionReducerMapBuilder
,
CaseReducer
,
createAsyncThunk
,
}
from
"
@reduxjs/toolkit
"
;
import
{
fetchCard
}
from
"
@/api/cards
"
;
import
{
RootState
}
from
"
@/store
"
;
import
{
ygopro
}
from
"
@/api/ocgcore/idl/ocgcore
"
;
import
{
RootState
}
from
"
@/store
"
;
import
{
DuelReducer
}
from
"
../generic
"
;
import
{
DuelState
}
from
"
../mod
"
;
import
{
findCardByLocation
}
from
"
../util
"
;
// 更新打开状态
...
...
src/reducers/duel/modal/checkCardModalV3Slice.ts
View file @
f7b96892
import
{
DuelState
}
from
"
../mod
"
;
import
{
DuelReducer
}
from
"
../generic
"
;
import
{
ActionReducerMapBuilder
,
CaseReducer
,
createAsyncThunk
,
}
from
"
@reduxjs/toolkit
"
;
import
{
fetchCard
}
from
"
@/api/cards
"
;
import
{
RootState
}
from
"
@/store
"
;
import
{
ygopro
}
from
"
@/api/ocgcore/idl/ocgcore
"
;
import
{
RootState
}
from
"
@/store
"
;
import
{
DuelReducer
}
from
"
../generic
"
;
import
{
DuelState
}
from
"
../mod
"
;
import
{
findCardByLocation
}
from
"
../util
"
;
// 更新打开状态
...
...
src/reducers/duel/modal/checkCounterModalSlice.ts
View file @
f7b96892
// 后续对于`MSG_SELECT_XXX`的处理UI都尽量用`Babylon.js`实现而不会通过`Antd`的`Modal`实现,因此这里不追求工程质量,暂时简单实现下。
import
{
PayloadAction
,
CaseReducer
}
from
"
@reduxjs/toolkit
"
;
import
{
CaseReducer
,
PayloadAction
}
from
"
@reduxjs/toolkit
"
;
import
{
ygopro
}
from
"
@/api/ocgcore/idl/ocgcore
"
;
import
{
RootState
}
from
"
@/store
"
;
import
{
DuelState
}
from
"
../mod
"
;
import
{
findCardByLocation
}
from
"
../util
"
;
import
{
ygopro
}
from
"
@/api/ocgcore/idl/ocgcore
"
;
type
SelectCounter
=
ReturnType
<
typeof
ygopro
.
StocGameMessage
.
MsgSelectCounter
.
prototype
.
toObject
>
;
...
...
src/reducers/duel/modal/mod.ts
View file @
f7b96892
...
...
@@ -114,13 +114,13 @@ export interface ModalState {
};
}
export
*
from
"
./cardModalSlice
"
;
export
*
from
"
./cardListModalSlice
"
;
export
*
from
"
./cardModalSlice
"
;
export
*
from
"
./checkCardModalSlice
"
;
export
*
from
"
./yesNoModalSlice
"
;
export
*
from
"
./positionModalSlice
"
;
export
*
from
"
./optionModalSlice
"
;
export
*
from
"
./checkCardModalV2Slice
"
;
export
*
from
"
./checkCardModalV3Slice
"
;
export
*
from
"
./checkCounterModalSlice
"
;
export
*
from
"
./optionModalSlice
"
;
export
*
from
"
./positionModalSlice
"
;
export
*
from
"
./sortCardModalSlice
"
;
export
*
from
"
./yesNoModalSlice
"
;
src/reducers/duel/modal/optionModalSlice.ts
View file @
f7b96892
import
{
PayloadAction
,
ActionReducerMapBuilder
,
CaseReducer
,
createAsyncThunk
,
ActionReducerMapBuilder
,
PayloadAction
,
}
from
"
@reduxjs/toolkit
"
;
import
{
DuelState
}
from
"
../mod
"
;
import
{
fetchCard
,
getCardStr
}
from
"
@/api/cards
"
;
import
{
RootState
}
from
"
@/store
"
;
import
{
DuelState
}
from
"
../mod
"
;
export
const
setOptionModalIsOpenImpl
:
CaseReducer
<
DuelState
,
PayloadAction
<
boolean
>
...
...
src/reducers/duel/modal/positionModalSlice.ts
View file @
f7b96892
import
{
PayloadAction
,
CaseReducer
}
from
"
@reduxjs/toolkit
"
;
import
{
CaseReducer
,
PayloadAction
}
from
"
@reduxjs/toolkit
"
;
import
{
ygopro
}
from
"
@/api/ocgcore/idl/ocgcore
"
;
import
{
RootState
}
from
"
@/store
"
;
import
{
DuelState
}
from
"
../mod
"
;
import
{
ygopro
}
from
"
@/api/ocgcore/idl/ocgcore
"
;
export
const
setPositionModalIsOpenImpl
:
CaseReducer
<
DuelState
,
...
...
src/reducers/duel/modal/sortCardModalSlice.ts
View file @
f7b96892
...
...
@@ -3,9 +3,11 @@ import {
CaseReducer
,
createAsyncThunk
,
}
from
"
@reduxjs/toolkit
"
;
import
{
fetchCard
}
from
"
@/api/cards
"
;
import
{
ygopro
}
from
"
@/api/ocgcore/idl/ocgcore
"
;
import
{
RootState
}
from
"
@/store
"
;
import
{
DuelReducer
}
from
"
../generic
"
;
import
{
DuelState
}
from
"
../mod
"
;
type
SortCard
=
ReturnType
<
...
...
src/reducers/duel/modal/yesNoModalSlice.ts
View file @
f7b96892
import
{
PayloadAction
,
ActionReducerMapBuilder
,
CaseReducer
,
createAsyncThunk
,
ActionReducerMapBuilder
,
PayloadAction
,
}
from
"
@reduxjs/toolkit
"
;
import
{
CardMeta
,
fetchCard
}
from
"
@/api/cards
"
;
import
{
ygopro
}
from
"
@/api/ocgcore/idl/ocgcore
"
;
import
{
fetchStrings
,
getStrings
}
from
"
@/api/strings
"
;
import
{
RootState
}
from
"
@/store
"
;
import
{
DuelState
}
from
"
../mod
"
;
// 更新YesNo弹窗是否打开状态
...
...
src/reducers/duel/monstersSlice.ts
View file @
f7b96892
import
{
judgeSelf
}
from
"
./util
"
;
import
{
PayloadAction
,
CaseReducer
,
ActionReducerMapBuilder
,
CaseReducer
,
createAsyncThunk
,
PayloadAction
,
}
from
"
@reduxjs/toolkit
"
;
import
{
DuelState
}
from
"
./mod
"
;
import
{
fetchCard
}
from
"
@/api/cards
"
;
import
{
ygopro
}
from
"
@/api/ocgcore/idl/ocgcore
"
;
import
{
RootState
}
from
"
@/store
"
;
import
{
DuelFieldState
,
Interactivity
,
clearIdleInteractivities
,
clearPlaceInteractivities
,
createAsyncMetaThunk
,
DuelFieldState
,
extendIdleInteractivities
,
extendOccupant
,
extendPlaceInteractivity
,
clearPlaceInteractivities
,
Interactivity
,
removeOccupant
,
extendIdleInteractivities
,
clearIdleInteractivities
,
setPosition
,
removeOverlay
,
setPosition
,
}
from
"
./generic
"
;
import
{
fetchCard
}
from
"
@/api/cards
"
;
import
{
DuelState
}
from
"
./mod
"
;
import
{
judgeSelf
}
from
"
./util
"
;
type
MsgUpdateCounter
=
ReturnType
<
typeof
ygopro
.
StocGameMessage
.
MsgUpdateCounter
.
prototype
.
toObject
>
;
...
...
src/reducers/duel/phaseSlice.ts
View file @
f7b96892
import
{
PayloadAction
,
CaseReducer
}
from
"
@reduxjs/toolkit
"
;
import
{
CaseReducer
,
PayloadAction
}
from
"
@reduxjs/toolkit
"
;
import
{
RootState
}
from
"
@/store
"
;
import
{
DuelState
}
from
"
./mod
"
;
export
interface
PhaseState
{
...
...
src/reducers/duel/timeLimit.ts
View file @
f7b96892
import
{
PayloadAction
,
CaseReducer
}
from
"
@reduxjs/toolkit
"
;
import
{
CaseReducer
,
PayloadAction
}
from
"
@reduxjs/toolkit
"
;
import
{
DuelState
}
from
"
./mod
"
;
import
{
judgeSelf
}
from
"
./util
"
;
...
...
src/reducers/duel/turnSlice.ts
View file @
f7b96892
import
{
PayloadAction
,
CaseReducer
}
from
"
@reduxjs/toolkit
"
;
import
{
CaseReducer
,
PayloadAction
}
from
"
@reduxjs/toolkit
"
;
import
{
RootState
}
from
"
@/store
"
;
import
{
DuelState
}
from
"
./mod
"
;
import
{
judgeSelf
}
from
"
./util
"
;
...
...
src/reducers/duel/util.ts
View file @
f7b96892
...
...
@@ -3,10 +3,12 @@
*
* */
import
{
DuelState
}
from
"
./mod
"
;
import
{
Draft
}
from
"
@reduxjs/toolkit
"
;
import
{
ygopro
}
from
"
@/api/ocgcore/idl/ocgcore
"
;
import
{
CardState
}
from
"
./generic
"
;
import
{
DuelState
}
from
"
./mod
"
;
type
Location
=
|
ygopro
.
CardLocation
...
...
src/reducers/joinSlice.ts
View file @
f7b96892
...
...
@@ -3,6 +3,7 @@
*
* */
import
{
createSlice
}
from
"
@reduxjs/toolkit
"
;
import
{
RootState
}
from
"
@/store
"
;
export
interface
JoinState
{
...
...
src/reducers/moraSlice.ts
View file @
f7b96892
...
...
@@ -3,6 +3,7 @@
*
* */
import
{
createSlice
}
from
"
@reduxjs/toolkit
"
;
import
{
RootState
}
from
"
@/store
"
;
export
interface
moraState
{
...
...
src/reducers/playerSlice.ts
View file @
f7b96892
...
...
@@ -3,6 +3,7 @@
*
* */
import
{
createSlice
,
PayloadAction
}
from
"
@reduxjs/toolkit
"
;
import
{
RootState
}
from
"
@/store
"
;
export
interface
Player
{
...
...
src/service/duel/draw.ts
View file @
f7b96892
import
{
ygopro
}
from
"
@/api/ocgcore/idl/ocgcore
"
;
import
{
AppDispatch
}
from
"
@/store
"
;
import
{
fetchHandsMeta
}
from
"
@/reducers/duel/handsSlice
"
;
import
{
fetchEsHintMeta
}
from
"
@/reducers/duel/hintSlice
"
;
import
{
AppDispatch
}
from
"
@/store
"
;
export
default
(
draw
:
ygopro
.
StocGameMessage
.
MsgDraw
,
...
...
src/service/duel/gameMsg.ts
View file @
f7b96892
import
{
ygopro
}
from
"
@/api/ocgcore/idl/ocgcore
"
;
import
{
setWaiting
}
from
"
@/reducers/duel/mod
"
;
import
{
store
}
from
"
@/store
"
;
import
onMsgStart
from
"
./start
"
;
import
onMsgAttack
from
"
./attack
"
;
import
onMsgAttackDisable
from
"
./attackDisable
"
;
import
onMsgChaining
from
"
./chaining
"
;
import
onMsgDraw
from
"
./draw
"
;
import
onMsg
NewTurn
from
"
./newTurn
"
;
import
onMsg
NewPhase
from
"
./newPhase
"
;
import
onMsg
FilpSummoned
from
"
./flipSummoned
"
;
import
onMsg
FlipSummoning
from
"
./flipSummoning
"
;
import
onMsgHint
from
"
./hint
"
;
import
onMsgSelectIdleCmd
from
"
./selectIdleCmd
"
;
import
onMsgSelectPlace
from
"
./selectPlace
"
;
import
onMsgMove
from
"
./move
"
;
import
onMsgNewPhase
from
"
./newPhase
"
;
import
onMsgNewTurn
from
"
./newTurn
"
;
import
onMsgPosChange
from
"
./posChange
"
;
import
onMsgReloadField
from
"
./reloadField
"
;
import
onMsgSelectBattleCmd
from
"
./selectBattleCmd
"
;
import
onMsgSelectCard
from
"
./selectCard
"
;
import
onMsgSelectChain
from
"
./selectChain
"
;
import
onMsgSelectCounter
from
"
./selectCounter
"
;
import
onMsgSelectEffectYn
from
"
./selectEffectYn
"
;
import
onMsgSelect
Position
from
"
./selectPosition
"
;
import
onMsgSelect
IdleCmd
from
"
./selectIdleCmd
"
;
import
onMsgSelectOption
from
"
./selectOption
"
;
import
onMsgShuffleHand
from
"
./shuffleHand
"
;
import
onMsgSelectBattleCmd
from
"
./selectBattleCmd
"
;
import
onMsgPosChange
from
"
./posChange
"
;
import
onMsgSelectUnselectCard
from
"
./selectUnselectCard
"
;
import
onMsgSelectYesNo
from
"
./selectYesNo
"
;
import
onMsgUpdateHp
from
"
./updateHp
"
;
import
onMsgWin
from
"
./win
"
;
import
onMsgWait
from
"
./wait
"
;
import
onUnimplemented
from
"
./unimplemented
"
;
import
onMsgUpdateData
from
"
./updateData
"
;
import
onMsgReloadField
from
"
./reloadField
"
;
import
onMsgSelectPlace
from
"
./selectPlace
"
;
import
onMsgSelectPosition
from
"
./selectPosition
"
;
import
onMsgSelectSum
from
"
./selectSum
"
;
import
onMsgSelectTribute
from
"
./selectTribute
"
;
import
onMsgUpdateCounter
from
"
./updateCounter
"
;
import
onMsgSelectCounter
from
"
./selectCounter
"
;
import
onMsgSortCard
from
"
./sortCard
"
;
import
onMsgSelectUnselectCard
from
"
./selectUnselectCard
"
;
import
onMsgSelectYesNo
from
"
./selectYesNo
"
;
import
onMsgSet
from
"
./set
"
;
import
onMsgSwap
from
"
./swap
"
;
import
onMsgAttack
from
"
./attack
"
;
import
onMsgAttackDisable
from
"
./attackDisable
"
;
import
onMsgChaining
from
"
./chaining
"
;
import
onMsgFlipSummoning
from
"
./flipSummoning
"
;
import
onMsgFilpSummoned
from
"
./flipSummoned
"
;
import
onMsgSpSummoning
from
"
./spSummoning
"
;
import
onMsgShuffleHand
from
"
./shuffleHand
"
;
import
onMsgSortCard
from
"
./sortCard
"
;
import
onMsgSpSummoned
from
"
./spSummoned
"
;
import
onMsgSummoning
from
"
./summoning
"
;
import
onMsgSpSummoning
from
"
./spSummoning
"
;
import
onMsgStart
from
"
./start
"
;
import
onMsgSummoned
from
"
./summoned
"
;
import
{
setWaiting
}
from
"
@/reducers/duel/mod
"
;
import
onMsgSummoning
from
"
./summoning
"
;
import
onMsgSwap
from
"
./swap
"
;
import
onUnimplemented
from
"
./unimplemented
"
;
import
onMsgUpdateCounter
from
"
./updateCounter
"
;
import
onMsgUpdateData
from
"
./updateData
"
;
import
onMsgUpdateHp
from
"
./updateHp
"
;
import
onMsgWait
from
"
./wait
"
;
import
onMsgWin
from
"
./win
"
;
const
ActiveList
=
[
"
select_idle_cmd
"
,
...
...
src/service/duel/hint.ts
View file @
f7b96892
import
{
ygopro
}
from
"
@/api/ocgcore/idl/ocgcore
"
;
import
{
AppDispatch
}
from
"
@/store
"
;
import
{
fetchCommonHintMeta
,
fetchEsHintMeta
,
fetchSelectHintMeta
,
}
from
"
@/reducers/duel/hintSlice
"
;
import
{
AppDispatch
}
from
"
@/store
"
;
import
MsgHint
=
ygopro
.
StocGameMessage
.
MsgHint
;
export
default
(
hint
:
MsgHint
,
dispatch
:
AppDispatch
)
=>
{
...
...
src/service/duel/move.ts
View file @
f7b96892
import
{
ygopro
}
from
"
@/api/ocgcore/idl/ocgcore
"
;
import
MsgMove
=
ygopro
.
StocGameMessage
.
MsgMove
;
import
{
AppDispatch
}
from
"
@/stor
e
"
;
import
{
fetchMonsterMeta
,
fetchOverlayMeta
,
}
from
"
@/reducers/duel/monsters
Slice
"
;
import
{
fetchCemeteryMeta
}
from
"
@/reducers/duel/cemeretySlic
e
"
;
import
{
fetchExclusionMeta
}
from
"
@/reducers/duel/exclusionSlice
"
;
import
{
fetchExtraDeckMeta
}
from
"
@/reducers/duel/extraDeckSlice
"
;
import
{
insertHandMeta
}
from
"
@/reducers/duel/handsSlice
"
;
import
{
fetchMagicMeta
}
from
"
@/reducers/duel/magic
Slice
"
;
import
{
removeCemetery
,
removeExclusion
,
...
...
@@ -14,11 +14,12 @@ import {
removeMonster
,
removeOverlay
,
}
from
"
@/reducers/duel/mod
"
;
import
{
fetchMagicMeta
}
from
"
@/reducers/duel/magicSlice
"
;
import
{
fetchCemeteryMeta
}
from
"
@/reducers/duel/cemeretySlice
"
;
import
{
insertHandMeta
}
from
"
@/reducers/duel/handsSlice
"
;
import
{
fetchExclusionMeta
}
from
"
@/reducers/duel/exclusionSlice
"
;
import
{
fetchExtraDeckMeta
}
from
"
@/reducers/duel/extraDeckSlice
"
;
import
{
fetchMonsterMeta
,
fetchOverlayMeta
,
}
from
"
@/reducers/duel/monstersSlice
"
;
import
{
AppDispatch
}
from
"
@/store
"
;
import
{
REASON_MATERIAL
}
from
"
../../common
"
;
const
OVERLAY_STACK
:
{
code
:
number
;
sequence
:
number
}[]
=
[];
...
...
src/service/duel/newPhase.ts
View file @
f7b96892
import
{
ygopro
}
from
"
@/api/ocgcore/idl/ocgcore
"
;
import
{
AppDispatch
}
from
"
@/store
"
;
import
{
updatePhase
}
from
"
@/reducers/duel/mod
"
;
import
{
AppDispatch
}
from
"
@/store
"
;
export
default
(
newPhase
:
ygopro
.
StocGameMessage
.
MsgNewPhase
,
...
...
src/service/duel/newTurn.ts
View file @
f7b96892
import
{
ygopro
}
from
"
@/api/ocgcore/idl/ocgcore
"
;
import
{
AppDispatch
}
from
"
@/store
"
;
import
{
updateTurn
}
from
"
@/reducers/duel/mod
"
;
import
{
AppDispatch
}
from
"
@/store
"
;
export
default
(
newTurn
:
ygopro
.
StocGameMessage
.
MsgNewTurn
,
...
...
src/service/duel/selectBattleCmd.ts
View file @
f7b96892
import
{
ActionCreatorWithPayload
}
from
"
@reduxjs/toolkit
"
;
import
{
ygopro
}
from
"
@/api/ocgcore/idl/ocgcore
"
;
import
{
Interactivity
,
InteractType
}
from
"
@/reducers/duel/generic
"
;
import
{
...
...
src/service/duel/selectCard.ts
View file @
f7b96892
import
{
ygopro
}
from
"
@/api/ocgcore/idl/ocgcore
"
;
import
{
AppDispatch
}
from
"
@/store
"
;
import
{
setCheckCardModalIsOpen
,
setCheckCardModalMinMax
,
setCheckCardModalOnSubmit
,
}
from
"
@/reducers/duel/mod
"
;
import
{
fetchCheckCardMeta
}
from
"
@/reducers/duel/modal/mod
"
;
import
{
AppDispatch
}
from
"
@/store
"
;
import
MsgSelectCard
=
ygopro
.
StocGameMessage
.
MsgSelectCard
;
import
{
CardZoneToChinese
}
from
"
./util
"
;
...
...
src/service/duel/selectChain.ts
View file @
f7b96892
...
...
@@ -10,6 +10,7 @@ import {
}
from
"
@/reducers/duel/mod
"
;
import
{
fetchCheckCardMeta
}
from
"
@/reducers/duel/modal/mod
"
;
import
{
AppDispatch
}
from
"
@/store
"
;
import
{
CardZoneToChinese
}
from
"
./util
"
;
import
MsgSelectChain
=
ygopro
.
StocGameMessage
.
MsgSelectChain
;
...
...
src/service/duel/selectEffectYn.ts
View file @
f7b96892
...
...
@@ -3,6 +3,7 @@ import { ygopro } from "@/api/ocgcore/idl/ocgcore";
import
{
setYesNoModalIsOpen
}
from
"
@/reducers/duel/mod
"
;
import
{
fetchYesNoMeta
}
from
"
@/reducers/duel/modal/mod
"
;
import
{
AppDispatch
}
from
"
@/store
"
;
import
{
CardZoneToChinese
}
from
"
./util
"
;
import
MsgSelectEffectYn
=
ygopro
.
StocGameMessage
.
MsgSelectEffectYn
;
...
...
src/service/duel/selectIdleCmd.ts
View file @
f7b96892
import
{
ygopro
}
from
"
@/api/ocgcore/idl/ocgcore
"
;
import
{
AppDispatch
}
from
"
@/store
"
;
import
{
Interactivity
,
InteractType
}
from
"
@/reducers/duel/generic
"
;
import
{
addCemeteryIdleInteractivities
,
addExclusionIdleInteractivities
,
addExtraDeckIdleInteractivities
,
addHandsIdleInteractivity
,
addMonsterIdleInteractivities
,
addMagicIdleInteractivities
,
addMonsterIdleInteractivities
,
clearAllIdleInteractivities
,
setEnableBp
,
setEnableEp
,
addCemeteryIdleInteractivities
,
clearAllIdleInteractivities
,
addExclusionIdleInteractivities
,
addExtraDeckIdleInteractivities
,
}
from
"
@/reducers/duel/mod
"
;
import
{
AppDispatch
}
from
"
@/store
"
;
import
MsgSelectIdleCmd
=
ygopro
.
StocGameMessage
.
MsgSelectIdleCmd
;
import
{
ActionCreatorWithPayload
}
from
"
@reduxjs/toolkit
"
;
...
...
src/service/duel/selectPlace.ts
View file @
f7b96892
...
...
@@ -2,8 +2,8 @@ import { ygopro } from "@/api/ocgcore/idl/ocgcore";
import
{
AppDispatch
}
from
"
@/store
"
;
import
MsgSelectPlace
=
ygopro
.
StocGameMessage
.
MsgSelectPlace
;
import
{
addMonsterPlaceInteractivities
,
addMagicPlaceInteractivities
,
addMonsterPlaceInteractivities
,
}
from
"
@/reducers/duel/mod
"
;
export
default
(
selectPlace
:
MsgSelectPlace
,
dispatch
:
AppDispatch
)
=>
{
...
...
src/service/duel/start.ts
View file @
f7b96892
import
{
ygopro
}
from
"
@/api/ocgcore/idl/ocgcore
"
;
import
{
AppDispatch
}
from
"
@/store
"
;
import
{
infoInit
,
setSelfType
,
initMonsters
,
initMagics
,
initCemetery
,
initDeck
,
initExclusion
,
initHint
,
initMagics
,
initMonsters
,
setSelfType
,
}
from
"
@/reducers/duel/mod
"
;
import
{
AppDispatch
}
from
"
@/store
"
;
export
default
(
start
:
ygopro
.
StocGameMessage
.
MsgStart
,
...
...
src/service/duel/timeLimit.ts
View file @
f7b96892
import
{
ygopro
}
from
"
@/api/ocgcore/idl/ocgcore
"
;
import
{
store
}
from
"
@/store
"
;
import
{
updateTimeLimit
}
from
"
@/reducers/duel/mod
"
;
import
{
sendTimeConfirm
}
from
"
@/api/ocgcore/ocgHelper
"
;
import
{
updateTimeLimit
}
from
"
@/reducers/duel/mod
"
;
import
{
store
}
from
"
@/store
"
;
export
default
function
handleTimeLimit
(
timeLimit
:
ygopro
.
StocTimeLimit
)
{
const
dispatch
=
store
.
dispatch
;
...
...
src/service/duel/unimplemented.ts
View file @
f7b96892
import
{
ygopro
}
from
"
@/api/ocgcore/idl/ocgcore
"
;
import
{
setUnimplemented
}
from
"
@/reducers/duel/mod
"
;
import
{
AppDispatch
}
from
"
@/store
"
;
import
NeosConfig
from
"
../../../neos.config.json
"
;
export
default
(
...
...
src/service/mora/deckCount.ts
View file @
f7b96892
import
{
ygopro
}
from
"
@/api/ocgcore/idl/ocgcore
"
;
import
{
store
}
from
"
@/store
"
;
import
{
player0DeckInfo
,
player1DeckInfo
}
from
"
@/reducers/playerSlice
"
;
import
{
store
}
from
"
@/store
"
;
// FIXME: player0 不一定是当前玩家
export
default
function
handleDeckCount
(
pb
:
ygopro
.
YgoStocMsg
)
{
...
...
src/service/mora/selectHand.ts
View file @
f7b96892
import
{
ygopro
}
from
"
@/api/ocgcore/idl/ocgcore
"
;
import
{
store
}
from
"
@/store
"
;
import
{
selectHandAble
}
from
"
@/reducers/moraSlice
"
;
import
{
store
}
from
"
@/store
"
;
export
default
function
handleSelectHand
(
_
:
ygopro
.
YgoStocMsg
)
{
const
dispatch
=
store
.
dispatch
;
...
...
src/service/mora/selectTp.ts
View file @
f7b96892
import
{
ygopro
}
from
"
@/api/ocgcore/idl/ocgcore
"
;
import
{
store
}
from
"
@/store
"
;
import
{
selectTpAble
}
from
"
@/reducers/moraSlice
"
;
import
{
store
}
from
"
@/store
"
;
export
default
function
handleSelectTp
(
_
:
ygopro
.
YgoStocMsg
)
{
const
dispatch
=
store
.
dispatch
;
...
...
src/service/onSocketMessage.ts
View file @
f7b96892
...
...
@@ -2,20 +2,21 @@
* 长连接消息事件订阅处理逻辑
*
* */
import
handleHsPlayerChange
from
"
./room/hsPlayerChange
"
;
import
handleTypeChange
from
"
./room/typeChange
"
;
import
handleHsPlayerEnter
from
"
./room/hsPlayerEnter
"
;
import
handleJoinGame
from
"
./room/joinGame
"
;
import
handleChat
from
"
./room/chat
"
;
import
handleHsWatchChange
from
"
./room/hsWatchChange
"
;
import
{
YgoProPacket
}
from
"
@/api/ocgcore/ocgAdapter/packet
"
;
import
{
adaptStoc
}
from
"
@/api/ocgcore/ocgAdapter/adapter
"
;
import
handleSelectHand
from
"
./mora/selectHand
"
;
import
handleSelectTp
from
"
./mora/selectTp
"
;
import
handleDeckCount
from
"
./mora/deckCount
"
;
import
{
YgoProPacket
}
from
"
@/api/ocgcore/ocgAdapter/packet
"
;
import
handleGameMsg
from
"
./duel/gameMsg
"
;
import
handleTimeLimit
from
"
./duel/timeLimit
"
;
import
handleDeckCount
from
"
./mora/deckCount
"
;
import
handleSelectHand
from
"
./mora/selectHand
"
;
import
handleSelectTp
from
"
./mora/selectTp
"
;
import
handleChat
from
"
./room/chat
"
;
import
handleDuelStart
from
"
./room/duelStart
"
;
import
handleHsPlayerChange
from
"
./room/hsPlayerChange
"
;
import
handleHsPlayerEnter
from
"
./room/hsPlayerEnter
"
;
import
handleHsWatchChange
from
"
./room/hsWatchChange
"
;
import
handleJoinGame
from
"
./room/joinGame
"
;
import
handleTypeChange
from
"
./room/typeChange
"
;
/*
* 先将从长连接中读取到的二进制数据通过Adapter转成protobuf结构体,
...
...
src/service/onSocketOpen.ts
View file @
f7b96892
...
...
@@ -3,6 +3,7 @@
*
* */
import
{
sendJoinGame
,
sendPlayerInfo
}
from
"
@/api/ocgcore/ocgHelper
"
;
import
NeosConfig
from
"
../../neos.config.json
"
;
/*
...
...
src/service/room/hsPlayerChange.ts
View file @
f7b96892
import
{
ygopro
}
from
"
@/api/ocgcore/idl/ocgcore
"
;
import
{
store
}
from
"
@/store
"
;
import
{
player0Update
,
player1Update
,
observerIncrement
,
player0Leave
,
player0Update
,
player1Leave
,
observerIncrement
,
player1Update
,
}
from
"
@/reducers/playerSlice
"
;
import
{
store
}
from
"
@/store
"
;
const
READY_STATE
=
"
ready
"
;
const
NO_READY_STATE
=
"
not ready
"
;
...
...
src/service/room/hsPlayerEnter.ts
View file @
f7b96892
import
{
ygopro
}
from
"
@/api/ocgcore/idl/ocgcore
"
;
import
{
store
}
from
"
@/store
"
;
import
{
player0Enter
,
player1Enter
}
from
"
@/reducers/playerSlice
"
;
import
{
store
}
from
"
@/store
"
;
export
default
function
handleHsPlayerEnter
(
pb
:
ygopro
.
YgoStocMsg
)
{
const
dispatch
=
store
.
dispatch
;
...
...
src/service/room/joinGame.ts
View file @
f7b96892
import
{
ygopro
}
from
"
@/api/ocgcore/idl/ocgcore
"
;
import
{
store
}
from
"
@/store
"
;
import
{
setJoined
}
from
"
@/reducers/joinSlice
"
;
import
{
store
}
from
"
@/store
"
;
export
default
function
handleJoinGame
(
pb
:
ygopro
.
YgoStocMsg
)
{
const
dispatch
=
store
.
dispatch
;
...
...
src/service/room/typeChange.ts
View file @
f7b96892
import
{
ygopro
}
from
"
@/api/ocgcore/idl/ocgcore
"
;
import
{
hostChange
,
player0Update
,
player1Update
,
hostChange
,
updateIsHost
,
}
from
"
@/reducers/playerSlice
"
;
import
{
store
}
from
"
@/store
"
;
...
...
src/store.ts
View file @
f7b96892
...
...
@@ -2,11 +2,12 @@
* 全局状态存储模块
* */
import
{
configureStore
,
Unsubscribe
}
from
"
@reduxjs/toolkit
"
;
import
joinedReducer
from
"
./reducers/joinSlice
"
;
import
chatReducer
from
"
./reducers/chatSlice
"
;
import
playerReducer
from
"
./reducers/playerSlice
"
;
import
moraReducer
from
"
./reducers/moraSlice
"
;
import
duelReducer
from
"
./reducers/duel/mod
"
;
import
joinedReducer
from
"
./reducers/joinSlice
"
;
import
moraReducer
from
"
./reducers/moraSlice
"
;
import
playerReducer
from
"
./reducers/playerSlice
"
;
export
const
store
=
configureStore
({
reducer
:
{
...
...
src/ui/Duel/Layout.tsx
View file @
f7b96892
import
React
from
"
react
"
;
import
{
Layout
}
from
"
antd
"
;
import
React
from
"
react
"
;
import
NeosConfig
from
"
../../../neos.config.json
"
;
const
layoutConfig
=
NeosConfig
.
ui
.
layout
;
...
...
src/ui/Duel/Main.tsx
View file @
f7b96892
import
*
as
BABYLON
from
"
@babylonjs/core
"
;
import
{
Row
}
from
"
antd
"
;
import
React
from
"
react
"
;
import
{
Engine
,
Scene
}
from
"
react-babylonjs
"
;
import
{
ReactReduxContext
,
Provider
}
from
"
react-redux
"
;
import
*
as
BABYLON
from
"
@babylonjs/core
"
;
import
{
Hands
,
Monsters
,
Magics
,
Field
,
Graveyard
,
ExtraDeck
,
}
from
"
./PlayMat
"
;
import
{
Provider
,
ReactReduxContext
}
from
"
react-redux
"
;
import
NeosConfig
from
"
../../../neos.config.json
"
;
import
NeosLayout
from
"
./Layout
"
;
import
{
CardModal
,
HintNotification
,
Alert
,
CardListModal
,
CardModal
,
CheckCardModal
,
YesNoModal
,
PositionModal
,
OptionModal
,
Phase
,
CheckCardModalV2
,
DuelTimeLine
,
SendBox
,
PlayerStatus
,
Alert
,
CheckCardModalV3
,
CheckCounterModal
,
DuelTimeLine
,
HintNotification
,
OptionModal
,
Phase
,
PlayerStatus
,
PositionModal
,
SendBox
,
SortCardModal
,
YesNoModal
,
}
from
"
./Message
"
;
import
{
CommonDeck
}
from
"
./PlayMat/Deck
"
;
import
{
ExtraDeck
,
Field
,
Graveyard
,
Hands
,
Magics
,
Monsters
,
}
from
"
./PlayMat
"
;
import
{
BanishedZone
}
from
"
./PlayMat/BanishedZone
"
;
import
NeosLayout
from
"
./Layout
"
;
import
NeosConfig
from
"
../../../neos.config.json
"
;
import
{
Row
}
from
"
antd
"
;
import
{
CommonDeck
}
from
"
./PlayMat/Deck
"
;
// Ref: https://github.com/brianzinn/react-babylonjs/issues/126
const
NeosDuel
=
()
=>
{
...
...
src/ui/Duel/Message/Alert.tsx
View file @
f7b96892
import
{
Alert
as
AntdAlert
}
from
"
antd
"
;
import
React
from
"
react
"
;
import
{
useNavigate
}
from
"
react-router-dom
"
;
import
{
sendSurrender
}
from
"
@/api/ocgcore/ocgHelper
"
;
import
{
useAppSelector
}
from
"
@/hook
"
;
import
{
selectUnimplemented
}
from
"
@/reducers/duel/mod
"
;
import
{
Alert
as
AntdAlert
}
from
"
antd
"
;
export
const
Alert
=
()
=>
{
const
unimplemented
=
useAppSelector
(
selectUnimplemented
);
...
...
src/ui/Duel/Message/CardListModal.tsx
View file @
f7b96892
import
{
Button
,
Drawer
,
List
}
from
"
antd
"
;
import
React
from
"
react
"
;
import
{
sendSelectIdleCmdResponse
}
from
"
@/api/ocgcore/ocgHelper
"
;
import
{
useAppSelector
}
from
"
@/hook
"
;
import
{
store
}
from
"
@/store
"
;
import
{
selectCardListModalIsOpen
,
selectCardListModalInfo
,
}
from
"
@/reducers/duel/modal/mod
"
;
import
{
clearAllIdleInteractivities
,
setCardListModalIsOpen
,
}
from
"
@/reducers/duel/mod
"
;
import
{
Drawer
,
List
,
Button
}
from
"
antd
"
;
import
{
sendSelectIdleCmdResponse
}
from
"
@/api/ocgcore/ocgHelper
"
;
import
{
selectCardListModalInfo
,
selectCardListModalIsOpen
,
}
from
"
@/reducers/duel/modal/mod
"
;
import
{
store
}
from
"
@/store
"
;
import
NeosConfig
from
"
../../../../neos.config.json
"
;
const
CARD_WIDTH
=
100
;
...
...
src/ui/Duel/Message/CardModal.tsx
View file @
f7b96892
import
Icon
,
{
StarOutlined
}
from
"
@ant-design/icons
"
;
import
{
Button
,
Card
,
Col
,
Modal
,
Row
}
from
"
antd
"
;
import
React
from
"
react
"
;
import
{
sendSelectIdleCmdResponse
}
from
"
@/api/ocgcore/ocgHelper
"
;
import
{
fetchStrings
}
from
"
@/api/strings
"
;
import
{
useAppSelector
}
from
"
@/hook
"
;
import
{
store
}
from
"
@/store
"
;
import
{
selectCardModalIsOpen
,
clearAllIdleInteractivities
,
setCardModalIsOpen
,
}
from
"
@/reducers/duel/mod
"
;
import
{
selectCardModalCounters
,
selectCardModalInteractivies
,
selectCardModalIsOpen
,
selectCardModalMeta
,
selectCardModalCounters
,
}
from
"
@/reducers/duel/modal/mod
"
;
import
{
setCardModalIsOpen
,
clearAllIdleInteractivities
,
}
from
"
@/reducers/duel/mod
"
;
import
{
Modal
,
Card
,
Button
,
Row
,
Col
}
from
"
antd
"
;
import
{
sendSelectIdleCmdResponse
}
from
"
@/api/ocgcore/ocgHelper
"
;
import
Icon
,
{
StarOutlined
}
from
"
@ant-design/icons
"
;
import
{
store
}
from
"
@/store
"
;
import
NeosConfig
from
"
../../../../neos.config.json
"
;
import
{
ReactComponent
as
BattleSvg
}
from
"
../../../../neos-assets/battle-axe.svg
"
;
import
{
ReactComponent
as
DefenceSvg
}
from
"
../../../../neos-assets/checked-shield.svg
"
;
import
{
extraCardTypes
,
Type2StringCodeMap
,
Attribute2StringCodeMap
,
extraCardTypes
,
Race2StringCodeMap
,
Type2StringCodeMap
,
}
from
"
../../../common
"
;
import
{
fetchStrings
}
from
"
@/api/strings
"
;
const
{
Meta
}
=
Card
;
const
CARD_WIDTH
=
240
;
...
...
src/ui/Duel/Message/CheckCardModal.tsx
View file @
f7b96892
import
{
ThunderboltOutlined
}
from
"
@ant-design/icons
"
;
import
{
CheckCard
,
CheckCardProps
}
from
"
@ant-design/pro-components
"
;
import
{
Button
,
Col
,
Popover
,
Row
}
from
"
antd
"
;
import
React
,
{
useState
}
from
"
react
"
;
import
{
sendSelectCardResponse
,
sendSelectChainResponse
,
}
from
"
@/api/ocgcore/ocgHelper
"
;
import
{
useAppSelector
}
from
"
@/hook
"
;
import
{
store
}
from
"
@/store
"
;
import
{
selectHint
}
from
"
@/reducers/duel/hintSlice
"
;
import
{
resetCheckCardModal
,
setCheckCardModalIsOpen
,
}
from
"
@/reducers/duel/mod
"
;
import
{
selectCheckCardModalCacnelResponse
,
selectCheckCardModalCancelAble
,
...
...
@@ -9,20 +21,10 @@ import {
selectCheckCardModalOnSubmit
,
selectCheckCardModalTags
,
}
from
"
@/reducers/duel/modal/mod
"
;
import
{
resetCheckCardModal
,
setCheckCardModalIsOpen
,
}
from
"
@/reducers/duel/mod
"
;
import
{
Button
,
Row
,
Col
,
Popover
}
from
"
antd
"
;
import
{
CheckCard
,
CheckCardProps
}
from
"
@ant-design/pro-components
"
;
import
{
sendSelectCardResponse
,
sendSelectChainResponse
,
}
from
"
@/api/ocgcore/ocgHelper
"
;
import
{
ThunderboltOutlined
}
from
"
@ant-design/icons
"
;
import
{
store
}
from
"
@/store
"
;
import
NeosConfig
from
"
../../../../neos.config.json
"
;
import
{
DragModal
}
from
"
./DragModal
"
;
import
{
selectHint
}
from
"
@/reducers/duel/hintSlice
"
;
export
const
CheckCardModal
=
()
=>
{
const
dispatch
=
store
.
dispatch
;
...
...
src/ui/Duel/Message/CheckCardModalV2.tsx
View file @
f7b96892
import
{
CheckCard
}
from
"
@ant-design/pro-components
"
;
import
{
Button
,
Card
,
Col
,
Row
}
from
"
antd
"
;
import
React
from
"
react
"
;
import
{
sendSelectUnselectCardResponse
}
from
"
@/api/ocgcore/ocgHelper
"
;
import
{
useAppSelector
}
from
"
@/hook
"
;
import
{
store
}
from
"
@/store
"
;
import
{
Button
,
Card
,
Row
,
Col
}
from
"
antd
"
;
import
{
CheckCard
}
from
"
@ant-design/pro-components
"
;
import
{
selectHint
}
from
"
@/reducers/duel/hintSlice
"
;
import
{
resetCheckCardModalV2
,
setCheckCardModalV2IsOpen
,
setCheckCardModalV2ResponseAble
,
}
from
"
@/reducers/duel/mod
"
;
import
{
selectCheckCardModalV2CancelAble
,
selectCheckCardModalV2FinishAble
,
...
...
@@ -12,15 +19,10 @@ import {
selectCheckCardModalV2SelectAbleOptions
,
selectCheckCardModalV2SelectedOptions
,
}
from
"
@/reducers/duel/modal/checkCardModalV2Slice
"
;
import
{
sendSelectUnselectCardResponse
}
from
"
@/api/ocgcore/ocgHelper
"
;
import
{
resetCheckCardModalV2
,
setCheckCardModalV2IsOpen
,
setCheckCardModalV2ResponseAble
,
}
from
"
@/reducers/duel/mod
"
;
import
{
store
}
from
"
@/store
"
;
import
NeosConfig
from
"
../../../../neos.config.json
"
;
import
{
DragModal
}
from
"
./DragModal
"
;
import
{
selectHint
}
from
"
@/reducers/duel/hintSlice
"
;
export
const
CheckCardModalV2
=
()
=>
{
const
dispatch
=
store
.
dispatch
;
...
...
src/ui/Duel/Message/CheckCardModalV3.tsx
View file @
f7b96892
import
React
,
{
useState
}
from
"
react
"
;
import
{
useAppSelector
}
from
"
@/hook
"
;
import
{
store
}
from
"
@/store
"
;
import
{
Button
,
Card
,
Row
,
Col
}
from
"
antd
"
;
import
{
CheckCard
}
from
"
@ant-design/pro-components
"
;
import
{
Button
,
Card
,
Col
,
Row
}
from
"
antd
"
;
import
React
,
{
useState
}
from
"
react
"
;
import
{
sendSelectCardResponse
}
from
"
@/api/ocgcore/ocgHelper
"
;
import
{
useAppSelector
}
from
"
@/hook
"
;
import
{
selectHint
}
from
"
@/reducers/duel/hintSlice
"
;
import
{
resetCheckCardModalV3
,
setCheckCardModalV3IsOpen
,
setCheckCardModalV3ResponseAble
,
}
from
"
@/reducers/duel/mod
"
;
import
NeosConfig
from
"
../../../../neos.config.json
"
;
import
{
selectCheckCardModalV3
}
from
"
@/reducers/duel/modal/checkCardModalV3Slice
"
;
import
{
store
}
from
"
@/store
"
;
import
NeosConfig
from
"
../../../../neos.config.json
"
;
import
{
DragModal
}
from
"
./DragModal
"
;
import
{
selectHint
}
from
"
@/reducers/duel/hintSlice
"
;
export
const
CheckCardModalV3
=
()
=>
{
const
dispatch
=
store
.
dispatch
;
...
...
src/ui/Duel/Message/CheckCounterModal.tsx
View file @
f7b96892
import
{
Button
,
Row
,
Col
,
Card
,
InputNumber
}
from
"
antd
"
;
import
{
Button
,
Card
,
Col
,
InputNumber
,
Row
}
from
"
antd
"
;
import
React
,
{
useState
}
from
"
react
"
;
import
{
sendSelectCounterResponse
}
from
"
@/api/ocgcore/ocgHelper
"
;
import
{
fetchStrings
}
from
"
@/api/strings
"
;
import
{
useAppSelector
}
from
"
@/hook
"
;
import
{
clearCheckCounter
}
from
"
@/reducers/duel/mod
"
;
import
{
selectCheckCounterModal
}
from
"
@/reducers/duel/modal/checkCounterModalSlice
"
;
import
{
store
}
from
"
@/store
"
;
import
{
DragModal
}
from
"
./DragModal
"
;
import
NeosConfig
from
"
../../../../neos.config.json
"
;
import
{
DragModal
}
from
"
./DragModal
"
;
export
const
CheckCounterModal
=
()
=>
{
const
dispatch
=
store
.
dispatch
;
...
...
src/ui/Duel/Message/DragModal.tsx
View file @
f7b96892
// 经过封装的可拖拽`Modal`
import
{
Modal
,
ModalProps
}
from
"
antd
"
;
import
React
,
{
useRef
,
useState
}
from
"
react
"
;
import
type
{
DraggableData
,
DraggableEvent
}
from
"
react-draggable
"
;
import
Draggable
from
"
react-draggable
"
;
import
{
Modal
,
ModalProps
}
from
"
antd
"
;
export
interface
DragModalProps
extends
ModalProps
{}
...
...
src/ui/Duel/Message/HintNotification.tsx
View file @
f7b96892
import
{
notification
}
from
"
antd
"
;
import
React
,
{
useEffect
}
from
"
react
"
;
import
{
useNavigate
}
from
"
react-router-dom
"
;
import
{
ygopro
}
from
"
@/api/ocgcore/idl/ocgcore
"
;
import
{
useAppSelector
}
from
"
@/hook
"
;
import
{
selectHint
}
from
"
@/reducers/duel/hintSlice
"
;
import
{
selectCurrentPhase
}
from
"
@/reducers/duel/phaseSlice
"
;
import
{
notification
}
from
"
antd
"
;
import
{
selectDuelResult
,
selectWaiting
}
from
"
@/reducers/duel/mod
"
;
import
{
useNavigate
}
from
"
react-router-dom
"
;
import
{
ygopro
}
from
"
@/api/ocgcore/idl/ocgcore
"
;
import
{
selectCurrentPhase
}
from
"
@/reducers/duel/phaseSlice
"
;
import
MsgWin
=
ygopro
.
StocGameMessage
.
MsgWin
;
import
NeosConfig
from
"
../../../../neos.config.json
"
;
...
...
src/ui/Duel/Message/OptionModal.tsx
View file @
f7b96892
import
{
CheckCard
}
from
"
@ant-design/pro-components
"
;
import
{
Button
}
from
"
antd
"
;
import
React
,
{
useState
}
from
"
react
"
;
import
{
sendSelectOptionResponse
}
from
"
@/api/ocgcore/ocgHelper
"
;
import
{
useAppSelector
}
from
"
@/hook
"
;
import
{
store
}
from
"
@/store
"
;
import
{
Button
}
from
"
antd
"
;
import
{
CheckCard
}
from
"
@ant-design/pro-components
"
;
import
{
resetOptionModal
,
setOptionModalIsOpen
}
from
"
@/reducers/duel/mod
"
;
import
{
selectOptionModalIsOpen
,
selectOptionModalOptions
,
}
from
"
@/reducers/duel/modal/mod
"
;
import
{
s
endSelectOptionResponse
}
from
"
@/api/ocgcore/ocgHelper
"
;
import
{
resetOptionModal
,
setOptionModalIsOpen
}
from
"
@/reducers/duel/mod
"
;
import
{
s
tore
}
from
"
@/store
"
;
import
{
DragModal
}
from
"
./DragModal
"
;
export
const
OptionModal
=
()
=>
{
...
...
src/ui/Duel/Message/Phase.tsx
View file @
f7b96892
import
Icon
from
"
@ant-design/icons
"
;
import
{
Button
,
Modal
,
Space
}
from
"
antd
"
;
import
React
,
{
useState
}
from
"
react
"
;
import
{
store
}
from
"
@/store
"
;
import
{
useAppSelector
}
from
"
@/hook
"
;
import
{
selectCurrentPhase
,
selectEnableBp
,
selectEnableEp
,
selectEnableM2
,
}
from
"
@/reducers/duel/phaseSlice
"
;
import
{
sendSelectBattleCmdResponse
,
sendSelectIdleCmdResponse
,
sendSurrender
,
}
from
"
@/api/ocgcore/ocgHelper
"
;
import
{
useAppSelector
}
from
"
@/hook
"
;
import
{
clearAllIdleInteractivities
,
setEnableBp
,
setEnableEp
,
setEnableM2
,
}
from
"
@/reducers/duel/mod
"
;
import
{
Button
,
Modal
,
Space
}
from
"
antd
"
;
import
Icon
from
"
@ant-design/icons
"
;
import
{
selectCurrentPhase
,
selectEnableBp
,
selectEnableEp
,
selectEnableM2
,
}
from
"
@/reducers/duel/phaseSlice
"
;
import
{
store
}
from
"
@/store
"
;
import
{
ReactComponent
as
BattleSvg
}
from
"
../../../../neos-assets/crossed-swords.svg
"
;
import
{
ReactComponent
as
Main2Svg
}
from
"
../../../../neos-assets/sword-in-stone.svg
"
;
import
{
ReactComponent
as
EpSvg
}
from
"
../../../../neos-assets/power-button.svg
"
;
import
{
ReactComponent
as
Main2Svg
}
from
"
../../../../neos-assets/sword-in-stone.svg
"
;
import
{
ReactComponent
as
SurrenderSvg
}
from
"
../../../../neos-assets/truce.svg
"
;
const
IconSize
=
"
150%
"
;
...
...
src/ui/Duel/Message/PositionModal.tsx
View file @
f7b96892
import
React
,
{
useState
}
from
"
react
"
;
import
{
useAppSelector
}
from
"
@/hook
"
;
import
{
store
}
from
"
@/store
"
;
import
{
CheckCard
}
from
"
@ant-design/pro-components
"
;
import
{
Button
}
from
"
antd
"
;
import
{
sendSelectPositionResponse
}
from
"
@/api/ocgcore/ocgHelper
"
;
import
{
selectPositionModalIsOpen
,
selectPositionModalPositions
,
}
from
"
@/reducers/duel/modal/mod
"
;
import
React
,
{
useState
}
from
"
react
"
;
import
{
ygopro
}
from
"
@/api/ocgcore/idl/ocgcore
"
;
import
{
sendSelectPositionResponse
}
from
"
@/api/ocgcore/ocgHelper
"
;
import
{
useAppSelector
}
from
"
@/hook
"
;
import
{
resetPositionModal
,
setPositionModalIsOpen
,
}
from
"
@/reducers/duel/mod
"
;
import
{
CheckCard
}
from
"
@ant-design/pro-components
"
;
import
{
selectPositionModalIsOpen
,
selectPositionModalPositions
,
}
from
"
@/reducers/duel/modal/mod
"
;
import
{
store
}
from
"
@/store
"
;
import
{
DragModal
}
from
"
./DragModal
"
;
export
const
PositionModal
=
()
=>
{
...
...
src/ui/Duel/Message/SendBox.tsx
View file @
f7b96892
import
React
,
{
useState
}
from
"
react
"
;
import
{
Input
,
Button
,
Row
,
Col
}
from
"
antd
"
;
import
{
SendOutlined
}
from
"
@ant-design/icons
"
;
import
{
Button
,
Col
,
Input
,
Row
}
from
"
antd
"
;
import
React
,
{
useState
}
from
"
react
"
;
import
{
sendChat
}
from
"
@/api/ocgcore/ocgHelper
"
;
export
const
SendBox
=
()
=>
{
...
...
src/ui/Duel/Message/SortCardModal.tsx
View file @
f7b96892
import
React
,
{
useEffect
,
useState
}
from
"
react
"
;
import
{
DndContext
,
closestCenter
,
DndContext
,
DragEndEvent
,
KeyboardSensor
,
PointerSensor
,
useSensor
,
useSensors
,
DragEndEvent
,
}
from
"
@dnd-kit/core
"
;
import
{
arrayMove
,
SortableContext
,
sortableKeyboardCoordinates
,
verticalListSortingStrategy
,
useSortable
,
verticalListSortingStrategy
,
}
from
"
@dnd-kit/sortable
"
;
import
{
CSS
}
from
"
@dnd-kit/utilities
"
;
import
{
Button
,
Card
,
Modal
}
from
"
antd
"
;
import
React
,
{
useEffect
,
useState
}
from
"
react
"
;
import
{
CardMeta
}
from
"
@/api/cards
"
;
import
{
sendSortCardResponse
}
from
"
@/api/ocgcore/ocgHelper
"
;
import
{
useAppSelector
}
from
"
@/hook
"
;
import
{
resetSortCardModal
}
from
"
@/reducers/duel/mod
"
;
import
{
selectSortCardModal
}
from
"
@/reducers/duel/modal/sortCardModalSlice
"
;
import
{
sendSortCardResponse
}
from
"
@/api/ocgcore/ocgHelper
"
;
import
{
store
}
from
"
@/store
"
;
import
{
resetSortCardModal
}
from
"
@/reducers/duel/mod
"
;
import
{
Modal
,
Button
,
Card
}
from
"
antd
"
;
import
{
CardMeta
}
from
"
@/api/cards
"
;
import
NeosConfig
from
"
../../../../neos.config.json
"
;
export
const
SortCardModal
=
()
=>
{
...
...
src/ui/Duel/Message/Status.tsx
View file @
f7b96892
import
React
from
"
react
"
;
import
{
UserOutlined
}
from
"
@ant-design/icons
"
;
import
{
Avatar
}
from
"
antd
"
;
import
{
CheckCard
}
from
"
@ant-design/pro-components
"
;
import
NeosConfig
from
"
../../../../neos.config.json
"
;
import
{
Avatar
}
from
"
antd
"
;
import
React
from
"
react
"
;
import
{
useAppSelector
}
from
"
@/hook
"
;
import
{
selectMeInitInfo
,
...
...
@@ -10,6 +10,8 @@ import {
}
from
"
@/reducers/duel/initInfoSlice
"
;
import
{
selectWaiting
}
from
"
@/reducers/duel/mod
"
;
import
NeosConfig
from
"
../../../../neos.config.json
"
;
const
Config
=
NeosConfig
.
ui
.
status
;
const
avatarSize
=
40
;
const
ME_VALUE
=
"
myself
"
;
...
...
src/ui/Duel/Message/TimeLine.tsx
View file @
f7b96892
import
React
,
{
useEffect
,
useState
}
from
"
react
"
;
import
{
Timeline
,
TimelineItemProps
}
from
"
antd
"
;
import
{
MessageOutlined
}
from
"
@ant-design/icons
"
;
import
{
Timeline
,
TimelineItemProps
}
from
"
antd
"
;
import
React
,
{
useEffect
,
useState
}
from
"
react
"
;
import
{
useAppSelector
}
from
"
@/hook
"
;
import
{
selectChat
}
from
"
@/reducers/chatSlice
"
;
...
...
src/ui/Duel/Message/YesNoModal.tsx
View file @
f7b96892
import
React
from
"
react
"
;
import
{
useAppSelector
}
from
"
@/hook
"
;
import
{
store
}
from
"
@/store
"
;
import
{
Button
}
from
"
antd
"
;
import
React
from
"
react
"
;
import
{
sendSelectEffectYnResponse
}
from
"
@/api/ocgcore/ocgHelper
"
;
import
{
useAppSelector
}
from
"
@/hook
"
;
import
{
selectHint
}
from
"
@/reducers/duel/hintSlice
"
;
import
{
setYesNoModalIsOpen
}
from
"
@/reducers/duel/mod
"
;
import
{
selectYesNoModalIsOpen
,
selectYesNOModalMsg
,
}
from
"
@/reducers/duel/modal/mod
"
;
import
{
setYesNoModalIsOpen
}
from
"
@/reducers/duel/mod
"
;
import
{
store
}
from
"
@/store
"
;
import
{
DragModal
}
from
"
./DragModal
"
;
import
{
selectHint
}
from
"
@/reducers/duel/hintSlice
"
;
export
const
YesNoModal
=
()
=>
{
const
dispatch
=
store
.
dispatch
;
...
...
src/ui/Duel/Message/alert.tsx
View file @
f7b96892
import
{
Alert
as
AntdAlert
}
from
"
antd
"
;
import
React
from
"
react
"
;
import
{
useNavigate
}
from
"
react-router-dom
"
;
import
{
sendSurrender
}
from
"
@/api/ocgcore/ocgHelper
"
;
import
{
useAppSelector
}
from
"
@/hook
"
;
import
{
selectUnimplemented
}
from
"
@/reducers/duel/mod
"
;
import
{
Alert
as
AntdAlert
}
from
"
antd
"
;
export
const
Alert
=
()
=>
{
const
unimplemented
=
useAppSelector
(
selectUnimplemented
);
...
...
src/ui/Duel/Message/cardListModal.tsx
View file @
f7b96892
import
{
Button
,
Drawer
,
List
}
from
"
antd
"
;
import
React
from
"
react
"
;
import
{
sendSelectIdleCmdResponse
}
from
"
@/api/ocgcore/ocgHelper
"
;
import
{
useAppSelector
}
from
"
@/hook
"
;
import
{
store
}
from
"
@/store
"
;
import
{
selectCardListModalIsOpen
,
selectCardListModalInfo
,
}
from
"
@/reducers/duel/modal/mod
"
;
import
{
clearAllIdleInteractivities
,
setCardListModalIsOpen
,
}
from
"
@/reducers/duel/mod
"
;
import
{
Drawer
,
List
,
Button
}
from
"
antd
"
;
import
{
sendSelectIdleCmdResponse
}
from
"
@/api/ocgcore/ocgHelper
"
;
import
{
selectCardListModalInfo
,
selectCardListModalIsOpen
,
}
from
"
@/reducers/duel/modal/mod
"
;
import
{
store
}
from
"
@/store
"
;
import
NeosConfig
from
"
../../../../neos.config.json
"
;
const
CARD_WIDTH
=
100
;
...
...
src/ui/Duel/Message/cardModal.tsx
View file @
f7b96892
import
Icon
,
{
StarOutlined
}
from
"
@ant-design/icons
"
;
import
{
Button
,
Card
,
Col
,
Modal
,
Row
}
from
"
antd
"
;
import
React
from
"
react
"
;
import
{
sendSelectIdleCmdResponse
}
from
"
@/api/ocgcore/ocgHelper
"
;
import
{
fetchStrings
}
from
"
@/api/strings
"
;
import
{
useAppSelector
}
from
"
@/hook
"
;
import
{
store
}
from
"
@/store
"
;
import
{
selectCardModalIsOpen
,
clearAllIdleInteractivities
,
setCardModalIsOpen
,
}
from
"
@/reducers/duel/mod
"
;
import
{
selectCardModalCounters
,
selectCardModalInteractivies
,
selectCardModalIsOpen
,
selectCardModalMeta
,
selectCardModalCounters
,
}
from
"
@/reducers/duel/modal/mod
"
;
import
{
setCardModalIsOpen
,
clearAllIdleInteractivities
,
}
from
"
@/reducers/duel/mod
"
;
import
{
Modal
,
Card
,
Button
,
Row
,
Col
}
from
"
antd
"
;
import
{
sendSelectIdleCmdResponse
}
from
"
@/api/ocgcore/ocgHelper
"
;
import
Icon
,
{
StarOutlined
}
from
"
@ant-design/icons
"
;
import
{
store
}
from
"
@/store
"
;
import
NeosConfig
from
"
../../../../neos.config.json
"
;
import
{
ReactComponent
as
BattleSvg
}
from
"
../../../../neos-assets/battle-axe.svg
"
;
import
{
ReactComponent
as
DefenceSvg
}
from
"
../../../../neos-assets/checked-shield.svg
"
;
import
{
extraCardTypes
,
Type2StringCodeMap
,
Attribute2StringCodeMap
,
extraCardTypes
,
Race2StringCodeMap
,
Type2StringCodeMap
,
}
from
"
../../../common
"
;
import
{
fetchStrings
}
from
"
@/api/strings
"
;
const
{
Meta
}
=
Card
;
const
CARD_WIDTH
=
240
;
...
...
src/ui/Duel/Message/checkCardModal.tsx
View file @
f7b96892
import
{
ThunderboltOutlined
}
from
"
@ant-design/icons
"
;
import
{
CheckCard
,
CheckCardProps
}
from
"
@ant-design/pro-components
"
;
import
{
Button
,
Col
,
Popover
,
Row
}
from
"
antd
"
;
import
React
,
{
useState
}
from
"
react
"
;
import
{
sendSelectCardResponse
,
sendSelectChainResponse
,
}
from
"
@/api/ocgcore/ocgHelper
"
;
import
{
useAppSelector
}
from
"
@/hook
"
;
import
{
store
}
from
"
@/store
"
;
import
{
selectHint
}
from
"
@/reducers/duel/hintSlice
"
;
import
{
resetCheckCardModal
,
setCheckCardModalIsOpen
,
}
from
"
@/reducers/duel/mod
"
;
import
{
selectCheckCardModalCacnelResponse
,
selectCheckCardModalCancelAble
,
...
...
@@ -9,20 +21,10 @@ import {
selectCheckCardModalOnSubmit
,
selectCheckCardModalTags
,
}
from
"
@/reducers/duel/modal/mod
"
;
import
{
resetCheckCardModal
,
setCheckCardModalIsOpen
,
}
from
"
@/reducers/duel/mod
"
;
import
{
Button
,
Row
,
Col
,
Popover
}
from
"
antd
"
;
import
{
CheckCard
,
CheckCardProps
}
from
"
@ant-design/pro-components
"
;
import
{
sendSelectCardResponse
,
sendSelectChainResponse
,
}
from
"
@/api/ocgcore/ocgHelper
"
;
import
{
ThunderboltOutlined
}
from
"
@ant-design/icons
"
;
import
{
store
}
from
"
@/store
"
;
import
NeosConfig
from
"
../../../../neos.config.json
"
;
import
{
DragModal
}
from
"
./DragModal
"
;
import
{
selectHint
}
from
"
@/reducers/duel/hintSlice
"
;
export
const
CheckCardModal
=
()
=>
{
const
dispatch
=
store
.
dispatch
;
...
...
src/ui/Duel/Message/checkCardModalV2.tsx
View file @
f7b96892
import
{
CheckCard
}
from
"
@ant-design/pro-components
"
;
import
{
Button
,
Card
,
Col
,
Row
}
from
"
antd
"
;
import
React
from
"
react
"
;
import
{
sendSelectUnselectCardResponse
}
from
"
@/api/ocgcore/ocgHelper
"
;
import
{
useAppSelector
}
from
"
@/hook
"
;
import
{
store
}
from
"
@/store
"
;
import
{
Button
,
Card
,
Row
,
Col
}
from
"
antd
"
;
import
{
CheckCard
}
from
"
@ant-design/pro-components
"
;
import
{
selectHint
}
from
"
@/reducers/duel/hintSlice
"
;
import
{
resetCheckCardModalV2
,
setCheckCardModalV2IsOpen
,
setCheckCardModalV2ResponseAble
,
}
from
"
@/reducers/duel/mod
"
;
import
{
selectCheckCardModalV2CancelAble
,
selectCheckCardModalV2FinishAble
,
...
...
@@ -12,15 +19,10 @@ import {
selectCheckCardModalV2SelectAbleOptions
,
selectCheckCardModalV2SelectedOptions
,
}
from
"
@/reducers/duel/modal/checkCardModalV2Slice
"
;
import
{
sendSelectUnselectCardResponse
}
from
"
@/api/ocgcore/ocgHelper
"
;
import
{
resetCheckCardModalV2
,
setCheckCardModalV2IsOpen
,
setCheckCardModalV2ResponseAble
,
}
from
"
@/reducers/duel/mod
"
;
import
{
store
}
from
"
@/store
"
;
import
NeosConfig
from
"
../../../../neos.config.json
"
;
import
{
DragModal
}
from
"
./DragModal
"
;
import
{
selectHint
}
from
"
@/reducers/duel/hintSlice
"
;
export
const
CheckCardModalV2
=
()
=>
{
const
dispatch
=
store
.
dispatch
;
...
...
src/ui/Duel/Message/checkCardModalV3.tsx
View file @
f7b96892
import
React
,
{
useState
}
from
"
react
"
;
import
{
useAppSelector
}
from
"
@/hook
"
;
import
{
store
}
from
"
@/store
"
;
import
{
Button
,
Card
,
Row
,
Col
}
from
"
antd
"
;
import
{
CheckCard
}
from
"
@ant-design/pro-components
"
;
import
{
Button
,
Card
,
Col
,
Row
}
from
"
antd
"
;
import
React
,
{
useState
}
from
"
react
"
;
import
{
sendSelectCardResponse
}
from
"
@/api/ocgcore/ocgHelper
"
;
import
{
useAppSelector
}
from
"
@/hook
"
;
import
{
selectHint
}
from
"
@/reducers/duel/hintSlice
"
;
import
{
resetCheckCardModalV3
,
setCheckCardModalV3IsOpen
,
setCheckCardModalV3ResponseAble
,
}
from
"
@/reducers/duel/mod
"
;
import
NeosConfig
from
"
../../../../neos.config.json
"
;
import
{
selectCheckCardModalV3
}
from
"
@/reducers/duel/modal/checkCardModalV3Slice
"
;
import
{
store
}
from
"
@/store
"
;
import
NeosConfig
from
"
../../../../neos.config.json
"
;
import
{
DragModal
}
from
"
./DragModal
"
;
import
{
selectHint
}
from
"
@/reducers/duel/hintSlice
"
;
export
const
CheckCardModalV3
=
()
=>
{
const
dispatch
=
store
.
dispatch
;
...
...
src/ui/Duel/Message/checkCounterModal.tsx
View file @
f7b96892
import
{
Button
,
Row
,
Col
,
Card
,
InputNumber
}
from
"
antd
"
;
import
{
Button
,
Card
,
Col
,
InputNumber
,
Row
}
from
"
antd
"
;
import
React
,
{
useState
}
from
"
react
"
;
import
{
sendSelectCounterResponse
}
from
"
@/api/ocgcore/ocgHelper
"
;
import
{
fetchStrings
}
from
"
@/api/strings
"
;
import
{
useAppSelector
}
from
"
@/hook
"
;
import
{
clearCheckCounter
}
from
"
@/reducers/duel/mod
"
;
import
{
selectCheckCounterModal
}
from
"
@/reducers/duel/modal/checkCounterModalSlice
"
;
import
{
store
}
from
"
@/store
"
;
import
{
DragModal
}
from
"
./DragModal
"
;
import
NeosConfig
from
"
../../../../neos.config.json
"
;
import
{
DragModal
}
from
"
./DragModal
"
;
export
const
CheckCounterModal
=
()
=>
{
const
dispatch
=
store
.
dispatch
;
...
...
src/ui/Duel/Message/dragModal.tsx
View file @
f7b96892
// 经过封装的可拖拽`Modal`
import
{
Modal
,
ModalProps
}
from
"
antd
"
;
import
React
,
{
useRef
,
useState
}
from
"
react
"
;
import
type
{
DraggableData
,
DraggableEvent
}
from
"
react-draggable
"
;
import
Draggable
from
"
react-draggable
"
;
import
{
Modal
,
ModalProps
}
from
"
antd
"
;
export
interface
DragModalProps
extends
ModalProps
{}
...
...
src/ui/Duel/Message/hintNotification.tsx
View file @
f7b96892
import
{
notification
}
from
"
antd
"
;
import
React
,
{
useEffect
}
from
"
react
"
;
import
{
useNavigate
}
from
"
react-router-dom
"
;
import
{
ygopro
}
from
"
@/api/ocgcore/idl/ocgcore
"
;
import
{
useAppSelector
}
from
"
@/hook
"
;
import
{
selectHint
}
from
"
@/reducers/duel/hintSlice
"
;
import
{
selectCurrentPhase
}
from
"
@/reducers/duel/phaseSlice
"
;
import
{
notification
}
from
"
antd
"
;
import
{
selectDuelResult
,
selectWaiting
}
from
"
@/reducers/duel/mod
"
;
import
{
useNavigate
}
from
"
react-router-dom
"
;
import
{
ygopro
}
from
"
@/api/ocgcore/idl/ocgcore
"
;
import
{
selectCurrentPhase
}
from
"
@/reducers/duel/phaseSlice
"
;
import
MsgWin
=
ygopro
.
StocGameMessage
.
MsgWin
;
import
NeosConfig
from
"
../../../../neos.config.json
"
;
...
...
src/ui/Duel/Message/optionModal.tsx
View file @
f7b96892
import
{
CheckCard
}
from
"
@ant-design/pro-components
"
;
import
{
Button
}
from
"
antd
"
;
import
React
,
{
useState
}
from
"
react
"
;
import
{
sendSelectOptionResponse
}
from
"
@/api/ocgcore/ocgHelper
"
;
import
{
useAppSelector
}
from
"
@/hook
"
;
import
{
store
}
from
"
@/store
"
;
import
{
Button
}
from
"
antd
"
;
import
{
CheckCard
}
from
"
@ant-design/pro-components
"
;
import
{
resetOptionModal
,
setOptionModalIsOpen
}
from
"
@/reducers/duel/mod
"
;
import
{
selectOptionModalIsOpen
,
selectOptionModalOptions
,
}
from
"
@/reducers/duel/modal/mod
"
;
import
{
s
endSelectOptionResponse
}
from
"
@/api/ocgcore/ocgHelper
"
;
import
{
resetOptionModal
,
setOptionModalIsOpen
}
from
"
@/reducers/duel/mod
"
;
import
{
s
tore
}
from
"
@/store
"
;
import
{
DragModal
}
from
"
./DragModal
"
;
export
const
OptionModal
=
()
=>
{
...
...
src/ui/Duel/Message/phase.tsx
View file @
f7b96892
import
Icon
from
"
@ant-design/icons
"
;
import
{
Button
,
Modal
,
Space
}
from
"
antd
"
;
import
React
,
{
useState
}
from
"
react
"
;
import
{
store
}
from
"
@/store
"
;
import
{
useAppSelector
}
from
"
@/hook
"
;
import
{
selectCurrentPhase
,
selectEnableBp
,
selectEnableEp
,
selectEnableM2
,
}
from
"
@/reducers/duel/phaseSlice
"
;
import
{
sendSelectBattleCmdResponse
,
sendSelectIdleCmdResponse
,
sendSurrender
,
}
from
"
@/api/ocgcore/ocgHelper
"
;
import
{
useAppSelector
}
from
"
@/hook
"
;
import
{
clearAllIdleInteractivities
,
setEnableBp
,
setEnableEp
,
setEnableM2
,
}
from
"
@/reducers/duel/mod
"
;
import
{
Button
,
Modal
,
Space
}
from
"
antd
"
;
import
Icon
from
"
@ant-design/icons
"
;
import
{
selectCurrentPhase
,
selectEnableBp
,
selectEnableEp
,
selectEnableM2
,
}
from
"
@/reducers/duel/phaseSlice
"
;
import
{
store
}
from
"
@/store
"
;
import
{
ReactComponent
as
BattleSvg
}
from
"
../../../../neos-assets/crossed-swords.svg
"
;
import
{
ReactComponent
as
Main2Svg
}
from
"
../../../../neos-assets/sword-in-stone.svg
"
;
import
{
ReactComponent
as
EpSvg
}
from
"
../../../../neos-assets/power-button.svg
"
;
import
{
ReactComponent
as
Main2Svg
}
from
"
../../../../neos-assets/sword-in-stone.svg
"
;
import
{
ReactComponent
as
SurrenderSvg
}
from
"
../../../../neos-assets/truce.svg
"
;
const
IconSize
=
"
150%
"
;
...
...
src/ui/Duel/Message/positionModal.tsx
View file @
f7b96892
import
React
,
{
useState
}
from
"
react
"
;
import
{
useAppSelector
}
from
"
@/hook
"
;
import
{
store
}
from
"
@/store
"
;
import
{
CheckCard
}
from
"
@ant-design/pro-components
"
;
import
{
Button
}
from
"
antd
"
;
import
{
sendSelectPositionResponse
}
from
"
@/api/ocgcore/ocgHelper
"
;
import
{
selectPositionModalIsOpen
,
selectPositionModalPositions
,
}
from
"
@/reducers/duel/modal/mod
"
;
import
React
,
{
useState
}
from
"
react
"
;
import
{
ygopro
}
from
"
@/api/ocgcore/idl/ocgcore
"
;
import
{
sendSelectPositionResponse
}
from
"
@/api/ocgcore/ocgHelper
"
;
import
{
useAppSelector
}
from
"
@/hook
"
;
import
{
resetPositionModal
,
setPositionModalIsOpen
,
}
from
"
@/reducers/duel/mod
"
;
import
{
CheckCard
}
from
"
@ant-design/pro-components
"
;
import
{
selectPositionModalIsOpen
,
selectPositionModalPositions
,
}
from
"
@/reducers/duel/modal/mod
"
;
import
{
store
}
from
"
@/store
"
;
import
{
DragModal
}
from
"
./DragModal
"
;
export
const
PositionModal
=
()
=>
{
...
...
src/ui/Duel/Message/sendBox.tsx
View file @
f7b96892
import
React
,
{
useState
}
from
"
react
"
;
import
{
Input
,
Button
,
Row
,
Col
}
from
"
antd
"
;
import
{
SendOutlined
}
from
"
@ant-design/icons
"
;
import
{
Button
,
Col
,
Input
,
Row
}
from
"
antd
"
;
import
React
,
{
useState
}
from
"
react
"
;
import
{
sendChat
}
from
"
@/api/ocgcore/ocgHelper
"
;
export
const
SendBox
=
()
=>
{
...
...
src/ui/Duel/Message/sortCardModal.tsx
View file @
f7b96892
import
React
,
{
useEffect
,
useState
}
from
"
react
"
;
import
{
DndContext
,
closestCenter
,
DndContext
,
DragEndEvent
,
KeyboardSensor
,
PointerSensor
,
useSensor
,
useSensors
,
DragEndEvent
,
}
from
"
@dnd-kit/core
"
;
import
{
arrayMove
,
SortableContext
,
sortableKeyboardCoordinates
,
verticalListSortingStrategy
,
useSortable
,
verticalListSortingStrategy
,
}
from
"
@dnd-kit/sortable
"
;
import
{
CSS
}
from
"
@dnd-kit/utilities
"
;
import
{
Button
,
Card
,
Modal
}
from
"
antd
"
;
import
React
,
{
useEffect
,
useState
}
from
"
react
"
;
import
{
CardMeta
}
from
"
@/api/cards
"
;
import
{
sendSortCardResponse
}
from
"
@/api/ocgcore/ocgHelper
"
;
import
{
useAppSelector
}
from
"
@/hook
"
;
import
{
resetSortCardModal
}
from
"
@/reducers/duel/mod
"
;
import
{
selectSortCardModal
}
from
"
@/reducers/duel/modal/sortCardModalSlice
"
;
import
{
sendSortCardResponse
}
from
"
@/api/ocgcore/ocgHelper
"
;
import
{
store
}
from
"
@/store
"
;
import
{
resetSortCardModal
}
from
"
@/reducers/duel/mod
"
;
import
{
Modal
,
Button
,
Card
}
from
"
antd
"
;
import
{
CardMeta
}
from
"
@/api/cards
"
;
import
NeosConfig
from
"
../../../../neos.config.json
"
;
export
const
SortCardModal
=
()
=>
{
...
...
src/ui/Duel/Message/status.tsx
View file @
f7b96892
import
React
from
"
react
"
;
import
{
UserOutlined
}
from
"
@ant-design/icons
"
;
import
{
Avatar
}
from
"
antd
"
;
import
{
CheckCard
}
from
"
@ant-design/pro-components
"
;
import
NeosConfig
from
"
../../../../neos.config.json
"
;
import
{
Avatar
}
from
"
antd
"
;
import
React
from
"
react
"
;
import
{
useAppSelector
}
from
"
@/hook
"
;
import
{
selectMeInitInfo
,
...
...
@@ -10,6 +10,8 @@ import {
}
from
"
@/reducers/duel/initInfoSlice
"
;
import
{
selectWaiting
}
from
"
@/reducers/duel/mod
"
;
import
NeosConfig
from
"
../../../../neos.config.json
"
;
const
Config
=
NeosConfig
.
ui
.
status
;
const
avatarSize
=
40
;
const
ME_VALUE
=
"
myself
"
;
...
...
src/ui/Duel/Message/timeLine.tsx
View file @
f7b96892
import
React
,
{
useEffect
,
useState
}
from
"
react
"
;
import
{
Timeline
,
TimelineItemProps
}
from
"
antd
"
;
import
{
MessageOutlined
}
from
"
@ant-design/icons
"
;
import
{
Timeline
,
TimelineItemProps
}
from
"
antd
"
;
import
React
,
{
useEffect
,
useState
}
from
"
react
"
;
import
{
useAppSelector
}
from
"
@/hook
"
;
import
{
selectChat
}
from
"
@/reducers/chatSlice
"
;
...
...
src/ui/Duel/Message/yesNoModal.tsx
View file @
f7b96892
import
React
from
"
react
"
;
import
{
useAppSelector
}
from
"
@/hook
"
;
import
{
store
}
from
"
@/store
"
;
import
{
Button
}
from
"
antd
"
;
import
React
from
"
react
"
;
import
{
sendSelectEffectYnResponse
}
from
"
@/api/ocgcore/ocgHelper
"
;
import
{
useAppSelector
}
from
"
@/hook
"
;
import
{
selectHint
}
from
"
@/reducers/duel/hintSlice
"
;
import
{
setYesNoModalIsOpen
}
from
"
@/reducers/duel/mod
"
;
import
{
selectYesNoModalIsOpen
,
selectYesNOModalMsg
,
}
from
"
@/reducers/duel/modal/mod
"
;
import
{
setYesNoModalIsOpen
}
from
"
@/reducers/duel/mod
"
;
import
{
store
}
from
"
@/store
"
;
import
{
DragModal
}
from
"
./DragModal
"
;
import
{
selectHint
}
from
"
@/reducers/duel/hintSlice
"
;
export
const
YesNoModal
=
()
=>
{
const
dispatch
=
store
.
dispatch
;
...
...
src/ui/Duel/PlayMat/BanishedZone.tsx
View file @
f7b96892
import
*
as
BABYLON
from
"
@babylonjs/core
"
;
import
{
useAppSelector
}
from
"
@/hook
"
;
import
{
selectMeExclusion
,
selectopExclusion
,
}
from
"
@/reducers/duel/exclusionSlice
"
;
import
{
SingleSlot
,
Depth
}
from
"
./SingleSlot
"
;
import
NeosConfig
from
"
../../../../neos.config.json
"
;
import
{
cardSlotRotation
}
from
"
../utils
"
;
import
{
Depth
,
SingleSlot
}
from
"
./SingleSlot
"
;
export
const
BanishedZone
=
()
=>
{
const
meExclusion
=
useAppSelector
(
selectMeExclusion
).
inner
;
...
...
src/ui/Duel/PlayMat/Deck.tsx
View file @
f7b96892
import
*
as
BABYLON
from
"
@babylonjs/core
"
;
import
{
useAppSelector
}
from
"
@/hook
"
;
import
{
selectMeDeck
,
selectOpDeck
}
from
"
@/reducers/duel/deckSlice
"
;
import
{
SingleSlot
,
Depth
}
from
"
./SingleSlot
"
;
import
{
cardSlotRotation
}
from
"
../utils
"
;
import
NeosConfig
from
"
../../../../neos.config.json
"
;
import
{
cardSlotRotation
}
from
"
../utils
"
;
import
{
Depth
,
SingleSlot
}
from
"
./SingleSlot
"
;
export
const
CommonDeck
=
()
=>
{
const
meDeck
=
useAppSelector
(
selectMeDeck
).
inner
;
...
...
src/ui/Duel/PlayMat/ExtraDeck.tsx
View file @
f7b96892
import
{
SingleSlot
,
Depth
}
from
"
./SingleSlot
"
;
import
*
as
BABYLON
from
"
@babylonjs/core
"
;
import
{
useAppSelector
}
from
"
@/hook
"
;
import
{
selectMeExtraDeck
,
selectOpExtraDeck
,
}
from
"
@/reducers/duel/extraDeckSlice
"
;
import
NeosConfig
from
"
../../../../neos.config.json
"
;
import
{
cardSlotRotation
}
from
"
../utils
"
;
import
{
Depth
,
SingleSlot
}
from
"
./SingleSlot
"
;
export
const
ExtraDeck
=
()
=>
{
const
meExtraDeck
=
useAppSelector
(
selectMeExtraDeck
).
inner
;
...
...
src/ui/Duel/PlayMat/Field.tsx
View file @
f7b96892
import
*
as
BABYLON
from
"
@babylonjs/core
"
;
import
{
useAppSelector
}
from
"
@/hook
"
;
import
{
selectMeMagics
,
selectOpMagics
}
from
"
@/reducers/duel/magicSlice
"
;
import
{
clearMagicPlaceInteractivities
}
from
"
@/reducers/duel/mod
"
;
import
{
FixedSlot
}
from
"
./FixedSlot
"
;
import
{
Depth
}
from
"
./SingleSlot
"
;
import
NeosConfig
from
"
../../../../neos.config.json
"
;
import
{
cardSlotRotation
}
from
"
../utils
"
;
import
{
FixedSlot
}
from
"
./FixedSlot
"
;
import
{
Depth
}
from
"
./SingleSlot
"
;
export
const
Field
=
()
=>
{
const
meField
=
useAppSelector
(
selectMeMagics
).
inner
.
find
(
...
...
src/ui/Duel/PlayMat/FixedSlot.tsx
View file @
f7b96892
import
*
as
BABYLON
from
"
@babylonjs/core
"
;
import
{
store
}
from
"
@/store
"
;
import
{
CardState
}
from
"
@/reducers/duel/generic
"
;
import
{
ActionCreatorWithPayload
}
from
"
@reduxjs/toolkit
"
;
import
{
useRef
}
from
"
react
"
;
import
{
useClick
}
from
"
@/hook
"
;
import
{
sendSelectPlaceResponse
}
from
"
@/api/ocgcore/ocgHelper
"
;
import
{
ygopro
}
from
"
@/api/ocgcore/idl/ocgcore
"
;
import
{
sendSelectPlaceResponse
}
from
"
@/api/ocgcore/ocgHelper
"
;
import
{
useClick
}
from
"
@/hook
"
;
import
{
CardState
}
from
"
@/reducers/duel/generic
"
;
import
{
setCardListModalInfo
,
setCardListModalIsOpen
,
...
...
@@ -13,9 +14,10 @@ import {
setCardModalIsOpen
,
setCardModalMeta
,
}
from
"
@/reducers/duel/mod
"
;
import
{
ActionCreatorWithPayload
}
from
"
@reduxjs/toolkit
"
;
import
{
interactTypeToString
}
from
"
../utils
"
;
import
{
store
}
from
"
@/store
"
;
import
NeosConfig
from
"
../../../../neos.config.json
"
;
import
{
interactTypeToString
}
from
"
../utils
"
;
const
transform
=
NeosConfig
.
ui
.
card
.
transform
;
const
defenceRotation
=
NeosConfig
.
ui
.
card
.
defenceRotation
;
...
...
src/ui/Duel/PlayMat/Graveyard.tsx
View file @
f7b96892
import
*
as
BABYLON
from
"
@babylonjs/core
"
;
import
{
useAppSelector
}
from
"
@/hook
"
;
import
{
selectMeCemetery
,
selectOpCemetery
,
}
from
"
@/reducers/duel/cemeretySlice
"
;
import
{
useAppSelector
}
from
"
@/hook
"
;
import
{
SingleSlot
,
Depth
}
from
"
./SingleSlot
"
;
import
{
cardSlotRotation
}
from
"
../utils
"
;
import
NeosConfig
from
"
../../../../neos.config.json
"
;
import
{
cardSlotRotation
}
from
"
../utils
"
;
import
{
Depth
,
SingleSlot
}
from
"
./SingleSlot
"
;
export
const
Graveyard
=
()
=>
{
const
meCemetery
=
useAppSelector
(
selectMeCemetery
).
inner
;
...
...
src/ui/Duel/PlayMat/Hands.tsx
View file @
f7b96892
import
*
as
BABYLON
from
"
@babylonjs/core
"
;
import
{
useEffect
,
useRef
,
useState
}
from
"
react
"
;
import
{
useHover
}
from
"
react-babylonjs
"
;
import
{
useAppSelector
,
useClick
}
from
"
@/hook
"
;
import
{
selectMeHands
,
selectOpHands
}
from
"
@/reducers/duel/handsSlice
"
;
import
{
CardState
}
from
"
@/reducers/duel/generic
"
;
import
{
selectMeHands
,
selectOpHands
}
from
"
@/reducers/duel/handsSlice
"
;
import
{
setCardModalInteractivies
,
setCardModalIsOpen
,
setCardModalMeta
,
setCardModalInteractivies
,
}
from
"
@/reducers/duel/mod
"
;
import
{
store
}
from
"
@/store
"
;
import
{
useHover
}
from
"
react-babylonjs
"
;
import
{
useState
,
useRef
,
useEffect
}
from
"
react
"
;
import
{
useSpring
,
animated
}
from
"
../spring
"
;
import
{
zip
,
interactTypeToString
}
from
"
../utils
"
;
import
NeosConfig
from
"
../../../../neos.config.json
"
;
import
{
animated
,
useSpring
}
from
"
../spring
"
;
import
{
interactTypeToString
,
zip
}
from
"
../utils
"
;
const
groundShape
=
NeosConfig
.
ui
.
ground
;
const
left
=
-
(
groundShape
.
width
/
2
);
...
...
src/ui/Duel/PlayMat/Magics.tsx
View file @
f7b96892
import
*
as
BABYLON
from
"
@babylonjs/core
"
;
import
{
selectMeMagics
,
selectOpMagics
}
from
"
@/reducers/duel/magicSlice
"
;
import
{
CardState
}
from
"
@/reducers/duel/generic
"
;
import
{
useAppSelector
}
from
"
@/hook
"
;
import
{
zip
,
cardSlotRotation
}
from
"
../utils
"
;
import
{
FixedSlot
}
from
"
./FixedSlot
"
;
import
{
CardState
}
from
"
@/reducers/duel/generic
"
;
import
{
selectMeMagics
,
selectOpMagics
}
from
"
@/reducers/duel/magicSlice
"
;
import
{
clearMagicPlaceInteractivities
}
from
"
@/reducers/duel/mod
"
;
import
NeosConfig
from
"
../../../../neos.config.json
"
;
import
{
cardSlotRotation
,
zip
}
from
"
../utils
"
;
import
{
FixedSlot
}
from
"
./FixedSlot
"
;
// TODO: use config
const
left
=
-
2.15
;
...
...
src/ui/Duel/PlayMat/Monsters.tsx
View file @
f7b96892
import
*
as
BABYLON
from
"
@babylonjs/core
"
;
import
{
CardState
}
from
"
@/reducers/duel/generic
"
;
import
"
react-babylonjs
"
;
import
*
as
BABYLON
from
"
@babylonjs/core
"
;
import
{
useAppSelector
}
from
"
@/hook
"
;
import
{
CardState
}
from
"
@/reducers/duel/generic
"
;
import
{
clearMonsterPlaceInteractivities
}
from
"
@/reducers/duel/mod
"
;
import
{
selectMeMonsters
,
selectOpMonsters
,
}
from
"
@/reducers/duel/monstersSlice
"
;
import
{
zip
,
cardSlotRotation
,
cardSlotDefenceRotation
}
from
"
../utils
"
;
import
{
FixedSlot
}
from
"
./FixedSlot
"
;
import
{
clearMonsterPlaceInteractivities
}
from
"
@/reducers/duel/mod
"
;
import
NeosConfig
from
"
../../../../neos.config.json
"
;
import
{
cardSlotDefenceRotation
,
cardSlotRotation
,
zip
}
from
"
../utils
"
;
import
{
FixedSlot
}
from
"
./FixedSlot
"
;
const
transform
=
NeosConfig
.
ui
.
card
.
transform
;
const
floating
=
NeosConfig
.
ui
.
card
.
floating
;
...
...
src/ui/Duel/PlayMat/SingleSlot.tsx
View file @
f7b96892
import
*
as
BABYLON
from
"
@babylonjs/core
"
;
import
{
CardState
}
from
"
@/reducers/duel/generic
"
;
import
{
store
}
from
"
@/store
"
;
import
{
useClick
}
from
"
@/hook
"
;
import
{
useRef
}
from
"
react
"
;
import
{
useClick
}
from
"
@/hook
"
;
import
{
CardState
}
from
"
@/reducers/duel/generic
"
;
import
{
setCardListModalInfo
,
setCardListModalIsOpen
,
}
from
"
@/reducers/duel/mod
"
;
import
{
interactTypeToString
}
from
"
../utils
"
;
import
{
store
}
from
"
@/store
"
;
import
NeosConfig
from
"
../../../../neos.config.json
"
;
import
{
interactTypeToString
}
from
"
../utils
"
;
const
transform
=
NeosConfig
.
ui
.
card
.
transform
;
export
const
Depth
=
0.005
;
...
...
src/ui/Duel/PlayMat/deck.tsx
View file @
f7b96892
import
*
as
BABYLON
from
"
@babylonjs/core
"
;
import
{
useAppSelector
}
from
"
@/hook
"
;
import
{
selectMeDeck
,
selectOpDeck
}
from
"
@/reducers/duel/deckSlice
"
;
import
{
SingleSlot
,
Depth
}
from
"
./SingleSlot
"
;
import
{
cardSlotRotation
}
from
"
../utils
"
;
import
NeosConfig
from
"
../../../../neos.config.json
"
;
import
{
cardSlotRotation
}
from
"
../utils
"
;
import
{
Depth
,
SingleSlot
}
from
"
./SingleSlot
"
;
export
const
CommonDeck
=
()
=>
{
const
meDeck
=
useAppSelector
(
selectMeDeck
).
inner
;
...
...
src/ui/Duel/PlayMat/extraDeck.tsx
View file @
f7b96892
import
{
SingleSlot
,
Depth
}
from
"
./SingleSlot
"
;
import
*
as
BABYLON
from
"
@babylonjs/core
"
;
import
{
useAppSelector
}
from
"
@/hook
"
;
import
{
selectMeExtraDeck
,
selectOpExtraDeck
,
}
from
"
@/reducers/duel/extraDeckSlice
"
;
import
NeosConfig
from
"
../../../../neos.config.json
"
;
import
{
cardSlotRotation
}
from
"
../utils
"
;
import
{
Depth
,
SingleSlot
}
from
"
./SingleSlot
"
;
export
const
ExtraDeck
=
()
=>
{
const
meExtraDeck
=
useAppSelector
(
selectMeExtraDeck
).
inner
;
...
...
src/ui/Duel/PlayMat/field.tsx
View file @
f7b96892
import
*
as
BABYLON
from
"
@babylonjs/core
"
;
import
{
useAppSelector
}
from
"
@/hook
"
;
import
{
selectMeMagics
,
selectOpMagics
}
from
"
@/reducers/duel/magicSlice
"
;
import
{
clearMagicPlaceInteractivities
}
from
"
@/reducers/duel/mod
"
;
import
{
FixedSlot
}
from
"
./FixedSlot
"
;
import
{
Depth
}
from
"
./SingleSlot
"
;
import
NeosConfig
from
"
../../../../neos.config.json
"
;
import
{
cardSlotRotation
}
from
"
../utils
"
;
import
{
FixedSlot
}
from
"
./FixedSlot
"
;
import
{
Depth
}
from
"
./SingleSlot
"
;
export
const
Field
=
()
=>
{
const
meField
=
useAppSelector
(
selectMeMagics
).
inner
.
find
(
...
...
src/ui/Duel/PlayMat/fixedSlot.tsx
View file @
f7b96892
import
*
as
BABYLON
from
"
@babylonjs/core
"
;
import
{
store
}
from
"
@/store
"
;
import
{
CardState
}
from
"
@/reducers/duel/generic
"
;
import
{
ActionCreatorWithPayload
}
from
"
@reduxjs/toolkit
"
;
import
{
useRef
}
from
"
react
"
;
import
{
useClick
}
from
"
@/hook
"
;
import
{
sendSelectPlaceResponse
}
from
"
@/api/ocgcore/ocgHelper
"
;
import
{
ygopro
}
from
"
@/api/ocgcore/idl/ocgcore
"
;
import
{
sendSelectPlaceResponse
}
from
"
@/api/ocgcore/ocgHelper
"
;
import
{
useClick
}
from
"
@/hook
"
;
import
{
CardState
}
from
"
@/reducers/duel/generic
"
;
import
{
setCardListModalInfo
,
setCardListModalIsOpen
,
...
...
@@ -13,9 +14,10 @@ import {
setCardModalIsOpen
,
setCardModalMeta
,
}
from
"
@/reducers/duel/mod
"
;
import
{
ActionCreatorWithPayload
}
from
"
@reduxjs/toolkit
"
;
import
{
interactTypeToString
}
from
"
../utils
"
;
import
{
store
}
from
"
@/store
"
;
import
NeosConfig
from
"
../../../../neos.config.json
"
;
import
{
interactTypeToString
}
from
"
../utils
"
;
const
transform
=
NeosConfig
.
ui
.
card
.
transform
;
const
defenceRotation
=
NeosConfig
.
ui
.
card
.
defenceRotation
;
...
...
src/ui/Duel/PlayMat/hands.tsx
View file @
f7b96892
import
*
as
BABYLON
from
"
@babylonjs/core
"
;
import
{
useEffect
,
useRef
,
useState
}
from
"
react
"
;
import
{
useHover
}
from
"
react-babylonjs
"
;
import
{
useAppSelector
,
useClick
}
from
"
@/hook
"
;
import
{
selectMeHands
,
selectOpHands
}
from
"
@/reducers/duel/handsSlice
"
;
import
{
CardState
}
from
"
@/reducers/duel/generic
"
;
import
{
selectMeHands
,
selectOpHands
}
from
"
@/reducers/duel/handsSlice
"
;
import
{
setCardModalInteractivies
,
setCardModalIsOpen
,
setCardModalMeta
,
setCardModalInteractivies
,
}
from
"
@/reducers/duel/mod
"
;
import
{
store
}
from
"
@/store
"
;
import
{
useHover
}
from
"
react-babylonjs
"
;
import
{
useState
,
useRef
,
useEffect
}
from
"
react
"
;
import
{
useSpring
,
animated
}
from
"
../spring
"
;
import
{
zip
,
interactTypeToString
}
from
"
../utils
"
;
import
NeosConfig
from
"
../../../../neos.config.json
"
;
import
{
animated
,
useSpring
}
from
"
../spring
"
;
import
{
interactTypeToString
,
zip
}
from
"
../utils
"
;
const
groundShape
=
NeosConfig
.
ui
.
ground
;
const
left
=
-
(
groundShape
.
width
/
2
);
...
...
src/ui/Duel/PlayMat/index.ts
View file @
f7b96892
export
*
from
"
./FixedSlot
"
;
export
*
from
"
./SingleSlot
"
;
export
*
from
"
./BanishedZone
"
;
export
*
from
"
./Deck
"
;
export
*
from
"
./ExtraDeck
"
;
export
*
from
"
./Field
"
;
export
*
from
"
./FixedSlot
"
;
export
*
from
"
./Graveyard
"
;
export
*
from
"
./Hands
"
;
export
*
from
"
./Magics
"
;
export
*
from
"
./Monsters
"
;
export
*
from
"
./SingleSlot
"
;
src/ui/Duel/PlayMat/magics.tsx
View file @
f7b96892
import
*
as
BABYLON
from
"
@babylonjs/core
"
;
import
{
selectMeMagics
,
selectOpMagics
}
from
"
@/reducers/duel/magicSlice
"
;
import
{
CardState
}
from
"
@/reducers/duel/generic
"
;
import
{
useAppSelector
}
from
"
@/hook
"
;
import
{
zip
,
cardSlotRotation
}
from
"
../utils
"
;
import
{
FixedSlot
}
from
"
./FixedSlot
"
;
import
{
CardState
}
from
"
@/reducers/duel/generic
"
;
import
{
selectMeMagics
,
selectOpMagics
}
from
"
@/reducers/duel/magicSlice
"
;
import
{
clearMagicPlaceInteractivities
}
from
"
@/reducers/duel/mod
"
;
import
NeosConfig
from
"
../../../../neos.config.json
"
;
import
{
cardSlotRotation
,
zip
}
from
"
../utils
"
;
import
{
FixedSlot
}
from
"
./FixedSlot
"
;
// TODO: use config
const
left
=
-
2.15
;
...
...
src/ui/Duel/PlayMat/monsters.tsx
View file @
f7b96892
import
*
as
BABYLON
from
"
@babylonjs/core
"
;
import
{
CardState
}
from
"
@/reducers/duel/generic
"
;
import
"
react-babylonjs
"
;
import
*
as
BABYLON
from
"
@babylonjs/core
"
;
import
{
useAppSelector
}
from
"
@/hook
"
;
import
{
CardState
}
from
"
@/reducers/duel/generic
"
;
import
{
clearMonsterPlaceInteractivities
}
from
"
@/reducers/duel/mod
"
;
import
{
selectMeMonsters
,
selectOpMonsters
,
}
from
"
@/reducers/duel/monstersSlice
"
;
import
{
zip
,
cardSlotRotation
,
cardSlotDefenceRotation
}
from
"
../utils
"
;
import
{
FixedSlot
}
from
"
./FixedSlot
"
;
import
{
clearMonsterPlaceInteractivities
}
from
"
@/reducers/duel/mod
"
;
import
NeosConfig
from
"
../../../../neos.config.json
"
;
import
{
cardSlotDefenceRotation
,
cardSlotRotation
,
zip
}
from
"
../utils
"
;
import
{
FixedSlot
}
from
"
./FixedSlot
"
;
const
transform
=
NeosConfig
.
ui
.
card
.
transform
;
const
floating
=
NeosConfig
.
ui
.
card
.
floating
;
...
...
src/ui/Duel/PlayMat/singleSlot.tsx
View file @
f7b96892
import
*
as
BABYLON
from
"
@babylonjs/core
"
;
import
{
CardState
}
from
"
@/reducers/duel/generic
"
;
import
{
store
}
from
"
@/store
"
;
import
{
useClick
}
from
"
@/hook
"
;
import
{
useRef
}
from
"
react
"
;
import
{
useClick
}
from
"
@/hook
"
;
import
{
CardState
}
from
"
@/reducers/duel/generic
"
;
import
{
setCardListModalInfo
,
setCardListModalIsOpen
,
}
from
"
@/reducers/duel/mod
"
;
import
{
interactTypeToString
}
from
"
../utils
"
;
import
{
store
}
from
"
@/store
"
;
import
NeosConfig
from
"
../../../../neos.config.json
"
;
import
{
interactTypeToString
}
from
"
../utils
"
;
const
transform
=
NeosConfig
.
ui
.
card
.
transform
;
export
const
Depth
=
0.005
;
...
...
src/ui/Duel/layout.tsx
View file @
f7b96892
import
React
from
"
react
"
;
import
{
Layout
}
from
"
antd
"
;
import
React
from
"
react
"
;
import
NeosConfig
from
"
../../../neos.config.json
"
;
const
layoutConfig
=
NeosConfig
.
ui
.
layout
;
...
...
src/ui/Duel/main.tsx
View file @
f7b96892
import
*
as
BABYLON
from
"
@babylonjs/core
"
;
import
{
Row
}
from
"
antd
"
;
import
React
from
"
react
"
;
import
{
Engine
,
Scene
}
from
"
react-babylonjs
"
;
import
{
ReactReduxContext
,
Provider
}
from
"
react-redux
"
;
import
*
as
BABYLON
from
"
@babylonjs/core
"
;
import
{
Hands
,
Monsters
,
Magics
,
Field
,
Graveyard
,
ExtraDeck
,
}
from
"
./PlayMat
"
;
import
{
Provider
,
ReactReduxContext
}
from
"
react-redux
"
;
import
NeosConfig
from
"
../../../neos.config.json
"
;
import
NeosLayout
from
"
./Layout
"
;
import
{
CardModal
,
HintNotification
,
Alert
,
CardListModal
,
CardModal
,
CheckCardModal
,
YesNoModal
,
PositionModal
,
OptionModal
,
Phase
,
CheckCardModalV2
,
DuelTimeLine
,
SendBox
,
PlayerStatus
,
Alert
,
CheckCardModalV3
,
CheckCounterModal
,
DuelTimeLine
,
HintNotification
,
OptionModal
,
Phase
,
PlayerStatus
,
PositionModal
,
SendBox
,
SortCardModal
,
YesNoModal
,
}
from
"
./Message
"
;
import
{
CommonDeck
}
from
"
./PlayMat/Deck
"
;
import
{
ExtraDeck
,
Field
,
Graveyard
,
Hands
,
Magics
,
Monsters
,
}
from
"
./PlayMat
"
;
import
{
BanishedZone
}
from
"
./PlayMat/BanishedZone
"
;
import
NeosLayout
from
"
./Layout
"
;
import
NeosConfig
from
"
../../../neos.config.json
"
;
import
{
Row
}
from
"
antd
"
;
import
{
CommonDeck
}
from
"
./PlayMat/Deck
"
;
// Ref: https://github.com/brianzinn/react-babylonjs/issues/126
const
NeosDuel
=
()
=>
{
...
...
src/ui/Duel/spring/animated.ts
View file @
f7b96892
// Copyright (c) 2020 hooke
import
{
CSSProperties
,
ForwardRefExoticComponent
,
FC
}
from
"
react
"
;
import
{
FluidValue
}
from
"
@react-spring/shared
"
;
import
{
AssignableKeys
,
ComponentPropsWithRef
,
ElementType
,
}
from
"
@react-spring/types
"
;
import
{
CSSProperties
,
FC
,
ForwardRefExoticComponent
}
from
"
react
"
;
import
{
Primitives
}
from
"
./primitives
"
;
type
AnimatedPrimitives
=
{
...
...
src/ui/Duel/spring/index.ts
View file @
f7b96892
// Copyright (c) 2020 hooke
import
{
Globals
}
from
"
@react-spring/core
"
;
import
"
./customProps
"
;
import
{
createHost
}
from
"
@react-spring/animated
"
;
import
{
Globals
}
from
"
@react-spring/core
"
;
import
{
createStringInterpolator
}
from
"
@react-spring/shared
"
;
import
{
applyInitialPropsToInstance
}
from
"
react-babylonjs
"
;
import
{
primitives
}
from
"
./primitives
"
;
import
{
WithAnimated
}
from
"
./animated
"
;
import
"
./customProp
s
"
;
import
{
primitives
}
from
"
./primitive
s
"
;
// todo: frameLoop can use runRenderLoop
Globals
.
assign
({
...
...
src/ui/Duel/utils/cardSlot.ts
View file @
f7b96892
import
NeosConfig
from
"
../../../../neos.config.json
"
;
import
{
Vector3
}
from
"
@babylonjs/core
"
;
import
NeosConfig
from
"
../../../../neos.config.json
"
;
const
cardRotation
=
NeosConfig
.
ui
.
card
.
rotation
;
const
cardReverseRotation
=
NeosConfig
.
ui
.
card
.
reverseRotation
;
const
cardDefenceRotation
=
NeosConfig
.
ui
.
card
.
defenceRotation
;
...
...
src/ui/Duel/utils/index.ts
View file @
f7b96892
export
*
from
"
./zip
"
;
export
*
from
"
./interactTypeToString
"
;
export
*
from
"
./cardSlot
"
;
export
*
from
"
./interactTypeToString
"
;
export
*
from
"
./zip
"
;
src/ui/Login.tsx
View file @
f7b96892
...
...
@@ -6,13 +6,16 @@
* passWd: 房间密码。
*
* */
import
"
../styles/core.scss
"
;
import
{
Input
}
from
"
antd
"
;
import
React
,
{
useState
,
ChangeEvent
,
useEffect
}
from
"
react
"
;
import
React
,
{
ChangeEvent
,
useEffect
,
useState
}
from
"
react
"
;
import
{
useNavigate
}
from
"
react-router-dom
"
;
import
"
../styles/core.scss
"
;
import
NeosConfig
from
"
../../neos.config.json
"
;
import
{
useConfig
}
from
"
@/config
"
;
import
NeosConfig
from
"
../../neos.config.json
"
;
const
serverConfig
=
NeosConfig
.
servers
;
const
{
defaults
:
{
defaultPlayer
,
defaultPassword
},
...
...
src/ui/Mora.tsx
View file @
f7b96892
import
{
ScissorOutlined
,
SketchOutlined
,
TableOutlined
,
}
from
"
@ant-design/icons
"
;
import
{
Button
,
Modal
}
from
"
antd
"
;
import
React
,
{
useEffect
}
from
"
react
"
;
import
{
useNavigate
,
useParams
}
from
"
react-router-dom
"
;
import
{
sendHandResult
,
sendTpResult
}
from
"
@/api/ocgcore/ocgHelper
"
;
import
{
useAppSelector
}
from
"
@/hook
"
;
import
{
useConfig
}
from
"
@/config
"
;
import
{
useAppSelector
}
from
"
@/hook
"
;
import
{
selectDuelHsStart
}
from
"
@/reducers/duel/mod
"
;
import
{
selectHandSelectAble
,
unSelectHandAble
,
selectTpSelectAble
,
unSelectHandAble
,
unSelectTpAble
,
}
from
"
@/reducers/moraSlice
"
;
import
{
selectDuelHsStart
}
from
"
@/reducers/duel/mod
"
;
import
{
store
}
from
"
@/store
"
;
import
{
useNavigate
,
useParams
}
from
"
react-router-dom
"
;
import
{
Button
,
Modal
}
from
"
antd
"
;
import
{
ScissorOutlined
,
SketchOutlined
,
TableOutlined
,
}
from
"
@ant-design/icons
"
;
const
{
automation
:
{
isAiMode
,
isAiFirst
},
...
...
src/ui/Neos.tsx
View file @
f7b96892
import
React
,
{
Suspense
}
from
"
react
"
;
import
{
Routes
,
Route
}
from
"
react-router-dom
"
;
import
{
Route
,
Routes
}
from
"
react-router-dom
"
;
import
LazyLoad
,
{
Loading
}
from
"
./LazyLoad
"
;
const
Login
=
React
.
lazy
(()
=>
import
(
"
./Login
"
));
...
...
src/ui/WaitRoom.tsx
View file @
f7b96892
import
{
Modal
,
Checkbox
,
CheckCircleFilled
,
LoginOutlined
,
LogoutOutlined
,
SendOutlined
,
TagOutlined
,
UploadOutlined
,
UserOutlined
,
}
from
"
@ant-design/icons
"
;
import
type
{
UploadProps
}
from
"
antd
"
;
import
{
Avatar
,
Space
,
Button
,
notification
,
Upload
,
Checkbox
,
message
,
Modal
,
notification
,
Select
,
Space
,
Upload
,
}
from
"
antd
"
;
import
React
,
{
useEffect
,
useState
}
from
"
react
"
;
import
{
useNavigate
,
useParams
}
from
"
react-router-dom
"
;
import
React
,
{
useState
,
useEffect
}
from
"
react
"
;
import
rustInit
from
"
rust-src
"
;
import
YGOProDeck
from
"
ygopro-deck-encode
"
;
import
{
DeckManager
,
fetchDeck
,
type
IDeck
}
from
"
@/api/deck
"
;
import
{
sendHsReady
,
sendHsStart
,
sendUpdateDeck
,
}
from
"
@/api/ocgcore/ocgHelper
"
;
import
{
initStrings
}
from
"
@/api/strings
"
;
import
{
useConfig
}
from
"
@/config
"
;
import
{
useAppSelector
}
from
"
@/hook
"
;
import
socketMiddleWare
,
{
socketCmd
}
from
"
@/middleware/socket
"
;
import
sqliteMiddleWare
,
{
sqliteCmd
}
from
"
@/middleware/sqlite
"
;
import
{
store
}
from
"
@/store
"
;
import
{
selectChat
}
from
"
@/reducers/chatSlice
"
;
import
{
initMeExtraDeckMeta
}
from
"
@/reducers/duel/extraDeckSlice
"
;
import
{
selectJoined
}
from
"
@/reducers/joinSlice
"
;
import
{
selectDuelStart
}
from
"
@/reducers/moraSlice
"
;
import
{
selectIsHost
,
selectPlayer0
,
selectPlayer1
,
}
from
"
@/reducers/playerSlice
"
;
import
{
useAppSelector
}
from
"
@/hook
"
;
import
{
useConfig
}
from
"
@/config
"
;
import
{
selectJoined
}
from
"
@/reducers/joinSlice
"
;
import
{
selectChat
}
from
"
@/reducers/chatSlice
"
;
import
{
fetchDeck
,
type
IDeck
,
DeckManager
}
from
"
@/api/deck
"
;
import
{
sendUpdateDeck
,
sendHsReady
,
sendHsStart
,
}
from
"
@/api/ocgcore/ocgHelper
"
;
import
{
UserOutlined
,
CheckCircleFilled
,
LoginOutlined
,
LogoutOutlined
,
SendOutlined
,
TagOutlined
,
UploadOutlined
,
}
from
"
@ant-design/icons
"
;
import
{
initMeExtraDeckMeta
}
from
"
@/reducers/duel/extraDeckSlice
"
;
import
type
{
UploadProps
}
from
"
antd
"
;
import
{
selectDuelStart
}
from
"
@/reducers/moraSlice
"
;
import
{
store
}
from
"
@/store
"
;
import
NeosConfig
from
"
../../neos.config.json
"
;
import
YGOProDeck
from
"
ygopro-deck-encode
"
;
import
rustInit
from
"
rust-src
"
;
import
{
initStrings
}
from
"
@/api/strings
"
;
const
READY_STATE
=
"
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