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
0a6f32ea
Commit
0a6f32ea
authored
Jan 13, 2023
by
chechunchi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update deck.tsx
parent
adcdd177
Pipeline
#19459
passed with stages
in 4 minutes and 31 seconds
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
29 additions
and
19 deletions
+29
-19
src/service/duel/start.ts
src/service/duel/start.ts
+3
-0
src/ui/Duel/deck.tsx
src/ui/Duel/deck.tsx
+26
-19
No files found.
src/service/duel/start.ts
View file @
0a6f32ea
...
...
@@ -6,6 +6,7 @@ import {
initMonsters
,
initMagics
,
initCemetery
,
initDeck
,
}
from
"
../../reducers/duel/mod
"
;
export
default
(
...
...
@@ -39,4 +40,6 @@ export default (
dispatch
(
initMagics
(
1
));
dispatch
(
initCemetery
(
0
));
dispatch
(
initCemetery
(
1
));
dispatch
(
initDeck
({
player
:
0
,
deskSize
:
start
.
deckSize1
}));
dispatch
(
initDeck
({
player
:
1
,
deskSize
:
start
.
deckSize2
}));
};
src/ui/Duel/deck.tsx
View file @
0a6f32ea
import
*
as
BABYLON
from
"
@babylonjs/core
"
;
import
*
as
CONFIG
from
"
../../config/ui
"
;
import
{
useAppSelector
}
from
"
../../hook
"
;
import
{
selectMeDeck
,
selectOpDeck
}
from
"
../../reducers/duel/deckSlice
"
;
import
SingleSlot
from
"
./singleSlot
"
;
const
depth
=
0.02
;
const
Deck
=
()
=>
(
<>
...
...
@@ -9,28 +14,22 @@ const Deck = () => (
);
const
CommonDeck
=
()
=>
{
const
shape
=
CONFIG
.
DeckSlotShape
();
const
position
=
new
BABYLON
.
Vector3
(
3.2
,
shape
.
depth
/
2
+
CONFIG
.
Floating
,
-
3.3
);
const
rotation
=
CONFIG
.
DeckSlotRotation
();
const
meDeck
=
useAppSelector
(
selectMeDeck
).
inner
;
const
opDeck
=
useAppSelector
(
selectOpDeck
).
inner
;
return
(
<
box
name=
"common-deck"
width=
{
shape
.
width
}
height=
{
shape
.
height
}
depth=
{
shape
.
depth
}
position=
{
position
}
rotation=
{
rotation
}
>
<
standardMaterial
name=
"common-deck-mat"
diffuseColor=
{
CONFIG
.
DeckColor
()
}
<>
<
SingleSlot
state=
{
meDeck
}
position=
{
deckPosition
(
0
,
meDeck
.
length
)
}
rotation=
{
CONFIG
.
CardSlotRotation
(
false
)
}
/>
</
box
>
<
SingleSlot
state=
{
opDeck
}
position=
{
deckPosition
(
1
,
opDeck
.
length
)
}
rotation=
{
CONFIG
.
CardSlotRotation
(
true
)
}
/>
</>
);
};
...
...
@@ -60,4 +59,12 @@ const ExtraDeck = () => {
);
};
const
deckPosition
=
(
player
:
number
,
deckLength
:
number
)
=>
{
const
x
=
player
==
0
?
3.2
:
-
3.2
;
const
y
=
(
depth
*
deckLength
)
/
2
+
CONFIG
.
Floating
;
const
z
=
player
==
0
?
-
3.3
:
3.3
;
return
new
BABYLON
.
Vector3
(
x
,
y
,
z
);
};
export
default
Deck
;
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