Merge pull request #35 from Yimura-Forks/master

refactor: Simplified code and clean up
This commit is contained in:
Yimura 2022-01-04 23:24:08 +01:00 committed by GitHub
commit 2c5d4efb79
16 changed files with 155 additions and 11963 deletions

View File

@ -13,94 +13,6 @@ namespace big
VEHICLE_GUN VEHICLE_GUN
}; };
enum class eExplosionType : unsigned int
{
DONTCARE = UINT_MAX,
GRENADE = 0,
GRENADELAUNCHER = 1,
STICKYBOMB = 2,
MOLOTOV = 3,
ROCKET = 4,
TANKSHELL = 5,
HI_OCTANE = 6,
CAR = 7,
PLANE = 8,
PETROL_PUMP = 9,
BIKE = 10,
DIR_STEAM = 11,
DIR_FLAME = 12,
DIR_WATER_HYDRANT = 13,
DIR_GAS_CANISTER = 14,
BOAT = 15,
SHIP_DESTROY = 16,
TRUCK = 17,
BULLET = 18,
SMOKEGRENADELAUNCHER = 19,
SMOKEGRENADE = 20,
BZGAS = 21,
FLARE = 22,
GAS_CANISTER = 23,
EXTINGUISHER = 24,
_0x988620B8 = 25,
EXP_TAG_TRAIN = 26,
EXP_TAG_BARREL = 27,
EXP_TAG_PROPANE = 28,
EXP_TAG_BLIMP = 29,
EXP_TAG_DIR_FLAME_EXPLODE = 30,
EXP_TAG_TANKER = 31,
PLANE_ROCKET = 32,
EXP_TAG_VEHICLE_BULLET = 33,
EXP_TAG_GAS_TANK = 34,
EXP_TAG_BIRD_CRAP = 35,
EXP_TAG_RAILGUN = 36,
EXP_TAG_BLIMP2 = 37,
EXP_TAG_FIREWORK = 38,
EXP_TAG_SNOWBALL = 39,
EXP_TAG_PROXMINE = 40,
EXP_TAG_VALKYRIE_CANNON = 41,
EXP_TAG_AIR_DEFENCE = 42,
EXP_TAG_PIPEBOMB = 43,
EXP_TAG_VEHICLEMINE = 44,
EXP_TAG_EXPLOSIVEAMMO = 45,
EXP_TAG_APCSHELL = 46,
EXP_TAG_BOMB_CLUSTER = 47,
EXP_TAG_BOMB_GAS = 48,
EXP_TAG_BOMB_INCENDIARY = 49,
EXP_TAG_BOMB_STANDARD = 50,
EXP_TAG_TORPEDO = 51,
EXP_TAG_TORPEDO_UNDERWATER = 52,
EXP_TAG_BOMBUSHKA_CANNON = 53,
EXP_TAG_BOMB_CLUSTER_SECONDARY = 54,
EXP_TAG_HUNTER_BARRAGE = 55,
EXP_TAG_HUNTER_CANNON = 56,
EXP_TAG_ROGUE_CANNON = 57,
EXP_TAG_MINE_UNDERWATER = 58,
EXP_TAG_ORBITAL_CANNON = 59,
EXP_TAG_BOMB_STANDARD_WIDE = 60,
EXP_TAG_EXPLOSIVEAMMO_SHOTGUN = 61,
EXP_TAG_OPPRESSOR2_CANNON = 62,
EXP_TAG_MORTAR_KINETIC = 63,
EXP_TAG_VEHICLEMINE_KINETIC = 64,
EXP_TAG_VEHICLEMINE_EMP = 65,
EXP_TAG_VEHICLEMINE_SPIKE = 66,
EXP_TAG_VEHICLEMINE_SLICK = 67,
EXP_TAG_VEHICLEMINE_TAR = 68,
EXP_TAG_SCRIPT_DRONE = 69,
EXP_TAG_RAYGUN = 70,
EXP_TAG_BURIEDMINE = 71,
EXP_TAG_SCRIPT_MISSILE = 72,
EXP_TAG_RCTANK_ROCKET = 73,
EXP_TAG_BOMB_WATER = 74,
EXP_TAG_BOMB_WATER_SECONDARY = 75,
_0xF728C4A9 = 76,
_0xBAEC056F = 77,
EXP_TAG_FLASHGRENADE = 78,
EXP_TAG_STUNGRENADE = 79,
_0x763D3B3B = 80,
EXP_TAG_SCRIPT_MISSILE_LARGE = 81,
EXP_TAG_SUBMARINE_BIG = 82,
};
enum class ePedTask enum class ePedTask
{ {
TASK_NONE, TASK_NONE,

View File

@ -1,4 +1,3 @@
#pragma once #pragma once
extern const unsigned char font_rubik[140732];
extern const unsigned char font_storopia[89888]; extern const unsigned char font_storopia[89888];

File diff suppressed because it is too large Load Diff

View File

@ -377,45 +377,93 @@ enum class ControllerInputs : std::uint32_t
SCRIPTED_INPUT_LAST SCRIPTED_INPUT_LAST
}; };
enum class ExplosionTypes : std::uint32_t enum eExplosionType
{ {
EXPLOSION_GRENADE, DONTCARE = -1,
EXPLOSION_GRENADELAUNCHER, GRENADE,
EXPLOSION_STICKYBOMB, GRENADELAUNCHER,
EXPLOSION_MOLOTOV, STICKYBOMB,
EXPLOSION_ROCKET, MOLOTOV,
EXPLOSION_TANKSHELL, ROCKET,
EXPLOSION_HI_OCTANE, TANKSHELL,
EXPLOSION_CAR, HI_OCTANE,
EXPLOSION_PLANE, CAR,
EXPLOSION_PETROL_PUMP, PLANE,
EXPLOSION_BIKE, PETROL_PUMP,
EXPLOSION_DIR_STEAM, BIKE,
EXPLOSION_DIR_FLAME, DIR_STEAM,
EXPLOSION_DIR_WATER_HYDRANT, DIR_FLAME,
EXPLOSION_DIR_GAS_CANISTER, DIR_WATER_HYDRANT,
EXPLOSION_BOAT, DIR_GAS_CANISTER,
EXPLOSION_SHIP_DESTROY, BOAT,
EXPLOSION_TRUCK, SHIP_DESTROY,
EXPLOSION_BULLET, TRUCK,
EXPLOSION_SMOKEGRENADELAUNCHER, BULLET,
EXPLOSION_SMOKEGRENADE, SMOKEGRENADELAUNCHER,
EXPLOSION_BZGAS, SMOKEGRENADE,
EXPLOSION_FLARE, BZGAS,
EXPLOSION_GAS_CANISTER, FLARE,
EXPLOSION_EXTINGUISHER, GAS_CANISTER,
EXPLOSION_PROGRAMMABLEAR, EXTINGUISHER,
EXPLOSION_TRAIN, PROGRAMMABLEAR,
EXPLOSION_BARREL, TRAIN,
EXPLOSION_PROPANE, BARREL,
EXPLOSION_BLIMP, PROPANE,
EXPLOSION_DIR_FLAME_EXPLODE, BLIMP,
EXPLOSION_TANKER, DIR_FLAME_EXPLODE,
EXPLOSION_PLANE_ROCKET, TANKER,
EXPLOSION_VEHICLE_BULLET, PLANE_ROCKET,
EXPLOSION_GAS_TANK, VEHICLE_BULLET,
EXPLOSION_BIRD_CRAP, GAS_TANK,
EXPLOSION_SNOWBALL = 39 BIRD_CRAP,
RAILGUN,
BLIMP2,
FIREWORK,
SNOWBALL,
PROXMINE,
VALKYRIE_CANNON,
AIR_DEFENCE,
PIPEBOMB,
VEHICLEMINE,
EXPLOSIVEAMMO,
APCSHELL,
BOMB_CLUSTER,
BOMB_GAS,
BOMB_INCENDIARY,
BOMB_STANDARD,
TORPEDO,
TORPEDO_UNDERWATER,
BOMBUSHKA_CANNON,
BOMB_CLUSTER_SECONDARY,
HUNTER_BARRAGE,
HUNTER_CANNON,
ROGUE_CANNON,
MINE_UNDERWATER,
ORBITAL_CANNON,
BOMB_STANDARD_WIDE,
EXPLOSIVEAMMO_SHOTGUN,
OPPRESSOR2_CANNON,
MORTAR_KINETIC,
VEHICLEMINE_KINETIC,
VEHICLEMINE_EMP,
VEHICLEMINE_SPIKE,
VEHICLEMINE_SLICK,
VEHICLEMINE_TAR,
SCRIPT_DRONE,
RAYGUN,
BURIEDMINE,
SCRIPT_MISSILE,
RCTANK_ROCKET,
BOMB_WATER,
BOMB_WATER_SECONDARY,
_0xF728C4A9,
_0xBAEC056F,
FLASHGRENADE,
STUNGRENADE,
_0x763D3B3B,
SCRIPT_MISSILE_LARGE,
SUBMARINE_BIG,
EMPLAUNCHER_EMP
}; };
enum class HudColor : std::uint32_t enum class HudColor : std::uint32_t

View File

@ -13,7 +13,7 @@
#include <imgui.h> #include <imgui.h>
#include "gui/gui_main.hpp" #include "gui/window.hpp"
#include "util/notify.hpp" #include "util/notify.hpp"
namespace big namespace big
@ -105,7 +105,7 @@ namespace big
{ {
TRY_CLAUSE TRY_CLAUSE
{ {
main_gui::draw(); window::draw_all();
} }
EXCEPT_CLAUSE EXCEPT_CLAUSE
} }

View File

@ -1,20 +0,0 @@
#include "gui_main.hpp"
#include "window.hpp"
namespace big
{
void main_gui::draw()
{
window::top_bar();
window::log();
window::debug();
window::main();
window::handling();
window::player();
window::users();
}
}

View File

@ -1,12 +0,0 @@
#pragma once
#include "common.hpp"
#include "natives.hpp"
namespace big
{
class main_gui {
public:
static void draw();
};
}

View File

@ -1,9 +1,9 @@
#pragma once #pragma once
#include "natives.hpp"
namespace big namespace big
{ {
class window { class window {
public:
static void debug(); static void debug();
static void top_bar(); static void top_bar();
static void handling(); static void handling();
@ -11,5 +11,21 @@ namespace big
static void main(); static void main();
static void player(); static void player();
static void users(); static void users();
public:
static void draw_all()
{
window::top_bar();
window::log();
window::debug();
window::main();
window::handling();
window::player();
window::users();
}
}; };
} }

View File

@ -4,15 +4,15 @@
namespace big namespace big
{ {
struct modal_debug namespace modal_debug
{ {
static void modal_new_global(); void modal_new_global();
}; }
struct tab_debug namespace tab_debug
{ {
static void tab_globals(); void tab_globals();
static void tab_script_events(); void tab_script_events();
static void _tab_debug(); void _tab_debug();
}; }
} }

View File

@ -4,25 +4,23 @@
namespace big namespace big
{ {
class tab_current_profile namespace tab_current_profile
{ {
public: void tab_brakes();
static void tab_brakes(); void tab_gearing();
static void tab_gearing(); void tab_general();
static void tab_general(); void tab_other();
static void tab_other(); void tab_rollbars();
static void tab_rollbars(); void tab_roll_centre_height();
static void tab_roll_centre_height(); void tab_suspension();
static void tab_suspension(); void tab_steering();
static void tab_steering(); void tab_traction();
static void tab_traction(); void tab_transmission();
static void tab_transmission(); }
};
class modal_handling namespace modal_handling
{ {
public: void modal_save_handling();
static void modal_save_handling(); void modal_update_handling();
static void modal_update_handling(); }
};
} }

View File

@ -1,14 +1,10 @@
#pragma once #pragma once
#include "current_profile/current_profile_tabs.hpp" #include "current_profile/current_profile_tabs.hpp"
namespace big namespace big::tab_handling
{ {
class tab_handling void tab_current_profile();
{ void tab_my_profiles();
public: void tab_saved_profiles();
static void tab_current_profile(); void tab_search();
static void tab_my_profiles();
static void tab_saved_profiles();
static void tab_search();
};
} }

View File

@ -2,18 +2,15 @@
#include "common.hpp" #include "common.hpp"
#include "imgui.h" #include "imgui.h"
namespace big namespace big::tab_main
{ {
class tab_main { void tab_tunables();
public: void tab_self();
static void tab_tunables(); void tab_recovery();
static void tab_self(); void tab_settings();
static void tab_recovery(); void tab_spawn();
static void tab_settings(); void tab_spoofing();
static void tab_spawn(); void tab_vehicle();
static void tab_spoofing(); void tab_weapons();
static void tab_vehicle(); void tab_teleport();
static void tab_weapons();
static void tab_teleport();
};
} }

View File

@ -2,13 +2,9 @@
#include "common.hpp" #include "common.hpp"
#include "imgui.h" #include "imgui.h"
namespace big namespace big::tab_player
{ {
class tab_player void tab_info();
{ void tab_teleport();
public: void tab_toxic();
static void tab_info();
static void tab_teleport();
static void tab_toxic();
};
} }

View File

@ -1,4 +1,5 @@
#include "fiber_pool.hpp" #include "fiber_pool.hpp"
#include "gta/enums.hpp"
#include "gta_util.hpp" #include "gta_util.hpp"
#include "player_tabs.hpp" #include "player_tabs.hpp"
#include "natives.hpp" #include "natives.hpp"

View File

@ -54,7 +54,6 @@ namespace big
std::strcpy(font_cfg.Name, "Storopia"); std::strcpy(font_cfg.Name, "Storopia");
m_font = ImGui::GetIO().Fonts->AddFontFromMemoryTTF(const_cast<std::uint8_t*>(font_storopia), sizeof(font_storopia), 20.f, &font_cfg); m_font = ImGui::GetIO().Fonts->AddFontFromMemoryTTF(const_cast<std::uint8_t*>(font_storopia), sizeof(font_storopia), 20.f, &font_cfg);
//m_font = ImGui::GetIO().Fonts->AddFontFromMemoryTTF(const_cast<std::uint8_t*>(font_rubik), sizeof(font_rubik), 20.f, &font_cfg);
m_monospace_font = ImGui::GetIO().Fonts->AddFontDefault(); m_monospace_font = ImGui::GetIO().Fonts->AddFontDefault();
g_gui.dx_init(); g_gui.dx_init();

View File

@ -1,5 +1,5 @@
#pragma once #pragma once
#include "core/enums.hpp" #include "gta/enums.hpp"
#include "natives.hpp" #include "natives.hpp"
#include "script_global.hpp" #include "script_global.hpp"
#include "system.hpp" #include "system.hpp"
@ -27,24 +27,19 @@ namespace big::toxic
blame_explode_coord(to_blame, coords, explosion_type, damage, is_audible, is_invisible, camera_shake); blame_explode_coord(to_blame, coords, explosion_type, damage, is_audible, is_invisible, camera_shake);
} }
// param 0 == should send inline void bounty_player(Player target, int amount)
// param 1 == player target
// param 2 == amount
// param 3 == unk? => always 1
// param 4 == if some kind of bit must be set
inline void bounty_player(Player target, Player origin, int amount)
{ {
const size_t arg_count = 22; const size_t arg_count = 22;
int args[arg_count] = { int args[arg_count] = {
(int)eRemoteEvent::Bounty, (int)eRemoteEvent::Bounty,
0, 0, // doesn't matter of we set this to something else, the TRIGGER_SCRIPT_EVENT routine will set it to our player id anyways
target, target,
0, 0, // set by player or NPC?
10000, 10000,
0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
*script_global(1921036 + 9).as<int*>(), *script_global(1921036).at(9).as<int*>(),
*script_global(1921036 + 10).as<int*>() *script_global(1921036).at(10).as<int*>()
}; };
g_pointers->m_trigger_script_event(1, args, arg_count, -1); g_pointers->m_trigger_script_event(1, args, arg_count, -1);