From 7c2e0a3d332842152351d8b0f21c1fd64988ba5d Mon Sep 17 00:00:00 2001 From: Yimura Date: Wed, 19 May 2021 11:49:22 +0200 Subject: [PATCH] feat(GUI): Added top bar to window --- BigBaseV2/src/gui/gui_main.cpp | 2 + BigBaseV2/src/gui/window.hpp | 1 + BigBaseV2/src/gui/window/window_top_bar.cpp | 77 +++++++++++++++++++++ 3 files changed, 80 insertions(+) create mode 100644 BigBaseV2/src/gui/window/window_top_bar.cpp diff --git a/BigBaseV2/src/gui/gui_main.cpp b/BigBaseV2/src/gui/gui_main.cpp index fc4d9aaf..b4a31569 100644 --- a/BigBaseV2/src/gui/gui_main.cpp +++ b/BigBaseV2/src/gui/gui_main.cpp @@ -5,6 +5,8 @@ namespace big { void main_gui::draw() { + window::top_bar(); + window::main(); } } \ No newline at end of file diff --git a/BigBaseV2/src/gui/window.hpp b/BigBaseV2/src/gui/window.hpp index 8ca9b374..f14a9639 100644 --- a/BigBaseV2/src/gui/window.hpp +++ b/BigBaseV2/src/gui/window.hpp @@ -4,6 +4,7 @@ namespace big { class window { public: + static void top_bar(); static void main(); }; } \ No newline at end of file diff --git a/BigBaseV2/src/gui/window/window_top_bar.cpp b/BigBaseV2/src/gui/window/window_top_bar.cpp new file mode 100644 index 00000000..a121b82f --- /dev/null +++ b/BigBaseV2/src/gui/window/window_top_bar.cpp @@ -0,0 +1,77 @@ +#include "gui/window.hpp" +#include "imgui.h" +#include "fiber_pool.hpp" +#include "script.hpp" +#include "util/notify.hpp" + +namespace big +{ + void window::top_bar() + { + if (ImGui::BeginMainMenuBar()) + { + if (ImGui::BeginMenu("Info")) + { + ImGui::MenuItem("Logged in as:", NULL, false, false); + ImGui::MenuItem("unknown", NULL, false, false); + + if (ImGui::MenuItem("Am I lobby host?")) + { + QUEUE_JOB_BEGIN_CLAUSE() + { + 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() + { + 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() + { + CUTSCENE::STOP_CUTSCENE_IMMEDIATELY(); + } + QUEUE_JOB_END_CLAUSE + } + + ImGui::EndMenu(); + } + + if (ImGui::BeginMenu("Quit")) + { + if (ImGui::MenuItem("Unload Menu (may crash)")) + { + QUEUE_JOB_BEGIN_CLAUSE(&) + { + notify::above_map("Thanks for using Yim's Mod Menu"); + + g_running = false; + }QUEUE_JOB_END_CLAUSE + } + + if (ImGui::MenuItem("Rage Quit (hard crash)")) + { + exit(0); + } + + ImGui::EndMenu(); + } + + ImGui::EndMainMenuBar(); + } + } +} \ No newline at end of file