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
cecc5658
Commit
cecc5658
authored
Jan 13, 2023
by
chechunchi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add field.tsx
parent
fc04e90b
Pipeline
#19470
passed with stages
in 5 minutes and 13 seconds
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
32 additions
and
17 deletions
+32
-17
src/service/duel/start.ts
src/service/duel/start.ts
+6
-0
src/ui/Duel/field.tsx
src/ui/Duel/field.tsx
+25
-17
src/ui/Duel/main.tsx
src/ui/Duel/main.tsx
+1
-0
No files found.
src/service/duel/start.ts
View file @
cecc5658
...
...
@@ -7,6 +7,8 @@ import {
initMagics
,
initCemetery
,
initDeck
,
initExclusion
,
initField
,
}
from
"
../../reducers/duel/mod
"
;
export
default
(
...
...
@@ -42,4 +44,8 @@ export default (
dispatch
(
initCemetery
(
1
));
dispatch
(
initDeck
({
player
:
0
,
deskSize
:
start
.
deckSize1
}));
dispatch
(
initDeck
({
player
:
1
,
deskSize
:
start
.
deckSize2
}));
dispatch
(
initExclusion
(
0
));
dispatch
(
initExclusion
(
1
));
dispatch
(
initField
(
0
));
dispatch
(
initField
(
1
));
};
src/ui/Duel/field.tsx
View file @
cecc5658
import
*
as
BABYLON
from
"
@babylonjs/core
"
;
import
*
as
CONFIG
from
"
../../config/ui
"
;
import
{
useAppSelector
}
from
"
../../hook
"
;
import
{
selectMeField
,
selectOpField
}
from
"
../../reducers/duel/fieldSlice
"
;
import
SingleSlot
,
{
Depth
}
from
"
./singleSlot
"
;
const
Field
=
()
=>
{
const
shape
=
CONFIG
.
FieldSlotShape
();
const
position
=
new
BABYLON
.
Vector3
(
-
3.3
,
shape
.
depth
/
2
+
CONFIG
.
Floating
,
-
2.0
);
const
rotation
=
CONFIG
.
FieldSlotRotation
();
const
meField
=
useAppSelector
(
selectMeField
)?.
inner
;
const
opField
=
useAppSelector
(
selectOpField
)?.
inner
;
return
(
<
box
name=
"field"
width=
{
shape
.
width
}
height=
{
shape
.
height
}
depth=
{
shape
.
depth
}
position=
{
position
}
rotation=
{
rotation
}
>
<
standardMaterial
name=
"field-mat"
diffuseColor=
{
CONFIG
.
FieldColor
()
}
/>
</
box
>
<>
<
SingleSlot
state=
{
meField
?
[
meField
]
:
[]
}
position=
{
fieldPosition
(
0
)
}
rotation=
{
CONFIG
.
CardSlotRotation
(
false
)
}
/>
<
SingleSlot
state=
{
opField
?
[
opField
]
:
[]
}
position=
{
fieldPosition
(
1
)
}
rotation=
{
CONFIG
.
CardSlotRotation
(
true
)
}
/>
</>
);
};
const
fieldPosition
=
(
player
:
number
)
=>
{
const
x
=
player
==
0
?
-
3.3
:
3.3
;
const
y
=
Depth
/
2
+
CONFIG
.
Floating
;
const
z
=
player
==
0
?
-
2.0
:
2.0
;
return
new
BABYLON
.
Vector3
(
x
,
y
,
z
);
};
export
default
Field
;
src/ui/Duel/main.tsx
View file @
cecc5658
...
...
@@ -35,6 +35,7 @@ const NeosDuel = () => (
<
Deck
/>
<
Cemeteries
/>
<
Exclusion
/>
<
Field
/>
<
Ground
/>
</
Provider
>
</
Scene
>
...
...
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