2022-12-22 21:23:32 +00:00
|
|
|
#include "fiber_pool.hpp"
|
2023-03-01 21:27:15 +00:00
|
|
|
#include "views/view.hpp"
|
2022-05-04 19:16:40 +02:00
|
|
|
|
|
|
|
namespace big
|
|
|
|
{
|
|
|
|
void view::heading()
|
|
|
|
{
|
2023-03-01 21:27:15 +00:00
|
|
|
ImGui::SetNextWindowSize({300.f * g.window.gui_scale, 80.f * g.window.gui_scale});
|
|
|
|
ImGui::SetNextWindowPos({10.f, 10.f});
|
2022-05-04 19:16:40 +02:00
|
|
|
if (ImGui::Begin("menu_heading", nullptr, window_flags | ImGuiWindowFlags_NoScrollbar))
|
|
|
|
{
|
|
|
|
ImGui::BeginGroup();
|
2023-02-01 19:46:33 +01:00
|
|
|
ImGui::Text("HEADING_WELCOME"_T.data());
|
2022-05-04 19:16:40 +02:00
|
|
|
ImGui::PushStyleColor(ImGuiCol_Text, ImVec4(0.172f, 0.380f, 0.909f, 1.f));
|
2023-03-01 21:27:15 +00:00
|
|
|
ImGui::Text(g_local_player == nullptr || g_local_player->m_player_info == nullptr ?
|
|
|
|
"UNKNOWN_USERNAME"_T.data() :
|
|
|
|
g_local_player->m_player_info->m_net_player_data.m_name);
|
2022-05-04 19:16:40 +02:00
|
|
|
ImGui::PopStyleColor();
|
|
|
|
ImGui::EndGroup();
|
|
|
|
ImGui::SameLine();
|
2023-03-01 21:27:15 +00:00
|
|
|
ImGui::SetCursorPos(
|
|
|
|
{(300.f * g.window.gui_scale) - ImGui::CalcTextSize("UNLOAD"_T.data()).x - ImGui::GetStyle().ItemSpacing.x,
|
|
|
|
ImGui::GetStyle().WindowPadding.y / 2 + ImGui::GetStyle().ItemSpacing.y + (ImGui::CalcTextSize("W").y / 2)});
|
2022-05-04 19:16:40 +02:00
|
|
|
ImGui::PushStyleColor(ImGuiCol_Text, ImVec4(0.69f, 0.29f, 0.29f, 1.00f));
|
2023-02-01 19:46:33 +01:00
|
|
|
if (components::nav_button("UNLOAD"_T))
|
2022-05-04 19:16:40 +02:00
|
|
|
{
|
2023-03-09 12:23:01 +00:00
|
|
|
g_fiber_pool->reset();
|
2023-03-01 21:27:15 +00:00
|
|
|
g_fiber_pool->queue_job([] {
|
2022-12-22 21:23:32 +00:00
|
|
|
for (auto& command : g_looped_commands)
|
2022-12-30 02:09:33 +01:00
|
|
|
if (command->is_enabled())
|
|
|
|
command->on_disable();
|
2022-12-22 21:23:32 +00:00
|
|
|
|
|
|
|
g_running = false;
|
|
|
|
});
|
2022-05-04 19:16:40 +02:00
|
|
|
}
|
|
|
|
ImGui::PopStyleColor();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|