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
7b5387ce
Commit
7b5387ce
authored
Dec 30, 2022
by
Chunchi Che
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update monster ui
parent
676e637d
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
27 additions
and
9 deletions
+27
-9
src/config/ui.ts
src/config/ui.ts
+8
-5
src/ui/Duel/monsters.tsx
src/ui/Duel/monsters.tsx
+19
-4
No files found.
src/config/ui.ts
View file @
7b5387ce
...
@@ -27,19 +27,22 @@ export const FieldSlotShape = () => {
...
@@ -27,19 +27,22 @@ export const FieldSlotShape = () => {
return
{
width
:
0.8
,
height
:
1
,
depth
:
0.2
};
return
{
width
:
0.8
,
height
:
1
,
depth
:
0.2
};
};
};
export
const
CardSlotRotation
=
()
=>
{
export
const
CardSlotRotation
=
()
=>
{
return
new
BABYLON
.
Vector3
(
1.5
,
0
,
0
);
return
new
BABYLON
.
Vector3
(
1.55
,
0
,
0
);
};
export
const
CardSlotDefenceRotation
=
()
=>
{
return
new
BABYLON
.
Vector3
(
1.55
,
1.55
,
0
);
};
};
export
const
DeckSlotRotation
=
()
=>
{
export
const
DeckSlotRotation
=
()
=>
{
return
new
BABYLON
.
Vector3
(
1.5
,
0
,
0
);
return
new
BABYLON
.
Vector3
(
1.5
5
,
0
,
0
);
};
};
export
const
CemeterySlotRotation
=
()
=>
{
export
const
CemeterySlotRotation
=
()
=>
{
return
new
BABYLON
.
Vector3
(
1.5
,
0
,
0
);
return
new
BABYLON
.
Vector3
(
1.5
5
,
0
,
0
);
};
};
export
const
ExclusionSlotRotation
=
()
=>
{
export
const
ExclusionSlotRotation
=
()
=>
{
return
new
BABYLON
.
Vector3
(
1.5
,
0
,
0
);
return
new
BABYLON
.
Vector3
(
1.5
5
,
0
,
0
);
};
};
export
const
FieldSlotRotation
=
()
=>
{
export
const
FieldSlotRotation
=
()
=>
{
return
new
BABYLON
.
Vector3
(
1.5
,
0
,
0
);
return
new
BABYLON
.
Vector3
(
1.5
5
,
0
,
0
);
};
};
// 浮空
// 浮空
...
...
src/ui/Duel/monsters.tsx
View file @
7b5387ce
...
@@ -9,6 +9,7 @@ import { sendSelectPlaceResponse } from "../../api/ocgcore/ocgHelper";
...
@@ -9,6 +9,7 @@ import { sendSelectPlaceResponse } from "../../api/ocgcore/ocgHelper";
import
{
clearMonsterSelectInfo
}
from
"
../../reducers/duel/mod
"
;
import
{
clearMonsterSelectInfo
}
from
"
../../reducers/duel/mod
"
;
import
{
useAppSelector
}
from
"
../../hook
"
;
import
{
useAppSelector
}
from
"
../../hook
"
;
import
{
selectMeMonsters
}
from
"
../../reducers/duel/monstersSlice
"
;
import
{
selectMeMonsters
}
from
"
../../reducers/duel/monstersSlice
"
;
import
{
ygopro
}
from
"
../../api/ocgcore/idl/ocgcore
"
;
const
left
=
-
2.15
;
// TODO: config
const
left
=
-
2.15
;
// TODO: config
const
gap
=
1.05
;
const
gap
=
1.05
;
...
@@ -34,11 +35,21 @@ const CommonMonster = (props: { state: Monster }) => {
...
@@ -34,11 +35,21 @@ const CommonMonster = (props: { state: Monster }) => {
shape
.
depth
/
2
+
CONFIG
.
Floating
,
shape
.
depth
/
2
+
CONFIG
.
Floating
,
-
1.35
-
1.35
);
);
const
rotation
=
CONFIG
.
CardSlotRotation
();
const
rotation
=
props
.
state
.
position
===
ygopro
.
CardPosition
.
DEFENSE
||
props
.
state
.
position
===
ygopro
.
CardPosition
.
FACEUP_DEFENSE
||
props
.
state
.
position
===
ygopro
.
CardPosition
.
FACEDOWN_DEFENSE
?
CONFIG
.
CardSlotDefenceRotation
()
:
CONFIG
.
CardSlotRotation
();
const
edgesWidth
=
2.0
;
const
edgesWidth
=
2.0
;
const
edgesColor
=
BABYLON
.
Color4
.
FromColor3
(
BABYLON
.
Color3
.
Yellow
());
const
edgesColor
=
BABYLON
.
Color4
.
FromColor3
(
BABYLON
.
Color3
.
Yellow
());
const
dispatch
=
store
.
dispatch
;
const
dispatch
=
store
.
dispatch
;
const
faceDown
=
props
.
state
.
position
===
ygopro
.
CardPosition
.
FACEDOWN_DEFENSE
||
ygopro
.
CardPosition
.
FACEDOWN_ATTACK
||
ygopro
.
CardPosition
.
FACEDOWN
;
useClick
(
useClick
(
(
_event
)
=>
{
(
_event
)
=>
{
if
(
props
.
state
.
selectInfo
)
{
if
(
props
.
state
.
selectInfo
)
{
...
@@ -67,9 +78,13 @@ const CommonMonster = (props: { state: Monster }) => {
...
@@ -67,9 +78,13 @@ const CommonMonster = (props: { state: Monster }) => {
name=
{
`monster-mat-${props.state.sequence}`
}
name=
{
`monster-mat-${props.state.sequence}`
}
diffuseTexture=
{
diffuseTexture=
{
props
.
state
.
occupant
props
.
state
.
occupant
?
new
BABYLON
.
Texture
(
?
faceDown
`https://cdn02.moecube.com:444/images/ygopro-images-zh-CN/${props.state.occupant.id}.jpg`
?
new
BABYLON
.
Texture
(
)
`http://localhost:3030/images/card_back.jpg`
)
:
new
BABYLON
.
Texture
(
`https://cdn02.moecube.com:444/images/ygopro-images-zh-CN/${props.state.occupant.id}.jpg`
)
:
new
BABYLON
.
Texture
(
`http://localhost:3030/images/card_slot.png`
)
:
new
BABYLON
.
Texture
(
`http://localhost:3030/images/card_slot.png`
)
}
}
alpha=
{
props
.
state
.
occupant
?
1
:
0
}
alpha=
{
props
.
state
.
occupant
?
1
:
0
}
...
...
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