mirror of
https://github.com/HarbourMasters/Shipwright.git
synced 2025-08-23 14:45:31 -07:00
C++ ? and build fix I think
This commit is contained in:
parent
ad9bdaf4a0
commit
c41bb4d45d
1 changed files with 6 additions and 8 deletions
|
@ -390,7 +390,7 @@ namespace SohImGui {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void EnhancementRadioButton(std::string text, std::string cvarName, int id) {
|
void EnhancementRadioButton(const char* text, const char* cvarName, int id) {
|
||||||
/*Usage :
|
/*Usage :
|
||||||
EnhancementRadioButton("My Visible Name","gMyCVarName", MyID);
|
EnhancementRadioButton("My Visible Name","gMyCVarName", MyID);
|
||||||
First arg is the visible name of the Radio button
|
First arg is the visible name of the Radio button
|
||||||
|
@ -401,14 +401,12 @@ namespace SohImGui {
|
||||||
EnhancementRadioButton("German", "gLanguages", 1);
|
EnhancementRadioButton("German", "gLanguages", 1);
|
||||||
EnhancementRadioButton("French", "gLanguages", 2);
|
EnhancementRadioButton("French", "gLanguages", 2);
|
||||||
*/
|
*/
|
||||||
char* unique_name = (char* ) malloc(1 + strlen(text)+ strlen(cvarName));
|
std::string make_invisible = "##";
|
||||||
strcpy(unique_name, text);
|
make_invisible += text;
|
||||||
strcat(unique_name, cvarName);
|
make_invisible += 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);
|
int val = CVar_GetS32(cvarName, 0);
|
||||||
if (ImGui::RadioButton(non_visible_unique_name, id == val)) {
|
if (ImGui::RadioButton(make_invisible.c_str(), id == val)) {
|
||||||
CVar_SetS32(cvarName, id);
|
CVar_SetS32(cvarName, id);
|
||||||
needs_save = true;
|
needs_save = true;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue