2024-02-11 12:59:00 +11:00
|
|
|
import { OnboardingButtons, useDismiss, useNextClick } from '.'
|
|
|
|
import { onboardingPaths } from 'routes/Onboarding/paths'
|
2023-08-06 21:29:26 -04:00
|
|
|
import { useStore } from '../../useStore'
|
2023-09-15 22:37:40 -04:00
|
|
|
import { SettingsSection } from 'routes/Settings'
|
2024-02-16 09:09:58 -05:00
|
|
|
import { useGlobalStateContext } from 'hooks/useGlobalStateContext'
|
2023-09-15 22:37:40 -04:00
|
|
|
import {
|
|
|
|
CameraSystem,
|
|
|
|
cameraMouseDragGuards,
|
|
|
|
cameraSystems,
|
|
|
|
} from 'lib/cameraControls'
|
2023-07-25 10:40:26 -04:00
|
|
|
|
2023-08-15 21:56:24 -04:00
|
|
|
export default function Units() {
|
2023-09-08 10:13:35 -04:00
|
|
|
const { buttonDownInStream } = useStore((s) => ({
|
|
|
|
buttonDownInStream: s.buttonDownInStream,
|
2023-08-06 21:29:26 -04:00
|
|
|
}))
|
2023-07-25 10:40:26 -04:00
|
|
|
const dismiss = useDismiss()
|
2023-09-15 22:37:40 -04:00
|
|
|
const next = useNextClick(onboardingPaths.STREAMING)
|
|
|
|
const {
|
|
|
|
settings: {
|
|
|
|
send,
|
|
|
|
state: {
|
|
|
|
context: { cameraControls },
|
|
|
|
},
|
|
|
|
},
|
2024-02-16 09:09:58 -05:00
|
|
|
} = useGlobalStateContext()
|
2023-07-25 10:40:26 -04:00
|
|
|
|
|
|
|
return (
|
2023-09-19 18:06:13 -04:00
|
|
|
<div className="fixed inset-0 z-50 grid items-end justify-start px-4 pointer-events-none">
|
2023-08-06 21:29:26 -04:00
|
|
|
<div
|
|
|
|
className={
|
2023-12-18 06:15:26 -05:00
|
|
|
'max-w-2xl border border-chalkboard-50 dark:border-chalkboard-80 shadow-lg flex flex-col justify-center bg-chalkboard-10 dark:bg-chalkboard-90 p-8 rounded' +
|
2023-09-08 10:13:35 -04:00
|
|
|
(buttonDownInStream ? '' : ' pointer-events-auto')
|
2023-08-06 21:29:26 -04:00
|
|
|
}
|
|
|
|
>
|
2023-09-15 22:37:40 -04:00
|
|
|
<SettingsSection
|
|
|
|
title="Camera Controls"
|
2023-09-18 16:13:04 -04:00
|
|
|
description="How you want to control the camera in the 3D view. Try them out above and choose the one that feels most comfortable to you."
|
2023-09-19 18:06:13 -04:00
|
|
|
className="my-4 last-of-type:mb-12"
|
2023-09-15 22:37:40 -04:00
|
|
|
>
|
|
|
|
<select
|
|
|
|
id="camera-controls"
|
2023-09-19 18:06:13 -04:00
|
|
|
className="block w-full px-3 py-1 bg-transparent border border-chalkboard-30"
|
2023-09-15 22:37:40 -04:00
|
|
|
value={cameraControls}
|
|
|
|
onChange={(e) => {
|
|
|
|
send({
|
|
|
|
type: 'Set Camera Controls',
|
|
|
|
data: { cameraControls: e.target.value as CameraSystem },
|
|
|
|
})
|
|
|
|
}}
|
|
|
|
>
|
|
|
|
{cameraSystems.map((program) => (
|
|
|
|
<option key={program} value={program}>
|
|
|
|
{program}
|
|
|
|
</option>
|
|
|
|
))}
|
|
|
|
</select>
|
2023-09-19 18:06:13 -04:00
|
|
|
<ul className="mx-4 my-2 text-sm leading-relaxed">
|
2023-09-15 22:37:40 -04:00
|
|
|
<li>
|
|
|
|
<strong>Pan:</strong>{' '}
|
|
|
|
{cameraMouseDragGuards[cameraControls].pan.description}
|
|
|
|
</li>
|
|
|
|
<li>
|
|
|
|
<strong>Zoom:</strong>{' '}
|
|
|
|
{cameraMouseDragGuards[cameraControls].zoom.description}
|
|
|
|
</li>
|
|
|
|
<li>
|
|
|
|
<strong>Rotate:</strong>{' '}
|
|
|
|
{cameraMouseDragGuards[cameraControls].rotate.description}
|
|
|
|
</li>
|
|
|
|
</ul>
|
|
|
|
</SettingsSection>
|
2023-12-06 14:44:13 -05:00
|
|
|
<OnboardingButtons
|
|
|
|
dismiss={dismiss}
|
|
|
|
next={next}
|
|
|
|
nextText="Next: Streaming"
|
|
|
|
/>
|
2023-07-25 10:40:26 -04:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
)
|
|
|
|
}
|