refactor(GUI): Reorder code and clean up includes

This commit is contained in:
Yimura 2021-01-15 23:16:50 +01:00
parent 9b3166f486
commit c40395731d
9 changed files with 51 additions and 43 deletions

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -1,10 +1,9 @@
#include "imgui.h"
#include "gui.hpp"
#include "window.hpp"
#include "features.hpp"
namespace big
{
void gui::render_user_sidebar()
void window::render_user_sidebar()
{
ImGui::SetNextWindowSize({ 350.f, (float)y }, 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();
};
}