Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
N
Neos
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Packages
Packages
List
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issues
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
love_飞影
Neos
Commits
be7cdb4d
Commit
be7cdb4d
authored
Jan 15, 2023
by
chechunchi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix field.tsx
parent
2c7f40eb
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
22 additions
and
1 deletion
+22
-1
src/reducers/duel/fieldSlice.ts
src/reducers/duel/fieldSlice.ts
+12
-0
src/reducers/duel/mod.ts
src/reducers/duel/mod.ts
+7
-1
src/ui/Duel/field.tsx
src/ui/Duel/field.tsx
+3
-0
No files found.
src/reducers/duel/fieldSlice.ts
View file @
be7cdb4d
...
@@ -38,5 +38,17 @@ export const initFieldImpl: CaseReducer<DuelState, PayloadAction<number>> = (
...
@@ -38,5 +38,17 @@ export const initFieldImpl: CaseReducer<DuelState, PayloadAction<number>> = (
}
}
};
};
export
const
clearFieldPlaceInteractivitiesImpl
:
CaseReducer
<
DuelState
,
PayloadAction
<
number
>
>
=
(
state
,
action
)
=>
{
const
player
=
action
.
payload
;
const
field
=
judgeSelf
(
player
,
state
)
?
state
.
meField
:
state
.
opField
;
if
(
field
&&
field
.
inner
)
{
field
.
inner
.
placeInteractivities
=
undefined
;
}
};
export
const
selectMeField
=
(
state
:
RootState
)
=>
state
.
duel
.
meField
;
export
const
selectMeField
=
(
state
:
RootState
)
=>
state
.
duel
.
meField
;
export
const
selectOpField
=
(
state
:
RootState
)
=>
state
.
duel
.
opField
;
export
const
selectOpField
=
(
state
:
RootState
)
=>
state
.
duel
.
opField
;
src/reducers/duel/mod.ts
View file @
be7cdb4d
...
@@ -64,7 +64,11 @@ import {
...
@@ -64,7 +64,11 @@ import {
exclusionCase
,
exclusionCase
,
}
from
"
./exclusionSlice
"
;
}
from
"
./exclusionSlice
"
;
import
{
DeckState
,
initDeckImpl
}
from
"
./deckSlice
"
;
import
{
DeckState
,
initDeckImpl
}
from
"
./deckSlice
"
;
import
{
FieldState
,
initFieldImpl
}
from
"
./fieldSlice
"
;
import
{
FieldState
,
initFieldImpl
,
clearFieldPlaceInteractivitiesImpl
,
}
from
"
./fieldSlice
"
;
export
interface
DuelState
{
export
interface
DuelState
{
selfType
?:
number
;
selfType
?:
number
;
...
@@ -156,6 +160,7 @@ const duelSlice = createSlice({
...
@@ -156,6 +160,7 @@ const duelSlice = createSlice({
// 场地区相关`Reducer`
// 场地区相关`Reducer`
initField
:
initFieldImpl
,
initField
:
initFieldImpl
,
clearFieldPlaceInteractivities
:
clearFieldPlaceInteractivitiesImpl
,
// UI相关`Reducer`
// UI相关`Reducer`
setCardModalIsOpen
:
setCardModalIsOpenImpl
,
setCardModalIsOpen
:
setCardModalIsOpenImpl
,
...
@@ -229,6 +234,7 @@ export const {
...
@@ -229,6 +234,7 @@ export const {
initDeck
,
initDeck
,
initExclusion
,
initExclusion
,
initField
,
initField
,
clearFieldPlaceInteractivities
,
}
=
duelSlice
.
actions
;
}
=
duelSlice
.
actions
;
export
const
selectDuelHsStart
=
(
state
:
RootState
)
=>
{
export
const
selectDuelHsStart
=
(
state
:
RootState
)
=>
{
return
state
.
duel
.
meInitInfo
!=
null
;
return
state
.
duel
.
meInitInfo
!=
null
;
...
...
src/ui/Duel/field.tsx
View file @
be7cdb4d
...
@@ -2,6 +2,7 @@ import * as BABYLON from "@babylonjs/core";
...
@@ -2,6 +2,7 @@ import * as BABYLON from "@babylonjs/core";
import
*
as
CONFIG
from
"
../../config/ui
"
;
import
*
as
CONFIG
from
"
../../config/ui
"
;
import
{
useAppSelector
}
from
"
../../hook
"
;
import
{
useAppSelector
}
from
"
../../hook
"
;
import
{
selectMeField
,
selectOpField
}
from
"
../../reducers/duel/fieldSlice
"
;
import
{
selectMeField
,
selectOpField
}
from
"
../../reducers/duel/fieldSlice
"
;
import
{
clearFieldPlaceInteractivities
}
from
"
../../reducers/duel/mod
"
;
import
FixedSlot
from
"
./fixedSlot
"
;
import
FixedSlot
from
"
./fixedSlot
"
;
import
{
Depth
}
from
"
./singleSlot
"
;
import
{
Depth
}
from
"
./singleSlot
"
;
...
@@ -17,6 +18,7 @@ const Field = () => {
...
@@ -17,6 +18,7 @@ const Field = () => {
sequence=
{
0
}
sequence=
{
0
}
position=
{
fieldPosition
(
0
)
}
position=
{
fieldPosition
(
0
)
}
rotation=
{
CONFIG
.
CardSlotRotation
(
false
)
}
rotation=
{
CONFIG
.
CardSlotRotation
(
false
)
}
clearPlaceInteractivitiesAction=
{
clearFieldPlaceInteractivities
}
/>
/>
)
:
(
)
:
(
<></>
<></>
...
@@ -27,6 +29,7 @@ const Field = () => {
...
@@ -27,6 +29,7 @@ const Field = () => {
sequence=
{
0
}
sequence=
{
0
}
position=
{
fieldPosition
(
1
)
}
position=
{
fieldPosition
(
1
)
}
rotation=
{
CONFIG
.
CardSlotRotation
(
true
)
}
rotation=
{
CONFIG
.
CardSlotRotation
(
true
)
}
clearPlaceInteractivitiesAction=
{
clearFieldPlaceInteractivities
}
/>
/>
)
:
(
)
:
(
<></>
<></>
...
...
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