Changing int type

This commit is contained in:
Baoulettes 2022-05-20 15:07:15 +02:00 committed by GitHub
parent 49e15d342d
commit c0cd3b5400
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -390,14 +390,14 @@ namespace SohImGui {
} }
} }
void EnhancementCombobox(const char* name, const char* ComboArray[], s16 FirstTimeValue = -1){ void EnhancementCombobox(const char* name, const char* ComboArray[], uint8_t FirstTimeValue = 0){
if (FirstTimeValue < 0){ if (FirstTimeValue <= 0){
FirstTimeValue = 0; FirstTimeValue = 0;
} }
s16 selected=CVar_GetS32(name, FirstTimeValue); uint8_t selected=CVar_GetS32(name, FirstTimeValue);
s16 DefaultValue=selected; uint8_t DefaultValue=selected;
if (ImGui::BeginCombo("##name", ComboArray[DefaultValue])) { if (ImGui::BeginCombo("##name", ComboArray[DefaultValue])) {
s16 ComboxSize = sizeof(&ComboArray); uint8_t ComboxSize = sizeof(&ComboArray);
for (uint8_t i = 0; i <= ComboxSize; i++) { for (uint8_t i = 0; i <= ComboxSize; i++) {
if (strlen(ComboArray[i]) > 1) { if (strlen(ComboArray[i]) > 1) {
if (ImGui::Selectable(ComboArray[i], i==selected)) { if (ImGui::Selectable(ComboArray[i], i==selected)) {