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
f8b621eb
Commit
f8b621eb
authored
Jan 15, 2023
by
Chunchi Che
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'fix/magic/place' into 'main'
fix FixedSlot.tsx See merge request
!77
parents
e6e7bab4
be7cdb4d
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
32 additions
and
4 deletions
+32
-4
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
src/ui/Duel/fixedSlot.tsx
src/ui/Duel/fixedSlot.tsx
+4
-3
src/ui/Duel/magics.tsx
src/ui/Duel/magics.tsx
+3
-0
src/ui/Duel/monsters.tsx
src/ui/Duel/monsters.tsx
+3
-0
No files found.
src/reducers/duel/fieldSlice.ts
View file @
f8b621eb
...
@@ -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 @
f8b621eb
...
@@ -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 @
f8b621eb
...
@@ -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
}
/>
/>
)
:
(
)
:
(
<></>
<></>
...
...
src/ui/Duel/fixedSlot.tsx
View file @
f8b621eb
...
@@ -7,12 +7,12 @@ import { useClick } from "./hook";
...
@@ -7,12 +7,12 @@ import { useClick } from "./hook";
import
{
sendSelectPlaceResponse
}
from
"
../../api/ocgcore/ocgHelper
"
;
import
{
sendSelectPlaceResponse
}
from
"
../../api/ocgcore/ocgHelper
"
;
import
{
ygopro
}
from
"
../../api/ocgcore/idl/ocgcore
"
;
import
{
ygopro
}
from
"
../../api/ocgcore/idl/ocgcore
"
;
import
{
import
{
clearMonsterPlaceInteractivities
,
setCardModalImgUrl
,
setCardModalImgUrl
,
setCardModalInteractivies
,
setCardModalInteractivies
,
setCardModalIsOpen
,
setCardModalIsOpen
,
setCardModalText
,
setCardModalText
,
}
from
"
../../reducers/duel/mod
"
;
}
from
"
../../reducers/duel/mod
"
;
import
{
ActionCreatorWithPayload
}
from
"
@reduxjs/toolkit
"
;
const
shape
=
CONFIG
.
CardSlotShape
();
const
shape
=
CONFIG
.
CardSlotShape
();
...
@@ -22,6 +22,7 @@ const FixedSlot = (props: {
...
@@ -22,6 +22,7 @@ const FixedSlot = (props: {
position
:
BABYLON
.
Vector3
;
position
:
BABYLON
.
Vector3
;
rotation
:
BABYLON
.
Vector3
;
rotation
:
BABYLON
.
Vector3
;
deffenseRotation
?:
BABYLON
.
Vector3
;
deffenseRotation
?:
BABYLON
.
Vector3
;
clearPlaceInteractivitiesAction
:
ActionCreatorWithPayload
<
number
,
string
>
;
})
=>
{
})
=>
{
const
planeRef
=
useRef
(
null
);
const
planeRef
=
useRef
(
null
);
...
@@ -44,8 +45,8 @@ const FixedSlot = (props: {
...
@@ -44,8 +45,8 @@ const FixedSlot = (props: {
(
_event
)
=>
{
(
_event
)
=>
{
if
(
props
.
state
.
placeInteractivities
)
{
if
(
props
.
state
.
placeInteractivities
)
{
sendSelectPlaceResponse
(
props
.
state
.
placeInteractivities
.
response
);
sendSelectPlaceResponse
(
props
.
state
.
placeInteractivities
.
response
);
dispatch
(
clearMonsterPlaceInteractivities
(
0
));
dispatch
(
props
.
clearPlaceInteractivitiesAction
(
0
));
dispatch
(
clearMonsterPlaceInteractivities
(
1
));
dispatch
(
props
.
clearPlaceInteractivitiesAction
(
1
));
}
else
if
(
props
.
state
.
occupant
)
{
}
else
if
(
props
.
state
.
occupant
)
{
dispatch
(
dispatch
(
setCardModalText
([
setCardModalText
([
...
...
src/ui/Duel/magics.tsx
View file @
f8b621eb
...
@@ -5,6 +5,7 @@ import { CardState } from "../../reducers/duel/generic";
...
@@ -5,6 +5,7 @@ import { CardState } from "../../reducers/duel/generic";
import
{
useAppSelector
}
from
"
../../hook
"
;
import
{
useAppSelector
}
from
"
../../hook
"
;
import
{
zip
}
from
"
./util
"
;
import
{
zip
}
from
"
./util
"
;
import
FixedSlot
from
"
./fixedSlot
"
;
import
FixedSlot
from
"
./fixedSlot
"
;
import
{
clearMagicPlaceInteractivities
}
from
"
../../reducers/duel/mod
"
;
// TODO: use config
// TODO: use config
const
left
=
-
2.15
;
const
left
=
-
2.15
;
...
@@ -27,6 +28,7 @@ const Magics = () => {
...
@@ -27,6 +28,7 @@ const Magics = () => {
sequence=
{
sequence
}
sequence=
{
sequence
}
position=
{
position
}
position=
{
position
}
rotation=
{
CONFIG
.
CardSlotRotation
(
false
)
}
rotation=
{
CONFIG
.
CardSlotRotation
(
false
)
}
clearPlaceInteractivitiesAction=
{
clearMagicPlaceInteractivities
}
/>
/>
);
);
})
}
})
}
...
@@ -38,6 +40,7 @@ const Magics = () => {
...
@@ -38,6 +40,7 @@ const Magics = () => {
sequence=
{
sequence
}
sequence=
{
sequence
}
position=
{
position
}
position=
{
position
}
rotation=
{
CONFIG
.
CardSlotRotation
(
true
)
}
rotation=
{
CONFIG
.
CardSlotRotation
(
true
)
}
clearPlaceInteractivitiesAction=
{
clearMagicPlaceInteractivities
}
/>
/>
);
);
})
}
})
}
...
...
src/ui/Duel/monsters.tsx
View file @
f8b621eb
...
@@ -9,6 +9,7 @@ import {
...
@@ -9,6 +9,7 @@ import {
}
from
"
../../reducers/duel/monstersSlice
"
;
}
from
"
../../reducers/duel/monstersSlice
"
;
import
{
zip
}
from
"
./util
"
;
import
{
zip
}
from
"
./util
"
;
import
FixedSlot
from
"
./fixedSlot
"
;
import
FixedSlot
from
"
./fixedSlot
"
;
import
{
clearMonsterPlaceInteractivities
}
from
"
../../reducers/duel/mod
"
;
const
shape
=
CONFIG
.
CardSlotShape
();
const
shape
=
CONFIG
.
CardSlotShape
();
const
left
=
-
2.15
;
// TODO: config
const
left
=
-
2.15
;
// TODO: config
...
@@ -32,6 +33,7 @@ const Monsters = () => {
...
@@ -32,6 +33,7 @@ const Monsters = () => {
position=
{
position
}
position=
{
position
}
rotation=
{
CONFIG
.
CardSlotRotation
(
false
)
}
rotation=
{
CONFIG
.
CardSlotRotation
(
false
)
}
deffenseRotation=
{
CONFIG
.
CardSlotDefenceRotation
()
}
deffenseRotation=
{
CONFIG
.
CardSlotDefenceRotation
()
}
clearPlaceInteractivitiesAction=
{
clearMonsterPlaceInteractivities
}
/>
/>
);
);
}
}
...
@@ -46,6 +48,7 @@ const Monsters = () => {
...
@@ -46,6 +48,7 @@ const Monsters = () => {
position=
{
position
}
position=
{
position
}
rotation=
{
CONFIG
.
CardSlotRotation
(
true
)
}
rotation=
{
CONFIG
.
CardSlotRotation
(
true
)
}
deffenseRotation=
{
CONFIG
.
CardSlotDefenceRotation
()
}
deffenseRotation=
{
CONFIG
.
CardSlotDefenceRotation
()
}
clearPlaceInteractivitiesAction=
{
clearMonsterPlaceInteractivities
}
/>
/>
);
);
}
}
...
...
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