TmpMenu/src/views/core/view_heading.cpp

36 lines
1.2 KiB
C++
Raw Normal View History

#include "views/view.hpp"
#include "fiber_pool.hpp"
namespace big
{
void view::heading()
{
2022-07-06 00:56:32 +08:00
ImGui::SetNextWindowSize({ 300.f, 80.f });
ImGui::SetNextWindowPos({ 10.f, 10.f });
if (ImGui::Begin("menu_heading", nullptr, window_flags | ImGuiWindowFlags_NoScrollbar))
{
ImGui::BeginGroup();
ImGui::Text("HEADING_WELCOME"_T.data());
ImGui::PushStyleColor(ImGuiCol_Text, ImVec4(0.172f, 0.380f, 0.909f, 1.f));
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);
ImGui::PopStyleColor();
ImGui::EndGroup();
ImGui::SameLine();
ImGui::SetCursorPos({ 300.f - ImGui::CalcTextSize("UNLOAD"_T.data()).x - ImGui::GetStyle().ItemSpacing.x, ImGui::GetStyle().WindowPadding.y / 2 + ImGui::GetStyle().ItemSpacing.y + (ImGui::CalcTextSize("W").y / 2) });
ImGui::PushStyleColor(ImGuiCol_Text, ImVec4(0.69f, 0.29f, 0.29f, 1.00f));
if (components::nav_button("UNLOAD"_T))
{
g_fiber_pool->queue_job([]
{
for (auto& command : g_looped_commands)
2022-12-30 02:09:33 +01:00
if (command->is_enabled())
command->on_disable();
g_running = false;
});
}
ImGui::PopStyleColor();
}
}
}