Commit 4d7402c3 authored by Chunchi Che's avatar Chunchi Che

Merge branch 'optimize/ui/edge' into 'main'

Optimize/ui/edge

See merge request mycard/Neos!57
parents 0e476ba3 7b428da2
...@@ -42,6 +42,8 @@ const CHand = (props: { state: Hand; idx: number; gap: number }) => { ...@@ -42,6 +42,8 @@ const CHand = (props: { state: Hand; idx: number; gap: number }) => {
const rotation = CONFIG.HandRotation(); const rotation = CONFIG.HandRotation();
const hoverScale = CONFIG.HandHoverScaling(); const hoverScale = CONFIG.HandHoverScaling();
const defaultScale = new BABYLON.Vector3(1, 1, 1); const defaultScale = new BABYLON.Vector3(1, 1, 1);
const edgesWidth = 2.0;
const edgesColor = BABYLON.Color4.FromColor3(BABYLON.Color3.Yellow());
const planeRef = useRef(null); const planeRef = useRef(null);
const [state, idx] = [props.state, props.idx]; const [state, idx] = [props.state, props.idx];
const [hovered, setHovered] = useState(false); const [hovered, setHovered] = useState(false);
...@@ -127,6 +129,9 @@ const CHand = (props: { state: Hand; idx: number; gap: number }) => { ...@@ -127,6 +129,9 @@ const CHand = (props: { state: Hand; idx: number; gap: number }) => {
scaling={hovered ? hoverScale : defaultScale} scaling={hovered ? hoverScale : defaultScale}
position={spring.position} position={spring.position}
rotation={rotation} rotation={rotation}
enableEdgesRendering
edgesWidth={state.interactivities.length == 0 ? 0 : edgesWidth}
edgesColor={edgesColor}
> >
<animated.standardMaterial <animated.standardMaterial
name={`hand-mat-${idx}`} name={`hand-mat-${idx}`}
......
...@@ -9,6 +9,7 @@ import { sendSelectPlaceResponse } from "../../api/ocgcore/ocgHelper"; ...@@ -9,6 +9,7 @@ import { sendSelectPlaceResponse } from "../../api/ocgcore/ocgHelper";
import { import {
clearMonsterSelectInfo, clearMonsterSelectInfo,
setCardModalImgUrl, setCardModalImgUrl,
setCardModalInteractivies,
setCardModalIsOpen, setCardModalIsOpen,
setCardModalText, setCardModalText,
} from "../../reducers/duel/mod"; } from "../../reducers/duel/mod";
...@@ -73,6 +74,7 @@ const CommonMonster = (props: { state: Monster }) => { ...@@ -73,6 +74,7 @@ const CommonMonster = (props: { state: Monster }) => {
`https://cdn02.moecube.com:444/images/ygopro-images-zh-CN/${props.state.occupant.id}.jpg` `https://cdn02.moecube.com:444/images/ygopro-images-zh-CN/${props.state.occupant.id}.jpg`
) )
); );
dispatch(setCardModalInteractivies([])); // TODO
dispatch(setCardModalIsOpen(true)); dispatch(setCardModalIsOpen(true));
} }
}, },
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment