2022-05-04 19:16:40 +02:00
|
|
|
#include "fiber_pool.hpp"
|
|
|
|
#include "util/session.hpp"
|
|
|
|
#include "views/view.hpp"
|
|
|
|
|
|
|
|
namespace big
|
|
|
|
{
|
2022-07-06 11:59:08 +02:00
|
|
|
void view::session()
|
|
|
|
{
|
2022-08-10 08:42:34 +08:00
|
|
|
components::sub_title("Session Switcher");
|
2022-07-06 11:59:08 +02:00
|
|
|
if (ImGui::ListBoxHeader("###session_switch"))
|
2022-05-04 19:16:40 +02:00
|
|
|
{
|
2022-07-06 11:59:08 +02:00
|
|
|
for (const auto& session_type : sessions)
|
|
|
|
{
|
|
|
|
components::selectable(session_type.name, false, [session_type] {
|
|
|
|
session::join_type(session_type);
|
|
|
|
});
|
|
|
|
}
|
|
|
|
ImGui::EndListBox();
|
2022-05-04 19:16:40 +02:00
|
|
|
}
|
|
|
|
if (ImGui::TreeNode("Local Time"))
|
|
|
|
{
|
|
|
|
ImGui::Checkbox("Override Time", &g->session.override_time);
|
|
|
|
|
|
|
|
if (g->session.override_time)
|
|
|
|
{
|
|
|
|
ImGui::SliderInt("Hour", &g->session.custom_time.hour, 0, 23);
|
|
|
|
ImGui::SliderInt("Minute", &g->session.custom_time.minute, 0, 59);
|
|
|
|
ImGui::SliderInt("Second", &g->session.custom_time.second, 0, 59);
|
|
|
|
}
|
|
|
|
|
|
|
|
ImGui::TreePop();
|
|
|
|
}
|
|
|
|
if (ImGui::TreeNode("Local Weather"))
|
|
|
|
{
|
2022-05-23 06:38:45 +08:00
|
|
|
components::button("Clear Override", [] {
|
|
|
|
MISC::CLEAR_OVERRIDE_WEATHER();
|
|
|
|
});
|
2022-05-04 19:16:40 +02:00
|
|
|
|
|
|
|
if(ImGui::ListBox("", &g->session.local_weather, session::weathers, 15))
|
|
|
|
{
|
|
|
|
g_fiber_pool->queue_job([]
|
|
|
|
{
|
|
|
|
session::local_weather();
|
|
|
|
});
|
|
|
|
|
|
|
|
ImGui::ListBoxFooter();
|
|
|
|
}
|
|
|
|
|
|
|
|
ImGui::TreePop();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|