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
This commit is contained in:
bicarus-dev
2025-12-16 15:24:46 -08:00
committed by GitHub
parent 6ae2e4003c
commit b0810558a7
2 changed files with 10 additions and 1 deletions
@@ -90,14 +90,20 @@ namespace overlay::windows {
this->flags |= ImGuiWindowFlags_NoBackground; this->flags |= ImGuiWindowFlags_NoBackground;
if (this->disabled_message.has_value()) { if (this->disabled_message.has_value()) {
this->draws_window = true;
this->flags &= ~ImGuiWindowFlags_NoBackground; this->flags &= ~ImGuiWindowFlags_NoBackground;
ImGui::TextColored(YELLOW, "%s", this->disabled_message.value().c_str()); ImGui::TextColored(YELLOW, "%s", this->disabled_message.value().c_str());
ImGui::TextUnformatted("");
if (ImGui::Button("Close")) {
this->set_active(false);
}
return; return;
} }
this->draw_texture(); this->draw_texture();
if (!this->texture) { if (!this->texture) {
this->draws_window = true;
this->flags &= ~ImGuiWindowFlags_NoBackground; this->flags &= ~ImGuiWindowFlags_NoBackground;
ImGui::TextColored(YELLOW, "Failed to acquire surface texture for subscreen."); ImGui::TextColored(YELLOW, "Failed to acquire surface texture for subscreen.");
if (avs::game::is_model("LDJ")) { if (avs::game::is_model("LDJ")) {
@@ -111,6 +117,10 @@ namespace overlay::windows {
"Ensure that you did not accidentally enable a patch \n" "Ensure that you did not accidentally enable a patch \n"
"that turns off subscreen rendering."); "that turns off subscreen rendering.");
} }
ImGui::TextUnformatted("");
if (ImGui::Button("Close")) {
this->set_active(false);
}
} }
#if OVERLAYDBG #if OVERLAYDBG
-1
View File
@@ -15,7 +15,6 @@ namespace overlay::windows {
this->disabled_message = this->disabled_message =
"Close this overlay and use the second window.\n" "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."; "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; float size = 0.5f;