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
67d5bd0d
Commit
67d5bd0d
authored
Apr 25, 2023
by
timel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: valtio store logic 100%, ui/mat
parent
0ee5f4d1
Changes
15
Show whitespace changes
Inline
Side-by-side
Showing
15 changed files
with
198 additions
and
86 deletions
+198
-86
src/env.d.ts
src/env.d.ts
+7
-0
src/ui/Duel/Message/CardListModal.tsx
src/ui/Duel/Message/CardListModal.tsx
+1
-1
src/ui/Duel/PlayMat/BanishedZone.tsx
src/ui/Duel/PlayMat/BanishedZone.tsx
+11
-4
src/ui/Duel/PlayMat/Deck.tsx
src/ui/Duel/PlayMat/Deck.tsx
+11
-4
src/ui/Duel/PlayMat/ExtraDeck.tsx
src/ui/Duel/PlayMat/ExtraDeck.tsx
+9
-4
src/ui/Duel/PlayMat/Field.tsx
src/ui/Duel/PlayMat/Field.tsx
+23
-10
src/ui/Duel/PlayMat/FixedSlot.tsx
src/ui/Duel/PlayMat/FixedSlot.tsx
+33
-25
src/ui/Duel/PlayMat/Graveyard.tsx
src/ui/Duel/PlayMat/Graveyard.tsx
+10
-4
src/ui/Duel/PlayMat/Hands.tsx
src/ui/Duel/PlayMat/Hands.tsx
+18
-4
src/ui/Duel/PlayMat/Magics.tsx
src/ui/Duel/PlayMat/Magics.tsx
+18
-7
src/ui/Duel/PlayMat/Monsters.tsx
src/ui/Duel/PlayMat/Monsters.tsx
+25
-13
src/ui/Duel/PlayMat/SingleSlot.tsx
src/ui/Duel/PlayMat/SingleSlot.tsx
+8
-10
src/valtioStores/matStore/types.ts
src/valtioStores/matStore/types.ts
+2
-0
src/valtioStores/messageStore/methods/clearAllPlaceInteradtivities.ts
...ores/messageStore/methods/clearAllPlaceInteradtivities.ts
+21
-0
src/valtioStores/messageStore/methods/index.ts
src/valtioStores/messageStore/methods/index.ts
+1
-0
No files found.
src/env.d.ts
View file @
67d5bd0d
...
@@ -10,3 +10,10 @@ interface ImportMetaEnv {
...
@@ -10,3 +10,10 @@ interface ImportMetaEnv {
interface
ImportMeta
{
interface
ImportMeta
{
readonly
env
:
ImportMetaEnv
;
readonly
env
:
ImportMetaEnv
;
}
}
// 重新声明useSnapshot,暂时先这么写。原版的会把所有的改成readonly,引发一些棘手的类型报错。
import
"
valtio/react
"
;
declare
module
"
valtio/react
"
{
export
declare
function
useSnapshot
<
T
extends
object
>
(
proxyObject
:
T
):
T
;
export
{};
}
src/ui/Duel/Message/CardListModal.tsx
View file @
67d5bd0d
...
@@ -16,6 +16,7 @@ import { store } from "@/store";
...
@@ -16,6 +16,7 @@ import { store } from "@/store";
import
{
import
{
messageStore
,
messageStore
,
matStore
,
clearAllIdleInteractivities
as
FIXME_clearAllIdleInteractivities
,
clearAllIdleInteractivities
as
FIXME_clearAllIdleInteractivities
,
}
from
"
@/valtioStores
"
;
}
from
"
@/valtioStores
"
;
import
{
useSnapshot
}
from
"
valtio
"
;
import
{
useSnapshot
}
from
"
valtio
"
;
...
@@ -44,7 +45,6 @@ export const CardListModal = () => {
...
@@ -44,7 +45,6 @@ export const CardListModal = () => {
<
Drawer
open=
{
isOpen
}
onClose=
{
handleOkOrCancel
}
>
<
Drawer
open=
{
isOpen
}
onClose=
{
handleOkOrCancel
}
>
<
List
<
List
itemLayout=
"horizontal"
itemLayout=
"horizontal"
// @ts-ignore 报错是因为类型不可变,实际上是没问题的
dataSource=
{
list
}
dataSource=
{
list
}
renderItem=
{
(
item
)
=>
(
renderItem=
{
(
item
)
=>
(
<
List
.
Item
<
List
.
Item
...
...
src/ui/Duel/PlayMat/BanishedZone.tsx
View file @
67d5bd0d
...
@@ -10,20 +10,27 @@ import {
...
@@ -10,20 +10,27 @@ import {
import
{
cardSlotRotation
}
from
"
../utils
"
;
import
{
cardSlotRotation
}
from
"
../utils
"
;
import
{
Depth
,
SingleSlot
}
from
"
./SingleSlot
"
;
import
{
Depth
,
SingleSlot
}
from
"
./SingleSlot
"
;
import
{
matStore
}
from
"
@/valtioStores
"
;
import
{
useSnapshot
}
from
"
valtio
"
;
const
NeosConfig
=
useConfig
();
const
NeosConfig
=
useConfig
();
export
const
BanishedZone
=
()
=>
{
export
const
BanishedZone
=
()
=>
{
const
meBanishedZone
=
useAppSelector
(
selectMeBanishedZone
).
inner
;
// const meBanishedZone = useAppSelector(selectMeBanishedZone).inner;
const
opBanishedZone
=
useAppSelector
(
selectOpBanishedZone
).
inner
;
// const opBanishedZone = useAppSelector(selectOpBanishedZone).inner;
const
meBanishedZone
=
useSnapshot
(
matStore
.
banishedZones
.
me
);
const
opBanishedZone
=
useSnapshot
(
matStore
.
banishedZones
.
op
);
return
(
return
(
<>
<>
<
SingleSlot
<
SingleSlot
state=
{
meBanishedZone
}
// 因为singleSlot里面会有snap,所以这儿可以直接传入store
state=
{
matStore
.
banishedZones
.
me
}
position=
{
banishedZonePosition
(
0
,
meBanishedZone
.
length
)
}
position=
{
banishedZonePosition
(
0
,
meBanishedZone
.
length
)
}
rotation=
{
cardSlotRotation
(
false
)
}
rotation=
{
cardSlotRotation
(
false
)
}
/>
/>
<
SingleSlot
<
SingleSlot
state=
{
opBanishedZone
}
state=
{
matStore
.
banishedZones
.
op
}
position=
{
banishedZonePosition
(
1
,
opBanishedZone
.
length
)
}
position=
{
banishedZonePosition
(
1
,
opBanishedZone
.
length
)
}
rotation=
{
cardSlotRotation
(
true
)
}
rotation=
{
cardSlotRotation
(
true
)
}
/>
/>
...
...
src/ui/Duel/PlayMat/Deck.tsx
View file @
67d5bd0d
...
@@ -8,19 +8,26 @@ import { cardSlotRotation } from "../utils";
...
@@ -8,19 +8,26 @@ import { cardSlotRotation } from "../utils";
import
{
Depth
,
SingleSlot
}
from
"
./SingleSlot
"
;
import
{
Depth
,
SingleSlot
}
from
"
./SingleSlot
"
;
const
NeosConfig
=
useConfig
();
const
NeosConfig
=
useConfig
();
import
{
matStore
}
from
"
@/valtioStores
"
;
import
{
useSnapshot
}
from
"
valtio
"
;
export
const
CommonDeck
=
()
=>
{
export
const
CommonDeck
=
()
=>
{
const
meDeck
=
useAppSelector
(
selectMeDeck
).
inner
;
// const meDeck = useAppSelector(selectMeDeck).inner;
const
opDeck
=
useAppSelector
(
selectOpDeck
).
inner
;
// const opDeck = useAppSelector(selectOpDeck).inner;
const
meDeck
=
useSnapshot
(
matStore
.
decks
.
me
);
const
opDeck
=
useSnapshot
(
matStore
.
decks
.
op
);
return
(
return
(
<>
<>
<
SingleSlot
<
SingleSlot
state=
{
m
eDeck
}
state=
{
m
atStore
.
decks
.
me
}
position=
{
deckPosition
(
0
,
meDeck
.
length
)
}
position=
{
deckPosition
(
0
,
meDeck
.
length
)
}
rotation=
{
cardSlotRotation
(
false
)
}
rotation=
{
cardSlotRotation
(
false
)
}
/>
/>
<
SingleSlot
<
SingleSlot
state=
{
opDeck
}
state=
{
matStore
.
decks
.
op
}
position=
{
deckPosition
(
1
,
opDeck
.
length
)
}
position=
{
deckPosition
(
1
,
opDeck
.
length
)
}
rotation=
{
cardSlotRotation
(
true
)
}
rotation=
{
cardSlotRotation
(
true
)
}
/>
/>
...
...
src/ui/Duel/PlayMat/ExtraDeck.tsx
View file @
67d5bd0d
...
@@ -12,19 +12,24 @@ import { Depth, SingleSlot } from "./SingleSlot";
...
@@ -12,19 +12,24 @@ import { Depth, SingleSlot } from "./SingleSlot";
const
NeosConfig
=
useConfig
();
const
NeosConfig
=
useConfig
();
import
{
matStore
}
from
"
@/valtioStores
"
;
import
{
useSnapshot
}
from
"
valtio
"
;
export
const
ExtraDeck
=
()
=>
{
export
const
ExtraDeck
=
()
=>
{
const
meExtraDeck
=
useAppSelector
(
selectMeExtraDeck
).
inner
;
// const meExtraDeck = useAppSelector(selectMeExtraDeck).inner;
const
opExtraDeck
=
useAppSelector
(
selectOpExtraDeck
).
inner
;
// const opExtraDeck = useAppSelector(selectOpExtraDeck).inner;
const
meExtraDeck
=
useSnapshot
(
matStore
.
extraDecks
.
me
);
const
opExtraDeck
=
useSnapshot
(
matStore
.
extraDecks
.
op
);
return
(
return
(
<>
<>
<
SingleSlot
<
SingleSlot
state=
{
m
eExtraDeck
}
state=
{
m
atStore
.
extraDecks
.
me
}
position=
{
extraDeckPosition
(
0
,
meExtraDeck
.
length
)
}
position=
{
extraDeckPosition
(
0
,
meExtraDeck
.
length
)
}
rotation=
{
cardSlotRotation
(
false
)
}
rotation=
{
cardSlotRotation
(
false
)
}
/>
/>
<
SingleSlot
<
SingleSlot
state=
{
opExtraDeck
}
state=
{
matStore
.
extraDecks
.
op
}
position=
{
extraDeckPosition
(
1
,
opExtraDeck
.
length
)
}
position=
{
extraDeckPosition
(
1
,
opExtraDeck
.
length
)
}
rotation=
{
cardSlotRotation
(
true
)
}
rotation=
{
cardSlotRotation
(
true
)
}
/>
/>
...
...
src/ui/Duel/PlayMat/Field.tsx
View file @
67d5bd0d
...
@@ -10,34 +10,47 @@ import { FixedSlot } from "./FixedSlot";
...
@@ -10,34 +10,47 @@ import { FixedSlot } from "./FixedSlot";
import
{
Depth
}
from
"
./SingleSlot
"
;
import
{
Depth
}
from
"
./SingleSlot
"
;
const
NeosConfig
=
useConfig
();
const
NeosConfig
=
useConfig
();
import
{
matStore
,
clearAllPlaceInteradtivities
}
from
"
@/valtioStores
"
;
import
{
useSnapshot
}
from
"
valtio
"
;
export
const
Field
=
()
=>
{
export
const
Field
=
()
=>
{
const
meField
=
useAppSelector
(
selectMeMagics
).
inner
.
find
(
// const meField = useAppSelector(selectMeMagics).inner.find(
(
_
,
sequence
)
=>
sequence
==
5
// (_, sequence) => sequence == 5
);
// );
const
opField
=
useAppSelector
(
selectOpMagics
).
inner
.
find
(
// const opField = useAppSelector(selectOpMagics).inner.find(
(
_
,
sequence
)
=>
sequence
==
5
// (_, sequence) => sequence == 5
);
// );
// 这儿的find可能是出于某种考虑,以后再深思
const
meField
=
useSnapshot
(
matStore
.
magics
.
me
[
5
]);
const
opField
=
useSnapshot
(
matStore
.
magics
.
op
[
5
]);
const
clearPlaceInteractivitiesAction
=
(
controller
:
number
)
=>
matStore
.
magics
.
of
(
controller
).
clearPlaceInteractivity
();
return
(
return
(
<>
<>
{
meField
?
(
{
meField
?
(
<
FixedSlot
<
FixedSlot
state=
{
meField
}
s
napS
tate=
{
meField
}
sequence=
{
0
}
sequence=
{
0
}
position=
{
fieldPosition
(
0
)
}
position=
{
fieldPosition
(
0
)
}
rotation=
{
cardSlotRotation
(
false
)
}
rotation=
{
cardSlotRotation
(
false
)
}
clearPlaceInteractivitiesAction=
{
clearMagicPlaceInteractivities
}
// clearPlaceInteractivitiesAction=
{
clearMagicPlaceInteractivities
}
clearPlaceInteractivitiesAction=
{
clearPlaceInteractivitiesAction
}
/>
/>
)
:
(
)
:
(
<></>
<></>
)
}
)
}
{
opField
?
(
{
opField
?
(
<
FixedSlot
<
FixedSlot
state=
{
opField
}
s
napS
tate=
{
opField
}
sequence=
{
0
}
sequence=
{
0
}
position=
{
fieldPosition
(
1
)
}
position=
{
fieldPosition
(
1
)
}
rotation=
{
cardSlotRotation
(
true
)
}
rotation=
{
cardSlotRotation
(
true
)
}
clearPlaceInteractivitiesAction=
{
clearMagicPlaceInteractivities
}
// clearPlaceInteractivitiesAction=
{
clearMagicPlaceInteractivities
}
clearPlaceInteractivitiesAction=
{
clearPlaceInteractivitiesAction
}
/>
/>
)
:
(
)
:
(
<></>
<></>
...
...
src/ui/Duel/PlayMat/FixedSlot.tsx
View file @
67d5bd0d
...
@@ -18,6 +18,9 @@ import {
...
@@ -18,6 +18,9 @@ import {
import
{
store
}
from
"
@/store
"
;
import
{
store
}
from
"
@/store
"
;
import
{
interactTypeToString
}
from
"
../utils
"
;
import
{
interactTypeToString
}
from
"
../utils
"
;
import
{
useSnapshot
}
from
"
valtio
"
;
import
{
clearAllIdleInteractivities
}
from
"
@/valtioStores
"
;
const
NeosConfig
=
useConfig
();
const
NeosConfig
=
useConfig
();
...
@@ -30,19 +33,22 @@ const cardDefenceRotation = new BABYLON.Vector3(
...
@@ -30,19 +33,22 @@ const cardDefenceRotation = new BABYLON.Vector3(
);
);
export
const
FixedSlot
=
(
props
:
{
export
const
FixedSlot
=
(
props
:
{
state
:
CardState
;
s
napS
tate
:
CardState
;
sequence
:
number
;
sequence
:
number
;
position
:
BABYLON
.
Vector3
;
position
:
BABYLON
.
Vector3
;
rotation
:
BABYLON
.
Vector3
;
rotation
:
BABYLON
.
Vector3
;
deffenseRotation
?:
BABYLON
.
Vector3
;
deffenseRotation
?:
BABYLON
.
Vector3
;
clearPlaceInteractivitiesAction
:
ActionCreatorWithPayload
<
number
,
string
>
;
// clearPlaceInteractivitiesAction: ActionCreatorWithPayload<number, string>;
clearPlaceInteractivitiesAction
:
(
controller
:
number
)
=>
void
;
})
=>
{
})
=>
{
const
planeRef
=
useRef
(
null
);
const
planeRef
=
useRef
(
null
);
// const snapState = useSnapshot(props.state);
const
snapState
=
props
.
snapState
;
const
rotation
=
const
rotation
=
props
.
s
tate
.
location
.
position
===
ygopro
.
CardPosition
.
DEFENSE
||
snapS
tate
.
location
.
position
===
ygopro
.
CardPosition
.
DEFENSE
||
props
.
s
tate
.
location
.
position
===
ygopro
.
CardPosition
.
FACEUP_DEFENSE
||
snapS
tate
.
location
.
position
===
ygopro
.
CardPosition
.
FACEUP_DEFENSE
||
props
.
s
tate
.
location
.
position
===
ygopro
.
CardPosition
.
FACEDOWN_DEFENSE
snapS
tate
.
location
.
position
===
ygopro
.
CardPosition
.
FACEDOWN_DEFENSE
?
props
.
deffenseRotation
||
cardDefenceRotation
?
props
.
deffenseRotation
||
cardDefenceRotation
:
props
.
rotation
;
:
props
.
rotation
;
const
edgesWidth
=
2.0
;
const
edgesWidth
=
2.0
;
...
@@ -50,22 +56,24 @@ export const FixedSlot = (props: {
...
@@ -50,22 +56,24 @@ export const FixedSlot = (props: {
const
dispatch
=
store
.
dispatch
;
const
dispatch
=
store
.
dispatch
;
const
faceDown
=
const
faceDown
=
props
.
s
tate
.
location
.
position
===
ygopro
.
CardPosition
.
FACEDOWN_DEFENSE
||
snapS
tate
.
location
.
position
===
ygopro
.
CardPosition
.
FACEDOWN_DEFENSE
||
props
.
s
tate
.
location
.
position
===
ygopro
.
CardPosition
.
FACEDOWN_ATTACK
||
snapS
tate
.
location
.
position
===
ygopro
.
CardPosition
.
FACEDOWN_ATTACK
||
props
.
s
tate
.
location
.
position
===
ygopro
.
CardPosition
.
FACEDOWN
;
snapS
tate
.
location
.
position
===
ygopro
.
CardPosition
.
FACEDOWN
;
useClick
(
useClick
(
(
_event
)
=>
{
(
_event
)
=>
{
if
(
props
.
state
.
placeInteractivities
)
{
if
(
snapState
.
placeInteractivities
)
{
sendSelectPlaceResponse
(
props
.
state
.
placeInteractivities
.
response
);
sendSelectPlaceResponse
(
snapState
.
placeInteractivities
.
response
);
dispatch
(
props
.
clearPlaceInteractivitiesAction
(
0
));
// dispatch(props.clearPlaceInteractivitiesAction(0));
dispatch
(
props
.
clearPlaceInteractivitiesAction
(
1
));
// dispatch(props.clearPlaceInteractivitiesAction(1));
}
else
if
(
props
.
state
.
occupant
)
{
clearAllIdleInteractivities
(
0
);
clearAllIdleInteractivities
(
1
);
}
else
if
(
snapState
.
occupant
)
{
// 中央弹窗展示选中卡牌信息
// 中央弹窗展示选中卡牌信息
dispatch
(
setCardModalMeta
(
props
.
s
tate
.
occupant
));
dispatch
(
setCardModalMeta
(
snapS
tate
.
occupant
));
dispatch
(
dispatch
(
setCardModalInteractivies
(
setCardModalInteractivies
(
props
.
s
tate
.
idleInteractivities
.
map
((
interactivity
)
=>
{
snapS
tate
.
idleInteractivities
.
map
((
interactivity
)
=>
{
return
{
return
{
desc
:
interactTypeToString
(
interactivity
.
interactType
),
desc
:
interactTypeToString
(
interactivity
.
interactType
),
response
:
interactivity
.
response
,
response
:
interactivity
.
response
,
...
@@ -73,17 +81,17 @@ export const FixedSlot = (props: {
...
@@ -73,17 +81,17 @@ export const FixedSlot = (props: {
})
})
)
)
);
);
dispatch
(
setCardModalCounters
(
props
.
s
tate
.
counters
));
dispatch
(
setCardModalCounters
(
snapS
tate
.
counters
));
dispatch
(
setCardModalIsOpen
(
true
));
dispatch
(
setCardModalIsOpen
(
true
));
// 侧边栏展示超量素材信息
// 侧边栏展示超量素材信息
if
(
if
(
props
.
s
tate
.
overlay_materials
&&
snapS
tate
.
overlay_materials
&&
props
.
s
tate
.
overlay_materials
.
length
>
0
snapS
tate
.
overlay_materials
.
length
>
0
)
{
)
{
dispatch
(
dispatch
(
setCardListModalInfo
(
setCardListModalInfo
(
props
.
s
tate
.
overlay_materials
?.
map
((
overlay
)
=>
{
snapS
tate
.
overlay_materials
?.
map
((
overlay
)
=>
{
return
{
return
{
meta
:
overlay
,
meta
:
overlay
,
interactivies
:
[],
interactivies
:
[],
...
@@ -96,7 +104,7 @@ export const FixedSlot = (props: {
...
@@ -96,7 +104,7 @@ export const FixedSlot = (props: {
}
}
},
},
planeRef
,
planeRef
,
[
props
.
s
tate
]
[
snapS
tate
]
);
);
return
(
return
(
...
@@ -109,8 +117,8 @@ export const FixedSlot = (props: {
...
@@ -109,8 +117,8 @@ export const FixedSlot = (props: {
rotation=
{
rotation
}
rotation=
{
rotation
}
enableEdgesRendering
enableEdgesRendering
edgesWidth=
{
edgesWidth=
{
props
.
s
tate
.
placeInteractivities
||
snapS
tate
.
placeInteractivities
||
props
.
s
tate
.
idleInteractivities
.
length
>
0
snapS
tate
.
idleInteractivities
.
length
>
0
?
edgesWidth
?
edgesWidth
:
0
:
0
}
}
...
@@ -119,15 +127,15 @@ export const FixedSlot = (props: {
...
@@ -119,15 +127,15 @@ export const FixedSlot = (props: {
<
standardMaterial
<
standardMaterial
name=
{
`fixedslot-mat-${props.sequence}`
}
name=
{
`fixedslot-mat-${props.sequence}`
}
diffuseTexture=
{
diffuseTexture=
{
props
.
s
tate
.
occupant
snapS
tate
.
occupant
?
faceDown
?
faceDown
?
new
BABYLON
.
Texture
(
`${NeosConfig.assetsPath}/card_back.jpg`
)
?
new
BABYLON
.
Texture
(
`${NeosConfig.assetsPath}/card_back.jpg`
)
:
new
BABYLON
.
Texture
(
:
new
BABYLON
.
Texture
(
`${NeosConfig.cardImgUrl}/${
props.s
tate.occupant.id}.jpg`
`${NeosConfig.cardImgUrl}/${
snapS
tate.occupant.id}.jpg`
)
)
:
new
BABYLON
.
Texture
(
`${NeosConfig.assetsPath}/card_slot.png`
)
:
new
BABYLON
.
Texture
(
`${NeosConfig.assetsPath}/card_slot.png`
)
}
}
alpha=
{
props
.
s
tate
.
occupant
?
1
:
0
}
alpha=
{
snapS
tate
.
occupant
?
1
:
0
}
></
standardMaterial
>
></
standardMaterial
>
</
plane
>
</
plane
>
);
);
...
...
src/ui/Duel/PlayMat/Graveyard.tsx
View file @
67d5bd0d
...
@@ -10,20 +10,26 @@ import {
...
@@ -10,20 +10,26 @@ import {
import
{
cardSlotRotation
}
from
"
../utils
"
;
import
{
cardSlotRotation
}
from
"
../utils
"
;
import
{
Depth
,
SingleSlot
}
from
"
./SingleSlot
"
;
import
{
Depth
,
SingleSlot
}
from
"
./SingleSlot
"
;
import
{
matStore
}
from
"
@/valtioStores
"
;
import
{
useSnapshot
}
from
"
valtio
"
;
const
NeosConfig
=
useConfig
();
const
NeosConfig
=
useConfig
();
export
const
Graveyard
=
()
=>
{
export
const
Graveyard
=
()
=>
{
const
meGraveyard
=
useAppSelector
(
selectMeGraveyard
).
inner
;
// const meGraveyard = useAppSelector(selectMeGraveyard).inner;
const
opGraveyard
=
useAppSelector
(
selectOpGraveyard
).
inner
;
// const opGraveyard = useAppSelector(selectOpGraveyard).inner;
const
meGraveyard
=
useSnapshot
(
matStore
.
graveyards
.
me
);
const
opGraveyard
=
useSnapshot
(
matStore
.
graveyards
.
op
);
return
(
return
(
<>
<>
<
SingleSlot
<
SingleSlot
state=
{
m
eGraveyard
}
state=
{
m
atStore
.
graveyards
.
me
}
position=
{
graveyardPosition
(
0
,
meGraveyard
.
length
)
}
position=
{
graveyardPosition
(
0
,
meGraveyard
.
length
)
}
rotation=
{
cardSlotRotation
(
false
)
}
rotation=
{
cardSlotRotation
(
false
)
}
/>
/>
<
SingleSlot
<
SingleSlot
state=
{
opGraveyard
}
state=
{
matStore
.
graveyards
.
op
}
position=
{
graveyardPosition
(
1
,
opGraveyard
.
length
)
}
position=
{
graveyardPosition
(
1
,
opGraveyard
.
length
)
}
rotation=
{
cardSlotRotation
(
true
)
}
rotation=
{
cardSlotRotation
(
true
)
}
/>
/>
...
...
src/ui/Duel/PlayMat/Hands.tsx
View file @
67d5bd0d
...
@@ -4,7 +4,7 @@ import { useHover } from "react-babylonjs";
...
@@ -4,7 +4,7 @@ import { useHover } from "react-babylonjs";
import
{
useConfig
}
from
"
@/config
"
;
import
{
useConfig
}
from
"
@/config
"
;
import
{
useAppSelector
,
useClick
}
from
"
@/hook
"
;
import
{
useAppSelector
,
useClick
}
from
"
@/hook
"
;
import
{
CardState
}
from
"
@/reducers/duel/generic
"
;
//
import { CardState } from "@/reducers/duel/generic";
import
{
selectMeHands
,
selectOpHands
}
from
"
@/reducers/duel/handsSlice
"
;
import
{
selectMeHands
,
selectOpHands
}
from
"
@/reducers/duel/handsSlice
"
;
import
{
import
{
setCardModalInteractivies
,
setCardModalInteractivies
,
...
@@ -12,6 +12,8 @@ import {
...
@@ -12,6 +12,8 @@ import {
setCardModalMeta
,
setCardModalMeta
,
}
from
"
@/reducers/duel/mod
"
;
}
from
"
@/reducers/duel/mod
"
;
import
{
store
}
from
"
@/store
"
;
import
{
store
}
from
"
@/store
"
;
import
{
matStore
,
type
CardState
,
messageStore
}
from
"
@/valtioStores
"
;
import
{
useSnapshot
}
from
"
valtio
"
;
import
{
animated
,
useSpring
}
from
"
../spring
"
;
import
{
animated
,
useSpring
}
from
"
../spring
"
;
import
{
interactTypeToString
,
zip
}
from
"
../utils
"
;
import
{
interactTypeToString
,
zip
}
from
"
../utils
"
;
...
@@ -26,9 +28,12 @@ const handRotation = new BABYLON.Vector3(rotation.x, rotation.y, rotation.z);
...
@@ -26,9 +28,12 @@ const handRotation = new BABYLON.Vector3(rotation.x, rotation.y, rotation.z);
const
hoverScaling
=
NeosConfig
.
ui
.
card
.
handHoverScaling
;
const
hoverScaling
=
NeosConfig
.
ui
.
card
.
handHoverScaling
;
export
const
Hands
=
()
=>
{
export
const
Hands
=
()
=>
{
const
meHands
=
useAppSelector
(
selectMeHands
).
inner
;
const
meHands
=
useSnapshot
(
matStore
.
hands
.
me
);
const
opHands
=
useSnapshot
(
matStore
.
hands
.
op
);
// const meHands = useAppSelector(selectMeHands).inner;
// const opHands = useAppSelector(selectOpHands).inner;
const
meHandPositions
=
handPositons
(
0
,
meHands
);
const
meHandPositions
=
handPositons
(
0
,
meHands
);
const
opHands
=
useAppSelector
(
selectOpHands
).
inner
;
const
opHandPositions
=
handPositons
(
1
,
opHands
);
const
opHandPositions
=
handPositons
(
1
,
opHands
);
return
(
return
(
...
@@ -116,6 +121,7 @@ const CHand = (props: {
...
@@ -116,6 +121,7 @@ const CHand = (props: {
()
=>
{
()
=>
{
if
(
state
.
occupant
)
{
if
(
state
.
occupant
)
{
dispatch
(
setCardModalMeta
(
state
.
occupant
));
dispatch
(
setCardModalMeta
(
state
.
occupant
));
messageStore
.
cardModal
.
meta
=
state
.
occupant
;
}
}
dispatch
(
dispatch
(
setCardModalInteractivies
(
setCardModalInteractivies
(
...
@@ -127,7 +133,14 @@ const CHand = (props: {
...
@@ -127,7 +133,14 @@ const CHand = (props: {
})
})
)
)
);
);
messageStore
.
cardModal
.
interactivies
=
state
.
idleInteractivities
.
map
(
(
interactive
)
=>
({
desc
:
interactTypeToString
(
interactive
.
interactType
),
response
:
interactive
.
response
,
})
);
dispatch
(
setCardModalIsOpen
(
true
));
dispatch
(
setCardModalIsOpen
(
true
));
messageStore
.
cardModal
.
isOpen
=
true
;
},
},
planeRef
,
planeRef
,
[
state
]
[
state
]
...
@@ -145,7 +158,8 @@ const CHand = (props: {
...
@@ -145,7 +158,8 @@ const CHand = (props: {
rotation=
{
props
.
rotation
}
rotation=
{
props
.
rotation
}
enableEdgesRendering
enableEdgesRendering
edgesWidth=
{
edgesWidth=
{
state
.
idleInteractivities
.
length
>
0
||
state
.
placeInteractivities
// state.idleInteractivities.length > 0 || state.placeInteractivities
state
.
idleInteractivities
.
length
>
0
||
state
.
placeInteractivity
?
edgesWidth
?
edgesWidth
:
0
:
0
}
}
...
...
src/ui/Duel/PlayMat/Magics.tsx
View file @
67d5bd0d
...
@@ -2,13 +2,16 @@ import * as BABYLON from "@babylonjs/core";
...
@@ -2,13 +2,16 @@ import * as BABYLON from "@babylonjs/core";
import
{
useConfig
}
from
"
@/config
"
;
import
{
useConfig
}
from
"
@/config
"
;
import
{
useAppSelector
}
from
"
@/hook
"
;
import
{
useAppSelector
}
from
"
@/hook
"
;
import
{
CardState
}
from
"
@/reducers/duel/generic
"
;
//
import { CardState } from "@/reducers/duel/generic";
import
{
selectMeMagics
,
selectOpMagics
}
from
"
@/reducers/duel/magicSlice
"
;
import
{
selectMeMagics
,
selectOpMagics
}
from
"
@/reducers/duel/magicSlice
"
;
import
{
clearMagicPlaceInteractivities
}
from
"
@/reducers/duel/mod
"
;
import
{
clearMagicPlaceInteractivities
}
from
"
@/reducers/duel/mod
"
;
import
{
cardSlotRotation
,
zip
}
from
"
../utils
"
;
import
{
cardSlotRotation
,
zip
}
from
"
../utils
"
;
import
{
FixedSlot
}
from
"
./FixedSlot
"
;
import
{
FixedSlot
}
from
"
./FixedSlot
"
;
import
{
matStore
,
type
CardState
,
messageStore
}
from
"
@/valtioStores
"
;
import
{
useSnapshot
}
from
"
valtio
"
;
const
NeosConfig
=
useConfig
();
const
NeosConfig
=
useConfig
();
// TODO: use config
// TODO: use config
const
left
=
-
2.15
;
const
left
=
-
2.15
;
...
@@ -16,11 +19,17 @@ const gap = 1.05;
...
@@ -16,11 +19,17 @@ const gap = 1.05;
const
transform
=
NeosConfig
.
ui
.
card
.
transform
;
const
transform
=
NeosConfig
.
ui
.
card
.
transform
;
export
const
Magics
=
()
=>
{
export
const
Magics
=
()
=>
{
const
meMagics
=
useAppSelector
(
selectMeMagics
).
inner
;
// const meMagics = useAppSelector(selectMeMagics).inner;
// const opMagics = useAppSelector(selectOpMagics).inner;
const
meMagics
=
useSnapshot
(
matStore
.
magics
.
me
);
const
opMagics
=
useSnapshot
(
matStore
.
magics
.
op
);
const
meMagicPositions
=
magicPositions
(
0
,
meMagics
);
const
meMagicPositions
=
magicPositions
(
0
,
meMagics
);
const
opMagics
=
useAppSelector
(
selectOpMagics
).
inner
;
const
opMagicPositions
=
magicPositions
(
1
,
opMagics
);
const
opMagicPositions
=
magicPositions
(
1
,
opMagics
);
const
clearPlaceInteractivitiesAction
=
(
controller
:
number
)
=>
matStore
.
magics
.
of
(
controller
).
clearPlaceInteractivity
();
return
(
return
(
<>
<>
{
zip
(
meMagics
,
meMagicPositions
)
{
zip
(
meMagics
,
meMagicPositions
)
...
@@ -28,12 +37,13 @@ export const Magics = () => {
...
@@ -28,12 +37,13 @@ export const Magics = () => {
.
map
(([
magic
,
position
],
sequence
)
=>
{
.
map
(([
magic
,
position
],
sequence
)
=>
{
return
(
return
(
<
FixedSlot
<
FixedSlot
state=
{
magic
}
s
napS
tate=
{
magic
}
key=
{
sequence
}
key=
{
sequence
}
sequence=
{
sequence
}
sequence=
{
sequence
}
position=
{
position
}
position=
{
position
}
rotation=
{
cardSlotRotation
(
false
)
}
rotation=
{
cardSlotRotation
(
false
)
}
clearPlaceInteractivitiesAction=
{
clearMagicPlaceInteractivities
}
// clearPlaceInteractivitiesAction=
{
clearMagicPlaceInteractivities
}
clearPlaceInteractivitiesAction=
{
clearPlaceInteractivitiesAction
}
/>
/>
);
);
})
}
})
}
...
@@ -42,12 +52,13 @@ export const Magics = () => {
...
@@ -42,12 +52,13 @@ export const Magics = () => {
.
map
(([
magic
,
position
],
sequence
)
=>
{
.
map
(([
magic
,
position
],
sequence
)
=>
{
return
(
return
(
<
FixedSlot
<
FixedSlot
state=
{
magic
}
s
napS
tate=
{
magic
}
key=
{
sequence
}
key=
{
sequence
}
sequence=
{
sequence
}
sequence=
{
sequence
}
position=
{
position
}
position=
{
position
}
rotation=
{
cardSlotRotation
(
true
)
}
rotation=
{
cardSlotRotation
(
true
)
}
clearPlaceInteractivitiesAction=
{
clearMagicPlaceInteractivities
}
// clearPlaceInteractivitiesAction=
{
clearMagicPlaceInteractivities
}
clearPlaceInteractivitiesAction=
{
clearPlaceInteractivitiesAction
}
/>
/>
);
);
})
}
})
}
...
...
src/ui/Duel/PlayMat/Monsters.tsx
View file @
67d5bd0d
...
@@ -4,7 +4,7 @@ import * as BABYLON from "@babylonjs/core";
...
@@ -4,7 +4,7 @@ import * as BABYLON from "@babylonjs/core";
import
{
useConfig
}
from
"
@/config
"
;
import
{
useConfig
}
from
"
@/config
"
;
import
{
useAppSelector
}
from
"
@/hook
"
;
import
{
useAppSelector
}
from
"
@/hook
"
;
import
{
CardState
}
from
"
@/reducers/duel/generic
"
;
//
import { CardState } from "@/reducers/duel/generic";
import
{
clearMonsterPlaceInteractivities
}
from
"
@/reducers/duel/mod
"
;
import
{
clearMonsterPlaceInteractivities
}
from
"
@/reducers/duel/mod
"
;
import
{
import
{
selectMeMonsters
,
selectMeMonsters
,
...
@@ -14,16 +14,24 @@ import {
...
@@ -14,16 +14,24 @@ import {
import
{
cardSlotDefenceRotation
,
cardSlotRotation
,
zip
}
from
"
../utils
"
;
import
{
cardSlotDefenceRotation
,
cardSlotRotation
,
zip
}
from
"
../utils
"
;
import
{
FixedSlot
}
from
"
./FixedSlot
"
;
import
{
FixedSlot
}
from
"
./FixedSlot
"
;
import
{
matStore
,
type
CardState
,
messageStore
}
from
"
@/valtioStores
"
;
import
{
useSnapshot
}
from
"
valtio
"
;
const
NeosConfig
=
useConfig
();
const
NeosConfig
=
useConfig
();
const
transform
=
NeosConfig
.
ui
.
card
.
transform
;
const
transform
=
NeosConfig
.
ui
.
card
.
transform
;
const
floating
=
NeosConfig
.
ui
.
card
.
floating
;
const
floating
=
NeosConfig
.
ui
.
card
.
floating
;
const
left
=
-
2.15
;
// TODO: config
const
left
=
-
2.15
;
// TODO: config
const
gap
=
1.05
;
const
gap
=
1.05
;
const
clearPlaceInteractivitiesAction
=
(
controller
:
number
)
=>
matStore
.
monsters
.
of
(
controller
).
clearPlaceInteractivity
();
export
const
Monsters
=
()
=>
{
export
const
Monsters
=
()
=>
{
const
meMonsters
=
useAppSelector
(
selectMeMonsters
).
inner
;
// const meMonsters = useAppSelector(selectMeMonsters).inner;
// const opMonsters = useAppSelector(selectOpMonsters).inner;
const
meMonsters
=
useSnapshot
(
matStore
.
monsters
.
me
);
const
opMonsters
=
useSnapshot
(
matStore
.
monsters
.
op
);
const
meMonsterPositions
=
monsterPositions
(
0
,
meMonsters
);
const
meMonsterPositions
=
monsterPositions
(
0
,
meMonsters
);
const
opMonsters
=
useAppSelector
(
selectOpMonsters
).
inner
;
const
opMonsterPositions
=
monsterPositions
(
1
,
opMonsters
);
const
opMonsterPositions
=
monsterPositions
(
1
,
opMonsters
);
return
(
return
(
...
@@ -32,26 +40,28 @@ export const Monsters = () => {
...
@@ -32,26 +40,28 @@ export const Monsters = () => {
.
slice
(
0
,
5
)
.
slice
(
0
,
5
)
.
map
(([
monster
,
position
],
sequence
)
=>
(
.
map
(([
monster
,
position
],
sequence
)
=>
(
<
FixedSlot
<
FixedSlot
state=
{
monster
}
s
napS
tate=
{
monster
}
key=
{
sequence
}
key=
{
sequence
}
sequence=
{
sequence
}
sequence=
{
sequence
}
position=
{
position
}
position=
{
position
}
rotation=
{
cardSlotRotation
(
false
)
}
rotation=
{
cardSlotRotation
(
false
)
}
deffenseRotation=
{
cardSlotDefenceRotation
()
}
deffenseRotation=
{
cardSlotDefenceRotation
()
}
clearPlaceInteractivitiesAction=
{
clearMonsterPlaceInteractivities
}
// clearPlaceInteractivitiesAction=
{
clearMonsterPlaceInteractivities
}
clearPlaceInteractivitiesAction=
{
clearPlaceInteractivitiesAction
}
/>
/>
))
}
))
}
{
zip
(
opMonsters
,
opMonsterPositions
)
{
zip
(
opMonsters
,
opMonsterPositions
)
.
slice
(
0
,
5
)
.
slice
(
0
,
5
)
.
map
(([
monster
,
position
],
sequence
)
=>
(
.
map
(([
monster
,
position
],
sequence
)
=>
(
<
FixedSlot
<
FixedSlot
state=
{
monster
}
s
napS
tate=
{
monster
}
key=
{
sequence
}
key=
{
sequence
}
sequence=
{
sequence
}
sequence=
{
sequence
}
position=
{
position
}
position=
{
position
}
rotation=
{
cardSlotRotation
(
true
)
}
rotation=
{
cardSlotRotation
(
true
)
}
deffenseRotation=
{
cardSlotDefenceRotation
()
}
deffenseRotation=
{
cardSlotDefenceRotation
()
}
clearPlaceInteractivitiesAction=
{
clearMonsterPlaceInteractivities
}
// clearPlaceInteractivitiesAction=
{
clearMonsterPlaceInteractivities
}
clearPlaceInteractivitiesAction=
{
clearPlaceInteractivitiesAction
}
/>
/>
))
}
))
}
<
ExtraMonsters
meMonsters=
{
meMonsters
}
opMonsters=
{
opMonsters
}
/>
<
ExtraMonsters
meMonsters=
{
meMonsters
}
opMonsters=
{
opMonsters
}
/>
...
@@ -79,31 +89,33 @@ const ExtraMonsters = (props: {
...
@@ -79,31 +89,33 @@ const ExtraMonsters = (props: {
<>
<>
{
meLeft
?
(
{
meLeft
?
(
<
FixedSlot
<
FixedSlot
state=
{
meLeft
}
s
napS
tate=
{
meLeft
}
sequence=
{
5
}
sequence=
{
5
}
position=
{
leftPosition
}
position=
{
leftPosition
}
rotation=
{
meRotation
}
rotation=
{
meRotation
}
deffenseRotation=
{
cardSlotDefenceRotation
()
}
deffenseRotation=
{
cardSlotDefenceRotation
()
}
clearPlaceInteractivitiesAction=
{
clearMonsterPlaceInteractivities
}
// clearPlaceInteractivitiesAction=
{
clearMonsterPlaceInteractivities
}
clearPlaceInteractivitiesAction=
{
clearPlaceInteractivitiesAction
}
/>
/>
)
:
(
)
:
(
<></>
<></>
)
}
)
}
{
meRight
?
(
{
meRight
?
(
<
FixedSlot
<
FixedSlot
state=
{
meRight
}
s
napS
tate=
{
meRight
}
sequence=
{
6
}
sequence=
{
6
}
position=
{
rightPosition
}
position=
{
rightPosition
}
rotation=
{
meRotation
}
rotation=
{
meRotation
}
deffenseRotation=
{
cardSlotDefenceRotation
()
}
deffenseRotation=
{
cardSlotDefenceRotation
()
}
clearPlaceInteractivitiesAction=
{
clearMonsterPlaceInteractivities
}
// clearPlaceInteractivitiesAction=
{
clearMonsterPlaceInteractivities
}
clearPlaceInteractivitiesAction=
{
clearPlaceInteractivitiesAction
}
/>
/>
)
:
(
)
:
(
<></>
<></>
)
}
)
}
{
opLeft
?
(
{
opLeft
?
(
<
FixedSlot
<
FixedSlot
state=
{
opLeft
}
s
napS
tate=
{
opLeft
}
sequence=
{
5
}
sequence=
{
5
}
position=
{
rightPosition
}
position=
{
rightPosition
}
rotation=
{
opRotation
}
rotation=
{
opRotation
}
...
@@ -115,7 +127,7 @@ const ExtraMonsters = (props: {
...
@@ -115,7 +127,7 @@ const ExtraMonsters = (props: {
)
}
)
}
{
opRight
?
(
{
opRight
?
(
<
FixedSlot
<
FixedSlot
state=
{
opRight
}
s
napS
tate=
{
opRight
}
sequence=
{
6
}
sequence=
{
6
}
position=
{
leftPosition
}
position=
{
leftPosition
}
rotation=
{
opRotation
}
rotation=
{
opRotation
}
...
...
src/ui/Duel/PlayMat/SingleSlot.tsx
View file @
67d5bd0d
...
@@ -11,6 +11,7 @@ import {
...
@@ -11,6 +11,7 @@ import {
import
{
store
}
from
"
@/store
"
;
import
{
store
}
from
"
@/store
"
;
import
{
interactTypeToString
}
from
"
../utils
"
;
import
{
interactTypeToString
}
from
"
../utils
"
;
import
{
useSnapshot
}
from
"
valtio
"
;
const
NeosConfig
=
useConfig
();
const
NeosConfig
=
useConfig
();
const
transform
=
NeosConfig
.
ui
.
card
.
transform
;
const
transform
=
NeosConfig
.
ui
.
card
.
transform
;
...
@@ -21,10 +22,11 @@ export const SingleSlot = (props: {
...
@@ -21,10 +22,11 @@ export const SingleSlot = (props: {
position
:
BABYLON
.
Vector3
;
position
:
BABYLON
.
Vector3
;
rotation
:
BABYLON
.
Vector3
;
rotation
:
BABYLON
.
Vector3
;
})
=>
{
})
=>
{
const
snapState
=
useSnapshot
(
props
.
state
);
const
boxRef
=
useRef
(
null
);
const
boxRef
=
useRef
(
null
);
const
dispatch
=
store
.
dispatch
;
const
dispatch
=
store
.
dispatch
;
const
edgeRender
=
const
edgeRender
=
props
.
s
tate
.
find
((
item
)
=>
snapS
tate
.
find
((
item
)
=>
item
===
undefined
?
false
:
item
.
idleInteractivities
.
length
>
0
item
===
undefined
?
false
:
item
.
idleInteractivities
.
length
>
0
)
!==
undefined
;
)
!==
undefined
;
const
edgesWidth
=
2.0
;
const
edgesWidth
=
2.0
;
...
@@ -32,10 +34,10 @@ export const SingleSlot = (props: {
...
@@ -32,10 +34,10 @@ export const SingleSlot = (props: {
useClick
(
useClick
(
(
_event
)
=>
{
(
_event
)
=>
{
if
(
props
.
s
tate
.
length
!=
0
)
{
if
(
snapS
tate
.
length
!=
0
)
{
dispatch
(
dispatch
(
setCardListModalInfo
(
setCardListModalInfo
(
props
.
s
tate
snapS
tate
.
filter
(
.
filter
(
(
item
)
=>
item
.
occupant
!==
undefined
&&
item
.
occupant
.
id
!==
0
(
item
)
=>
item
.
occupant
!==
undefined
&&
item
.
occupant
.
id
!==
0
)
)
...
@@ -56,7 +58,7 @@ export const SingleSlot = (props: {
...
@@ -56,7 +58,7 @@ export const SingleSlot = (props: {
}
}
},
},
boxRef
,
boxRef
,
[
props
.
s
tate
]
[
snapS
tate
]
);
);
return
(
return
(
...
@@ -64,11 +66,7 @@ export const SingleSlot = (props: {
...
@@ -64,11 +66,7 @@ export const SingleSlot = (props: {
name=
"single-slot"
name=
"single-slot"
ref=
{
boxRef
}
ref=
{
boxRef
}
scaling=
{
scaling=
{
new
BABYLON
.
Vector3
(
new
BABYLON
.
Vector3
(
transform
.
x
,
transform
.
y
,
Depth
*
snapState
.
length
)
transform
.
x
,
transform
.
y
,
Depth
*
props
.
state
.
length
)
}
}
position=
{
props
.
position
}
position=
{
props
.
position
}
rotation=
{
props
.
rotation
}
rotation=
{
props
.
rotation
}
...
@@ -81,7 +79,7 @@ export const SingleSlot = (props: {
...
@@ -81,7 +79,7 @@ export const SingleSlot = (props: {
diffuseTexture=
{
diffuseTexture=
{
new
BABYLON
.
Texture
(
`${NeosConfig.assetsPath}/card_back.jpg`
)
new
BABYLON
.
Texture
(
`${NeosConfig.assetsPath}/card_back.jpg`
)
}
}
alpha=
{
props
.
s
tate
.
length
==
0
?
0
:
1
}
alpha=
{
snapS
tate
.
length
==
0
?
0
:
1
}
/>
/>
</
box
>
</
box
>
);
);
...
...
src/valtioStores/matStore/types.ts
View file @
67d5bd0d
...
@@ -42,6 +42,8 @@ export type DuelFieldState = CardState[] & {
...
@@ -42,6 +42,8 @@ export type DuelFieldState = CardState[] & {
clearPlaceInteractivity
:
()
=>
void
;
clearPlaceInteractivity
:
()
=>
void
;
};
};
type
test
=
DuelFieldState
extends
(
infer
S
)[]
?
S
:
never
;
export
interface
MatState
{
export
interface
MatState
{
selfType
:
number
;
selfType
:
number
;
...
...
src/valtioStores/messageStore/methods/clearAllPlaceInteradtivities.ts
0 → 100644
View file @
67d5bd0d
import
{
matStore
}
from
"
@/valtioStores
"
;
import
{
ygopro
}
from
"
@/api
"
;
/** 清空所有place互动性,也可以删除某一个zone的互动性。zone为空则为清除所有。 */
export
const
clearAllPlaceInteradtivities
=
(
controller
:
number
,
zone
?:
ygopro
.
CardZone
)
=>
{
if
(
zone
)
{
matStore
.
in
(
zone
).
of
(
controller
).
clearPlaceInteractivity
();
}
else
{
matStore
.
banishedZones
.
of
(
controller
).
clearPlaceInteractivity
();
matStore
.
decks
.
of
(
controller
).
clearPlaceInteractivity
();
matStore
.
extraDecks
.
of
(
controller
).
clearPlaceInteractivity
();
matStore
.
graveyards
.
of
(
controller
).
clearPlaceInteractivity
();
matStore
.
hands
.
of
(
controller
).
clearPlaceInteractivity
();
matStore
.
magics
.
of
(
controller
).
clearPlaceInteractivity
();
matStore
.
monsters
.
of
(
controller
).
clearPlaceInteractivity
();
}
};
src/valtioStores/messageStore/methods/index.ts
View file @
67d5bd0d
export
*
from
"
./clearAllIdleInteractivities
"
;
export
*
from
"
./clearAllIdleInteractivities
"
;
export
*
from
"
./fetchCheckCardMetasV2
"
;
export
*
from
"
./fetchCheckCardMetasV2
"
;
export
*
from
"
./fetchCheckCardMetasV3
"
;
export
*
from
"
./fetchCheckCardMetasV3
"
;
export
*
from
"
./clearAllPlaceInteradtivities
"
;
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