MCPcopy Create free account
hub / github.com/Open-GD/OpenGD / draw

Function draw

Source/CocosExplorer.cpp:361–398  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

359}
360
361void 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
400void CocosExplorer::openForever()
401{

Callers

nothing calls this directly

Calls 3

generateTreeFunction · 0.85
drawPropertiesFunction · 0.85
highlightFunction · 0.85

Tested by

no test coverage detected