From 9ab3b97947e2e5b659b58c5e49286115b465ea82 Mon Sep 17 00:00:00 2001 From: Yimura Date: Thu, 31 Dec 2020 11:04:38 +0100 Subject: [PATCH] fix(TabOnline): Fixed weather switch combo UI bug --- BigBaseV2/src/gui/tab_bar/tab_online.cpp | 26 +++++++++++++----------- 1 file changed, 14 insertions(+), 12 deletions(-) diff --git a/BigBaseV2/src/gui/tab_bar/tab_online.cpp b/BigBaseV2/src/gui/tab_bar/tab_online.cpp index 417e838e..a42aac80 100644 --- a/BigBaseV2/src/gui/tab_bar/tab_online.cpp +++ b/BigBaseV2/src/gui/tab_bar/tab_online.cpp @@ -99,23 +99,25 @@ namespace big } ImGui::Text("Weather:"); - ImGui::BeginCombo("##weather", weatherTypes[g_temp.weather_type]); - for (uint8_t i = 0; i < IM_ARRAYSIZE(weatherTypes); i++) + if (ImGui::BeginCombo("##weather", weatherTypes[g_temp.weather_type])) { - bool is_selected = (g_temp.weather_type == i); - if (ImGui::Selectable(weatherTypes[i], is_selected)) + for (uint8_t i = 0; i < IM_ARRAYSIZE(weatherTypes); i++) { - g_temp.weather_type = i; - - QUEUE_JOB_BEGIN_CLAUSE(=) + bool is_selected = (g_temp.weather_type == i); + if (ImGui::Selectable(weatherTypes[i], is_selected)) { - g_pointers->m_set_session_weather(1, i, 76, 0); - }QUEUE_JOB_END_CLAUSE + g_temp.weather_type = i; + + QUEUE_JOB_BEGIN_CLAUSE(= ) + { + g_pointers->m_set_session_weather(1, i, 76, 0); + }QUEUE_JOB_END_CLAUSE + } + if (is_selected) + ImGui::SetItemDefaultFocus(); } - if (is_selected) - ImGui::SetItemDefaultFocus(); + ImGui::EndCombo(); } - ImGui::EndCombo(); ImGui::TreePop(); }