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
0a6f32ea
Commit
0a6f32ea
authored
Jan 13, 2023
by
chechunchi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update deck.tsx
parent
adcdd177
Changes
2
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 {
...
@@ -6,6 +6,7 @@ import {
initMonsters
,
initMonsters
,
initMagics
,
initMagics
,
initCemetery
,
initCemetery
,
initDeck
,
}
from
"
../../reducers/duel/mod
"
;
}
from
"
../../reducers/duel/mod
"
;
export
default
(
export
default
(
...
@@ -39,4 +40,6 @@ export default (
...
@@ -39,4 +40,6 @@ export default (
dispatch
(
initMagics
(
1
));
dispatch
(
initMagics
(
1
));
dispatch
(
initCemetery
(
0
));
dispatch
(
initCemetery
(
0
));
dispatch
(
initCemetery
(
1
));
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
BABYLON
from
"
@babylonjs/core
"
;
import
*
as
CONFIG
from
"
../../config/ui
"
;
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
=
()
=>
(
const
Deck
=
()
=>
(
<>
<>
...
@@ -9,28 +14,22 @@ const Deck = () => (
...
@@ -9,28 +14,22 @@ const Deck = () => (
);
);
const
CommonDeck
=
()
=>
{
const
CommonDeck
=
()
=>
{
const
shape
=
CONFIG
.
DeckSlotShape
();
const
meDeck
=
useAppSelector
(
selectMeDeck
).
inner
;
const
position
=
new
BABYLON
.
Vector3
(
const
opDeck
=
useAppSelector
(
selectOpDeck
).
inner
;
3.2
,
shape
.
depth
/
2
+
CONFIG
.
Floating
,
-
3.3
);
const
rotation
=
CONFIG
.
DeckSlotRotation
();
return
(
return
(
<
box
<>
name=
"common-deck"
<
SingleSlot
width=
{
shape
.
width
}
state=
{
meDeck
}
height=
{
shape
.
height
}
position=
{
deckPosition
(
0
,
meDeck
.
length
)
}
depth=
{
shape
.
depth
}
rotation=
{
CONFIG
.
CardSlotRotation
(
false
)
}
position=
{
position
}
rotation=
{
rotation
}
>
<
standardMaterial
name=
"common-deck-mat"
diffuseColor=
{
CONFIG
.
DeckColor
()
}
/>
/>
</
box
>
<
SingleSlot
state=
{
opDeck
}
position=
{
deckPosition
(
1
,
opDeck
.
length
)
}
rotation=
{
CONFIG
.
CardSlotRotation
(
true
)
}
/>
</>
);
);
};
};
...
@@ -60,4 +59,12 @@ const ExtraDeck = () => {
...
@@ -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
;
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