diff --git a/source/main/gui/GUIUtils.cpp b/source/main/gui/GUIUtils.cpp index 3d90c3cc48..2dd2a62e9c 100644 --- a/source/main/gui/GUIUtils.cpp +++ b/source/main/gui/GUIUtils.cpp @@ -332,13 +332,15 @@ void RoR::DrawGTextEdit(CVar* cvar, const char* label, Str<1000>& buf) } } -void RoR::DrawGCombo(CVar* cvar, const char* label, const char* values) +bool RoR::DrawGCombo(CVar* cvar, const char* label, const char* values) { int selection = cvar->getInt(); if (ImGui::Combo(label, &selection, values)) { cvar->setVal(selection); + return true; } + return false; } Ogre::TexturePtr RoR::FetchIcon(const char* name) diff --git a/source/main/gui/GUIUtils.h b/source/main/gui/GUIUtils.h index 081a987e00..97d1f773be 100644 --- a/source/main/gui/GUIUtils.h +++ b/source/main/gui/GUIUtils.h @@ -70,7 +70,7 @@ void DrawGFloatBox(CVar* cvar, const char* label); void DrawGTextEdit(CVar* cvar, const char* label, Str<1000>& buf); -void DrawGCombo(CVar* cvar, const char* label, const char* values); +bool DrawGCombo(CVar* cvar, const char* label, const char* values); Ogre::TexturePtr FetchIcon(const char* name); diff --git a/source/main/gui/panels/GUI_GameSettings.cpp b/source/main/gui/panels/GUI_GameSettings.cpp index 0cc6f0c2d4..1804fa4dce 100644 --- a/source/main/gui/panels/GUI_GameSettings.cpp +++ b/source/main/gui/panels/GUI_GameSettings.cpp @@ -616,13 +616,12 @@ void GameSettings::SetVisible(bool v) void GameSettings::DrawUiPresetCombo() { ImGui::PushID("uiPreset"); - - DrawGCombo(App::ui_preset, _LC("TopMenubar", "UI Preset"), m_cached_uipreset_combo_string.c_str()); - if (ImGui::IsItemEdited()) + if (DrawGCombo(App::ui_preset, _LC("TopMenubar", "UI Preset"), m_cached_uipreset_combo_string.c_str())) { App::GetGuiManager()->ApplyUiPreset(); } + if (ImGui::IsItemHovered()) { ImGui::BeginTooltip();