From 9bbab5b15ed36118bbffe50fcacb4f294ee1d772 Mon Sep 17 00:00:00 2001 From: Kawe Mazidjatari <48657826+Mauler125@users.noreply.github.com> Date: Tue, 9 Jul 2024 11:45:21 +0200 Subject: [PATCH] Recast: remove unused tool parameters These parameters are unused, but since they are checked on and unset, they caused certain elements to not display. Removed them since the expansion logic is now fully handled by Dear ImGui. --- src/naveditor/CrowdTool.cpp | 39 +++++++++++++------------------ src/naveditor/include/CrowdTool.h | 4 ---- 2 files changed, 16 insertions(+), 27 deletions(-) diff --git a/src/naveditor/CrowdTool.cpp b/src/naveditor/CrowdTool.cpp index 192871fc..90b61604 100644 --- a/src/naveditor/CrowdTool.cpp +++ b/src/naveditor/CrowdTool.cpp @@ -88,21 +88,17 @@ CrowdToolState::CrowdToolState() : m_graphSampleTime(0.0f), m_run(true) { - m_toolParams.m_expandSelectedDebugDraw = true; m_toolParams.m_showCorners = false; m_toolParams.m_showCollisionSegments = false; m_toolParams.m_showPath = false; m_toolParams.m_showVO = false; m_toolParams.m_showOpt = false; m_toolParams.m_showNeis = false; - m_toolParams.m_expandDebugDraw = false; m_toolParams.m_showLabels = false; m_toolParams.m_showGrid = false; m_toolParams.m_showNodes = false; m_toolParams.m_showPerfGraph = false; m_toolParams.m_showDetailAll = false; - m_toolParams.m_expandOptions = true; - m_toolParams.m_expandTraversalOptions = false; m_toolParams.m_anticipateTurns = true; m_toolParams.m_optimizeVis = true; m_toolParams.m_optimizeTopo = true; @@ -1002,31 +998,28 @@ void CrowdTool::handleMenu() const int traverseTableCount = NavMesh_GetTraversalTableCountForNavMeshType(loadedNavMeshType); const TraverseAnimType_e baseType = NavMesh_GetFirstTraverseAnimTypeForType(loadedNavMeshType); - if (params->m_expandTraversalOptions) + ImGui::Indent(); + + for (int i = ANIMTYPE_NONE; i < traverseTableCount; i++) { - ImGui::Indent(); + const bool noAnimtype = i == ANIMTYPE_NONE; - for (int i = ANIMTYPE_NONE; i < traverseTableCount; i++) + const TraverseAnimType_e animTypeIndex = noAnimtype ? ANIMTYPE_NONE : TraverseAnimType_e((int)baseType + i); + const char* animtypeName = noAnimtype ? "none" : g_traverseAnimTypeNames[animTypeIndex]; + + bool isAnimTypeEnabled = params->m_traverseAnimType == animTypeIndex; + + if (ImGui::Checkbox(animtypeName, &isAnimTypeEnabled)) { - const bool noAnimtype = i == ANIMTYPE_NONE; - - const TraverseAnimType_e animTypeIndex = noAnimtype ? ANIMTYPE_NONE : TraverseAnimType_e((int)baseType + i); - const char* animtypeName = noAnimtype ? "none" : g_traverseAnimTypeNames[animTypeIndex]; - - bool isAnimTypeEnabled = params->m_traverseAnimType == animTypeIndex; - - if (ImGui::Checkbox(animtypeName, &isAnimTypeEnabled)) - { - params->m_traverseAnimType = animTypeIndex; - m_state->updateAgentParams(); - } + params->m_traverseAnimType = animTypeIndex; + m_state->updateAgentParams(); } - - ImGui::Unindent(); } + + ImGui::Unindent(); } - if (ImGui::CollapsingHeader("Selected Debug Draw", 0, params->m_expandSelectedDebugDraw)) + if (ImGui::CollapsingHeader("Selected Debug Draw")) { ImGui::Indent(); ImGui::Checkbox("Show Corners", ¶ms->m_showCorners); @@ -1038,7 +1031,7 @@ void CrowdTool::handleMenu() ImGui::Unindent(); } - if (ImGui::CollapsingHeader("Debug Draw", 0, params->m_expandDebugDraw)) + if (ImGui::CollapsingHeader("Debug Draw")) { ImGui::Indent(); ImGui::Checkbox("Show Labels", ¶ms->m_showLabels); diff --git a/src/naveditor/include/CrowdTool.h b/src/naveditor/include/CrowdTool.h index ca00d526..5beeb02c 100644 --- a/src/naveditor/include/CrowdTool.h +++ b/src/naveditor/include/CrowdTool.h @@ -31,7 +31,6 @@ struct CrowdToolParams { - bool m_expandSelectedDebugDraw; // todo(amos): imgui upgrade; needed? bool m_showCorners; bool m_showCollisionSegments; bool m_showPath; @@ -39,15 +38,12 @@ struct CrowdToolParams bool m_showOpt; bool m_showNeis; - bool m_expandDebugDraw; // todo(amos): imgui upgrade; needed? bool m_showLabels; bool m_showGrid; bool m_showNodes; bool m_showPerfGraph; bool m_showDetailAll; - bool m_expandOptions; // todo(amos): imgui upgrade; needed? - bool m_expandTraversalOptions; // todo(amos): imgui upgrade; needed? bool m_anticipateTurns; bool m_optimizeVis; bool m_optimizeTopo;