Commit 13746858 authored by chechunchi's avatar chechunchi

Revert "fix small but not done"

This reverts commit f12960ff.
parent f12960ff
...@@ -3,29 +3,19 @@ import { Engine, Scene } from "react-babylonjs"; ...@@ -3,29 +3,19 @@ import { Engine, Scene } from "react-babylonjs";
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 DuelHands from "./hands_"; import DuelHands from "./hands_";
import { selectMeHands } from "../../reducers/duel/handsSlice";
import { useAppSelector } from "../../hook";
import CardModal from "./cardModal";
import HintNotification from "./hintNotification";
const BabylonCanvas = () => { const BabylonCanvas = () => (
const hands = useAppSelector(selectMeHands).cards; <div>
<Engine antialias adaptToDeviceRatio canvasId="babylonJS">
return ( <Scene>
<div> <DuelCamera />
<Engine antialias adaptToDeviceRatio canvasId="babylonJS"> <DuelLight />
<Scene> <DuelHands />
<DuelCamera /> <DuelGround />
<DuelLight /> </Scene>
<DuelHands hands={hands} /> </Engine>
<DuelGround /> </div>
</Scene> );
</Engine>
<CardModal />
<HintNotification />
</div>
);
};
const DuelCamera = () => ( const DuelCamera = () => (
<freeCamera <freeCamera
......
import * as BABYLON from "@babylonjs/core"; import * as BABYLON from "@babylonjs/core";
import { useAppSelector } from "../../hook";
import { selectMeHands } from "../../reducers/duel/handsSlice";
import * as CONFIG from "../../config/ui"; import * as CONFIG from "../../config/ui";
import { Card, InteractType } from "../../reducers/duel/util"; import { Card, InteractType } from "../../reducers/duel/util";
import { import {
...@@ -11,11 +13,13 @@ import { store } from "../../store"; ...@@ -11,11 +13,13 @@ import { store } from "../../store";
import { useClick, useHover } from "react-babylonjs"; import { useClick, useHover } from "react-babylonjs";
import { useState, useRef } from "react"; import { useState, useRef } from "react";
const DuelHands = (props: { hands: Card[] }) => { const DuelHands = () => {
const hands = useAppSelector(selectMeHands).cards;
return ( return (
<> <>
{props.hands.map((hand, idx) => { {hands.map((hand, idx) => {
return <DuelHand state={hand} idx={idx} key={idx} />; return <DuelHand state={hand} idx={idx} />;
})} })}
</> </>
); );
...@@ -54,7 +58,6 @@ const DuelHand = (props: { state: Card; idx: number }) => { ...@@ -54,7 +58,6 @@ const DuelHand = (props: { state: Card; idx: number }) => {
); );
dispatch(setCardModalIsOpen(true)); dispatch(setCardModalIsOpen(true));
}, planeRef); }, planeRef);
return ( return (
<> <>
<plane <plane
......
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