Skip to content
This repository has been archived by the owner on Aug 21, 2024. It is now read-only.

Commit

Permalink
added feature flag for point and click mode
Browse files Browse the repository at this point in the history
  • Loading branch information
MbfloydIR committed Aug 16, 2024
1 parent 1cedafc commit f583d12
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 9 deletions.
3 changes: 2 additions & 1 deletion packages/common/src/constants/FeatureFlags.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,8 @@ export const FeatureFlags = {
TransformPivot: 'ir.editor.ui.transformPivot',
Hierarchy: {
ShowModelChildren: 'ir.editor.ui.hierarchy.showModelChildren'
}
},
PointClick: 'ir.editor.ui.pointClick'
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,10 @@ All portions of the code written by the Ethereal Engine team are Copyright © 20
Ethereal Engine. All Rights Reserved.
*/

import { FeatureFlags } from '@etherealengine/common/src/constants/FeatureFlags'
import { downloadScreenshot } from '@etherealengine/editor/src/functions/takeScreenshot'
import { EditorHelperState, PlacementMode } from '@etherealengine/editor/src/services/EditorHelperState'
import useFeatureFlags from '@etherealengine/engine/src/useFeatureFlags'
import { useMutableState } from '@etherealengine/hyperflux'
import { RendererState } from '@etherealengine/spatial/src/renderer/RendererState'
import React from 'react'
Expand All @@ -41,17 +43,20 @@ export default function SceneHelpersTool() {
const { t } = useTranslation()
const editorHelperState = useMutableState(EditorHelperState)
const rendererState = useMutableState(RendererState)
const [pointClickEnabled] = useFeatureFlags([FeatureFlags.Studio.UI.PointClick])

return (
<div className="flex items-center gap-1">
<Tooltip content={t('editor:toolbar.placement.click')}>
<Button
startIcon={<LuMousePointerClick className="text-theme-input" />}
onClick={() => editorHelperState.placementMode.set(PlacementMode.CLICK)}
variant={editorHelperState.placementMode.value === PlacementMode.CLICK ? 'outline' : 'transparent'}
className="px-0"
/>
</Tooltip>
{pointClickEnabled && (
<Tooltip content={t('editor:toolbar.placement.click')}>
<Button
startIcon={<LuMousePointerClick className="text-theme-input" />}
onClick={() => editorHelperState.placementMode.set(PlacementMode.CLICK)}
variant={editorHelperState.placementMode.value === PlacementMode.CLICK ? 'outline' : 'transparent'}
className="px-0"
/>
</Tooltip>
)}
<Tooltip content={t('editor:toolbar.placement.drag')}>
<Button
startIcon={<LuMove3D className="text-theme-input" />}
Expand Down

0 comments on commit f583d12

Please sign in to comment.