@@ -73,22 +73,24 @@ void Visualizer::defaultGuiCallback() {
7373 guiAddLightControls (light);
7474 guiAddCameraParams (controller, cameraParams);
7575
76- auto add_env_checkbox = [this ](const char *title, entt::entity ent) {
76+ auto addDebugCheckbox = [this ](const char *title,
77+ entt::entity ent) -> auto & {
7778 char label[32 ];
7879 SDL_snprintf (label, sizeof (label), " hud.%s" , title);
7980 auto &dmc = registry.get <DebugMeshComponent>(ent);
8081 ImGui::Checkbox (label, &dmc.enable );
82+ return dmc;
8183 };
8284 if (ImGui::CollapsingHeader (" Settings (HUD and env)" ,
8385 ImGuiTreeNodeFlags_DefaultOpen)) {
84- add_env_checkbox (" grid" , m_grid);
85- ImGui::SameLine ();
8686 {
87- auto &dmc = registry.get <DebugMeshComponent>(m_grid);
87+ auto &dmc = addDebugCheckbox (" grid" , m_grid);
88+ ImGui::SameLine ();
8889 ImGui::ColorEdit4 (" hud.grid.color" , dmc.colors [0 ].data (),
8990 ImGuiColorEditFlags_AlphaPreview);
9091 }
91- add_env_checkbox (" triad" , m_triad);
92+ addDebugCheckbox (" triad" , m_triad);
93+ ImGui::SameLine ();
9294 guiAddDisableCheckbox (" Render plane" , registry, m_plane,
9395 envStatus.show_plane );
9496 }
0 commit comments