| 359 | } |
| 360 | |
| 361 | void draw() |
| 362 | { |
| 363 | extern bool _showDebugImgui; |
| 364 | if (!_showDebugImgui) |
| 365 | return; |
| 366 | |
| 367 | hovered_node = nullptr; |
| 368 | |
| 369 | ImGui::PushStyleVar(ImGuiStyleVar_WindowMinSize, ImVec2(300, 300)); |
| 370 | |
| 371 | auto current = Director::getInstance()->getRunningScene(); |
| 372 | ImGui::Begin("Cocos Explorer"); |
| 373 | const auto avail = ImGui::GetContentRegionAvail(); |
| 374 | |
| 375 | ImGui::BeginChild("explorer.tree", ImVec2(avail.x * 0.5f, 0), false, ImGuiWindowFlags_HorizontalScrollbar); |
| 376 | reached_selected_node = false; |
| 377 | generateTree(current); |
| 378 | ImGui::EndChild(); |
| 379 | |
| 380 | if (!reached_selected_node) |
| 381 | selected_node = nullptr; |
| 382 | |
| 383 | ImGui::SameLine(); |
| 384 | |
| 385 | ImGui::BeginChild("explorer.options"); |
| 386 | |
| 387 | drawProperties(); |
| 388 | |
| 389 | ImGui::EndChild(); |
| 390 | |
| 391 | ImGui::End(); |
| 392 | ImGui::PopStyleVar(); |
| 393 | |
| 394 | if (selected_node) |
| 395 | highlight(selected_node, true); |
| 396 | if (hovered_node) |
| 397 | highlight(hovered_node, false); |
| 398 | } |
| 399 | |
| 400 | void CocosExplorer::openForever() |
| 401 | { |
nothing calls this directly
no test coverage detected