imgui: update to v1.91.4, make various fixes to overlay (#286)

## Link to GitHub Issue, if one exists
n/a

## Description of change
Update ImGui to `v1.91.4`. We can't update to `v1.91.5` or newer just
yet because impl_spice depends on the old IO model of ImGui which got
removed in `v1.91.5`.

We also can't update the DX9 renderer right now, because at some point
overlay breaks in TDJ (and only in TDJ...)

Enable the new debug logging functionality in ImGui. Add a button in
overlay to toggle debug log window.

Fix some minor bugs spotted by the new ImGui debug log: mismatched API
calls, font loading issues.

## Compiling
👍 

## Testing
In progress.
This commit is contained in:
bicarus-dev
2025-04-03 19:14:48 -07:00
committed by GitHub
parent 7301cdaa6c
commit 6de8b529d2
21 changed files with 14082 additions and 5919 deletions
@@ -115,7 +115,6 @@ namespace overlay::windows {
ImGui::BeginDisabled();
ImGui::Button(" <No card> \n xxxx xxxx xxxx xxxx ");
ImGui::EndDisabled();
ImGui::PopStyleColor(4);
}
}
+8 -6
View File
@@ -3054,13 +3054,13 @@ namespace overlay::windows {
// workaround for popups triggered by menu, see https://github.com/ocornut/imgui/issues/331
if (about_popup) {
ImGui::OpenPopup("About");
ImGui::OpenPopup("About##topbarpopup");
}
if (licenses_popup) {
ImGui::OpenPopup("Licenses");
ImGui::OpenPopup("Licenses##topbarpopup");
}
if (shutdown_popup) {
ImGui::OpenPopup("System");
ImGui::OpenPopup("System##topbarpopup");
}
// draw popups
@@ -3069,7 +3069,7 @@ namespace overlay::windows {
bool unused_open = true;
if (ImGui::BeginPopupModal(
"System",
"System##topbarpopup",
&unused_open,
ImGuiWindowFlags_AlwaysAutoResize | ImGuiWindowFlags_NoResize)) {
@@ -3108,13 +3108,15 @@ namespace overlay::windows {
ImGui::SetNextWindowSize(popup_size, ImGuiCond_Appearing);
ImGui::SetNextWindowPos(popup_pos, ImGuiCond_Appearing);
if (ImGui::BeginPopupModal("About", &unused_open)) {
bool unused_open2 = true;
if (ImGui::BeginPopupModal("About##topbarpopup", &unused_open2)) {
this->build_about();
ImGui::EndPopup();
}
ImGui::SetNextWindowSize(popup_size, ImGuiCond_Appearing);
ImGui::SetNextWindowPos(popup_pos, ImGuiCond_Appearing);
if (ImGui::BeginPopupModal("Licenses", &unused_open)) {
bool unused_open3 = true;
if (ImGui::BeginPopupModal("Licenses##topbarpopup", &unused_open3)) {
this->build_licenses();
ImGui::EndPopup();
}
+5 -3
View File
@@ -178,9 +178,11 @@ namespace overlay::windows {
static_cast<int>(ImGui::GetIO().DisplaySize.x),
static_cast<int>(ImGui::GetIO().DisplaySize.y));
// removed for size (along with setting IMGUI_DISABLE_DEMO_WINDOWS
// and IMGUI_DISABLE_DEBUG_TOOLS) - saves about 300kb in each
// binary
if (ImGui::Button("ImGui Debug Log")) {
overlay::SHOW_DEBUG_LOG_WINDOW = !overlay::SHOW_DEBUG_LOG_WINDOW;
}
// removed for size (IMGUI_DISABLE_DEMO_WINDOWS)
// metrics button
// this->metrics_open |= ImGui::Button("Metrics Window");
+1 -1
View File
@@ -206,7 +206,7 @@ namespace overlay::windows {
bottom_right.x += overlay_content_top_left.x;
bottom_right.y += overlay_content_top_left.y;
ImGui::GetBackgroundDrawList()->AddImage(
reinterpret_cast<void *>(this->texture),
reinterpret_cast<ImTextureID>(this->texture),
overlay_content_top_left,
bottom_right);