Fix Radiobutton uniqueness issues (#397)

* Fix Radiobox uniqueness issues

* C++ ? and build fix I think

* To match the edit made in .c
This commit is contained in:
Baoulettes 2022-05-29 22:38:21 +02:00 committed by GitHub
parent 7913398110
commit 29d4cd27c4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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)