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
a20ba050
Commit
a20ba050
authored
Jan 23, 2023
by
Chunchi Che
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add extraDeck.tsx
parent
ac068254
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
43 additions
and
36 deletions
+43
-36
src/ui/Duel/deck.tsx
src/ui/Duel/deck.tsx
+1
-34
src/ui/Duel/extraDeck.tsx
src/ui/Duel/extraDeck.tsx
+38
-0
src/ui/Duel/main.tsx
src/ui/Duel/main.tsx
+4
-2
No files found.
src/ui/Duel/deck.tsx
View file @
a20ba050
...
...
@@ -4,13 +4,6 @@ import { useAppSelector } from "../../hook";
import
{
selectMeDeck
,
selectOpDeck
}
from
"
../../reducers/duel/deckSlice
"
;
import
SingleSlot
,
{
Depth
}
from
"
./singleSlot
"
;
const
Deck
=
()
=>
(
<>
<
CommonDeck
/>
<
ExtraDeck
/>
</>
);
const
CommonDeck
=
()
=>
{
const
meDeck
=
useAppSelector
(
selectMeDeck
).
inner
;
const
opDeck
=
useAppSelector
(
selectOpDeck
).
inner
;
...
...
@@ -31,32 +24,6 @@ const CommonDeck = () => {
);
};
const
ExtraDeck
=
()
=>
{
const
shape
=
CONFIG
.
ExtraDeckSlotShape
();
const
position
=
new
BABYLON
.
Vector3
(
-
3.3
,
shape
.
depth
/
2
+
CONFIG
.
Floating
,
-
3.3
);
const
rotation
=
CONFIG
.
DeckSlotRotation
();
return
(
<
box
name=
"extra-deck"
width=
{
shape
.
width
}
height=
{
shape
.
height
}
depth=
{
shape
.
depth
}
position=
{
position
}
rotation=
{
rotation
}
>
<
standardMaterial
name=
"extra-deck-mat"
diffuseColor=
{
CONFIG
.
ExtraDeckColor
()
}
/>
</
box
>
);
};
const
deckPosition
=
(
player
:
number
,
deckLength
:
number
)
=>
{
const
x
=
player
==
0
?
3.2
:
-
3.2
;
const
y
=
(
Depth
*
deckLength
)
/
2
+
CONFIG
.
Floating
;
...
...
@@ -65,4 +32,4 @@ const deckPosition = (player: number, deckLength: number) => {
return
new
BABYLON
.
Vector3
(
x
,
y
,
z
);
};
export
default
Deck
;
export
default
Common
Deck
;
src/ui/Duel/extraDeck.tsx
0 → 100644
View file @
a20ba050
import
SingleSlot
,
{
Depth
}
from
"
./singleSlot
"
;
import
*
as
BABYLON
from
"
@babylonjs/core
"
;
import
*
as
CONFIG
from
"
../../config/ui
"
;
import
{
useAppSelector
}
from
"
../../hook
"
;
import
{
selectMeExtraDeck
,
selectOpExtraDeck
,
}
from
"
../../reducers/duel/extraDeckSlice
"
;
const
ExtraDeck
=
()
=>
{
const
meExtraDeck
=
useAppSelector
(
selectMeExtraDeck
).
inner
;
const
opExtraDeck
=
useAppSelector
(
selectOpExtraDeck
).
inner
;
return
(
<>
<
SingleSlot
state=
{
meExtraDeck
}
position=
{
extraDeckPosition
(
0
,
meExtraDeck
.
length
)
}
rotation=
{
CONFIG
.
CardSlotRotation
(
false
)
}
/>
<
SingleSlot
state=
{
opExtraDeck
}
position=
{
extraDeckPosition
(
1
,
opExtraDeck
.
length
)
}
rotation=
{
CONFIG
.
CardSlotRotation
(
true
)
}
/>
</>
);
};
const
extraDeckPosition
=
(
player
:
number
,
deckLength
:
number
)
=>
{
const
x
=
player
==
0
?
-
3.3
:
3.3
;
const
y
=
(
Depth
&
deckLength
)
/
2
+
CONFIG
.
Floating
;
const
z
=
player
==
0
?
-
3.3
:
3.3
;
return
new
BABYLON
.
Vector3
(
x
,
y
,
z
);
};
export
default
ExtraDeck
;
src/ui/Duel/main.tsx
View file @
a20ba050
...
...
@@ -9,7 +9,7 @@ import CardModal from "./cardModal";
import
HintNotification
from
"
./hintNotification
"
;
import
Magics
from
"
./magics
"
;
import
Field
from
"
./field
"
;
import
Deck
from
"
./deck
"
;
import
Common
Deck
from
"
./deck
"
;
import
Exclusion
from
"
./exclusion
"
;
import
Cemeteries
from
"
./cemetery
"
;
import
CardListModal
from
"
./cardListModal
"
;
...
...
@@ -19,6 +19,7 @@ import PositionModal from "./positionModal";
import
OptionModal
from
"
./optionModal
"
;
import
Phase
from
"
./phase
"
;
import
CheckCardModalV2
from
"
./checkCardModalV2
"
;
import
ExtraDeck
from
"
./extraDeck
"
;
// Ref: https://github.com/brianzinn/react-babylonjs/issues/126
const
NeosDuel
=
()
=>
(
...
...
@@ -34,7 +35,8 @@ const NeosDuel = () => (
<
Monsters
/>
<
Magics
/>
<
Field
/>
<
Deck
/>
<
CommonDeck
/>
<
ExtraDeck
/>
<
Cemeteries
/>
<
Exclusion
/>
<
Field
/>
...
...
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