diff --git a/packages/ui/src/components/editor/panels/Viewport/container/index.tsx b/packages/ui/src/components/editor/panels/Viewport/container/index.tsx index 24db66349e..c940e28c15 100644 --- a/packages/ui/src/components/editor/panels/Viewport/container/index.tsx +++ b/packages/ui/src/components/editor/panels/Viewport/container/index.tsx @@ -29,7 +29,7 @@ import { ItemTypes } from '@etherealengine/editor/src/constants/AssetTypes' import { EditorControlFunctions } from '@etherealengine/editor/src/functions/EditorControlFunctions' import { getCursorSpawnPosition } from '@etherealengine/editor/src/functions/screenSpaceFunctions' import { EditorState } from '@etherealengine/editor/src/services/EditorServices' -import { getMutableState, useHookstate } from '@etherealengine/hyperflux' +import { useMutableState } from '@etherealengine/hyperflux' import { TransformComponent } from '@etherealengine/spatial' import { RendererComponent } from '@etherealengine/spatial/src/renderer/WebGLRendererSystem' import React, { useEffect, useRef } from 'react' @@ -38,6 +38,7 @@ import { useTranslation } from 'react-i18next' import { twMerge } from 'tailwind-merge' import { Vector2, Vector3 } from 'three' import Text from '../../../../../primitives/tailwind/Text' +import GizmoTool from '../tools/GizmoTool' import GridTool from '../tools/GridTool' import PlayModeTool from '../tools/PlayModeTool' import RenderModeTool from '../tools/RenderTool' @@ -97,9 +98,9 @@ const ViewportDnD = () => { const ViewPortPanelContainer = () => { const { t } = useTranslation() - const sceneName = useHookstate(getMutableState(EditorState).sceneName).value + const sceneName = useMutableState(EditorState).sceneName.value return ( -
+
@@ -109,6 +110,7 @@ const ViewPortPanelContainer = () => {
+ {sceneName ? : null} {sceneName ? ( ) : ( diff --git a/packages/ui/src/components/editor/panels/Viewport/tools/GizmoTool.tsx b/packages/ui/src/components/editor/panels/Viewport/tools/GizmoTool.tsx new file mode 100644 index 0000000000..196634c0fa --- /dev/null +++ b/packages/ui/src/components/editor/panels/Viewport/tools/GizmoTool.tsx @@ -0,0 +1,97 @@ +/* +CPAL-1.0 License + +The contents of this file are subject to the Common Public Attribution License +Version 1.0. (the "License"); you may not use this file except in compliance +with the License. You may obtain a copy of the License at +https://github.com/EtherealEngine/etherealengine/blob/dev/LICENSE. +The License is based on the Mozilla Public License Version 1.1, but Sections 14 +and 15 have been added to cover use of software over a computer network and +provide for limited attribution for the Original Developer. In addition, +Exhibit A has been modified to be consistent with Exhibit B. + +Software distributed under the License is distributed on an "AS IS" basis, +WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for the +specific language governing rights and limitations under the License. + +The Original Code is Ethereal Engine. + +The Original Developer is the Initial Developer. The Initial Developer of the +Original Code is the Ethereal Engine team. + +All portions of the code written by the Ethereal Engine team are Copyright © 2021-2023 +Ethereal Engine. All Rights Reserved. +*/ + +import { EditorControlFunctions } from '@etherealengine/editor/src/functions/EditorControlFunctions' +import { setTransformMode } from '@etherealengine/editor/src/functions/transformFunctions' +import { EditorHelperState } from '@etherealengine/editor/src/services/EditorHelperState' +import { TransformMode } from '@etherealengine/engine/src/scene/constants/transformConstants' +import { useMutableState } from '@etherealengine/hyperflux' +import React from 'react' +import { TbPointer, TbRefresh, TbVector, TbWindowMaximize } from 'react-icons/tb' +import { twMerge } from 'tailwind-merge' +import Button from '../../../../../primitives/tailwind/Button' + +function Placer() { + return ( + <> +
+
+ + ) +} + +export default function GizmoTool() { + const editorHelperState = useMutableState(EditorHelperState) + const transformMode = editorHelperState.transformMode.value + + return ( +
+ +
+
+
+ ) +} diff --git a/packages/ui/src/components/editor/panels/Viewport/tools/GridTool.tsx b/packages/ui/src/components/editor/panels/Viewport/tools/GridTool.tsx index e7195bd5ce..f47fd1f86b 100644 --- a/packages/ui/src/components/editor/panels/Viewport/tools/GridTool.tsx +++ b/packages/ui/src/components/editor/panels/Viewport/tools/GridTool.tsx @@ -43,7 +43,7 @@ const GridTool = () => { } return ( -
+