2022-10-26 20:27:15 +02:00
|
|
|
#include "fiber_pool.hpp"
|
|
|
|
#include "util/session.hpp"
|
2023-03-01 21:27:15 +00:00
|
|
|
#include "views/view.hpp"
|
2022-10-26 20:27:15 +02:00
|
|
|
|
|
|
|
namespace big
|
|
|
|
{
|
|
|
|
void view::time_and_weather()
|
|
|
|
{
|
2023-02-01 19:46:33 +01:00
|
|
|
if (ImGui::TreeNode("LOCAL_TIME"_T.data()))
|
2022-10-26 20:27:15 +02:00
|
|
|
{
|
2023-02-01 19:46:33 +01:00
|
|
|
ImGui::Checkbox("OVERRIDE_TIME"_T.data(), &g.session.override_time);
|
2022-10-26 20:27:15 +02:00
|
|
|
|
2022-12-18 23:15:52 +01:00
|
|
|
if (g.session.override_time)
|
2022-10-26 20:27:15 +02:00
|
|
|
{
|
2023-02-01 19:46:33 +01:00
|
|
|
ImGui::SliderInt("HOUR"_T.data(), &g.session.custom_time.hour, 0, 23);
|
|
|
|
ImGui::SliderInt("MINUTE"_T.data(), &g.session.custom_time.minute, 0, 59);
|
|
|
|
ImGui::SliderInt("SECOND"_T.data(), &g.session.custom_time.second, 0, 59);
|
2022-10-26 20:27:15 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
ImGui::TreePop();
|
|
|
|
}
|
|
|
|
|
2023-02-01 19:46:33 +01:00
|
|
|
if (ImGui::TreeNode("LOCAL_WEATHER"_T.data()))
|
2022-10-26 20:27:15 +02:00
|
|
|
{
|
2023-03-01 21:27:15 +00:00
|
|
|
components::button("CLEAR_OVERRIDE"_T, [] {
|
2022-10-26 20:27:15 +02:00
|
|
|
MISC::CLEAR_OVERRIDE_WEATHER();
|
|
|
|
});
|
|
|
|
|
2023-02-01 19:46:33 +01:00
|
|
|
if (ImGui::ListBox("##weather-listbox", &g.session.local_weather, session::weathers, 15))
|
2022-10-26 20:27:15 +02:00
|
|
|
{
|
2023-03-01 21:27:15 +00:00
|
|
|
g_fiber_pool->queue_job([] {
|
2022-10-26 20:27:15 +02:00
|
|
|
session::local_weather();
|
|
|
|
});
|
|
|
|
|
|
|
|
ImGui::ListBoxFooter();
|
|
|
|
}
|
|
|
|
|
|
|
|
ImGui::TreePop();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|