From 29d4cd27c46af4c31b15980518647c9cb47a5eeb Mon Sep 17 00:00:00 2001 From: Baoulettes Date: Sun, 29 May 2022 22:38:21 +0200 Subject: [PATCH] Fix Radiobutton uniqueness issues (#397) * Fix Radiobox uniqueness issues * C++ ? and build fix I think * To match the edit made in .c --- libultraship/libultraship/SohImGuiImpl.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/libultraship/libultraship/SohImGuiImpl.cpp b/libultraship/libultraship/SohImGuiImpl.cpp index c91f31750..c03cd8e78 100644 --- a/libultraship/libultraship/SohImGuiImpl.cpp +++ b/libultraship/libultraship/SohImGuiImpl.cpp @@ -447,11 +447,17 @@ namespace SohImGui { EnhancementRadioButton("German", "gLanguages", 1); EnhancementRadioButton("French", "gLanguages", 2); */ + std::string make_invisible = "##"; + make_invisible += text; + make_invisible += cvarName; + int val = CVar_GetS32(cvarName, 0); - if (ImGui::RadioButton(text, id == val)) { + if (ImGui::RadioButton(make_invisible.c_str(), id == val)) { CVar_SetS32(cvarName, id); needs_save = true; } + ImGui::SameLine(); + ImGui::Text("%s", text); } void EnhancementCheckbox(const char* text, const char* cvarName)