refactor(GUI): Reorder code and clean up includes

This commit is contained in:
Yimura 2021-01-15 23:16:50 +01:00
parent 2271049ab3
commit fcfb777408
No known key found for this signature in database
GPG Key ID: 54EFAD29393A6E78
9 changed files with 51 additions and 43 deletions

View File

@ -9,28 +9,40 @@ namespace big
{ {
g_playerId = PLAYER::PLAYER_ID(); g_playerId = PLAYER::PLAYER_ID();
// System
update_player_structs(); update_player_structs();
update_screen_sizes(); update_screen_sizes();
// Custom Guns
delete_gun(); delete_gun();
disable_phone();
god_mode();
gravity_gun(); gravity_gun();
money_gun(); money_gun();
vehicle_gun();
// Tunable
disable_phone();
no_idle_kick();
// Self
god_mode();
never_wanted(); never_wanted();
noclip(); noclip();
no_bike_fall();
no_idle_kick();
no_ragdoll(); no_ragdoll();
off_radar(); off_radar();
population_modifiers();
reveal_players();
spectate_player();
speedo_meter();
spoof_rank();
sticky_tyres();
super_sprint(); super_sprint();
vehicle_gun(); spoof_rank();
// Vehicle
no_bike_fall();
speedo_meter();
sticky_tyres();
// World
population_modifiers();
// Util
spectate_player();
} }
void features::script_func() void features::script_func()

View File

@ -43,7 +43,6 @@ namespace big
void no_ragdoll(); void no_ragdoll();
void off_radar(); void off_radar();
void population_modifiers(); void population_modifiers();
void reveal_players();
void spectate_player(); void spectate_player();
void speedo_meter(); void speedo_meter();
void spoof_rank(); void spoof_rank();

View File

@ -11,6 +11,8 @@
#include "renderer.hpp" #include "renderer.hpp"
#include "script.hpp" #include "script.hpp"
#include "gui/window.hpp"
#include <imgui.h> #include <imgui.h>
namespace big namespace big
@ -103,16 +105,16 @@ namespace big
TRY_CLAUSE TRY_CLAUSE
{ {
// gui/top_bar.cpp // gui/top_bar.cpp
render_top_bar(); window::render_top_bar();
// gui/main_window.cpp // gui/main_window.cpp
render_main_window(); window::render_main_window();
// gui/user_sidebar.cpp // gui/user_sidebar.cpp
render_user_sidebar(); window::render_user_sidebar();
// gui/player_window.cpp // gui/player_window.cpp
render_player_window(); window::render_player_window();
} }
EXCEPT_CLAUSE EXCEPT_CLAUSE
} }

View File

@ -12,11 +12,6 @@ namespace big
void script_init(); void script_init();
void script_on_tick(); void script_on_tick();
static void script_func(); static void script_func();
void render_top_bar();
void render_main_window();
void render_user_sidebar();
void render_player_window();
public: public:
bool m_opened{}; bool m_opened{};
}; };

View File

@ -1,11 +1,9 @@
#include "common.hpp" #include "window.hpp"
#include "gui.hpp"
#include "imgui.h"
#include "tab_bar/tab_bar.hpp" #include "tab_bar/tab_bar.hpp"
namespace big namespace big
{ {
void gui::render_main_window() void window::render_main_window()
{ {
if (ImGui::Begin("Yimura's Mod Menu")) if (ImGui::Begin("Yimura's Mod Menu"))
{ {

View File

@ -1,11 +1,10 @@
#include "gui.hpp" #include "window.hpp"
#include "imgui.h"
#include "features.hpp" #include "features.hpp"
#include "pointers.hpp" #include "pointers.hpp"
namespace big namespace big
{ {
void gui::render_player_window() void window::render_player_window()
{ {
if (g_selectedPlayer.id != g_selectedPlayerId || !g_selectedPlayer.is_online) return; if (g_selectedPlayer.id != g_selectedPlayerId || !g_selectedPlayer.is_online) return;

View File

@ -1,6 +1,4 @@
#include "common.hpp" #include "window.hpp"
#include "gui.hpp"
#include "imgui.h"
#include "features.hpp" #include "features.hpp"
#include "natives.hpp" #include "natives.hpp"
#include "script.hpp" #include "script.hpp"
@ -10,7 +8,7 @@ namespace big
{ {
static char* player_name = ""; static char* player_name = "";
void gui::render_top_bar() void window::render_top_bar()
{ {
if (ImGui::BeginMainMenuBar()) if (ImGui::BeginMainMenuBar())
{ {
@ -95,14 +93,6 @@ namespace big
ImGui::EndMenu(); 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(); ImGui::EndMainMenuBar();
} }
} }

View File

@ -1,10 +1,9 @@
#include "imgui.h" #include "window.hpp"
#include "gui.hpp"
#include "features.hpp" #include "features.hpp"
namespace big namespace big
{ {
void gui::render_user_sidebar() void window::render_user_sidebar()
{ {
ImGui::SetNextWindowSize({ 350.f, (float)y }, ImGuiCond_Always); ImGui::SetNextWindowSize({ 350.f, (float)y }, ImGuiCond_Always);
ImGui::SetNextWindowPos({ x - 350.f, 0.f }, ImGuiCond_Always); ImGui::SetNextWindowPos({ x - 350.f, 0.f }, ImGuiCond_Always);

View File

@ -0,0 +1,14 @@
#pragma once
#include "imgui.h"
namespace big
{
class window
{
public:
static void render_top_bar();
static void render_main_window();
static void render_user_sidebar();
static void render_player_window();
};
}