MCPcopy Create free account
hub / github.com/clementgallet/libTAS / StackToolFormatLevelInfo

Function StackToolFormatLevelInfo

src/external/imgui/imgui.cpp:15156–15171  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

15154}
15155
15156static int StackToolFormatLevelInfo(ImGuiIDStackTool* tool, int n, bool format_for_ui, char* buf, size_t buf_size)
15157{
15158 ImGuiStackLevelInfo* info = &tool->Results[n];
15159 ImGuiWindow* window = (info->Desc[0] == 0 && n == 0) ? ImGui::FindWindowByID(info->ID) : NULL;
15160 if (window) // Source: window name (because the root ID don't call GetID() and so doesn't get hooked)
15161 return ImFormatString(buf, buf_size, format_for_ui ? "\"%s\" [window]" : "%s", window->Name);
15162 if (info->QuerySuccess) // Source: GetID() hooks (prioritize over ItemInfo() because we frequently use patterns like: PushID(str), Button("") where they both have same id)
15163 return ImFormatString(buf, buf_size, (format_for_ui && info->DataType == ImGuiDataType_String) ? "\"%s\"" : "%s", info->Desc);
15164 if (tool->StackLevel < tool->Results.Size) // Only start using fallback below when all queries are done, so during queries we don't flickering ??? markers.
15165 return (*buf = 0);
15166#ifdef IMGUI_ENABLE_TEST_ENGINE
15167 if (const char* label = ImGuiTestEngine_FindItemDebugLabel(GImGui, info->ID)) // Source: ImGuiTestEngine's ItemInfo()
15168 return ImFormatString(buf, buf_size, format_for_ui ? "??? \"%s\"" : "%s", label);
15169#endif
15170 return ImFormatString(buf, buf_size, "???");
15171}
15172
15173// ID Stack Tool: Display UI
15174void ImGui::ShowIDStackToolWindow(bool* p_open)

Callers 1

ShowIDStackToolWindowMethod · 0.85

Calls 1

ImFormatStringFunction · 0.85

Tested by

no test coverage detected