feat(SpecialAmmo): Added special ammo options
- Removed frame flags #108
This commit is contained in:
parent
046759a8cc
commit
b644c89e1f
@ -40,7 +40,6 @@ namespace big
|
||||
QUEUE_JOB_BEGIN_CLAUSE()
|
||||
{
|
||||
looped::self_clean_player();
|
||||
looped::self_frame_flags();
|
||||
looped::self_free_cam();
|
||||
looped::self_godmode();
|
||||
looped::self_invisibility();
|
||||
@ -63,6 +62,7 @@ namespace big
|
||||
|
||||
QUEUE_JOB_BEGIN_CLAUSE()
|
||||
{
|
||||
looped::weapons_ammo_special_type();
|
||||
looped::weapons_cage_gun();
|
||||
looped::weapons_delete_gun();
|
||||
looped::weapons_force_crosshairs();
|
||||
|
@ -18,7 +18,6 @@ namespace big
|
||||
static void protections_replay_interface();
|
||||
|
||||
static void self_clean_player();
|
||||
static void self_frame_flags();
|
||||
static void self_free_cam();
|
||||
static void self_godmode();
|
||||
static void self_invisibility();
|
||||
@ -39,6 +38,7 @@ namespace big
|
||||
static void vehicle_ls_customs();
|
||||
static void vehicle_speedo_meter();
|
||||
|
||||
static void weapons_ammo_special_type();
|
||||
static void weapons_cage_gun();
|
||||
static void weapons_delete_gun();
|
||||
static void weapons_force_crosshairs();
|
||||
|
@ -1,32 +0,0 @@
|
||||
#include "backend/looped/looped.hpp"
|
||||
#include "core/enums.hpp"
|
||||
|
||||
namespace big
|
||||
{
|
||||
enum eFrameFlags : std::uint32_t
|
||||
{
|
||||
eFrameFlagExplosiveAmmo = 1 << 11,
|
||||
eFrameFlagFireAmmo = 1 << 12,
|
||||
eFrameFlagExplosiveMelee = 1 << 13,
|
||||
eFrameFlagSuperJump = 1 << 14,
|
||||
};
|
||||
|
||||
void looped::self_frame_flags()
|
||||
{
|
||||
if (g_local_player == nullptr || g_local_player->m_player_info == nullptr) return;
|
||||
|
||||
uint32_t& flags = g_local_player->m_player_info->m_frame_flags;
|
||||
|
||||
if (g->self.frame_flags.explosive_ammo)
|
||||
flags |= eFrameFlagExplosiveAmmo;
|
||||
|
||||
if (g->self.frame_flags.explosive_melee)
|
||||
flags |= eFrameFlagExplosiveMelee;
|
||||
|
||||
if (g->self.frame_flags.fire_ammo)
|
||||
flags |= eFrameFlagFireAmmo;
|
||||
|
||||
if (g->self.frame_flags.super_jump)
|
||||
flags |= eFrameFlagSuperJump;
|
||||
}
|
||||
}
|
21
BigBaseV2/src/backend/looped/weapons/ammo_special_type.cpp
Normal file
21
BigBaseV2/src/backend/looped/weapons/ammo_special_type.cpp
Normal file
@ -0,0 +1,21 @@
|
||||
#include "backend/looped/looped.hpp"
|
||||
|
||||
namespace big
|
||||
{
|
||||
static bool bLastState = false;
|
||||
void looped::weapons_ammo_special_type()
|
||||
{
|
||||
if (g_local_player == nullptr ||
|
||||
g_local_player->m_weapon_manager == nullptr ||
|
||||
g_local_player->m_weapon_manager->m_weapon_info == nullptr ||
|
||||
g_local_player->m_weapon_manager->m_weapon_info->m_ammo_info == nullptr)
|
||||
return;
|
||||
|
||||
if (g->weapons.ammo_special.toggle)
|
||||
g_local_player->m_weapon_manager->m_weapon_info->m_ammo_info->m_ammo_special_type = g->weapons.ammo_special.type;
|
||||
else if (bLastState)
|
||||
g_local_player->m_weapon_manager->m_weapon_info->m_ammo_info->m_ammo_special_type = eAmmoSpecialType::None;
|
||||
|
||||
bLastState = g->weapons.ammo_special.toggle;
|
||||
}
|
||||
}
|
18
BigBaseV2/src/core/data/special_ammo_types.hpp
Normal file
18
BigBaseV2/src/core/data/special_ammo_types.hpp
Normal file
@ -0,0 +1,18 @@
|
||||
#pragma once
|
||||
#include "CAmmoInfo.hpp"
|
||||
|
||||
struct SpecialAmmo
|
||||
{
|
||||
char name[32];
|
||||
eAmmoSpecialType type;
|
||||
};
|
||||
|
||||
constexpr std::array<SpecialAmmo, 7> SPECIAL_AMMOS = {{
|
||||
{ "No Special Ammo", eAmmoSpecialType::None },
|
||||
{ "Armor Piercing Ammo", eAmmoSpecialType::ArmorPiercing },
|
||||
{ "Explosive Ammo", eAmmoSpecialType::Explosive },
|
||||
{ "Full Metal Jacket Ammo",eAmmoSpecialType::FMJ },
|
||||
{ "Hollow Point Ammo", eAmmoSpecialType::HollowPoint },
|
||||
{ "Incendiary Ammo", eAmmoSpecialType::Incendiary },
|
||||
{ "Tracer Ammo", eAmmoSpecialType::Tracer },
|
||||
}};
|
@ -1,4 +1,5 @@
|
||||
#pragma once
|
||||
#include "CAmmoInfo.hpp"
|
||||
#include "enums.hpp"
|
||||
#include "file_manager.hpp"
|
||||
#include "imgui.h"
|
||||
@ -57,13 +58,6 @@ namespace big
|
||||
};
|
||||
|
||||
struct self {
|
||||
struct frame_flags {
|
||||
bool explosive_ammo = false;
|
||||
bool explosive_melee = false;
|
||||
bool fire_ammo = false;
|
||||
bool super_jump = false;
|
||||
};
|
||||
|
||||
bool clean_player = false;
|
||||
bool force_wanted_level = false;
|
||||
bool free_cam = false;
|
||||
@ -75,8 +69,6 @@ namespace big
|
||||
bool off_radar = false;
|
||||
bool super_run = false;
|
||||
int wanted_level = 0;
|
||||
|
||||
frame_flags frame_flags{};
|
||||
};
|
||||
|
||||
struct settings {
|
||||
@ -127,6 +119,12 @@ namespace big
|
||||
};
|
||||
|
||||
struct weapons {
|
||||
struct ammo_special
|
||||
{
|
||||
bool toggle = false;
|
||||
eAmmoSpecialType type = eAmmoSpecialType::None;
|
||||
} ammo_special;
|
||||
|
||||
CustomWeapon custom_weapon = CustomWeapon::NONE;
|
||||
bool force_crosshairs = false;
|
||||
bool infinite_ammo = false;
|
||||
@ -234,11 +232,6 @@ namespace big
|
||||
this->self.off_radar = j["self"]["off_radar"];
|
||||
this->self.super_run = j["self"]["super_run"];
|
||||
|
||||
this->self.frame_flags.explosive_ammo = j["self"]["frame_flags"]["explosive_ammo"];
|
||||
this->self.frame_flags.explosive_melee = j["self"]["frame_flags"]["explosive_melee"];
|
||||
this->self.frame_flags.fire_ammo = j["self"]["frame_flags"]["fire_ammo"];
|
||||
this->self.frame_flags.super_jump = j["self"]["frame_flags"]["super_jump"];
|
||||
|
||||
this->settings.hotkeys.menu_toggle = j["settings"]["hotkeys"]["menu_toggle"];
|
||||
|
||||
this->spawn.preview_vehicle = j["spawn"]["preview_vehicle"];
|
||||
@ -271,6 +264,9 @@ namespace big
|
||||
this->weapons.no_recoil = j["weapons"]["no_recoil"];
|
||||
this->weapons.no_spread = j["weapons"]["no_spread"];
|
||||
|
||||
this->weapons.ammo_special.type = (eAmmoSpecialType)j["weapons"]["ammo_special"]["type"];
|
||||
this->weapons.ammo_special.toggle = j["weapons"]["ammo_special"]["toggle"];
|
||||
|
||||
this->window.debug = j["window"]["debug"];
|
||||
this->window.handling = j["window"]["handling"];
|
||||
this->window.log = j["window"]["log"];
|
||||
@ -345,16 +341,7 @@ namespace big
|
||||
{ "never_wanted", this->self.never_wanted },
|
||||
{ "no_ragdoll", this->self.no_ragdoll },
|
||||
{ "off_radar", this->self.off_radar },
|
||||
{ "super_run", this->self.super_run },
|
||||
|
||||
{
|
||||
"frame_flags", {
|
||||
{ "explosive_ammo", this->self.frame_flags.explosive_ammo },
|
||||
{ "explosive_melee", this->self.frame_flags.explosive_melee },
|
||||
{ "fire_ammo", this->self.frame_flags.fire_ammo },
|
||||
{ "super_jump", this->self.frame_flags.super_jump }
|
||||
}
|
||||
}
|
||||
{ "super_run", this->self.super_run }
|
||||
}
|
||||
},
|
||||
{
|
||||
@ -404,6 +391,12 @@ namespace big
|
||||
},
|
||||
{
|
||||
"weapons", {
|
||||
{ "ammo_special", {
|
||||
{ "toggle", this->weapons.ammo_special.toggle },
|
||||
{ "type", (int)this->weapons.ammo_special.type },
|
||||
|
||||
}
|
||||
},
|
||||
{ "custom_weapon", (int)this->weapons.custom_weapon },
|
||||
{ "force_crosshairs", this->weapons.force_crosshairs },
|
||||
{ "increased_damage", this->weapons.increased_damage },
|
||||
|
@ -47,25 +47,6 @@ namespace big
|
||||
ImGui::TreePop();
|
||||
}
|
||||
|
||||
if (ImGui::TreeNode("Frame Flags"))
|
||||
{
|
||||
ImGui::BeginGroup();
|
||||
|
||||
ImGui::Checkbox("Explosive Ammo", &g->self.frame_flags.explosive_ammo);
|
||||
ImGui::Checkbox("Fire Ammo", &g->self.frame_flags.fire_ammo);
|
||||
|
||||
ImGui::EndGroup();
|
||||
ImGui::SameLine();
|
||||
ImGui::BeginGroup();
|
||||
|
||||
ImGui::Checkbox("Explosive Melee", &g->self.frame_flags.explosive_melee);
|
||||
ImGui::Checkbox("Super Jump", &g->self.frame_flags.super_jump);
|
||||
|
||||
ImGui::EndGroup();
|
||||
|
||||
ImGui::TreePop();
|
||||
}
|
||||
|
||||
if (ImGui::TreeNode("Player Model"))
|
||||
{
|
||||
static char model[32];
|
||||
|
@ -2,6 +2,7 @@
|
||||
#include "fiber_pool.hpp"
|
||||
#include "gta/Weapons.h"
|
||||
#include "script.hpp"
|
||||
#include "core/data/special_ammo_types.hpp"
|
||||
#include "views/view.hpp"
|
||||
|
||||
namespace big
|
||||
@ -46,7 +47,30 @@ namespace big
|
||||
|
||||
ImGui::TreePop();
|
||||
}
|
||||
|
||||
|
||||
if (ImGui::TreeNode("Ammo Special"))
|
||||
{
|
||||
ImGui::Checkbox("Enable Special Ammo", &g->weapons.ammo_special.toggle);
|
||||
|
||||
eAmmoSpecialType selected = g->weapons.ammo_special.type;
|
||||
|
||||
if (ImGui::BeginCombo("Ammo Special", SPECIAL_AMMOS[(int)selected].name))
|
||||
{
|
||||
for (const auto& special_ammo : SPECIAL_AMMOS)
|
||||
{
|
||||
if (ImGui::Selectable(special_ammo.name, special_ammo.type == selected))
|
||||
g->weapons.ammo_special.type = special_ammo.type;
|
||||
|
||||
if (special_ammo.type == selected)
|
||||
ImGui::SetItemDefaultFocus();
|
||||
}
|
||||
|
||||
ImGui::EndCombo();
|
||||
}
|
||||
|
||||
ImGui::TreePop();
|
||||
}
|
||||
|
||||
if (ImGui::TreeNode("Custom Weapons"))
|
||||
{
|
||||
CustomWeapon selected = g->weapons.custom_weapon;
|
||||
@ -69,16 +93,6 @@ namespace big
|
||||
|
||||
switch (selected)
|
||||
{
|
||||
case CustomWeapon::NONE:
|
||||
break;
|
||||
case CustomWeapon::CAGE_GUN:
|
||||
break;
|
||||
case CustomWeapon::DELETE_GUN:
|
||||
break;
|
||||
case CustomWeapon::GRAVITY_GUN:
|
||||
break;
|
||||
case CustomWeapon::REPAIR_GUN:
|
||||
break;
|
||||
case CustomWeapon::VEHICLE_GUN:
|
||||
ImGui::Text("Shooting Model:");
|
||||
ImGui::InputText("##vehicle_gun_model", g->weapons.vehicle_gun_model, 12);
|
||||
|
Reference in New Issue
Block a user