satdump/src-interface/error.cpp
2022-03-10 19:56:37 +01:00

29 lines
No EOL
688 B
C++

#include "error.h"
#include "imgui/imgui.h"
#include <string>
namespace satdump
{
namespace error
{
bool hasError = false;
std::string error_title;
std::string error_message;
void set_error(std::string title, std::string description)
{
error_title = title;
error_message = description;
hasError = true;
}
void render()
{
ImGui::Begin(error_title.c_str(), &hasError);
ImGui::TextColored(ImColor(255, 0, 0), "%s", error_message.c_str());
if (ImGui::Button("Close"))
hasError = false;
ImGui::End();
}
}
}