diff --git a/BigBaseV2/src/backend/backend.cpp b/BigBaseV2/src/backend/backend.cpp index 9879bfc5..38447c8d 100644 --- a/BigBaseV2/src/backend/backend.cpp +++ b/BigBaseV2/src/backend/backend.cpp @@ -75,6 +75,7 @@ namespace big while (g_running) { looped::vehicle_auto_drive(); + looped::vehicle_boost_behavior(); looped::vehicle_despawn_bypass(); looped::vehicle_drive_on_water(); looped::vehicle_god_mode(); diff --git a/BigBaseV2/src/backend/looped/looped.hpp b/BigBaseV2/src/backend/looped/looped.hpp index 2e185fd2..3f5ad1e1 100644 --- a/BigBaseV2/src/backend/looped/looped.hpp +++ b/BigBaseV2/src/backend/looped/looped.hpp @@ -42,6 +42,7 @@ namespace big static void system_update_pointers(); static void vehicle_auto_drive(); + static void vehicle_boost_behavior(); static void vehicle_despawn_bypass(); static void vehicle_drive_on_water(); static void vehicle_fly(); diff --git a/BigBaseV2/src/backend/looped/vehicle/boost_behavior.cpp b/BigBaseV2/src/backend/looped/vehicle/boost_behavior.cpp new file mode 100644 index 00000000..14bb40f4 --- /dev/null +++ b/BigBaseV2/src/backend/looped/vehicle/boost_behavior.cpp @@ -0,0 +1,27 @@ +#include "backend/looped/looped.hpp" +#include "core/enums.hpp" +#include "natives.hpp" + +namespace big +{ + void looped::vehicle_boost_behavior() + { + auto* const vehicle = g_local_player->m_vehicle; + + if (vehicle && VEHICLE::GET_HAS_ROCKET_BOOST_(self::veh)) + { + if (g->vehicle.boost_behavior == eBoostBehaviors::INSTANT_REFIL && vehicle->m_boost == 0.f) // No Boost Refil Time + { + vehicle->m_boost = 1.f; + } + else if (g->vehicle.boost_behavior == eBoostBehaviors::INFINITE_BOOST) // Infinite Boost + { + if (vehicle->m_boost_state) + { + vehicle->m_boost_allow_recharge = true; + vehicle->m_boost = 1.f; + } + } + } + } +} diff --git a/BigBaseV2/src/core/enums.hpp b/BigBaseV2/src/core/enums.hpp index c6f07090..884b06be 100644 --- a/BigBaseV2/src/core/enums.hpp +++ b/BigBaseV2/src/core/enums.hpp @@ -2,6 +2,13 @@ namespace big { + enum class eBoostBehaviors + { + DEFAULT, + INSTANT_REFIL, + INFINITE_BOOST + }; + enum class CustomWeapon { NONE, diff --git a/BigBaseV2/src/core/globals.hpp b/BigBaseV2/src/core/globals.hpp index 26cc5952..3a195de5 100644 --- a/BigBaseV2/src/core/globals.hpp +++ b/BigBaseV2/src/core/globals.hpp @@ -242,21 +242,22 @@ namespace big AutoDriveDestination auto_drive_destination = AutoDriveDestination::STOPPED; AutoDriveStyle auto_drive_style = AutoDriveStyle::LAW_ABIDING; + float auto_drive_speed = 1; bool auto_turn_signals = false; + eBoostBehaviors boost_behavior = eBoostBehaviors::DEFAULT; bool drive_on_water = false; bool horn_boost = false; - bool vehicle_jump = false; bool instant_brake = false; bool is_targetable = true; - bool ls_customs = false; // don't save this to dis - bool seatbelt = false; - bool turn_signals = false; - float auto_drive_speed = 1; + bool ls_customs = false; // don't save this to disk + bool rainbow_neon = false; int rainbow_paint = 0; bool rainbow_primary = false; bool rainbow_secondary = false; - bool rainbow_neon = false; bool rainbow_smoke = false; + bool seatbelt = false; + bool turn_signals = false; + bool vehicle_jump = false; speedo_meter speedo_meter{}; fly fly{}; }; @@ -555,6 +556,7 @@ namespace big this->vehicle.proof_steam = j["vehicle"]["proof_steam"]; this->vehicle.proof_water = j["vehicle"]["proof_water"]; this->vehicle.proof_mask = j["vehicle"]["proof_mask"]; + this->vehicle.boost_behavior = j["vehicle"]["boost_behavior"]; this->vehicle.auto_drive_style = j["vehicle"]["auto_drive_style"]; this->vehicle.auto_drive_speed = j["vehicle"]["auto_drive_speed"]; this->vehicle.auto_turn_signals = j["vehicle"]["auto_turn_signals"]; @@ -832,6 +834,7 @@ namespace big { "auto_drive_style", this->vehicle.auto_drive_style }, { "auto_drive_speed", this->vehicle.auto_drive_speed }, { "auto_turn_signals", this->vehicle.auto_turn_signals }, + { "boost_behavior", this->vehicle.boost_behavior }, { "drive_on_water", this->vehicle.drive_on_water }, { "horn_boost", this->vehicle.horn_boost }, { "vehicle_jump", this->vehicle.vehicle_jump }, diff --git a/BigBaseV2/src/views/vehicle/view_vehicle_fun.cpp b/BigBaseV2/src/views/vehicle/view_vehicle_fun.cpp index 111a1da7..773694e4 100644 --- a/BigBaseV2/src/views/vehicle/view_vehicle_fun.cpp +++ b/BigBaseV2/src/views/vehicle/view_vehicle_fun.cpp @@ -1,10 +1,11 @@ +#include "core/data/speed_units.hpp" +#include "core/enums.hpp" #include "fiber_pool.hpp" #include "gui/handling/handling_tabs.hpp" #include "script.hpp" +#include "util/mobile.hpp" #include "util/vehicle.hpp" #include "views/view.hpp" -#include "util/mobile.hpp" -#include "core/data/speed_units.hpp" namespace big { @@ -36,7 +37,7 @@ namespace big seats = tmp_seats; ready = true; - }); + }); } @@ -70,7 +71,7 @@ namespace big components::button(name, [idx] { PED::SET_PED_INTO_VEHICLE(self::ped, self::veh, idx); - }); + }); if (!it.second) { ImGui::EndDisabled(); @@ -176,6 +177,29 @@ namespace big ImGui::Separator(); + static constexpr char const* boost_behaviors[] = { "Default", "Instant Refill", "Infinite" }; + if (ImGui::BeginCombo("Boost Behavior", boost_behaviors[static_cast(g->vehicle.boost_behavior)])) + { + for (int i = 0; i < 3; i++) + { + bool itemSelected = g->vehicle.boost_behavior == static_cast(i); + + if (ImGui::Selectable(boost_behaviors[i], itemSelected)) + { + g->vehicle.boost_behavior = static_cast(i); + } + + if (itemSelected) + { + ImGui::SetItemDefaultFocus(); + } + } + + ImGui::EndCombo(); + } + + ImGui::Separator(); + components::small_text("Vehicle Fly"); ImGui::BeginGroup();