erreula: Avoid triggering debug assert in imgui

It does not like empty window titles
This commit is contained in:
Exzap 2024-04-10 20:23:15 +02:00
parent 12eda10387
commit d45c2fa6d1

View File

@ -277,10 +277,11 @@ namespace erreula
ImGui::SetNextWindowBgAlpha(0.9f); ImGui::SetNextWindowBgAlpha(0.9f);
ImGui::PushFont(font); ImGui::PushFont(font);
std::string title = "ErrEula"; std::string title;
if (appearArg.title) if (appearArg.title)
title = boost::nowide::narrow(GetText(appearArg.title.GetPtr())); title = boost::nowide::narrow(GetText(appearArg.title.GetPtr()));
if(title.empty()) // ImGui doesn't allow empty titles, so set one if appearArg.title is not set or empty
title = "ErrEula";
if (ImGui::Begin(title.c_str(), nullptr, kPopupFlags)) if (ImGui::Begin(title.c_str(), nullptr, kPopupFlags))
{ {
const float startx = ImGui::GetWindowSize().x / 2.0f; const float startx = ImGui::GetWindowSize().x / 2.0f;