@@ -550,9 +550,8 @@ float MeshCraftApplication::drawMenuBar()
550550 if (walkController_.isActive ()) exitWalkMode (); else enterWalkMode ();
551551 }
552552 ImGui::Separator ();
553- ImGui::MenuItem (" Edge Overlay" , " Alt+W" , &showEdgeOverlay_);
554- ImGui::MenuItem (" Wireframe Mode" , nullptr , &showWireframeMode_);
555- ImGui::MenuItem (" Stats Overlay" , nullptr , &showStatsOverlay_);
553+ UI::MenuBar::drawOverlays (showEdgeOverlay_, showWireframeMode_,
554+ showStatsOverlay_, shadowDebugEnabled_, snapEnabled_);
556555 if (supportsTextShaderEffects ()) {
557556 ImGui::MenuItem (" Bloom (emissive glow)" , nullptr , &bloomEnabled_);
558557 if (bloomEnabled_) {
@@ -580,8 +579,6 @@ float MeshCraftApplication::drawMenuBar()
580579 } else {
581580 ImGui::TextDisabled (" Bloom and SSAO require cross-backend ShaderEffect support" );
582581 }
583- ImGui::MenuItem (" Shadow Map Debug" , nullptr , &shadowDebugEnabled_);
584- ImGui::MenuItem (" Snap to Grid" , nullptr , &snapEnabled_);
585582 UI::MenuBar::drawPanelToggles (showTimeline_, showRegistryPanel_,
586583 showAiPanel_, showValidationPanel_);
587584 ImGui::EndMenu ();
@@ -611,4 +608,12 @@ void MenuBar::drawPanelToggles(bool& timeline, bool& registry, bool& ai, bool& v
611608 ImGui::MenuItem (" Validation" , nullptr , &validation);
612609}
613610
611+ void MenuBar::drawOverlays (bool & edges, bool & wireframe, bool & stats, bool & shadowDebug, bool & snap) {
612+ ImGui::MenuItem (" Edge Overlay" , " Alt+W" , &edges);
613+ ImGui::MenuItem (" Wireframe Mode" , nullptr , &wireframe);
614+ ImGui::MenuItem (" Stats Overlay" , nullptr , &stats);
615+ ImGui::MenuItem (" Shadow Map Debug" , nullptr , &shadowDebug);
616+ ImGui::MenuItem (" Snap to Grid" , nullptr , &snap);
617+ }
618+
614619} // namespace MeshCraft::Application::UI
0 commit comments