From 1b5a2fd85122a0a11e3fc8446e16b592883afc72 Mon Sep 17 00:00:00 2001 From: SweetId <2630750+SweetId@users.noreply.github.com> Date: Sat, 21 Oct 2023 16:44:31 -0400 Subject: [PATCH] ensure imgui window ID is consistent across translations --- src/NazaraEditor/Core/UI/Window.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/NazaraEditor/Core/UI/Window.cpp b/src/NazaraEditor/Core/UI/Window.cpp index b507986..de0c91b 100644 --- a/src/NazaraEditor/Core/UI/Window.cpp +++ b/src/NazaraEditor/Core/UI/Window.cpp @@ -31,7 +31,11 @@ namespace Nz { bool bNeedsMenu = !m_root.entries.empty(); ImGuiWindowFlags flags = (bNeedsMenu ? ImGuiWindowFlags_MenuBar : 0); - if (ImGui::Begin(m_windowName.c_str(), nullptr, flags)) + + // using name###ID form to ensure ID is consistent across translations + std::string name = std::format("{}###{}", m_windowName.ToString(), m_windowName.GetBaseString()); + + if (ImGui::Begin(name.c_str(), nullptr, flags)) { if (ImGui::BeginMenuBar()) {