From b0810558a7605e11a990911adc3e658a19fe042f Mon Sep 17 00:00:00 2001 From: bicarus-dev <202771338+bicarus-dev@users.noreply.github.com> Date: Tue, 16 Dec 2025 15:24:46 -0800 Subject: [PATCH] iidx,sdvx: error message for subscreen unavailable does not draw a proper ImGui window (#453) ## Link to GitHub Issue, if one exists n/a ## Description of change In cases where the subscreen overlay window does not have anything to show (either via misconfiguration or an error), ensure that the window border is shown with the close button. Additionally, add a small button to close the dialog to help the user. ## Testing manual validation --- src/spice2x/overlay/windows/generic_sub.cpp | 10 ++++++++++ src/spice2x/overlay/windows/iidx_sub.cpp | 1 - 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/src/spice2x/overlay/windows/generic_sub.cpp b/src/spice2x/overlay/windows/generic_sub.cpp index 9558860..b20df4d 100644 --- a/src/spice2x/overlay/windows/generic_sub.cpp +++ b/src/spice2x/overlay/windows/generic_sub.cpp @@ -90,14 +90,20 @@ namespace overlay::windows { this->flags |= ImGuiWindowFlags_NoBackground; if (this->disabled_message.has_value()) { + this->draws_window = true; this->flags &= ~ImGuiWindowFlags_NoBackground; ImGui::TextColored(YELLOW, "%s", this->disabled_message.value().c_str()); + ImGui::TextUnformatted(""); + if (ImGui::Button("Close")) { + this->set_active(false); + } return; } this->draw_texture(); if (!this->texture) { + this->draws_window = true; this->flags &= ~ImGuiWindowFlags_NoBackground; ImGui::TextColored(YELLOW, "Failed to acquire surface texture for subscreen."); if (avs::game::is_model("LDJ")) { @@ -111,6 +117,10 @@ namespace overlay::windows { "Ensure that you did not accidentally enable a patch \n" "that turns off subscreen rendering."); } + ImGui::TextUnformatted(""); + if (ImGui::Button("Close")) { + this->set_active(false); + } } #if OVERLAYDBG diff --git a/src/spice2x/overlay/windows/iidx_sub.cpp b/src/spice2x/overlay/windows/iidx_sub.cpp index e9bb887..8c907e8 100644 --- a/src/spice2x/overlay/windows/iidx_sub.cpp +++ b/src/spice2x/overlay/windows/iidx_sub.cpp @@ -15,7 +15,6 @@ namespace overlay::windows { this->disabled_message = "Close this overlay and use the second window.\n" "If you don't see the window, double check your DLL type and apply TDJ I/O patches as needed."; - this->draws_window = false; } float size = 0.5f;