| 22469 | } |
| 22470 | |
| 22471 | static void ShowDebugLogFlag(const char* name, ImGuiDebugLogFlags flags) |
| 22472 | { |
| 22473 | ImGuiContext& g = *GImGui; |
| 22474 | ImVec2 size(ImGui::GetFrameHeight() + g.Style.ItemInnerSpacing.x + ImGui::CalcTextSize(name).x, ImGui::GetFrameHeight()); |
| 22475 | SameLineOrWrap(size); // FIXME-LAYOUT: To be done automatically once we rework ItemSize/ItemAdd into ItemLayout. |
| 22476 | |
| 22477 | bool highlight_errors = (flags == ImGuiDebugLogFlags_EventError && g.DebugLogSkippedErrors > 0); |
| 22478 | if (highlight_errors) |
| 22479 | ImGui::PushStyleColor(ImGuiCol_Text, ImLerp(g.Style.Colors[ImGuiCol_Text], ImVec4(1.0f, 0.0f, 0.0f, 1.0f), 0.30f)); |
| 22480 | if (ImGui::CheckboxFlags(name, &g.DebugLogFlags, flags) && g.IO.KeyShift && (g.DebugLogFlags & flags) != 0) |
| 22481 | { |
| 22482 | g.DebugLogAutoDisableFrames = 2; |
| 22483 | g.DebugLogAutoDisableFlags |= flags; |
| 22484 | } |
| 22485 | if (highlight_errors) |
| 22486 | { |
| 22487 | ImGui::PopStyleColor(); |
| 22488 | ImGui::SetItemTooltip("%d past errors skipped.", g.DebugLogSkippedErrors); |
| 22489 | } |
| 22490 | else |
| 22491 | { |
| 22492 | ImGui::SetItemTooltip("Hold SHIFT when clicking to enable for 2 frames only (useful for spammy log entries)"); |
| 22493 | } |
| 22494 | } |
| 22495 | |
| 22496 | void ImGui::ShowDebugLogWindow(bool* p_open) |
| 22497 | { |
no test coverage detected