mirror of
https://github.com/HarbourMasters/Shipwright.git
synced 2025-08-22 14:23:44 -07:00
Fix Radiobox uniqueness issues
This commit is contained in:
parent
076887e71f
commit
ad9bdaf4a0
1 changed files with 11 additions and 3 deletions
|
@ -401,11 +401,19 @@ namespace SohImGui {
|
|||
EnhancementRadioButton("German", "gLanguages", 1);
|
||||
EnhancementRadioButton("French", "gLanguages", 2);
|
||||
*/
|
||||
int val = CVar_GetS32(cvarName.c_str(), 0);
|
||||
if (ImGui::RadioButton(text.c_str(), id == val)) {
|
||||
CVar_SetS32(cvarName.c_str(), (int)id);
|
||||
char* unique_name = (char* ) malloc(1 + strlen(text)+ strlen(cvarName));
|
||||
strcpy(unique_name, text);
|
||||
strcat(unique_name, cvarName);
|
||||
char* non_visible_unique_name = (char* ) malloc(1 + strlen("##")+ strlen(unique_name));
|
||||
strcpy(non_visible_unique_name, "##");
|
||||
strcat(non_visible_unique_name, unique_name);
|
||||
int val = CVar_GetS32(cvarName, 0);
|
||||
if (ImGui::RadioButton(non_visible_unique_name, id == val)) {
|
||||
CVar_SetS32(cvarName, id);
|
||||
needs_save = true;
|
||||
}
|
||||
ImGui::SameLine();
|
||||
ImGui::Text("%s", text);
|
||||
}
|
||||
|
||||
void EnhancementCheckbox(std::string text, std::string cvarName)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue