From c2db053ec7743dd21ad38d73bb15453396b070e2 Mon Sep 17 00:00:00 2001 From: Alexander Mangel Date: Sun, 8 Oct 2023 10:51:15 -0500 Subject: [PATCH] fix: remove flickering on cursor --- packages/client/src/game/entities/facility.tsx | 2 +- packages/client/src/game/input/cursor.tsx | 12 ++++++++---- .../client/src/game/systems/constructionSystem.tsx | 1 + packages/contracts/worlds.json | 2 +- 4 files changed, 11 insertions(+), 6 deletions(-) diff --git a/packages/client/src/game/entities/facility.tsx b/packages/client/src/game/entities/facility.tsx index 088283a..84accca 100644 --- a/packages/client/src/game/entities/facility.tsx +++ b/packages/client/src/game/entities/facility.tsx @@ -128,7 +128,7 @@ const Facility = (props: IFacility) => { ? palette.cursor : "black" } - visible={faceIndex !== undefined && faceIndex === index} + visible={false} transparent={true} // TODO: Remove the face highlighting completely, or use alternative face highlighting like in Townscraper opacity={0} diff --git a/packages/client/src/game/input/cursor.tsx b/packages/client/src/game/input/cursor.tsx index 3d0883f..e9de769 100644 --- a/packages/client/src/game/input/cursor.tsx +++ b/packages/client/src/game/input/cursor.tsx @@ -1,6 +1,6 @@ import { useEffect, useRef, useState } from "react"; import { Sparkles } from "@react-three/drei"; -import { AdditiveBlending, DoubleSide } from "three"; +import { AdditiveBlending, DoubleSide, Vector3 } from "three"; import { useStore } from "../store"; import { palette } from "../utils/palette"; @@ -38,9 +38,13 @@ function Cursor() { }, [cursorState, building, position, setCursor]); return ( - + - + {/* Face mapping for direction */} {[...Array(6)].map((_, index) => ( {/* 🐁 main cursor block */} - + { const { input: { building }, diff --git a/packages/contracts/worlds.json b/packages/contracts/worlds.json index bd48105..ab87925 100644 --- a/packages/contracts/worlds.json +++ b/packages/contracts/worlds.json @@ -1,5 +1,5 @@ { "31337": { - "address": "0x5FbDB2315678afecb367f032d93F642f64180aa3" + "address": "0xB7f8BC63BbcaD18155201308C8f3540b07f84F5e" } } \ No newline at end of file