fix: enable controls when assets are selected and prevent play mode if comparison product is active
This commit is contained in:
parent
0a4e5f97bf
commit
1901c3031a
|
@ -151,6 +151,8 @@ const SelectionControls: React.FC = () => {
|
|||
setSelectedAssets(selected);
|
||||
}
|
||||
}
|
||||
} else if (controls) {
|
||||
(controls as any).enabled = true;
|
||||
}
|
||||
};
|
||||
|
||||
|
|
|
@ -14,6 +14,7 @@ import { getAllProjects } from "../../services/dashboard/getAllProjects";
|
|||
import { getUserData } from "../../components/Dashboard/functions/getUserData";
|
||||
import { useLoadingProgress, useSocketStore } from "../../store/builder/store";
|
||||
import { useAssetsStore } from "../../store/builder/useAssetStore";
|
||||
import { Color } from "three";
|
||||
|
||||
export default function Scene({ layout }: { readonly layout: 'Main Layout' | 'Comparison Layout' }) {
|
||||
const map = useMemo(() => [
|
||||
|
@ -89,7 +90,7 @@ export default function Scene({ layout }: { readonly layout: 'Main Layout' | 'Co
|
|||
e.preventDefault();
|
||||
}}
|
||||
onCreated={(e) => {
|
||||
e.scene.background = null;
|
||||
e.scene.background = layout === 'Main Layout' ? null : new Color(0x19191d);
|
||||
}}
|
||||
gl={{ powerPreference: "high-performance", antialias: true, preserveDrawingBuffer: true }}
|
||||
>
|
||||
|
|
|
@ -23,7 +23,7 @@ import { useLogger } from "../../components/ui/log/LoggerContext";
|
|||
import { useComparisonProduct } from "../../store/simulation/useSimulationStore";
|
||||
|
||||
const KeyPressListener: React.FC = () => {
|
||||
const { clearComparisonProduct } = useComparisonProduct();
|
||||
const { comparisonProduct, clearComparisonProduct } = useComparisonProduct();
|
||||
const { activeModule, setActiveModule } = useModuleStore();
|
||||
const { setActiveSubTool } = useActiveSubTool();
|
||||
const { toggleUILeft, toggleUIRight, setToggleUI } = useToggleStore();
|
||||
|
@ -195,7 +195,7 @@ const KeyPressListener: React.FC = () => {
|
|||
handleBuilderShortcuts(keyCombination);
|
||||
|
||||
// Shortcut to enter play mode
|
||||
if (keyCombination === "Ctrl+P" && !toggleView) {
|
||||
if (keyCombination === "Ctrl+P" && !toggleView && !comparisonProduct) {
|
||||
setIsPlaying(true);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue