MCPcopy Create free account
hub / github.com/XJTU-Graphics/dandelion / ShowDebugLogFlag

Function ShowDebugLogFlag

deps/imgui/imgui.cpp:23183–23206  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

23181}
23182
23183static void ShowDebugLogFlag(const char* name, ImGuiDebugLogFlags flags)
23184{
23185 ImGuiContext& g = *GImGui;
23186 ImVec2 size(ImGui::GetFrameHeight() + g.Style.ItemInnerSpacing.x + ImGui::CalcTextSize(name).x, ImGui::GetFrameHeight());
23187 SameLineOrWrap(size); // FIXME-LAYOUT: To be done automatically once we rework ItemSize/ItemAdd into ItemLayout.
23188
23189 bool highlight_errors = (flags == ImGuiDebugLogFlags_EventError && g.DebugLogSkippedErrors > 0);
23190 if (highlight_errors)
23191 ImGui::PushStyleColor(ImGuiCol_Text, ImLerp(g.Style.Colors[ImGuiCol_Text], ImVec4(1.0f, 0.0f, 0.0f, 1.0f), 0.30f));
23192 if (ImGui::CheckboxFlags(name, &g.DebugLogFlags, flags) && g.IO.KeyShift && (g.DebugLogFlags & flags) != 0)
23193 {
23194 g.DebugLogAutoDisableFrames = 2;
23195 g.DebugLogAutoDisableFlags |= flags;
23196 }
23197 if (highlight_errors)
23198 {
23199 ImGui::PopStyleColor();
23200 ImGui::SetItemTooltip("%d past errors skipped.", g.DebugLogSkippedErrors);
23201 }
23202 else
23203 {
23204 ImGui::SetItemTooltip("Hold SHIFT when clicking to enable for 2 frames only (useful for spammy log entries)");
23205 }
23206}
23207
23208void ImGui::ShowDebugLogWindow(bool* p_open)
23209{

Callers 1

ShowDebugLogWindowMethod · 0.85

Calls 3

SameLineOrWrapFunction · 0.85
ImLerpFunction · 0.85
ImVec4Class · 0.85

Tested by

no test coverage detected