feat(GUI): Added Top Bar to gui namespace

This commit is contained in:
Yimura 2020-12-26 16:45:04 +01:00
parent e7818b5159
commit b917ac9905
No known key found for this signature in database
GPG Key ID: 54EFAD29393A6E78
3 changed files with 89 additions and 0 deletions

View File

@ -99,6 +99,9 @@ namespace big
{
TRY_CLAUSE
{
// gui/top_bar.cpp
render_top_bar();
// gui/main_window.cpp
render_main_window();
}

View File

@ -13,6 +13,7 @@ namespace big
void script_on_tick();
static void script_func();
void render_top_bar();
void render_main_window();
public:
bool m_opened{};

View File

@ -0,0 +1,85 @@
#include "common.hpp"
#include "gui.hpp"
#include "imgui.h"
#include "features.hpp"
#include "natives.hpp"
#include "script.hpp"
#include "fiber_pool.hpp"
namespace big
{
void gui::render_top_bar()
{
if (ImGui::BeginMainMenuBar())
{
if (ImGui::BeginMenu("Info"))
{
ImGui::MenuItem("Logged in as:", NULL, false, false);
ImGui::MenuItem(g_players[g_playerId].name, NULL, false, false);
if (ImGui::MenuItem("Am I lobby host?"))
{
QUEUE_JOB_BEGIN_CLAUSE()
{
//features::notify_above_map(NETWORK::NETWORK_IS_HOST() ? "~g~Yes you are the host." : "You aren't the host.");
}
QUEUE_JOB_END_CLAUSE
}
if (ImGui::MenuItem("Flagged Account?"))
{
QUEUE_JOB_BEGIN_CLAUSE()
{
//features::notify_above_map(NETWORK::NETWORK_PLAYER_IS_BADSPORT() ? "You have been ~r~reported multiple times!" : "Your account is in good standing.");
}
QUEUE_JOB_END_CLAUSE
}
ImGui::EndMenu();
}
if (ImGui::BeginMenu("Extra"))
{
if (ImGui::MenuItem("Skip Cutscene"))
{
QUEUE_JOB_BEGIN_CLAUSE()
{
if (CUTSCENE::IS_CUTSCENE_ACTIVE())
CUTSCENE::STOP_CUTSCENE_IMMEDIATELY();
//else
//features::notify_above_map("There's no cutscene active at the moment.");
}
QUEUE_JOB_END_CLAUSE
}
ImGui::EndMenu();
}
if (ImGui::BeginMenu("Quit"))
{
if (ImGui::MenuItem("Unload Menu (may crash)"))
{
g_running = false;
}
if (ImGui::MenuItem("Rage Quit (hard crash)"))
{
exit(0);
}
ImGui::EndMenu();
}
/*if (ImGui::BeginMenu("Developer Options"))
{
ImGui::MenuItem("Scripted Game Event Logging (kick)", NULL, &g_bScriptedGameLogging);
ImGui::MenuItem("Event Data Logging (other events)", NULL, &g_bScriptLogging);
ImGui::EndMenu();
}*/
ImGui::EndMainMenuBar();
}
}
}