From 0df434282dfa452ef3cccab3f136369b27da091a Mon Sep 17 00:00:00 2001 From: antopilo Date: Mon, 6 Mar 2023 16:57:07 -0500 Subject: [PATCH] Added a option to disable drawing axis in the view menu --- Editor/Editor.cpp | 2 +- Editor/src/Windows/EditorInterface.cpp | 2 ++ Editor/src/Windows/EditorInterface.h | 3 +++ 3 files changed, 6 insertions(+), 1 deletion(-) diff --git a/Editor/Editor.cpp b/Editor/Editor.cpp index 5e1b88b0..cb9181c8 100644 --- a/Editor/Editor.cpp +++ b/Editor/Editor.cpp @@ -148,7 +148,7 @@ int main(int argc, char* argv[]) camera = currentScene->m_EditorCamera; } - if (currentScene && !Nuake::Engine::IsPlayMode) + if (currentScene && !Nuake::Engine::IsPlayMode && editor.ShouldDrawAxis()) { gizmoDrawer.DrawGizmos(currentScene); } diff --git a/Editor/src/Windows/EditorInterface.cpp b/Editor/src/Windows/EditorInterface.cpp index 4d0769f5..d2ff0fbb 100644 --- a/Editor/src/Windows/EditorInterface.cpp +++ b/Editor/src/Windows/EditorInterface.cpp @@ -1273,6 +1273,8 @@ namespace Nuake { if (ImGui::MenuItem("Lighting", NULL, true)) {} if (ImGui::MenuItem("Draw grid", NULL, m_DrawGrid)) m_DrawGrid = !m_DrawGrid; + if (ImGui::MenuItem("Draw Axis", NULL, m_DrawAxis)) + m_DrawAxis = !m_DrawAxis; if (ImGui::MenuItem("Draw collisions", NULL, m_DebugCollisions)) { m_DebugCollisions = !m_DebugCollisions; diff --git a/Editor/src/Windows/EditorInterface.h b/Editor/src/Windows/EditorInterface.h index 1e2a6cd4..3ab72536 100644 --- a/Editor/src/Windows/EditorInterface.h +++ b/Editor/src/Windows/EditorInterface.h @@ -14,6 +14,7 @@ namespace Nuake { { private: bool m_DrawGrid = false; + bool m_DrawAxis = true; bool m_ShowImGuiDemo = false; bool m_DebugCollisions = false; bool m_ShowOverlay = true; @@ -46,5 +47,7 @@ namespace Nuake { void DrawLogger(); bool EntityContainsItself(Entity ent1, Entity ent2); void Overlay(); + + bool ShouldDrawAxis() const { return m_DrawAxis; } }; }