diff --git a/core/oslib/audiostream.h b/core/oslib/audiostream.h index 37c1cbc43..408592b55 100644 --- a/core/oslib/audiostream.h +++ b/core/oslib/audiostream.h @@ -14,8 +14,8 @@ void UpdateBuff(u8* pos); typedef std::vector (*audio_option_callback_t)(); enum audio_option_type { - text = 0 -, integer = 1 + integer = 0 +, checkbox = 1 , list = 2 }; diff --git a/core/rend/gui.cpp b/core/rend/gui.cpp index 0404b503a..b6f0b30aa 100644 --- a/core/rend/gui.cpp +++ b/core/rend/gui.cpp @@ -1099,7 +1099,20 @@ static void gui_display_settings() } value = (*cfg_entries)[options->cfg_name]; - if (options->type == list) + if (options->type == integer) + { + int val = stoi(value); + ImGui::SliderInt(options->caption.c_str(), &val, options->min_value, options->max_value); + (*cfg_entries)[options->cfg_name] = to_string(val); + } + else if (options->type == checkbox) + { + bool check = (value == "1"); + ImGui::Checkbox(options->caption.c_str(), &check); + std::string cur = check ? "1" : "0"; + (*cfg_entries)[options->cfg_name] = cur; + } + else if (options->type == list) { if (ImGui::BeginCombo(options->caption.c_str(), value.c_str(), ImGuiComboFlags_None)) { @@ -1120,6 +1133,9 @@ static void gui_display_settings() ImGui::EndCombo(); } } + else { + printf("Unknown option\n"); + } options++; }