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 af9c4ea846
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
16 changed files with 155 additions and 11963 deletions

View File

@ -13,94 +13,6 @@ namespace big
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
{
TASK_NONE,

View File

@ -1,4 +1,3 @@
#pragma once
extern const unsigned char font_rubik[140732];
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
};
enum class ExplosionTypes : std::uint32_t
enum eExplosionType
{
EXPLOSION_GRENADE,
EXPLOSION_GRENADELAUNCHER,
EXPLOSION_STICKYBOMB,
EXPLOSION_MOLOTOV,
EXPLOSION_ROCKET,
EXPLOSION_TANKSHELL,
EXPLOSION_HI_OCTANE,
EXPLOSION_CAR,
EXPLOSION_PLANE,
EXPLOSION_PETROL_PUMP,
EXPLOSION_BIKE,
EXPLOSION_DIR_STEAM,
EXPLOSION_DIR_FLAME,
EXPLOSION_DIR_WATER_HYDRANT,
EXPLOSION_DIR_GAS_CANISTER,
EXPLOSION_BOAT,
EXPLOSION_SHIP_DESTROY,
EXPLOSION_TRUCK,
EXPLOSION_BULLET,
EXPLOSION_SMOKEGRENADELAUNCHER,
EXPLOSION_SMOKEGRENADE,
EXPLOSION_BZGAS,
EXPLOSION_FLARE,
EXPLOSION_GAS_CANISTER,
EXPLOSION_EXTINGUISHER,
EXPLOSION_PROGRAMMABLEAR,
EXPLOSION_TRAIN,
EXPLOSION_BARREL,
EXPLOSION_PROPANE,
EXPLOSION_BLIMP,
EXPLOSION_DIR_FLAME_EXPLODE,
EXPLOSION_TANKER,
EXPLOSION_PLANE_ROCKET,
EXPLOSION_VEHICLE_BULLET,
EXPLOSION_GAS_TANK,
EXPLOSION_BIRD_CRAP,
EXPLOSION_SNOWBALL = 39
DONTCARE = -1,
GRENADE,
GRENADELAUNCHER,
STICKYBOMB,
MOLOTOV,
ROCKET,
TANKSHELL,
HI_OCTANE,
CAR,
PLANE,
PETROL_PUMP,
BIKE,
DIR_STEAM,
DIR_FLAME,
DIR_WATER_HYDRANT,
DIR_GAS_CANISTER,
BOAT,
SHIP_DESTROY,
TRUCK,
BULLET,
SMOKEGRENADELAUNCHER,
SMOKEGRENADE,
BZGAS,
FLARE,
GAS_CANISTER,
EXTINGUISHER,
PROGRAMMABLEAR,
TRAIN,
BARREL,
PROPANE,
BLIMP,
DIR_FLAME_EXPLODE,
TANKER,
PLANE_ROCKET,
VEHICLE_BULLET,
GAS_TANK,
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

View File

@ -13,7 +13,7 @@
#include <imgui.h>
#include "gui/gui_main.hpp"
#include "gui/window.hpp"
#include "util/notify.hpp"
namespace big
@ -105,7 +105,7 @@ namespace big
{
TRY_CLAUSE
{
main_gui::draw();
window::draw_all();
}
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
#include "natives.hpp"
namespace big
{
class window {
public:
static void debug();
static void top_bar();
static void handling();
@ -11,5 +11,21 @@ namespace big
static void main();
static void player();
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
{
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();
static void tab_script_events();
static void _tab_debug();
};
void tab_globals();
void tab_script_events();
void _tab_debug();
}
}

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -54,7 +54,6 @@ namespace big
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_rubik), sizeof(font_rubik), 20.f, &font_cfg);
m_monospace_font = ImGui::GetIO().Fonts->AddFontDefault();
g_gui.dx_init();

View File

@ -1,5 +1,5 @@
#pragma once
#include "core/enums.hpp"
#include "gta/enums.hpp"
#include "natives.hpp"
#include "script_global.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);
}
// param 0 == should send
// 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)
inline void bounty_player(Player target, int amount)
{
const size_t arg_count = 22;
int args[arg_count] = {
(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,
0,
0, // set by player or NPC?
10000,
0, 1, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0,
*script_global(1921036 + 9).as<int*>(),
*script_global(1921036 + 10).as<int*>()
*script_global(1921036).at(9).as<int*>(),
*script_global(1921036).at(10).as<int*>()
};
g_pointers->m_trigger_script_event(1, args, arg_count, -1);