summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBaoulettes <perlouzerie@hotmail.fr>2022-05-20 02:42:53 +0200
committerGitHub <noreply@github.com>2022-05-20 02:42:53 +0200
commitbb44350a8f9524f064fbd0fbf9e9fecf73ee36b4 (patch)
tree474138a4d4dcf91b9041e259a8fd1023d20e680d
parent6229233b5f08b5ecac654be0212cc2c0d5e7a283 (diff)
Remove comment and stuff useless
-rw-r--r--libultraship/libultraship/SohImGuiImpl.cpp14
1 files changed, 4 insertions, 10 deletions
diff --git a/libultraship/libultraship/SohImGuiImpl.cpp b/libultraship/libultraship/SohImGuiImpl.cpp
index 86e486066..1986cc889 100644
--- a/libultraship/libultraship/SohImGuiImpl.cpp
+++ b/libultraship/libultraship/SohImGuiImpl.cpp
@@ -391,26 +391,20 @@ namespace SohImGui {
}
void EnhancementCombobox(const char* name, const char* ComboArray[], s16 FirstTimeValue = -1){
- //The -1 do not force the maker to add a default first value
if (FirstTimeValue < 0){
- //If there is no default value it will pass this condition and so to prevent crash we set 0
FirstTimeValue = 0;
}
- //And now we set the default value to the CVar fallback
- //This way we ensure to show the number we want the user to see the first time
s16 selected=CVar_GetS32(name, FirstTimeValue);
- //Now we set the fetched value to the drop box.
- //This way if a player set something else than the default it will show their selection.
s16 DefaultValue=selected;
if (ImGui::BeginCombo("##name", ComboArray[DefaultValue])) {
- //char *[] got two extra : '\123' (begin) '\n' (last)
- s16 ComboxSize = sizeof(&ComboArray)-2;
- //Seem like it does not count entry 0 so it end up doing 0, 1, 2 and count 2 not 3
+ s16 ComboxSize = sizeof(&ComboArray);
for (uint8_t i = 0; i <= ComboxSize; i++) {
- if (ImGui::Selectable(ComboArray[i], i==selected)) {
+ if (strlen(ComboArray[i]) > 1) {
+ if (ImGui::Selectable(ComboArray[i], i==selected)) {
CVar_SetS32(name, i);
selected=i;
needs_save = true;
+ }
}
}
ImGui::EndCombo();