diff --git a/app/public/index.html b/app/public/index.html
index 785ee0f..d05ca9d 100644
--- a/app/public/index.html
+++ b/app/public/index.html
@@ -1,9 +1,12 @@
-
+
@@ -52,12 +52,7 @@ const Header: React.FC = () => {
))}
-
- {userName[0]}
-
+
{userName[0]}
diff --git a/app/src/components/layout/sidebarRight/mechanics/ConveyorMechanics.tsx b/app/src/components/layout/sidebarRight/mechanics/ConveyorMechanics.tsx
index f80fca0..bd10613 100644
--- a/app/src/components/layout/sidebarRight/mechanics/ConveyorMechanics.tsx
+++ b/app/src/components/layout/sidebarRight/mechanics/ConveyorMechanics.tsx
@@ -9,9 +9,13 @@ import RenameInput from "../../../ui/inputs/RenameInput";
import InputWithDropDown from "../../../ui/inputs/InputWithDropDown";
import LabledDropdown from "../../../ui/inputs/LabledDropdown";
import { handleResize } from "../../../../functions/handleResizePannel";
-import { useSelectedActionSphere, useSelectedPath, useSimulationPaths } from "../../../../store/store";
-import * as THREE from 'three';
-import * as Types from '../../../../types/world/worldTypes';
+import {
+ useSelectedActionSphere,
+ useSelectedPath,
+ useSimulationPaths,
+} from "../../../../store/store";
+import * as THREE from "three";
+import * as Types from "../../../../types/world/worldTypes";
import InputToggle from "../../../ui/inputs/InputToggle";
const ConveyorMechanics: React.FC = () => {
@@ -25,7 +29,9 @@ const ConveyorMechanics: React.FC = () => {
const selectedPoint = useMemo(() => {
if (!selectedActionSphere) return null;
return simulationPaths
- .filter((path): path is Types.ConveyorEventsSchema => path.type === "Conveyor")
+ .filter(
+ (path): path is Types.ConveyorEventsSchema => path.type === "Conveyor"
+ )
.flatMap((path) => path.points)
.find((point) => point.uuid === selectedActionSphere.point.uuid);
}, [selectedActionSphere, simulationPaths]);
@@ -43,11 +49,11 @@ const ConveyorMechanics: React.FC = () => {
const newAction = {
uuid: THREE.MathUtils.generateUUID(),
name: `Action ${actionIndex + 1}`,
- type: 'Inherit',
- material: 'Inherit',
- delay: 'Inherit',
- spawnInterval: 'Inherit',
- isUsed: false
+ type: "Inherit",
+ material: "Inherit",
+ delay: "Inherit",
+ spawnInterval: "Inherit",
+ isUsed: false,
};
return { ...point, actions: [...point.actions, newAction] };
@@ -68,13 +74,18 @@ const ConveyorMechanics: React.FC = () => {
const updatedPaths = simulationPaths.map((path) =>
path.type === "Conveyor"
? {
- ...path,
- points: path.points.map((point) =>
- point.uuid === selectedActionSphere.point.uuid
- ? { ...point, actions: point.actions.filter(action => action.uuid !== uuid) }
- : point
- ),
- }
+ ...path,
+ points: path.points.map((point) =>
+ point.uuid === selectedActionSphere.point.uuid
+ ? {
+ ...point,
+ actions: point.actions.filter(
+ (action) => action.uuid !== uuid
+ ),
+ }
+ : point
+ ),
+ }
: path
);
@@ -87,26 +98,33 @@ const ConveyorMechanics: React.FC = () => {
const updatedPaths = simulationPaths.map((path) =>
path.type === "Conveyor"
? {
- ...path,
- points: path.points.map((point) =>
- point.uuid === selectedActionSphere.point.uuid
- ? {
- ...point,
- actions: point.actions.map((action) =>
- action.uuid === uuid
- ? {
- ...action,
- type: actionType,
- material: actionType === 'Spawn' || actionType === 'Swap' ? 'Inherit' : action.material,
- delay: actionType === 'Delay' ? 'Inherit' : action.delay,
- spawnInterval: actionType === 'Spawn' ? 'Inherit' : action.spawnInterval
- }
- : action
- ),
- }
- : point
- ),
- }
+ ...path,
+ points: path.points.map((point) =>
+ point.uuid === selectedActionSphere.point.uuid
+ ? {
+ ...point,
+ actions: point.actions.map((action) =>
+ action.uuid === uuid
+ ? {
+ ...action,
+ type: actionType,
+ material:
+ actionType === "Spawn" || actionType === "Swap"
+ ? "Inherit"
+ : action.material,
+ delay:
+ actionType === "Delay" ? "Inherit" : action.delay,
+ spawnInterval:
+ actionType === "Spawn"
+ ? "Inherit"
+ : action.spawnInterval,
+ }
+ : action
+ ),
+ }
+ : point
+ ),
+ }
: path
);
@@ -115,15 +133,17 @@ const ConveyorMechanics: React.FC = () => {
// Update the selected item to reflect changes
if (selectedItem?.type === "action" && selectedItem.item.uuid === uuid) {
const updatedAction = updatedPaths
- .filter((path): path is Types.ConveyorEventsSchema => path.type === "Conveyor")
- .flatMap(path => path.points)
- .find(p => p.uuid === selectedActionSphere.point.uuid)
- ?.actions.find(a => a.uuid === uuid);
+ .filter(
+ (path): path is Types.ConveyorEventsSchema => path.type === "Conveyor"
+ )
+ .flatMap((path) => path.points)
+ .find((p) => p.uuid === selectedActionSphere.point.uuid)
+ ?.actions.find((a) => a.uuid === uuid);
if (updatedAction) {
setSelectedItem({
type: "action",
- item: updatedAction
+ item: updatedAction,
});
}
}
@@ -136,21 +156,21 @@ const ConveyorMechanics: React.FC = () => {
const updatedPaths = simulationPaths.map((path) =>
path.type === "Conveyor"
? {
- ...path,
- points: path.points.map((point) =>
- point.uuid === selectedActionSphere.point.uuid
- ? {
- ...point,
- actions: point.actions.map((action) =>
- action.uuid === uuid &&
- (action.type === 'Spawn' || action.type === 'Swap')
- ? { ...action, material }
- : action
- ),
- }
- : point
- ),
- }
+ ...path,
+ points: path.points.map((point) =>
+ point.uuid === selectedActionSphere.point.uuid
+ ? {
+ ...point,
+ actions: point.actions.map((action) =>
+ action.uuid === uuid &&
+ (action.type === "Spawn" || action.type === "Swap")
+ ? { ...action, material }
+ : action
+ ),
+ }
+ : point
+ ),
+ }
: path
);
@@ -162,8 +182,8 @@ const ConveyorMechanics: React.FC = () => {
...selectedItem,
item: {
...selectedItem.item,
- material
- }
+ material,
+ },
});
}
};
@@ -174,42 +194,47 @@ const ConveyorMechanics: React.FC = () => {
const updatedPaths = simulationPaths.map((path) =>
path.type === "Conveyor"
? {
- ...path,
- points: path.points.map((point) =>
- point.uuid === selectedActionSphere.point.uuid
- ? {
- ...point,
- actions: point.actions.map((action) =>
- action.uuid === uuid ? { ...action, delay } : action
- ),
- }
- : point
- ),
- }
+ ...path,
+ points: path.points.map((point) =>
+ point.uuid === selectedActionSphere.point.uuid
+ ? {
+ ...point,
+ actions: point.actions.map((action) =>
+ action.uuid === uuid ? { ...action, delay } : action
+ ),
+ }
+ : point
+ ),
+ }
: path
);
setSimulationPaths(updatedPaths);
};
- const handleSpawnIntervalChange = (uuid: string, spawnInterval: number | string) => {
+ const handleSpawnIntervalChange = (
+ uuid: string,
+ spawnInterval: number | string
+ ) => {
if (!selectedActionSphere) return;
const updatedPaths = simulationPaths.map((path) =>
path.type === "Conveyor"
? {
- ...path,
- points: path.points.map((point) =>
- point.uuid === selectedActionSphere.point.uuid
- ? {
- ...point,
- actions: point.actions.map((action) =>
- action.uuid === uuid ? { ...action, spawnInterval } : action
- ),
- }
- : point
- ),
- }
+ ...path,
+ points: path.points.map((point) =>
+ point.uuid === selectedActionSphere.point.uuid
+ ? {
+ ...point,
+ actions: point.actions.map((action) =>
+ action.uuid === uuid
+ ? { ...action, spawnInterval }
+ : action
+ ),
+ }
+ : point
+ ),
+ }
: path
);
@@ -233,23 +258,23 @@ const ConveyorMechanics: React.FC = () => {
const updatedPaths = simulationPaths.map((path) =>
path.type === "Conveyor"
? {
- ...path,
- points: path.points.map((point) => {
- if (point.uuid === selectedActionSphere.point.uuid) {
- const triggerIndex = point.triggers.length;
- const newTrigger = {
- uuid: THREE.MathUtils.generateUUID(),
- name: `Trigger ${triggerIndex + 1}`,
- type: '',
- bufferTime: 0,
- isUsed: false
- };
+ ...path,
+ points: path.points.map((point) => {
+ if (point.uuid === selectedActionSphere.point.uuid) {
+ const triggerIndex = point.triggers.length;
+ const newTrigger = {
+ uuid: THREE.MathUtils.generateUUID(),
+ name: `Trigger ${triggerIndex + 1}`,
+ type: "",
+ bufferTime: 0,
+ isUsed: false,
+ };
- return { ...point, triggers: [...point.triggers, newTrigger] };
- }
- return point;
- }),
- }
+ return { ...point, triggers: [...point.triggers, newTrigger] };
+ }
+ return point;
+ }),
+ }
: path
);
@@ -262,13 +287,18 @@ const ConveyorMechanics: React.FC = () => {
const updatedPaths = simulationPaths.map((path) =>
path.type === "Conveyor"
? {
- ...path,
- points: path.points.map((point) =>
- point.uuid === selectedActionSphere.point.uuid
- ? { ...point, triggers: point.triggers.filter(trigger => trigger.uuid !== uuid) }
- : point
- ),
- }
+ ...path,
+ points: path.points.map((point) =>
+ point.uuid === selectedActionSphere.point.uuid
+ ? {
+ ...point,
+ triggers: point.triggers.filter(
+ (trigger) => trigger.uuid !== uuid
+ ),
+ }
+ : point
+ ),
+ }
: path
);
@@ -281,18 +311,20 @@ const ConveyorMechanics: React.FC = () => {
const updatedPaths = simulationPaths.map((path) =>
path.type === "Conveyor"
? {
- ...path,
- points: path.points.map((point) =>
- point.uuid === selectedActionSphere.point.uuid
- ? {
- ...point,
- triggers: point.triggers.map((trigger) =>
- trigger.uuid === uuid ? { ...trigger, type: triggerType } : trigger
- ),
- }
- : point
- ),
- }
+ ...path,
+ points: path.points.map((point) =>
+ point.uuid === selectedActionSphere.point.uuid
+ ? {
+ ...point,
+ triggers: point.triggers.map((trigger) =>
+ trigger.uuid === uuid
+ ? { ...trigger, type: triggerType }
+ : trigger
+ ),
+ }
+ : point
+ ),
+ }
: path
);
@@ -309,26 +341,25 @@ const ConveyorMechanics: React.FC = () => {
}
};
-
// Update the toggle handlers to immediately update the selected item
const handleActionToggle = (uuid: string) => {
if (!selectedActionSphere) return;
const updatedPaths = simulationPaths.map((path) =>
path.type === "Conveyor"
? {
- ...path,
- points: path.points.map((point) =>
- point.uuid === selectedActionSphere.point.uuid
- ? {
- ...point,
- actions: point.actions.map((action) => ({
- ...action,
- isUsed: action.uuid === uuid ? !action.isUsed : false,
- })),
- }
- : point
- ),
- }
+ ...path,
+ points: path.points.map((point) =>
+ point.uuid === selectedActionSphere.point.uuid
+ ? {
+ ...point,
+ actions: point.actions.map((action) => ({
+ ...action,
+ isUsed: action.uuid === uuid ? !action.isUsed : false,
+ })),
+ }
+ : point
+ ),
+ }
: path
);
@@ -340,8 +371,8 @@ const ConveyorMechanics: React.FC = () => {
...selectedItem,
item: {
...selectedItem.item,
- isUsed: !selectedItem.item.isUsed
- }
+ isUsed: !selectedItem.item.isUsed,
+ },
});
}
};
@@ -353,19 +384,19 @@ const ConveyorMechanics: React.FC = () => {
const updatedPaths = simulationPaths.map((path) =>
path.type === "Conveyor"
? {
- ...path,
- points: path.points.map((point) =>
- point.uuid === selectedActionSphere.point.uuid
- ? {
- ...point,
- triggers: point.triggers.map((trigger) => ({
- ...trigger,
- isUsed: trigger.uuid === uuid ? !trigger.isUsed : false,
- })),
- }
- : point
- ),
- }
+ ...path,
+ points: path.points.map((point) =>
+ point.uuid === selectedActionSphere.point.uuid
+ ? {
+ ...point,
+ triggers: point.triggers.map((trigger) => ({
+ ...trigger,
+ isUsed: trigger.uuid === uuid ? !trigger.isUsed : false,
+ })),
+ }
+ : point
+ ),
+ }
: path
);
@@ -377,8 +408,8 @@ const ConveyorMechanics: React.FC = () => {
...selectedItem,
item: {
...selectedItem.item,
- isUsed: !selectedItem.item.isUsed
- }
+ isUsed: !selectedItem.item.isUsed,
+ },
});
}
};
@@ -389,18 +420,20 @@ const ConveyorMechanics: React.FC = () => {
const updatedPaths = simulationPaths.map((path) =>
path.type === "Conveyor"
? {
- ...path,
- points: path.points.map((point) =>
- point.uuid === selectedActionSphere.point.uuid
- ? {
- ...point,
- triggers: point.triggers.map((trigger) =>
- trigger.uuid === uuid ? { ...trigger, bufferTime } : trigger
- ),
- }
- : point
- ),
- }
+ ...path,
+ points: path.points.map((point) =>
+ point.uuid === selectedActionSphere.point.uuid
+ ? {
+ ...point,
+ triggers: point.triggers.map((trigger) =>
+ trigger.uuid === uuid
+ ? { ...trigger, bufferTime }
+ : trigger
+ ),
+ }
+ : point
+ ),
+ }
: path
);
@@ -412,13 +445,16 @@ const ConveyorMechanics: React.FC = () => {
...selectedItem,
item: {
...selectedItem.item,
- bufferTime
- }
+ bufferTime,
+ },
});
}
};
- const [selectedItem, setSelectedItem] = useState<{ type: "action" | "trigger"; item: any; } | null>(null);
+ const [selectedItem, setSelectedItem] = useState<{
+ type: "action" | "trigger";
+ item: any;
+ } | null>(null);
useEffect(() => {
setSelectedItem(null);
@@ -426,21 +462,20 @@ const ConveyorMechanics: React.FC = () => {
return (
- {!selectedPath &&
+ {!selectedPath && (
{selectedActionSphere?.path?.modelName || "point name not found"}
- }
-
- {selectedPath &&
+ )}
+ {selectedPath && (
{selectedPath.path.modelName || "path name not found"}
- }
+ )}
- {!selectedPath &&
+ {!selectedPath && (
<>
@@ -458,16 +493,20 @@ const ConveyorMechanics: React.FC = () => {
{selectedPoint?.actions.map((action) => (
setSelectedItem({ type: "action", item: action })}
+ onClick={() =>
+ setSelectedItem({ type: "action", item: action })
+ }
>
+
{
{selectedPoint?.triggers.map((trigger) => (
>
- }
+ )}
{selectedItem && (
@@ -553,48 +596,69 @@ const ConveyorMechanics: React.FC = () => {
handleActionSelect(selectedItem.item.uuid, option)}
+ onSelect={(option) =>
+ handleActionSelect(selectedItem.item.uuid, option)
+ }
/>
{/* Only show material dropdown for Spawn/Swap actions */}
- {(selectedItem.item.type === 'Spawn' || selectedItem.item.type === 'Swap') && (
+ {(selectedItem.item.type === "Spawn" ||
+ selectedItem.item.type === "Swap") && (
handleMaterialSelect(selectedItem.item.uuid, option)}
+ onSelect={(option) =>
+ handleMaterialSelect(selectedItem.item.uuid, option)
+ }
/>
)}
{/* Only show delay input for Delay actions */}
- {selectedItem.item.type === 'Delay' && (
+ {selectedItem.item.type === "Delay" && (
{
const numValue = parseInt(value);
handleDelayChange(
selectedItem.item.uuid,
- !value ? 'Inherit' : numValue
+ !value ? "Inherit" : numValue
);
}}
/>
)}
{/* Only show spawn interval for Spawn actions */}
- {selectedItem.item.type === 'Spawn' && (
+ {selectedItem.item.type === "Spawn" && (
{
- handleSpawnIntervalChange(selectedItem.item.uuid, (value === "") ? "Inherit" : parseInt(value));
+ handleSpawnIntervalChange(
+ selectedItem.item.uuid,
+ value === "" ? "Inherit" : parseInt(value)
+ );
}}
/>
-
)}
>
)}
@@ -609,9 +673,13 @@ const ConveyorMechanics: React.FC = () => {
/>
handleTriggerSelect(selectedItem.item.uuid, option)}
+ onSelect={(option) =>
+ handleTriggerSelect(selectedItem.item.uuid, option)
+ }
/>
{selectedItem.item.type === "Buffer" && (
@@ -619,23 +687,34 @@ const ConveyorMechanics: React.FC = () => {
label="Buffer Time"
value={selectedItem.item.bufferTime.toString()}
onChange={(value) => {
- handleTriggerBufferTimeChange(selectedItem.item.uuid, parseInt(value));
+ handleTriggerBufferTimeChange(
+ selectedItem.item.uuid,
+ parseInt(value)
+ );
}}
/>
)}
>
)}
-
>
)}
{selectedPath && !selectedItem && (
-
+
handleSpeedChange((value === "") ? "Inherit" : parseInt(value))}
+ value={
+ selectedPath.path.speed === "Inherit"
+ ? ""
+ : selectedPath.path.speed.toString()
+ }
+ onChange={(value) =>
+ handleSpeedChange(value === "" ? "Inherit" : parseInt(value))
+ }
/>
)}
@@ -657,4 +736,4 @@ const ConveyorMechanics: React.FC = () => {
);
};
-export default ConveyorMechanics;
\ No newline at end of file
+export default ConveyorMechanics;
diff --git a/app/src/components/ui/menu/menu.tsx b/app/src/components/ui/menu/menu.tsx
index b4ab78e..a416c2c 100644
--- a/app/src/components/ui/menu/menu.tsx
+++ b/app/src/components/ui/menu/menu.tsx
@@ -1,5 +1,6 @@
import React, { useState } from "react";
import { ArrowIcon } from "../../icons/ExportCommonIcons";
+import { toggleTheme } from "../../../utils/theme";
interface MenuBarProps {
setOpenMenu: (isOpen: boolean) => void; // Function to update menu state
@@ -22,6 +23,13 @@ const MenuBar: React.FC
= ({ setOpenMenu }) => {
}));
};
+ function handleThemeChange(){
+ toggleTheme();
+ window.location.reload();
+ }
+
+ const savedTheme: string | null = localStorage.getItem("theme") || "light";
+
return (
= ({ setOpenMenu }) => {
Export as...
+ setActiveMenu("theme")}
+ onMouseLeave={() => {
+ setActiveMenu(null);
+ setActiveSubMenu(null);
+ }}
+ onClick={() => {
+ handleThemeChange();
+ }}
+ >
+
+
+
{/* Apps Menu */}
{/* {
- const [lines, setLines] = useState<{ distance: string; position: THREE.Vector3; userData: Types.Line; layer: string }[]>([]);
- const { activeLayer } = useActiveLayer();
- const { toggleView } = useToggleView();
- const { newLines, setNewLines } = useNewLines();
- const { deletedLines, setDeletedLines } = useDeletedLines();
+ const [lines, setLines] = useState<
+ {
+ distance: string;
+ position: THREE.Vector3;
+ userData: Types.Line;
+ layer: string;
+ }[]
+ >([]);
+ const { activeLayer } = useActiveLayer();
+ const { toggleView } = useToggleView();
+ const { newLines, setNewLines } = useNewLines();
+ const { deletedLines, setDeletedLines } = useDeletedLines();
- useEffect(() => {
- const email = localStorage.getItem('email')
- if (!email) return;
- const organization = (email.split("@")[1]).split(".")[0];
+ useEffect(() => {
+ const email = localStorage.getItem("email");
+ if (!email) return;
+ const organization = email.split("@")[1].split(".")[0];
- getLines(organization).then((data) => {
- data = objectLinesToArray(data);
+ getLines(organization).then((data) => {
+ data = objectLinesToArray(data);
- const lines = data.filter((line: Types.Line) => line[0][2] === activeLayer)
- .map((line: Types.Line) => {
- const point1 = new THREE.Vector3(line[0][0].x, line[0][0].y, line[0][0].z);
- const point2 = new THREE.Vector3(line[1][0].x, line[1][0].y, line[1][0].z);
- const distance = point1.distanceTo(point2);
- const midpoint = new THREE.Vector3().addVectors(point1, point2).divideScalar(2);
- return {
- distance: distance.toFixed(1),
- position: midpoint,
- userData: line,
- layer: activeLayer,
- };
- });
- setLines(lines)
- })
- }, [activeLayer])
+ const lines = data
+ .filter((line: Types.Line) => line[0][2] === activeLayer)
+ .map((line: Types.Line) => {
+ const point1 = new THREE.Vector3(
+ line[0][0].x,
+ line[0][0].y,
+ line[0][0].z
+ );
+ const point2 = new THREE.Vector3(
+ line[1][0].x,
+ line[1][0].y,
+ line[1][0].z
+ );
+ const distance = point1.distanceTo(point2);
+ const midpoint = new THREE.Vector3()
+ .addVectors(point1, point2)
+ .divideScalar(2);
+ return {
+ distance: distance.toFixed(1),
+ position: midpoint,
+ userData: line,
+ layer: activeLayer,
+ };
+ });
+ setLines(lines);
+ });
+ }, [activeLayer]);
- useEffect(() => {
- if (newLines.length > 0) {
- if (newLines[0][0][2] !== activeLayer) return;
- const newLinesData = newLines.map((line: Types.Line) => {
- const point1 = new THREE.Vector3(line[0][0].x, line[0][0].y, line[0][0].z);
- const point2 = new THREE.Vector3(line[1][0].x, line[1][0].y, line[1][0].z);
- const distance = point1.distanceTo(point2);
- const midpoint = new THREE.Vector3().addVectors(point1, point2).divideScalar(2);
+ useEffect(() => {
+ if (newLines.length > 0) {
+ if (newLines[0][0][2] !== activeLayer) return;
+ const newLinesData = newLines.map((line: Types.Line) => {
+ const point1 = new THREE.Vector3(
+ line[0][0].x,
+ line[0][0].y,
+ line[0][0].z
+ );
+ const point2 = new THREE.Vector3(
+ line[1][0].x,
+ line[1][0].y,
+ line[1][0].z
+ );
+ const distance = point1.distanceTo(point2);
+ const midpoint = new THREE.Vector3()
+ .addVectors(point1, point2)
+ .divideScalar(2);
- return {
- distance: distance.toFixed(1),
- position: midpoint,
- userData: line,
- layer: activeLayer,
- };
- });
- setLines((prevLines) => [...prevLines, ...newLinesData]);
- setNewLines([]);
- }
- }, [newLines, activeLayer]);
+ return {
+ distance: distance.toFixed(1),
+ position: midpoint,
+ userData: line,
+ layer: activeLayer,
+ };
+ });
+ setLines((prevLines) => [...prevLines, ...newLinesData]);
+ setNewLines([]);
+ }
+ }, [newLines, activeLayer]);
+ useEffect(() => {
+ if ((deletedLines as Types.Lines).length > 0) {
+ setLines((prevLines) =>
+ prevLines.filter(
+ (line) =>
+ !deletedLines.some(
+ (deletedLine: any) =>
+ deletedLine[0][1] === line.userData[0][1] &&
+ deletedLine[1][1] === line.userData[1][1]
+ )
+ )
+ );
+ setDeletedLines([]);
+ }
+ }, [deletedLines]);
- useEffect(() => {
- if ((deletedLines as Types.Lines).length > 0) {
- setLines((prevLines) =>
- prevLines.filter(
- (line) => !deletedLines.some((deletedLine: any) => deletedLine[0][1] === line.userData[0][1] && deletedLine[1][1] === line.userData[1][1])
- )
- );
- setDeletedLines([]);
- }
- }, [deletedLines]);
+ return (
+ <>
+ {toggleView && (
+
+ {lines.map((text) => (
+
+
+ {text.distance} m
+
+
+ ))}
+
+ )}
+ >
+ );
+};
- return (
- <>
- {toggleView && (
-
- {lines.map((text) => (
-
- {text.distance} m
-
- ))}
-
- )}
- >
- )
-
-}
-
-export default DistanceText;
\ No newline at end of file
+export default DistanceText;
diff --git a/app/src/modules/builder/groups/zoneGroup.tsx b/app/src/modules/builder/groups/zoneGroup.tsx
index 3d47a7e..c5e54d3 100644
--- a/app/src/modules/builder/groups/zoneGroup.tsx
+++ b/app/src/modules/builder/groups/zoneGroup.tsx
@@ -434,9 +434,9 @@ const ZoneGroup: React.FC = () => {
const point2 = new THREE.Vector3(nextPoint[0], nextPoint[1], nextPoint[2]);
const planeWidth = point1.distanceTo(point2);
- const planeHeight = CONSTANTS.wallConfig.height;
+ const planeHeight = CONSTANTS.zoneConfig.height;
- const midpoint = new THREE.Vector3((point1.x + point2.x) / 2, (CONSTANTS.wallConfig.height / 2) + ((zone.layer - 1) * CONSTANTS.wallConfig.height), (point1.z + point2.z) / 2);
+ const midpoint = new THREE.Vector3((point1.x + point2.x) / 2, (CONSTANTS.zoneConfig.height / 2) + ((zone.layer - 1) * CONSTANTS.zoneConfig.height), (point1.z + point2.z) / 2);
const angle = Math.atan2(point2.z - point1.z, point2.x - point1.x);
diff --git a/app/src/modules/scene/environment/ground.tsx b/app/src/modules/scene/environment/ground.tsx
index 6a54577..ebc017e 100644
--- a/app/src/modules/scene/environment/ground.tsx
+++ b/app/src/modules/scene/environment/ground.tsx
@@ -1,9 +1,9 @@
-import * as THREE from 'three';
import { useToggleView } from '../../../store/store';
import * as CONSTANTS from '../../../types/world/worldConstants';
const Ground = ({ grid, plane }: any) => {
- const { toggleView, setToggleView } = useToggleView();
+ const { toggleView } = useToggleView();
+ const savedTheme: string | null = localStorage.getItem('theme');
return (
@@ -19,4 +19,4 @@ const Ground = ({ grid, plane }: any) => {
)
}
-export default Ground;
\ No newline at end of file
+export default Ground;
diff --git a/app/src/modules/scene/scene.tsx b/app/src/modules/scene/scene.tsx
index 74693b4..0a01a99 100644
--- a/app/src/modules/scene/scene.tsx
+++ b/app/src/modules/scene/scene.tsx
@@ -1,11 +1,11 @@
-import { useMemo, useState } from "react";
+import { useMemo } from "react";
import { Canvas } from "@react-three/fiber";
import { Environment, KeyboardControls } from "@react-three/drei";
import World from "./world/world";
import Controls from "./controls/controls";
import TransformControl from "./controls/transformControls";
-import PostProcessing from "./postProcessing/postProcessing"
+import PostProcessing from "./postProcessing/postProcessing";
import Sun from "./environment/sky";
import CamModelsGroup from "../collaboration/collabCams";
import Shadows from "./environment/shadow";
@@ -15,33 +15,31 @@ import background from "../../assets/textures/hdr/mudroadpuresky2k.hdr";
import SelectionControls from "./controls/selection/selectionControls";
import MeasurementTool from "./tools/measurementTool";
import Simulation from "../simulation/simulation";
-import DroppedObjects from "../../components/ui/componets/DroppedFloatingWidgets";
// import Simulation from "./simulationtemp/simulation";
import ZoneCentreTarget from "../../components/ui/componets/zoneCameraTarget";
-import ProductionCapacity from "../../components/layout/3D-cards/cards/ProductionCapacity";
import Dropped3dWidgets from "../../components/ui/componets/Dropped3dWidget";
-import { useWidgetSubOption } from "../../store/store";
export default function Scene() {
-
- const map = useMemo(() => [
- { name: "forward", keys: ["ArrowUp", "w", "W"] },
- { name: "backward", keys: ["ArrowDown", "s", "S"] },
- { name: "left", keys: ["ArrowLeft", "a", "A"] },
- { name: "right", keys: ["ArrowRight", "d", "D"] },
- ], [])
+ const map = useMemo(
+ () => [
+ { name: "forward", keys: ["ArrowUp", "w", "W"] },
+ { name: "backward", keys: ["ArrowDown", "s", "S"] },
+ { name: "left", keys: ["ArrowLeft", "a", "A"] },
+ { name: "right", keys: ["ArrowRight", "d", "D"] },
+ ],
+ []
+ );
+ const savedTheme: string | null = localStorage.getItem("theme");
return (