Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
N
Neos
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
1
Issues
1
List
Boards
Labels
Service Desk
Milestones
Merge Requests
2
Merge Requests
2
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Packages
Packages
List
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issues
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
MyCard
Neos
Commits
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
Pipeline
#19536
passed with stages
in 5 minutes and 58 seconds
Changes
6
Pipelines
1
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>> = (
}
};
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
selectOpField
=
(
state
:
RootState
)
=>
state
.
duel
.
opField
;
src/reducers/duel/mod.ts
View file @
f8b621eb
...
...
@@ -64,7 +64,11 @@ import {
exclusionCase
,
}
from
"
./exclusionSlice
"
;
import
{
DeckState
,
initDeckImpl
}
from
"
./deckSlice
"
;
import
{
FieldState
,
initFieldImpl
}
from
"
./fieldSlice
"
;
import
{
FieldState
,
initFieldImpl
,
clearFieldPlaceInteractivitiesImpl
,
}
from
"
./fieldSlice
"
;
export
interface
DuelState
{
selfType
?:
number
;
...
...
@@ -156,6 +160,7 @@ const duelSlice = createSlice({
// 场地区相关`Reducer`
initField
:
initFieldImpl
,
clearFieldPlaceInteractivities
:
clearFieldPlaceInteractivitiesImpl
,
// UI相关`Reducer`
setCardModalIsOpen
:
setCardModalIsOpenImpl
,
...
...
@@ -229,6 +234,7 @@ export const {
initDeck
,
initExclusion
,
initField
,
clearFieldPlaceInteractivities
,
}
=
duelSlice
.
actions
;
export
const
selectDuelHsStart
=
(
state
:
RootState
)
=>
{
return
state
.
duel
.
meInitInfo
!=
null
;
...
...
src/ui/Duel/field.tsx
View file @
f8b621eb
...
...
@@ -2,6 +2,7 @@ import * as BABYLON from "@babylonjs/core";
import
*
as
CONFIG
from
"
../../config/ui
"
;
import
{
useAppSelector
}
from
"
../../hook
"
;
import
{
selectMeField
,
selectOpField
}
from
"
../../reducers/duel/fieldSlice
"
;
import
{
clearFieldPlaceInteractivities
}
from
"
../../reducers/duel/mod
"
;
import
FixedSlot
from
"
./fixedSlot
"
;
import
{
Depth
}
from
"
./singleSlot
"
;
...
...
@@ -17,6 +18,7 @@ const Field = () => {
sequence=
{
0
}
position=
{
fieldPosition
(
0
)
}
rotation=
{
CONFIG
.
CardSlotRotation
(
false
)
}
clearPlaceInteractivitiesAction=
{
clearFieldPlaceInteractivities
}
/>
)
:
(
<></>
...
...
@@ -27,6 +29,7 @@ const Field = () => {
sequence=
{
0
}
position=
{
fieldPosition
(
1
)
}
rotation=
{
CONFIG
.
CardSlotRotation
(
true
)
}
clearPlaceInteractivitiesAction=
{
clearFieldPlaceInteractivities
}
/>
)
:
(
<></>
...
...
src/ui/Duel/fixedSlot.tsx
View file @
f8b621eb
...
...
@@ -7,12 +7,12 @@ import { useClick } from "./hook";
import
{
sendSelectPlaceResponse
}
from
"
../../api/ocgcore/ocgHelper
"
;
import
{
ygopro
}
from
"
../../api/ocgcore/idl/ocgcore
"
;
import
{
clearMonsterPlaceInteractivities
,
setCardModalImgUrl
,
setCardModalInteractivies
,
setCardModalIsOpen
,
setCardModalText
,
}
from
"
../../reducers/duel/mod
"
;
import
{
ActionCreatorWithPayload
}
from
"
@reduxjs/toolkit
"
;
const
shape
=
CONFIG
.
CardSlotShape
();
...
...
@@ -22,6 +22,7 @@ const FixedSlot = (props: {
position
:
BABYLON
.
Vector3
;
rotation
:
BABYLON
.
Vector3
;
deffenseRotation
?:
BABYLON
.
Vector3
;
clearPlaceInteractivitiesAction
:
ActionCreatorWithPayload
<
number
,
string
>
;
})
=>
{
const
planeRef
=
useRef
(
null
);
...
...
@@ -44,8 +45,8 @@ const FixedSlot = (props: {
(
_event
)
=>
{
if
(
props
.
state
.
placeInteractivities
)
{
sendSelectPlaceResponse
(
props
.
state
.
placeInteractivities
.
response
);
dispatch
(
clearMonsterPlaceInteractivities
(
0
));
dispatch
(
clearMonsterPlaceInteractivities
(
1
));
dispatch
(
props
.
clearPlaceInteractivitiesAction
(
0
));
dispatch
(
props
.
clearPlaceInteractivitiesAction
(
1
));
}
else
if
(
props
.
state
.
occupant
)
{
dispatch
(
setCardModalText
([
...
...
src/ui/Duel/magics.tsx
View file @
f8b621eb
...
...
@@ -5,6 +5,7 @@ import { CardState } from "../../reducers/duel/generic";
import
{
useAppSelector
}
from
"
../../hook
"
;
import
{
zip
}
from
"
./util
"
;
import
FixedSlot
from
"
./fixedSlot
"
;
import
{
clearMagicPlaceInteractivities
}
from
"
../../reducers/duel/mod
"
;
// TODO: use config
const
left
=
-
2.15
;
...
...
@@ -27,6 +28,7 @@ const Magics = () => {
sequence=
{
sequence
}
position=
{
position
}
rotation=
{
CONFIG
.
CardSlotRotation
(
false
)
}
clearPlaceInteractivitiesAction=
{
clearMagicPlaceInteractivities
}
/>
);
})
}
...
...
@@ -38,6 +40,7 @@ const Magics = () => {
sequence=
{
sequence
}
position=
{
position
}
rotation=
{
CONFIG
.
CardSlotRotation
(
true
)
}
clearPlaceInteractivitiesAction=
{
clearMagicPlaceInteractivities
}
/>
);
})
}
...
...
src/ui/Duel/monsters.tsx
View file @
f8b621eb
...
...
@@ -9,6 +9,7 @@ import {
}
from
"
../../reducers/duel/monstersSlice
"
;
import
{
zip
}
from
"
./util
"
;
import
FixedSlot
from
"
./fixedSlot
"
;
import
{
clearMonsterPlaceInteractivities
}
from
"
../../reducers/duel/mod
"
;
const
shape
=
CONFIG
.
CardSlotShape
();
const
left
=
-
2.15
;
// TODO: config
...
...
@@ -32,6 +33,7 @@ const Monsters = () => {
position=
{
position
}
rotation=
{
CONFIG
.
CardSlotRotation
(
false
)
}
deffenseRotation=
{
CONFIG
.
CardSlotDefenceRotation
()
}
clearPlaceInteractivitiesAction=
{
clearMonsterPlaceInteractivities
}
/>
);
}
...
...
@@ -46,6 +48,7 @@ const Monsters = () => {
position=
{
position
}
rotation=
{
CONFIG
.
CardSlotRotation
(
true
)
}
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