Refactor and enhance zone and wall item management:
- Update zone handling in ZoneGroup to include selected zone visibility. - Improve camera transition speed in ZoneCentreTarget. - Add clearSelectedZone functionality in useZoneStore. - Integrate clearSelectedZone in KeyPressListener for ESCAPE key action. - Adjust sidebar and module toggle positioning for better UI layout. - Clean up unused code and comments in Project component.
This commit is contained in:
@@ -12,6 +12,7 @@ import {
|
||||
} from "../../store/store";
|
||||
import { usePlayButtonStore } from "../../store/usePlayButtonStore";
|
||||
import { detectModifierKeys } from "./detectModifierKeys";
|
||||
import { useSelectedZoneStore } from "../../store/visualization/useZoneStore";
|
||||
|
||||
const KeyPressListener: React.FC = () => {
|
||||
const { activeModule, setActiveModule } = useModuleStore();
|
||||
@@ -25,6 +26,7 @@ const KeyPressListener: React.FC = () => {
|
||||
const { setAddAction } = useAddAction();
|
||||
const { setSelectedWallItem } = useSelectedWallItem();
|
||||
const { setActiveTool } = useActiveTool();
|
||||
const { clearSelectedZone} = useSelectedZoneStore();
|
||||
|
||||
const isTextInput = (element: Element | null): boolean =>
|
||||
element instanceof HTMLInputElement ||
|
||||
@@ -131,6 +133,7 @@ const KeyPressListener: React.FC = () => {
|
||||
if (keyCombination === "ESCAPE") {
|
||||
setActiveTool("cursor");
|
||||
setIsPlaying(false);
|
||||
clearSelectedZone();
|
||||
}
|
||||
|
||||
// Placeholder for future implementation
|
||||
|
||||
Reference in New Issue
Block a user