patcher: show errors on invalid json response from remote (#281)

## Link to GitHub Issue, if one exists
#0

## Description of change
When patcher URL returns an invalid response (as in, cannot be parsed as
JSON), show an error message to user.

Add a "copy text" button to copy the error message.

Fix WarnTooltip so that can handle the case where description is an
empty string for a patch - previously this was just showing as multiple
lines of empty space and then the warning.

## Compiling
It's fine except Docker build currently fails due to cmake version
issue.

## Testing
Tested valid / invalid datecodes and checked against responses.
This commit is contained in:
bicarus-dev
2025-04-02 18:32:15 -07:00
committed by GitHub
parent 68f5a614ef
commit 302f08dd57
2 changed files with 40 additions and 6 deletions
+2 -2
View File
@@ -39,12 +39,12 @@ namespace ImGui {
ImGui::BeginTooltip();
ImGui::PushTextWrapPos(ImGui::GetFontSize() * 35.0f);
if (desc) {
if (desc && desc[0]) {
ImGui::TextUnformatted(desc);
ImGui::TextUnformatted("");
}
ImGui::PushStyleColor(ImGuiCol_Text, ImVec4(1.f, 1.f, 0.f, 1.f));
if (warn) {
if (warn && warn[0]) {
ImGui::TextUnformatted("WARNING:");
ImGui::TextUnformatted(warn);
}