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
cecc5658
Commit
cecc5658
authored
Jan 13, 2023
by
chechunchi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add field.tsx
parent
fc04e90b
Changes
3
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 {
...
@@ -7,6 +7,8 @@ import {
initMagics
,
initMagics
,
initCemetery
,
initCemetery
,
initDeck
,
initDeck
,
initExclusion
,
initField
,
}
from
"
../../reducers/duel/mod
"
;
}
from
"
../../reducers/duel/mod
"
;
export
default
(
export
default
(
...
@@ -42,4 +44,8 @@ export default (
...
@@ -42,4 +44,8 @@ export default (
dispatch
(
initCemetery
(
1
));
dispatch
(
initCemetery
(
1
));
dispatch
(
initDeck
({
player
:
0
,
deskSize
:
start
.
deckSize1
}));
dispatch
(
initDeck
({
player
:
0
,
deskSize
:
start
.
deckSize1
}));
dispatch
(
initDeck
({
player
:
1
,
deskSize
:
start
.
deckSize2
}));
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
BABYLON
from
"
@babylonjs/core
"
;
import
*
as
CONFIG
from
"
../../config/ui
"
;
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
Field
=
()
=>
{
const
shape
=
CONFIG
.
FieldSlotShape
();
const
meField
=
useAppSelector
(
selectMeField
)?.
inner
;
const
position
=
new
BABYLON
.
Vector3
(
const
opField
=
useAppSelector
(
selectOpField
)?.
inner
;
-
3.3
,
shape
.
depth
/
2
+
CONFIG
.
Floating
,
-
2.0
);
const
rotation
=
CONFIG
.
FieldSlotRotation
();
return
(
return
(
<
box
<>
name=
"field"
<
SingleSlot
width=
{
shape
.
width
}
state=
{
meField
?
[
meField
]
:
[]
}
height=
{
shape
.
height
}
position=
{
fieldPosition
(
0
)
}
depth=
{
shape
.
depth
}
rotation=
{
CONFIG
.
CardSlotRotation
(
false
)
}
position=
{
position
}
/>
rotation=
{
rotation
}
<
SingleSlot
>
state=
{
opField
?
[
opField
]
:
[]
}
<
standardMaterial
name=
"field-mat"
diffuseColor=
{
CONFIG
.
FieldColor
()
}
/>
position=
{
fieldPosition
(
1
)
}
</
box
>
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
;
export
default
Field
;
src/ui/Duel/main.tsx
View file @
cecc5658
...
@@ -35,6 +35,7 @@ const NeosDuel = () => (
...
@@ -35,6 +35,7 @@ const NeosDuel = () => (
<
Deck
/>
<
Deck
/>
<
Cemeteries
/>
<
Cemeteries
/>
<
Exclusion
/>
<
Exclusion
/>
<
Field
/>
<
Ground
/>
<
Ground
/>
</
Provider
>
</
Provider
>
</
Scene
>
</
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