diff --git a/app/modules/LowerPanel/LowerPanel.tsx b/app/modules/LowerPanel/LowerPanel.tsx index 6bf237da52..6871d8c6df 100644 --- a/app/modules/LowerPanel/LowerPanel.tsx +++ b/app/modules/LowerPanel/LowerPanel.tsx @@ -6,6 +6,9 @@ import { scale, timelineHeight, } from "~/pages/PageEnigma/store"; +import Queue from "~/pages/PageEnigma/Queue/Queue"; +import { QueueNames } from "~/pages/PageEnigma/Queue/QueueNames"; +import { toEngineActions } from "~/pages/PageEnigma/Queue/toEngineActions"; interface LowerPanelPropsI { children: React.ReactNode; @@ -19,7 +22,13 @@ export const LowerPanel = ({ children }: LowerPanelPropsI) => { const onTimelineClick = useCallback( (event: React.PointerEvent) => { if (event.button === 0) { - currentTime.value = (Math.round(event.clientX) - 92) / 4 / scale.value; + const newTime = Math.round((event.clientX - 92) / 4 / scale.value); + currentTime.value = newTime; + Queue.publish({ + queueName: QueueNames.TO_ENGINE, + action: toEngineActions.UPDATE_TIME, + data: { currentTime: Math.round(newTime) }, + }); } }, [], diff --git a/app/pages/PageEnigma/comps/Timeline/Timeline.tsx b/app/pages/PageEnigma/comps/Timeline/Timeline.tsx index d7f3f6b368..1a7043d26f 100644 --- a/app/pages/PageEnigma/comps/Timeline/Timeline.tsx +++ b/app/pages/PageEnigma/comps/Timeline/Timeline.tsx @@ -17,11 +17,8 @@ import { timelineHeight, } from "~/pages/PageEnigma/store"; import { useQueueHandler } from "~/pages/PageEnigma/comps/Timeline/utils/useQueueHandler"; -import { EngineContext } from "../../contexts/EngineContext"; export const Timeline = () => { - const editorEngine = useContext(EngineContext); - const { characters, objects,