mirror of
https://github.com/spice2x/spice2x.github.io.git
synced 2026-08-01 22:30:42 -07:00
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:
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user