diff --git a/BigBaseV2/src/backend/looped/self/godmode.cpp b/BigBaseV2/src/backend/looped/self/godmode.cpp index 2a31a585..913ba628 100644 --- a/BigBaseV2/src/backend/looped/self/godmode.cpp +++ b/BigBaseV2/src/backend/looped/self/godmode.cpp @@ -1,21 +1,53 @@ #include "backend/looped/looped.hpp" -#include "natives.hpp" +#include "util/water.hpp" namespace big { - static uint32_t lastProofBits = 0; + static uint32_t last_bits = 0; + static float last_water_collistion_strength = 0; - void looped::self_godmode() { - if (g_local_player != nullptr) { - uint32_t proofBits = g->self.proof_mask; - uint32_t changedProofBits = proofBits ^ lastProofBits; - uint32_t changedOrEnabledProofBits = proofBits | changedProofBits; + void looped::self_godmode() + { + if (g_local_player == nullptr) + { + return; + } - if (changedOrEnabledProofBits) { - uint32_t unchangedBits = g_local_player->m_damage_bits & ~changedOrEnabledProofBits; - g_local_player->m_damage_bits = unchangedBits | proofBits; - lastProofBits = proofBits; + float* water_collision_ptr = nullptr; + if (g_local_player->m_navigation != nullptr) + { + water_collision_ptr = water::get_water_collision_ptr(g_local_player->m_navigation); + } + + uint32_t bits = g->self.proof_mask; + uint32_t changed_bits = bits ^ last_bits; + uint32_t changed_or_enabled_bits = bits | changed_bits; + + if (changed_or_enabled_bits) + { + uint32_t unchanged_bits = g_local_player->m_damage_bits & ~changed_or_enabled_bits; + g_local_player->m_damage_bits = unchanged_bits | bits; + last_bits = bits; + + + if (changed_or_enabled_bits & (uint32_t)eEntityProofs::WATER) + { + water::reset_ped_oxygen_time(g_local_player); + + if (water_collision_ptr != nullptr && *water_collision_ptr != 0.f) + { + last_water_collistion_strength = *water_collision_ptr; + *water_collision_ptr = 0; + } + + return; } } + + if (last_water_collistion_strength != 0 && water_collision_ptr != nullptr) + { + *water_collision_ptr = last_water_collistion_strength; + last_water_collistion_strength = 0; + } } } \ No newline at end of file diff --git a/BigBaseV2/src/backend/looped/vehicle/vehicle_god.cpp b/BigBaseV2/src/backend/looped/vehicle/vehicle_god.cpp index 1fa91e95..ac1abfde 100644 --- a/BigBaseV2/src/backend/looped/vehicle/vehicle_god.cpp +++ b/BigBaseV2/src/backend/looped/vehicle/vehicle_god.cpp @@ -1,25 +1,64 @@ #include "backend/looped/looped.hpp" #include "util/misc.hpp" +#include "util/water.hpp" namespace big { - static bool last_veh_god = false; + static uint32_t last_bits = 0; + static float last_water_collistion_strength = 0; + void looped::vehicle_god_mode() { - if ((!g->vehicle.god_mode && last_veh_god == g->vehicle.god_mode) || g_local_player == nullptr || g_local_player->m_vehicle == nullptr) - return; - - if (g->vehicle.god_mode && g_local_player->m_ped_task_flag & (int)ePedTask::TASK_DRIVING) + if (g_local_player == nullptr || g_local_player->m_vehicle == nullptr) { + return; + } + + if ( + (g->vehicle.god_mode || g->vehicle.proof_collision) && + g_local_player->m_ped_task_flag & (int)ePedTask::TASK_DRIVING + ) { g_local_player->m_vehicle->m_deform_god = 0x8C; - misc::set_bit((int*)&g_local_player->m_vehicle->m_damage_bits, 8); } else { g_local_player->m_vehicle->m_deform_god = 0x9C; - misc::clear_bit((int*)&g_local_player->m_vehicle->m_damage_bits, 8); } - last_veh_god = g->vehicle.god_mode; + float* water_collision_ptr = nullptr; + if (g_local_player->m_vehicle->m_navigation != nullptr) + { + water_collision_ptr = water::get_water_collision_ptr(g_local_player->m_vehicle->m_navigation); + } + + uint32_t bits = g->vehicle.proof_mask; + uint32_t changed_bits = bits ^ last_bits; + uint32_t changed_or_enabled_bits = bits | changed_bits; + + if (changed_or_enabled_bits) + { + uint32_t unchanged_bits = g_local_player->m_vehicle->m_damage_bits & ~changed_or_enabled_bits; + g_local_player->m_vehicle->m_damage_bits = unchanged_bits | bits; + last_bits = bits; + + if (changed_or_enabled_bits & (uint32_t)eEntityProofs::WATER) + { + water::reset_ped_oxygen_time(g_local_player); + + if (water_collision_ptr != nullptr && *water_collision_ptr != 0.f) + { + last_water_collistion_strength = *water_collision_ptr; + *water_collision_ptr = 0; + } + + return; + } + } + + if (last_water_collistion_strength != 0 && water_collision_ptr != nullptr) + { + *water_collision_ptr = last_water_collistion_strength; + last_water_collistion_strength = 0; + } } } \ No newline at end of file diff --git a/BigBaseV2/src/core/data/vehicle_plate_types.hpp b/BigBaseV2/src/core/data/vehicle_plate_types.hpp new file mode 100644 index 00000000..e5608581 --- /dev/null +++ b/BigBaseV2/src/core/data/vehicle_plate_types.hpp @@ -0,0 +1,18 @@ +#pragma once +#include "gta\VehicleValues.h" + +struct vehicle_plate_type { + PlateTextIndexs type; + const char name[16]; +}; + + +#define PLATE_TYPE_SIZE 6 +vehicle_plate_type vehicle_plate_types[PLATE_TYPE_SIZE] = { + { PLATE_BLUEONWHITE1, "Blue on White 1" }, + { PLATE_BLUEONWHITE2, "Blue on White 2" }, + { PLATE_BLUEONWHITE3, "Blue on White 3" }, + { PLATE_YELLOWONBLACK, "Yellow on Black" }, + { PLATE_YELLOWONBLUE, "Yellow on Blue" }, + { PLATE_YANKTON, "Yankton" } +}; diff --git a/BigBaseV2/src/core/data/vehicle_wheel_types.hpp b/BigBaseV2/src/core/data/vehicle_wheel_types.hpp new file mode 100644 index 00000000..7c8867c2 --- /dev/null +++ b/BigBaseV2/src/core/data/vehicle_wheel_types.hpp @@ -0,0 +1,21 @@ +#pragma once +#include "gta\VehicleValues.h" + +struct vehicle_wheel_type { + WheelTypes type; + const char name[16]; +}; + +std::map vehicle_wheel_types = { + { WHEEL_TYPE_SPORT, "Sport" }, + { WHEEL_TYPE_MUSCLE, "Muscle" }, + { WHEEL_TYPE_LOWRIDER, "Lowrider" }, + { WHEEL_TYPE_SUV, "SUV" }, + { WHEEL_TYPE_OFFROAD, "Offroad" }, + { WHEEL_TYPE_TUNER, "Tuner" }, + { WHEEL_TYPE_BIKEWHEELS, "Bike Wheels" }, + { WHEEL_TYPE_HIGHEND, "High End" }, + { WHEEL_TYPE_BENNYS_ORIGINAL, "Bennys Original" }, + { WHEEL_TYPE_BENNYS_BESPOKE, "Bennys Bespoke" }, + { WHEEL_TYPE_F1, "F1" } +}; diff --git a/BigBaseV2/src/core/enums.hpp b/BigBaseV2/src/core/enums.hpp index 973c64cf..fc1a07a1 100644 --- a/BigBaseV2/src/core/enums.hpp +++ b/BigBaseV2/src/core/enums.hpp @@ -119,60 +119,6 @@ namespace big UNK2 = 1 << 16 }; - enum eVehicleModType - { - VMT_SPOILER = 0, - VMT_BUMPER_F = 1, - VMT_BUMPER_R = 2, - VMT_SKIRT = 3, - VMT_EXHAUST = 4, - VMT_CHASSIS = 5, - VMT_GRILL = 6, - VMT_BONNET = 7, - VMT_WING_L = 8, - VMT_WING_R = 9, - VMT_ROOF = 10, - VMT_ENGINE = 11, - VMT_BRAKES = 12, - VMT_GEARBOX = 13, - VMT_HORN = 14, - VMT_SUSPENSION = 15, - VMT_ARMOUR = 16, - VMT_NITROUS = 17, - VMT_TURBO = 18, - VMT_SUBWOOFER = 19, - VMT_TYRE_SMOKE = 20, - VMT_HYDRAULICS = 21, - VMT_XENON_LIGHTS = 22, - VMT_WHEELS = 23, - VMT_WHEELS_REAR_OR_HYDRAULICS = 24, - VMT_PLTHOLDER = 25, - VMT_PLTVANITY = 26, - VMT_INTERIOR1 = 27, - VMT_INTERIOR2 = 28, - VMT_INTERIOR3 = 29, - VMT_INTERIOR4 = 30, - VMT_INTERIOR5 = 31, - VMT_SEATS = 32, - VMT_STEERING = 33, - VMT_KNOB = 34, - VMT_PLAQUE = 35, - VMT_ICE = 36, - VMT_TRUNK = 37, - VMT_HYDRO = 38, - VMT_ENGINEBAY1 = 39, - VMT_ENGINEBAY2 = 40, - VMT_ENGINEBAY3 = 41, - VMT_CHASSIS2 = 42, - VMT_CHASSIS3 = 43, - VMT_CHASSIS4 = 44, - VMT_CHASSIS5 = 45, - VMT_DOOR_L = 46, - VMT_DOOR_R = 47, - VMT_LIVERY_MOD = 48, - VMT_LIGHTBAR = 49 - }; - enum class ePedTask { TASK_NONE, @@ -259,4 +205,37 @@ namespace big DROWN = 1 << 16, WATER = 1 << 24, }; -} \ No newline at end of file + enum ePedType : uint32_t + { + PED_TYPE_PLAYER_0, + PED_TYPE_PLAYER_1, + PED_TYPE_NETWORK_PLAYER, + PED_TYPE_PLAYER_2, + PED_TYPE_CIVMALE, + PED_TYPE_CIVFEMALE, + PED_TYPE_COP, + PED_TYPE_GANG_ALBANIAN, + PED_TYPE_GANG_BIKER_1, + PED_TYPE_GANG_BIKER_2, + PED_TYPE_GANG_ITALIAN, + PED_TYPE_GANG_RUSSIAN, + PED_TYPE_GANG_RUSSIAN_2, + PED_TYPE_GANG_IRISH, + PED_TYPE_GANG_JAMAICAN, + PED_TYPE_GANG_AFRICAN_AMERICAN, + PED_TYPE_GANG_KOREAN, + PED_TYPE_GANG_CHINESE_JAPANESE, + PED_TYPE_GANG_PUERTO_RICAN, + PED_TYPE_DEALER, + PED_TYPE_MEDIC, + PED_TYPE_FIREMAN, + PED_TYPE_CRIMINAL, + PED_TYPE_BUM, + PED_TYPE_PROSTITUTE, + PED_TYPE_SPECIAL, + PED_TYPE_MISSION, + PED_TYPE_SWAT, + PED_TYPE_ANIMAL, + PED_TYPE_ARMY + }; +} diff --git a/BigBaseV2/src/core/globals.hpp b/BigBaseV2/src/core/globals.hpp index b59a3de3..2f778949 100644 --- a/BigBaseV2/src/core/globals.hpp +++ b/BigBaseV2/src/core/globals.hpp @@ -133,7 +133,6 @@ namespace big bool clean_player = false; bool force_wanted_level = false; bool free_cam = false; - bool godmode = false; bool invisibility = false; bool local_visibility = true; bool never_wanted = false; @@ -143,6 +142,7 @@ namespace big bool super_run = false; int wanted_level = 0; + bool god_mode = false; bool proof_bullet = false; bool proof_fire = false; bool proof_collision = false; @@ -230,11 +230,20 @@ namespace big float speed = 1; }; + bool god_mode = false; + bool proof_bullet = false; + bool proof_fire = false; + bool proof_collision = false; + bool proof_melee = false; + bool proof_explosion = false; + bool proof_steam = false; + bool proof_water = false; + uint32_t proof_mask = 0; + bool auto_drive_to_waypoint = false; bool auto_drive_wander = false; bool auto_turn_signals = false; bool drive_on_water = false; - bool god_mode = false; bool horn_boost = false; bool vehicle_jump = false; bool instant_brake = false; @@ -493,8 +502,17 @@ namespace big this->tunables.disable_phone = j["tunables"]["disable_phone"]; this->tunables.no_idle_kick = j["tunables"]["no_idle_kick"]; + this->self.god_mode = j["self"]["god_mode"]; + this->self.proof_bullet = j["self"]["proof_bullet"]; + this->self.proof_fire = j["self"]["proof_fire"]; + this->self.proof_collision = j["self"]["proof_collision"]; + this->self.proof_melee = j["self"]["proof_melee"]; + this->self.proof_explosion = j["self"]["proof_explosion"]; + this->self.proof_steam = j["self"]["proof_steam"]; + this->self.proof_drown = j["self"]["proof_drown"]; + this->self.proof_water = j["self"]["proof_water"]; + this->self.proof_mask = j["self"]["proof_mask"]; this->self.clean_player = j["self"]["clean_player"]; - this->self.godmode = j["self"]["godmode"]; this->self.invisibility = j["self"]["invisibility"]; this->self.local_visibility = j["self"]["local_visibility"]; this->self.never_wanted = j["self"]["never_wanted"]; @@ -534,13 +552,21 @@ namespace big this->spoofing.rockstar_id = j["spoofing"]["rockstar_id"]; this->spoofing.username = j["spoofing"]["username"]; + this->vehicle.god_mode = j["vehicle"]["god_mode"]; + this->vehicle.proof_bullet = j["vehicle"]["proof_bullet"]; + this->vehicle.proof_fire = j["vehicle"]["proof_fire"]; + this->vehicle.proof_collision = j["vehicle"]["proof_collision"]; + this->vehicle.proof_melee = j["vehicle"]["proof_melee"]; + this->vehicle.proof_explosion = j["vehicle"]["proof_explosion"]; + 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.auto_drive_speed = j["vehicle"]["auto_drive_speed"]; this->vehicle.auto_drive_to_waypoint = j["vehicle"]["auto_drive_to_waypoint"]; this->vehicle.auto_drive_wander = j["vehicle"]["auto_drive_wander"]; this->vehicle.auto_turn_signals = j["vehicle"]["auto_turn_signals"]; this->vehicle.drive_on_water = j["vehicle"]["drive_on_water"]; this->vehicle.driving_style_id = j["vehicle"]["driving_style"]; - this->vehicle.god_mode = j["vehicle"]["god_mode"]; this->vehicle.horn_boost = j["vehicle"]["horn_boost"]; this->vehicle.vehicle_jump = j["vehicle"]["vehicle_jump"]; this->vehicle.instant_brake = j["vehicle"]["instant_brake"]; @@ -734,8 +760,17 @@ namespace big }, { "self", { + { "god_mode", this->self.god_mode }, + { "proof_bullet", this->self.proof_bullet }, + { "proof_fire", this->self.proof_fire }, + { "proof_collision", this->self.proof_collision }, + { "proof_melee", this->self.proof_melee }, + { "proof_explosion", this->self.proof_explosion }, + { "proof_steam", this->self.proof_steam }, + { "proof_drown", this->self.proof_drown }, + { "proof_water", this->self.proof_water }, + { "proof_mask", this->self.proof_mask }, { "clean_player", this->self.clean_player }, - { "godmode", this->self.godmode }, { "invisibility", this->self.invisibility }, { "local_visibility", this->self.local_visibility }, { "never_wanted", this->self.never_wanted }, @@ -797,13 +832,21 @@ namespace big }, { "vehicle", { + { "god_mode", this->vehicle.god_mode }, + { "proof_bullet", this->vehicle.proof_bullet }, + { "proof_fire", this->vehicle.proof_fire }, + { "proof_collision", this->vehicle.proof_collision }, + { "proof_melee", this->vehicle.proof_melee }, + { "proof_explosion", this->vehicle.proof_explosion }, + { "proof_steam", this->vehicle.proof_steam }, + { "proof_water", this->vehicle.proof_water }, + { "proof_mask", this->vehicle.proof_mask }, { "auto_drive_speed", this->vehicle.auto_drive_speed }, { "auto_drive_to_waypoint", this->vehicle.auto_drive_to_waypoint }, { "auto_drive_wander", this->vehicle.auto_drive_wander }, { "auto_turn_signals", this->vehicle.auto_turn_signals }, { "drive_on_water", this->vehicle.drive_on_water }, { "driving_style", this->vehicle.driving_style_id }, - { "god_mode", this->vehicle.god_mode }, { "horn_boost", this->vehicle.horn_boost }, { "vehicle_jump", this->vehicle.vehicle_jump }, { "instant_brake", this->vehicle.instant_brake }, diff --git a/BigBaseV2/src/gta/VehicleValues.h b/BigBaseV2/src/gta/VehicleValues.h index 056a7623..7ac612b2 100644 --- a/BigBaseV2/src/gta/VehicleValues.h +++ b/BigBaseV2/src/gta/VehicleValues.h @@ -348,6 +348,12 @@ enum VehicleModType MOD_HORNS, MOD_SUSPENSION, MOD_ARMOR, + MOD_NITROUS = 17, + MOD_TURBO = 18, + MOD_SUBWOOFER = 19, + MOD_TYRE_SMOKE = 20, + MOD_HYDRAULICS = 21, + MOD_XENON_LIGHTS = 22, MOD_FRONTWHEEL = 23, MOD_REARWHEEL, MOD_PLATEHOLDER, @@ -363,7 +369,7 @@ enum VehicleModType MOD_PLAQUES, MOD_SPEAKERS, MOD_TRUNK, - MOD_HYDRAULICS, + MOD_HYDRO, MOD_ENGINEBLOCK, MOD_AIRFILTER, MOD_STRUTS, @@ -378,13 +384,6 @@ enum VehicleModType static const char* mod_names[] = { "MOD_SPOILERS", "MOD_FRONTBUMPER", "MOD_REARBUMPER", "MOD_SIDESKIRT", "MOD_EXHAUST", "MOD_FRAME", "MOD_GRILLE", "MOD_HOOD", "MOD_FENDER", "MOD_RIGHTFENDER", "MOD_ROOF", "MOD_ENGINE", "MOD_BRAKES", "MOD_TRANSMISSION", "MOD_HORNS", "MOD_SUSPENSION", "MOD_ARMOR", "", "MOD_TURBO", "", "MOD_TIRESMOKE", "", "MOD_XENONHEADLIGHTS", "MOD_FRONTWHEEL", "MOD_REARWHEEL", "MOD_PLATEHOLDER", "MOD_VANITYPLATES", "MOD_TRIMDESIGN", "MOD_ORNAMENTS", "MOD_DASHBOARD", "MOD_DIALDESIGN", "MOD_DOORSPEAKERS", "MOD_SEATS", "MOD_STEERINGWHEELS", "MOD_COLUMNSHIFTERLEVERS", "MOD_PLAQUES", "MOD_SPEAKERS", "MOD_TRUNK", "MOD_HYDRAULICS", "MOD_ENGINEBLOCK", "MOD_AIRFILTER", "MOD_STRUTS", "MOD_ARCHCOVER", "MOD_AERIALS", "MOD_TRIM", "MOD_TANK", "MOD_WINDOWS", "", "MOD_LIVERY" }; -enum VehicleToggleModType -{ - MOD_TURBO = 18, - MOD_TIRESMOKE = 20, - MOD_XENONHEADLIGHTS = 22 -}; - enum VehicleModHorns { HORN_STOCK = -1, diff --git a/BigBaseV2/src/gui.cpp b/BigBaseV2/src/gui.cpp index 15e68979..ff5084ff 100644 --- a/BigBaseV2/src/gui.cpp +++ b/BigBaseV2/src/gui.cpp @@ -58,7 +58,7 @@ namespace big colors[ImGuiCol_Button] = ImVec4(0.24f, 0.23f, 0.29f, 1.00f); colors[ImGuiCol_ButtonHovered] = ImVec4(0.24f, 0.23f, 0.29f, 1.00f); colors[ImGuiCol_ButtonActive] = ImVec4(0.56f, 0.56f, 0.58f, 1.00f); - colors[ImGuiCol_Header] = ImVec4(0.10f, 0.09f, 0.12f, 1.00f); + colors[ImGuiCol_Header] = ImVec4(0.30f, 0.29f, 0.32f, 1.00f); colors[ImGuiCol_HeaderHovered] = ImVec4(0.56f, 0.56f, 0.58f, 1.00f); colors[ImGuiCol_HeaderActive] = ImVec4(0.06f, 0.05f, 0.07f, 1.00f); colors[ImGuiCol_ResizeGrip] = ImVec4(0.00f, 0.00f, 0.00f, 0.00f); diff --git a/BigBaseV2/src/services/gui/gui_service.hpp b/BigBaseV2/src/services/gui/gui_service.hpp index a8cb91c2..887a4a26 100644 --- a/BigBaseV2/src/services/gui/gui_service.hpp +++ b/BigBaseV2/src/services/gui/gui_service.hpp @@ -24,6 +24,7 @@ namespace big SETTINGS, SPAWN, PV, + VEHICLE_FUN, SPOOFING, TELEPORT, VEHICLE, @@ -49,16 +50,17 @@ namespace big { tabs::MOBILE, {"Mobile", view::mobile}}, { tabs::TELEPORT, {"Teleport", view::teleport}}, }}}, - {tabs::VEHICLE, {"Vehicle", view::vehicle, { + {tabs::VEHICLE, { "Vehicle", view::vehicle, { { tabs::HANDLING, {"Handling", view::handling_current_profile, { { tabs::HANDLING_CURRENT_PROFILE, {"Current Profile", view::handling_current_profile } }, { tabs::HANDLING_MY_PROFILES, {"My Profiles", view::handling_my_profiles } }, { tabs::HANDLING_SAVED_PROFILE, {"Saved Profiles", view::handling_saved_profiles } }, { tabs::HANDLING_SEARCH, {"Search Handling", view::handling_search } }, }}}, - { tabs::LSC, {"LSC", view::lsc }}, + { tabs::LSC, { "LS Customs", view::lsc }}, { tabs::SPAWN, { "Spawn", view::spawn }}, { tabs::PV, { "Personal Vehicle", view::pv }}, + { tabs::VEHICLE_FUN, { "Fun Features", view::vehicle_fun }}, }}}, {tabs::NETWORK, { "Network", nullptr, { { tabs::SPOOFING, { "Spoofing", view::spoofing }}, diff --git a/BigBaseV2/src/services/vehicle_helper/vehicle_helper.cpp b/BigBaseV2/src/services/vehicle_helper/vehicle_helper.cpp index 186299b4..d413299d 100644 --- a/BigBaseV2/src/services/vehicle_helper/vehicle_helper.cpp +++ b/BigBaseV2/src/services/vehicle_helper/vehicle_helper.cpp @@ -106,7 +106,7 @@ namespace big return HUD::GET_LABEL_TEXT_("CMM_MOD_S11"); case MOD_TRUNK: return HUD::GET_LABEL_TEXT_("CMM_MOD_S12"); - case MOD_HYDRAULICS: + case MOD_HYDRO: return HUD::GET_LABEL_TEXT_("CMM_MOD_S13"); case MOD_ENGINEBLOCK: return HUD::GET_LABEL_TEXT_("CMM_MOD_S14"); diff --git a/BigBaseV2/src/services/vehicle_preview/vehicle_preview_service.cpp b/BigBaseV2/src/services/vehicle_preview/vehicle_preview_service.cpp index 66a18158..b17bfa06 100644 --- a/BigBaseV2/src/services/vehicle_preview/vehicle_preview_service.cpp +++ b/BigBaseV2/src/services/vehicle_preview/vehicle_preview_service.cpp @@ -63,7 +63,7 @@ namespace big g_vehicle_preview_service = nullptr; } - const vehicle_preview_item& vehicle_preview_service::find_vehicle_item_by_hash(int hash) + const vehicle_preview_item& vehicle_preview_service::find_vehicle_item_by_hash(Hash hash) { int idx = -1; @@ -110,48 +110,49 @@ namespace big return; m_running = true; - g_fiber_pool->queue_job([this] - { - while (g_running && m_running && g->spawn.preview_vehicle && g_gui.m_opened) + g_fiber_pool->queue_job([this] { + while ( + g_running && m_running && g_gui.m_opened && + (g->spawn.preview_vehicle || g->clone_pv.preview_vehicle) + ) { + auto location = ENTITY::GET_OFFSET_FROM_ENTITY_IN_WORLD_COORDS(self::ped, 0.f, 10.f, .5f); + if (m_current_veh == -1) { - auto location = ENTITY::GET_OFFSET_FROM_ENTITY_IN_WORLD_COORDS(self::ped, 0.f, 10.f, .5f); - if (m_current_veh == -1) - { - m_new_model = false; - location.z = -10.f; - m_current_veh = vehicle::spawn(m_model_hash, location, 0.f, false); - ENTITY::FREEZE_ENTITY_POSITION(m_current_veh, true); - ENTITY::SET_ENTITY_ALPHA(m_current_veh, 0, 0); - ENTITY::SET_ENTITY_COLLISION(m_current_veh, false, false); - ENTITY::SET_CAN_CLIMB_ON_ENTITY(m_current_veh, false); - OBJECT::SET_OBJECT_ALLOW_LOW_LOD_BUOYANCY(m_current_veh, false); - } - else if (m_new_model) - { - entity::delete_entity(m_current_veh); + m_new_model = false; + location.z = -10.f; + m_current_veh = vehicle::spawn(m_model_hash, location, 0.f, false); + ENTITY::FREEZE_ENTITY_POSITION(m_current_veh, true); + ENTITY::SET_ENTITY_ALPHA(m_current_veh, 0, 0); + ENTITY::SET_ENTITY_COLLISION(m_current_veh, false, false); + ENTITY::SET_CAN_CLIMB_ON_ENTITY(m_current_veh, false); + OBJECT::SET_OBJECT_ALLOW_LOW_LOD_BUOYANCY(m_current_veh, false); + } + else if (m_new_model) + { + entity::delete_entity(m_current_veh); - m_current_veh = -1; - } - else + m_current_veh = -1; + } + else + { + if (const int alpha = ENTITY::GET_ENTITY_ALPHA(m_current_veh); alpha < 250) { - if (const int alpha = ENTITY::GET_ENTITY_ALPHA(m_current_veh); alpha < 250) - { - ENTITY::SET_ENTITY_ALPHA(m_current_veh, std::min(255, alpha + 10), 0); - } - - ENTITY::SET_ENTITY_HEADING(m_current_veh, m_heading); - ENTITY::SET_ENTITY_COORDS(m_current_veh, location.x, location.y, location.z, 0, 0, 0, 0); + ENTITY::SET_ENTITY_ALPHA(m_current_veh, std::min(255, alpha + 10), 0); } - if (m_heading += 0.5f; m_heading > 359) m_heading = 0; - - script::get_current()->yield(); + ENTITY::SET_ENTITY_HEADING(m_current_veh, m_heading); + ENTITY::SET_ENTITY_COORDS(m_current_veh, location.x, location.y, location.z, 0, 0, 0, 0); } - entity::delete_entity(m_current_veh); - m_current_veh = -1; - m_running = false; - }); + if (m_heading += 0.5f; m_heading > 359) m_heading = 0; + + script::get_current()->yield(); + } + + entity::delete_entity(m_current_veh); + m_current_veh = -1; + m_running = false; + }); } void vehicle_preview_service::stop_preview() @@ -188,7 +189,7 @@ namespace big continue; } - m_hash_idx_map[item_json["SignedHash"]] = (int)m_vehicle_preview_item_arr.size(); + m_hash_idx_map[item_json["Hash"]] = (int)m_vehicle_preview_item_arr.size(); m_vehicle_preview_item_arr.push_back(vehicle_preview_item(item_json)); } } diff --git a/BigBaseV2/src/services/vehicle_preview/vehicle_preview_service.hpp b/BigBaseV2/src/services/vehicle_preview/vehicle_preview_service.hpp index d2e5c4de..7acb94de 100644 --- a/BigBaseV2/src/services/vehicle_preview/vehicle_preview_service.hpp +++ b/BigBaseV2/src/services/vehicle_preview/vehicle_preview_service.hpp @@ -35,7 +35,7 @@ namespace big vehicle_preview_service(); ~vehicle_preview_service(); - const vehicle_preview_item& find_vehicle_item_by_hash(int hash); + const vehicle_preview_item& find_vehicle_item_by_hash(Hash hash); std::vector& get_vehicle_preview_item_arr(); void set_preview_vehicle(const vehicle_preview_item& item); diff --git a/BigBaseV2/src/util/all.hpp b/BigBaseV2/src/util/all.hpp index 382042f9..f6431033 100644 --- a/BigBaseV2/src/util/all.hpp +++ b/BigBaseV2/src/util/all.hpp @@ -8,4 +8,5 @@ #include "session.hpp" #include "system.hpp" #include "teleport.hpp" -#include "vehicle.hpp" \ No newline at end of file +#include "vehicle.hpp" +#include "water.hpp" \ No newline at end of file diff --git a/BigBaseV2/src/util/entity.hpp b/BigBaseV2/src/util/entity.hpp index da5cb95f..2cc342f4 100644 --- a/BigBaseV2/src/util/entity.hpp +++ b/BigBaseV2/src/util/entity.hpp @@ -1,5 +1,6 @@ #pragma once #include "gta/joaat.hpp" +#include "gta/replay.hpp" #include "natives.hpp" #include "script.hpp" #include "math.hpp" diff --git a/BigBaseV2/src/util/vehicle.hpp b/BigBaseV2/src/util/vehicle.hpp index 4f6d89cc..caca881c 100644 --- a/BigBaseV2/src/util/vehicle.hpp +++ b/BigBaseV2/src/util/vehicle.hpp @@ -7,6 +7,7 @@ #include "script.hpp" #include "teleport.hpp" #include "script_global.hpp" +#include "gta\VehicleValues.h" namespace big::vehicle { @@ -17,7 +18,7 @@ namespace big::vehicle *script_global(2671447).at(8).as() = 1; } - inline void bring(Vehicle veh, Vector3 location, bool put_in = true) + inline void bring(Vehicle veh, Vector3 location, bool put_in = true, int seatIdx = -1) { if (!ENTITY::IS_ENTITY_A_VEHICLE(veh)) return g_notification_service->push_error("Vehicle", "Invalid handle"); @@ -36,7 +37,21 @@ namespace big::vehicle for (size_t i = 0; i < 100 && math::distance_between_vectors(location, ENTITY::GET_ENTITY_COORDS(veh, true)) > 10; i++) script::get_current()->yield(); - PED::SET_PED_INTO_VEHICLE(ped, veh, -1); + auto driver_ped = VEHICLE::GET_PED_IN_VEHICLE_SEAT(veh, -1, false); + + if (driver_ped != 0) + { + if (PED::GET_PED_TYPE(driver_ped) == ePedType::PED_TYPE_NETWORK_PLAYER) + { + TASK::CLEAR_PED_TASKS_IMMEDIATELY(driver_ped); + } + else + { + entity::delete_entity(driver_ped); + } + } + + PED::SET_PED_INTO_VEHICLE(ped, veh, seatIdx); } } @@ -48,7 +63,7 @@ namespace big::vehicle { const auto veh_interface_size = veh_interface->m_max_vehicles; - float min_dist = range + 1; + float min_dist = FLT_MAX; int32_t m_handle = 0; for (int32_t i = 0; i < veh_interface_size; i++) @@ -68,8 +83,13 @@ namespace big::vehicle if (dist < min_dist) { - min_dist = dist; - m_handle = g_pointers->m_ptr_to_handle(veh_ptr); + int32_t tmp_handle = g_pointers->m_ptr_to_handle(veh_ptr); + + if (entity::take_control_of(tmp_handle)) + { + min_dist = dist; + m_handle = tmp_handle; + } } } @@ -245,7 +265,7 @@ namespace big::vehicle for (int i = 0; i < 50; i++) { if ( - i != eVehicleModType::VMT_LIVERY_MOD + i != MOD_LIVERY ) { VEHICLE::SET_VEHICLE_MOD(veh, i, VEHICLE::GET_NUM_VEHICLE_MODS(veh, i) - 1, true); } diff --git a/BigBaseV2/src/util/water.hpp b/BigBaseV2/src/util/water.hpp new file mode 100644 index 00000000..19f9193c --- /dev/null +++ b/BigBaseV2/src/util/water.hpp @@ -0,0 +1,16 @@ +#pragma once + +namespace big::water +{ + inline float* get_water_collision_ptr(CNavigation* nav) + { + auto nav_addr = (uint64_t)nav; + return (float*)(*(uint64_t*)(nav_addr + 0x10) + 0x54); + } + + inline void reset_ped_oxygen_time(CPed* ped) + { + auto ped_addr = (uint64_t)ped; + *(float*)(*(uint64_t*)(ped_addr + 0x10C0) + 0x278) = 0; + } +} diff --git a/BigBaseV2/src/views/self/view_self.cpp b/BigBaseV2/src/views/self/view_self.cpp index 176be029..a42fa66c 100644 --- a/BigBaseV2/src/views/self/view_self.cpp +++ b/BigBaseV2/src/views/self/view_self.cpp @@ -5,7 +5,8 @@ namespace big { - void view::self() { + void view::self() + { components::button("Suicide", [] { ENTITY::SET_ENTITY_HEALTH(self::ped, 0, 0); }); @@ -42,12 +43,14 @@ namespace big g_fiber_pool->queue_job([] { const Hash hash = rage::joaat(model); - for (uint8_t i = 0; !STREAMING::HAS_MODEL_LOADED(hash) && i < 100; i++) { + for (uint8_t i = 0; !STREAMING::HAS_MODEL_LOADED(hash) && i < 100; i++) + { STREAMING::REQUEST_MODEL(hash); script::get_current()->yield(); } - if (!STREAMING::HAS_MODEL_LOADED(hash)) { + if (!STREAMING::HAS_MODEL_LOADED(hash)) + { g_notification_service->push_error("Self", "Failed to spawn model, did you give an incorrect model ? "); return; @@ -66,7 +69,7 @@ namespace big ImGui::BeginGroup(); - ImGui::Checkbox("God Mode", &g->self.godmode); + ImGui::Checkbox("God Mode", &g->self.god_mode); ImGui::Checkbox("Off Radar", &g->self.off_radar); ImGui::Checkbox("Free Cam", &g->self.free_cam); ImGui::Checkbox("Disable Phone", &g->tunables.disable_phone); @@ -99,25 +102,6 @@ namespace big ImGui::Separator(); - components::small_text("Police"); - - ImGui::Checkbox("Never Wanted", &g->self.never_wanted); - - if (!g->self.never_wanted) - { - ImGui::Checkbox("Force Wanted Level", &g->self.force_wanted_level); - ImGui::Text("Wanted Level"); - if ( - ImGui::SliderInt("###wanted_level", &g->self.wanted_level, 0, 5) && - !g->self.force_wanted_level && - g_local_player != nullptr - ) { - g_local_player->m_player_info->m_wanted_level = g->self.wanted_level; - } - } - - ImGui::Separator(); - components::small_text("Proofs"); if (ImGui::Button("Check all")) @@ -174,44 +158,61 @@ namespace big ImGui::EndGroup(); + ImGui::Separator(); + + components::small_text("Police"); + + ImGui::Checkbox("Never Wanted", &g->self.never_wanted); + + if (!g->self.never_wanted) + { + ImGui::Checkbox("Force Wanted Level", &g->self.force_wanted_level); + ImGui::Text("Wanted Level"); + if ( + ImGui::SliderInt("###wanted_level", &g->self.wanted_level, 0, 5) && + !g->self.force_wanted_level && + g_local_player != nullptr + ) { + g_local_player->m_player_info->m_wanted_level = g->self.wanted_level; + } + } + g->self.proof_mask = 0; - if (g->self.godmode) + if (g->self.god_mode) { g->self.proof_mask |= static_cast(eEntityProofs::GOD); - } else + } + if (g->self.proof_bullet) { - if (g->self.proof_bullet) - { - g->self.proof_mask |= static_cast(eEntityProofs::BULLET); - } - if (g->self.proof_fire) - { - g->self.proof_mask |= static_cast(eEntityProofs::FIRE); - } - if (g->self.proof_collision) - { - g->self.proof_mask |= static_cast(eEntityProofs::COLLISION); - } - if (g->self.proof_melee) - { - g->self.proof_mask |= static_cast(eEntityProofs::MELEE); - } - if (g->self.proof_explosion) - { - g->self.proof_mask |= static_cast(eEntityProofs::EXPLOSION); - } - if (g->self.proof_steam) - { - g->self.proof_mask |= static_cast(eEntityProofs::STEAM); - } - if (g->self.proof_drown) - { - g->self.proof_mask |= static_cast(eEntityProofs::DROWN); - } - if (g->self.proof_water) - { - g->self.proof_mask |= static_cast(eEntityProofs::WATER); - } + g->self.proof_mask |= static_cast(eEntityProofs::BULLET); + } + if (g->self.proof_fire) + { + g->self.proof_mask |= static_cast(eEntityProofs::FIRE); + } + if (g->self.proof_collision) + { + g->self.proof_mask |= static_cast(eEntityProofs::COLLISION); + } + if (g->self.proof_melee) + { + g->self.proof_mask |= static_cast(eEntityProofs::MELEE); + } + if (g->self.proof_explosion) + { + g->self.proof_mask |= static_cast(eEntityProofs::EXPLOSION); + } + if (g->self.proof_steam) + { + g->self.proof_mask |= static_cast(eEntityProofs::STEAM); + } + if (g->self.proof_drown) + { + g->self.proof_mask |= static_cast(eEntityProofs::DROWN); + } + if (g->self.proof_water) + { + g->self.proof_mask |= static_cast(eEntityProofs::WATER); } } } diff --git a/BigBaseV2/src/views/vehicle/view_lsc.cpp b/BigBaseV2/src/views/vehicle/view_lsc.cpp index 6948875b..e2510e86 100644 --- a/BigBaseV2/src/views/vehicle/view_lsc.cpp +++ b/BigBaseV2/src/views/vehicle/view_lsc.cpp @@ -3,442 +3,604 @@ #include "script.hpp" #include "services/vehicle_helper/vehicle_helper.hpp" #include "views/view.hpp" +#include "util/vehicle.hpp" +#include "core/data/vehicle_plate_types.hpp" +#include "core/data/vehicle_wheel_types.hpp" +#include namespace big { void view::lsc() { - static Vehicle player_vehicle{}; - static std::vector slot_display_names{}; - static std::map owned_mods{}; - static std::map> mod_display_names{}; + static Vehicle player_vehicle = 0; + static std::map owned_mods; + static std::map slot_display_names; + static std::map> mod_display_names{}; static int selected_slot = -1; - static bool can_tires_burst{}, tiresmoke{}, turbo{}, xenon{}; - static int primary_color{}, secondary_color{}, pearlescent{}, wheel_color{}, interior_color{}, dashboard_color{}; + + static bool can_tires_burst = false; + static bool tiresmoke = false; + static bool turbo = false; + static bool xenon = false; + + static int primary_color = 0; + static int secondary_color = 0; + static int pearlescent = 0; + static int wheel_color = 0; + static int interior_color = 0; + static int dashboard_color = 0; + + static int plate_type = -1; + static int wheel_type = -1; + + static Hash veh_model_hash = 0; + static bool is_bike = false; if (self::veh == 0) { - if (!slot_display_names.empty()) - { - player_vehicle = NULL; - mod_display_names.clear(); - slot_display_names.clear(); - } + player_vehicle = 0; + owned_mods.clear(); + slot_display_names.clear(); + mod_display_names.clear(); ImGui::Text("Please enter a vehicle."); return; } - g_fiber_pool->queue_job([] + g_fiber_pool->queue_job([] { + if (player_vehicle != self::veh) { - if (player_vehicle != PED::GET_VEHICLE_PED_IS_IN(PLAYER::PLAYER_PED_ID(), FALSE)) + player_vehicle = 0; + owned_mods.clear(); + slot_display_names.clear(); + mod_display_names.clear(); + + if (!HUD::HAS_THIS_ADDITIONAL_TEXT_LOADED("MOD_MNU", 10)) { - if (!HUD::HAS_THIS_ADDITIONAL_TEXT_LOADED("MOD_MNU", 10)) + HUD::CLEAR_ADDITIONAL_TEXT(10, TRUE); + HUD::REQUEST_ADDITIONAL_TEXT("MOD_MNU", 10); + script::get_current()->yield(); + } + + player_vehicle = PED::GET_VEHICLE_PED_IS_IN(PLAYER::PLAYER_PED_ID(), FALSE); + can_tires_burst = !VEHICLE::GET_VEHICLE_TYRES_CAN_BURST(player_vehicle); + tiresmoke = VEHICLE::IS_TOGGLE_MOD_ON(player_vehicle, MOD_TYRE_SMOKE); + turbo = VEHICLE::IS_TOGGLE_MOD_ON(player_vehicle, MOD_TURBO); + xenon = VEHICLE::IS_TOGGLE_MOD_ON(player_vehicle, MOD_XENON_LIGHTS); + plate_type = VEHICLE::GET_VEHICLE_NUMBER_PLATE_TEXT_INDEX(player_vehicle); + wheel_type = VEHICLE::GET_VEHICLE_WHEEL_TYPE(player_vehicle); + + veh_model_hash = g_local_player->m_vehicle->m_model_info->m_model_hash; + is_bike = VEHICLE::IS_THIS_MODEL_A_BIKE(veh_model_hash) || VEHICLE::IS_THIS_MODEL_A_BICYCLE(veh_model_hash); + + VEHICLE::GET_VEHICLE_COLOURS(player_vehicle, &primary_color, &secondary_color); + VEHICLE::GET_VEHICLE_EXTRA_COLOURS(player_vehicle, &pearlescent, &wheel_color); + VEHICLE::GET_VEHICLE_INTERIOR_COLOR_(player_vehicle, &interior_color); + VEHICLE::GET_VEHICLE_DASHBOARD_COLOR_(player_vehicle, &dashboard_color); + + + for (int slot = MOD_SPOILERS; slot <= MOD_LIVERY; slot++) + { + int count = VEHICLE::GET_NUM_VEHICLE_MODS(player_vehicle, slot); + if (count > 0) { - HUD::CLEAR_ADDITIONAL_TEXT(10, TRUE); - HUD::REQUEST_ADDITIONAL_TEXT("MOD_MNU", 10); - script::get_current()->yield(); - } + owned_mods[slot] = VEHICLE::GET_VEHICLE_MOD(player_vehicle, slot); - player_vehicle = PED::GET_VEHICLE_PED_IS_IN(PLAYER::PLAYER_PED_ID(), FALSE); - can_tires_burst = !VEHICLE::GET_VEHICLE_TYRES_CAN_BURST(player_vehicle); - tiresmoke = VEHICLE::IS_TOGGLE_MOD_ON(player_vehicle, MOD_TIRESMOKE); - turbo = VEHICLE::IS_TOGGLE_MOD_ON(player_vehicle, MOD_TURBO); - xenon = VEHICLE::IS_TOGGLE_MOD_ON(player_vehicle, MOD_XENONHEADLIGHTS); - VEHICLE::GET_VEHICLE_COLOURS(player_vehicle, &primary_color, &secondary_color); - VEHICLE::GET_VEHICLE_EXTRA_COLOURS(player_vehicle, &pearlescent, &wheel_color); - VEHICLE::GET_VEHICLE_INTERIOR_COLOR_(player_vehicle, &interior_color); - VEHICLE::GET_VEHICLE_DASHBOARD_COLOR_(player_vehicle, &dashboard_color); - std::vector dsp_names{}; - for (int slot = MOD_SPOILERS; slot <= MOD_LIVERY; slot++) - { - int count = VEHICLE::GET_NUM_VEHICLE_MODS(player_vehicle, slot); - if (count > 0) + std::string slot_name = vehicle_helper::get_mod_slot_name(slot, player_vehicle); + if (slot_name.empty()) { - owned_mods[slot] = (VEHICLE::GET_VEHICLE_MOD(player_vehicle, selected_slot) + 1); - dsp_names.push_back(vehicle_helper::get_mod_slot_name(slot, player_vehicle)); - std::vector names; - for (int mod = -1; mod < count; mod++) - names.push_back(vehicle_helper::get_mod_name(mod, slot, count, player_vehicle)); - mod_display_names[slot] = names; - - } - else - { - dsp_names.push_back(""); - } - } - slot_display_names = dsp_names; - } - }); - - if (!slot_display_names.empty()) - { - if (ImGui::TreeNode("Los santos customs")) - { - if (components::button("Max Vehicle")) - { - g_fiber_pool->queue_job([] - { - Vehicle vehicle = PED::GET_VEHICLE_PED_IS_IN(PLAYER::PLAYER_PED_ID(), false); - VEHICLE::SET_VEHICLE_MOD_KIT(vehicle, 0); - for (int i = 0; i < 50; i++) - { - VEHICLE::SET_VEHICLE_MOD(vehicle, i, VEHICLE::GET_NUM_VEHICLE_MODS(vehicle, i) - 1, false); - } - }); - } - ImGui::Separator(); - if (ImGui::Checkbox("Bulletproof Tires", &can_tires_burst)) - { - g_fiber_pool->queue_job([] - { - VEHICLE::SET_VEHICLE_TYRES_CAN_BURST(player_vehicle, !can_tires_burst); - }); - } - ImGui::SameLine(); - if (ImGui::Checkbox("Tiresmoke", &tiresmoke)) - { - g_fiber_pool->queue_job([] - { - VEHICLE::TOGGLE_VEHICLE_MOD(player_vehicle, MOD_TIRESMOKE, tiresmoke); - }); - } - ImGui::SameLine(); - if (ImGui::Checkbox("Turbo", &turbo)) - { - g_fiber_pool->queue_job([] - { - VEHICLE::TOGGLE_VEHICLE_MOD(player_vehicle, MOD_TURBO, turbo); - }); - } - if (ImGui::Button("F1 Wheels")) - { - g_fiber_pool->queue_job([] - { - VEHICLE::SET_VEHICLE_WHEEL_TYPE(player_vehicle, WHEEL_TYPE_F1); - }); - } - if (ImGui::Checkbox("Xenon", &xenon)) - { - g_fiber_pool->queue_job([] - { - VEHICLE::TOGGLE_VEHICLE_MOD(player_vehicle, MOD_XENONHEADLIGHTS, xenon); - }); - } - - if (ImGui::ListBoxHeader("Slot", ImVec2(200, 200))) - { - for (int slot = MOD_SPOILERS; slot <= MOD_LIVERY; slot++) - { - if (slot_display_names[slot].empty()) continue; - if (ImGui::Selectable(slot_display_names[slot].c_str(), slot == selected_slot)) - selected_slot = slot; - } - ImGui::ListBoxFooter(); - } - if (selected_slot != -1) - { - ImGui::SameLine(); - if (ImGui::ListBoxHeader("Mod", ImVec2(200, 200))) - { - for (int i = 0; i < mod_display_names[selected_slot].size(); i++) + } + slot_display_names[slot] = slot_name; + + std::map mod_names; + for (int mod = -1; mod < count; mod++) { - if (mod_display_names[selected_slot][i].empty()) + std::string mod_name = vehicle_helper::get_mod_name(mod, slot, count, player_vehicle); + if (mod_name.empty()) + { continue; - - if (ImGui::Selectable(mod_display_names[selected_slot][i].c_str(), i == owned_mods[selected_slot])) - { - g_fiber_pool->queue_job([i] - { - NETWORK::NETWORK_REQUEST_CONTROL_OF_ENTITY(PED::GET_VEHICLE_PED_IS_IN(PLAYER::PLAYER_PED_ID(), false)); - - owned_mods[selected_slot] = i; - VEHICLE::SET_VEHICLE_MOD(player_vehicle, selected_slot, i - 1, false); - }); } - } - ImGui::ListBoxFooter(); - } - } - static int windowtint{}; - static char* windowtint_combo[] = { "None", "Black", "Dark", "Light" }; - if (ImGui::Combo("Window Tint", &windowtint, windowtint_combo, IM_ARRAYSIZE(windowtint_combo))) - { - g_fiber_pool->queue_job([] - { - VEHICLE::SET_VEHICLE_WINDOW_TINT(player_vehicle, windowtint); - }); - } + bool repeated = false; - static int main_color{}; - ImGui::RadioButton("Primary Color", &main_color, 0); - ImGui::SameLine(); - ImGui::RadioButton("Secondary Color", &main_color, 1); - ImGui::BeginGroup(); - static int color_type{}; - if (ImGui::ListBoxHeader("##colors", ImVec2(200, 200))) - { - if (ImGui::Selectable("Chrome", color_type == 0)) - color_type = 0; - if (ImGui::Selectable("Classic", color_type == 1)) - color_type = 1; - if (ImGui::Selectable("Matte", color_type == 2)) - color_type = 2; - if (ImGui::Selectable("Metals", color_type == 3)) - color_type = 3; - if (ImGui::Selectable("Pearlescent", color_type == 4)) - color_type = 4; - if (ImGui::Selectable("Wheel Color", color_type == 5)) - color_type = 5; - if (ImGui::Selectable("Interior Color", color_type == 6)) - color_type = 6; - if (ImGui::Selectable("Dashboard Color", color_type == 7)) - color_type = 7; - ImGui::ListBoxFooter(); - } - static const char* classic_names[] = { "Black", "Carbon Black", "Graphite", "Anthracite Black", "Black Steel", "Dark Steel", "Silver", "Bluish Silver", "Rolled Steel", "Shadow SIlver", "Stone Silver", "Midnight Silver", "Cast Iron Silver", "Red", "Torino Red", "Formula Red", "Lava Red", "Blaze Red", "Grace Red", "Garnet Red", "Sunset Red", "Cabernet Red", "Wine Red", "Candy Red", "Hot Pink", "Pfister Pink", "Salmon Pink", "Sunrise Orange", "Orange", "Bright Orange", "Gold", "Bronze", "Yellow", "Race Yellow", "Dew Yellow", "Dark Green", "Racing Green", "Sea Green", "Olive Green", "Bright Green", "Gasoline Green", "Lime Green", "Midnight Blue", "Galaxy Blue", "Dark Blue", "Saxon Blue", "Blue", "Mariner Blue", "Harbor Blue", "Diamond Blue", "Surf Blue", "Nautical Blue", "Racing Blue", "Ultra Blue", "Light Blue", "Chocolate Brown", "Bison Brown", "Creek Brown", "Feltzer Brown", "Maple Brown", "Beechwood Brown", "Sienna Brown", "Saddle Brown", "Moss Brown", "Woodbeech Brown", "Straw Brown", "Sandy Brown", "Bleached Brown", "Schafter Purple", "Spinnaker Purple", "Midnight Purple", "Bright Purple", "Cream", "Ice White", "Frost White" }; - static int classic_ids[] = { COLOR_CLASSIC_BLACK, COLOR_CLASSIC_CARBON_BLACK, COLOR_CLASSIC_GRAPHITE, COLOR_CLASSIC_ANHRACITE_BLACK, COLOR_CLASSIC_BLACK_STEEL, COLOR_CLASSIC_DARK_STEEL, COLOR_CLASSIC_SILVER, COLOR_CLASSIC_BLUISH_SILVER, COLOR_CLASSIC_ROLLED_STEEL, COLOR_CLASSIC_SHADOW_SILVER, COLOR_CLASSIC_STONE_SILVER, COLOR_CLASSIC_MIDNIGHT_SILVER, COLOR_CLASSIC_CAST_IRON_SILVER, COLOR_CLASSIC_RED, COLOR_CLASSIC_TORINO_RED, COLOR_CLASSIC_FORMULA_RED, COLOR_CLASSIC_LAVA_RED, COLOR_CLASSIC_BLAZE_RED, COLOR_CLASSIC_GRACE_RED, COLOR_CLASSIC_GARNET_RED, COLOR_CLASSIC_SUNSET_RED, COLOR_CLASSIC_CABERNET_RED, COLOR_CLASSIC_WINE_RED, COLOR_CLASSIC_CANDY_RED, COLOR_CLASSIC_HOT_PINK, COLOR_CLASSIC_PFSITER_PINK, COLOR_CLASSIC_SALMON_PINK, COLOR_CLASSIC_SUNRISE_ORANGE, COLOR_CLASSIC_ORANGE, COLOR_CLASSIC_BRIGHT_ORANGE, COLOR_CLASSIC_GOLD, COLOR_CLASSIC_BRONZE, COLOR_CLASSIC_YELLOW, COLOR_CLASSIC_RACE_YELLOW, COLOR_CLASSIC_DEW_YELLOW, COLOR_CLASSIC_DARK_GREEN, COLOR_CLASSIC_RACING_GREEN, COLOR_CLASSIC_SEA_GREEN, COLOR_CLASSIC_OLIVE_GREEN, COLOR_CLASSIC_BRIGHT_GREEN, COLOR_CLASSIC_GASOLINE_GREEN, COLOR_CLASSIC_LIME_GREEN, COLOR_CLASSIC_MIDNIGHT_BLUE, COLOR_CLASSIC_GALAXY_BLUE, COLOR_CLASSIC_DARK_BLUE, COLOR_CLASSIC_SAXON_BLUE, COLOR_CLASSIC_BLUE, COLOR_CLASSIC_MARINER_BLUE, COLOR_CLASSIC_HARBOR_BLUE, COLOR_CLASSIC_DIAMOND_BLUE, COLOR_CLASSIC_SURF_BLUE, COLOR_CLASSIC_NAUTICAL_BLUE, COLOR_CLASSIC_RACING_BLUE, COLOR_CLASSIC_ULTRA_BLUE, COLOR_CLASSIC_LIGHT_BLUE, COLOR_CLASSIC_CHOCOLATE_BROWN, COLOR_CLASSIC_BISON_BROWN, COLOR_CLASSIC_CREEEN_BROWN, COLOR_CLASSIC_FELTZER_BROWN, COLOR_CLASSIC_MAPLE_BROWN, COLOR_CLASSIC_BEECHWOOD_BROWN, COLOR_CLASSIC_SIENNA_BROWN, COLOR_CLASSIC_SADDLE_BROWN, COLOR_CLASSIC_MOSS_BROWN, COLOR_CLASSIC_WOODBEECH_BROWN, COLOR_CLASSIC_STRAW_BROWN, COLOR_CLASSIC_SANDY_BROWN, COLOR_CLASSIC_BLEACHED_BROWN, COLOR_CLASSIC_SCHAFTER_PURPLE, COLOR_CLASSIC_SPINNAKER_PURPLE, COLOR_CLASSIC_MIDNIGHT_PURPLE, COLOR_CLASSIC_BRIGHT_PURPLE, COLOR_CLASSIC_CREAM, COLOR_CLASSIC_ICE_WHITE, COLOR_CLASSIC_FROST_WHITE }; - static const char* matte_names[] = { "Black", "Gray", "Light Gray", "Ice White", "Blue", "Dark Blue", "Midnight Blue", "Midnight Purple", "Shafter Purple", "Red", "Dark Red", "Orange", "Yellow", "Lime Green", "Green", "Forest Green", "Foliage Green", "Olive Drab", "Dark Earth", "Desert Tan" }; - static int matte_ids[] = { COLOR_MATTE_BLACK, COLOR_MATTE_GRAY, COLOR_MATTE_LIGHT_GRAY, COLOR_MATTE_ICE_WHITE, COLOR_MATTE_BLUE, COLOR_MATTE_DARK_BLUE, COLOR_MATTE_MIDNIGHT_BLUE, COLOR_MATTE_MIDNIGHT_PURPLE, COLOR_MATTE_SCHAFTER_PURPLE, COLOR_MATTE_RED, COLOR_MATTE_DARK_RED, COLOR_MATTE_ORANGE, COLOR_MATTE_YELLOW, COLOR_MATTE_LIME_GREEN, COLOR_MATTE_GREEN, COLOR_MATTE_FOREST_GREEN, COLOR_MATTE_FOLIAGE_GREEN, COLOR_MATTE_OLIVE_DARB, COLOR_MATTE_DARK_EARTH, COLOR_MATTE_DESERT_TAN }; - static const char* metal_names[] = { "Brushed Steel", "Brushed Black Steel", "Brushed Aluminium", "Pure Gold", "Brushed Gold" }; - static int metal_ids[] = { COLOR_METALS_BRUSHED_STEEL, COLOR_METALS_BRUSHED_BLACK_STEEL, COLOR_METALS_BRUSHED_ALUMINUM, COLOR_METALS_PURE_GOLD, COLOR_METALS_BRUSHED_GOLD }; - - int color_check{}; - switch (color_type) - { - case 4: - color_check = pearlescent; - break; - case 5: - color_check = wheel_color; - break; - case 6: - color_check = interior_color; - break; - case 7: - color_check = dashboard_color; - break; - default: - color_check = (main_color == 0) ? primary_color : secondary_color; - } - ImGui::SameLine(); - if (ImGui::ListBoxHeader("##color", ImVec2(200, 200))) - { - switch (color_type) - { - case 0: //Chrome - { - if (ImGui::Selectable("Chrome", color_check == COLOR_CHROME)) - { - if (main_color == 0) - primary_color = COLOR_CHROME; - else - secondary_color = COLOR_CHROME; - g_fiber_pool->queue_job([] + for (const auto& it : mod_names) + { + if (it.second == mod_name) { - VEHICLE::SET_VEHICLE_COLOURS(player_vehicle, primary_color, secondary_color); - }); - } - break; - } - case 1: //Classic - { - for (int i = 0; i < 74; i++) - { - if (ImGui::Selectable(classic_names[i], color_check == classic_ids[i])) - { - if (main_color == 0) - primary_color = classic_ids[i]; - else - secondary_color = classic_ids[i]; - g_fiber_pool->queue_job([] - { - VEHICLE::SET_VEHICLE_COLOURS(player_vehicle, primary_color, secondary_color); - }); - } - } - break; - } - case 2: //Matte - { - for (int i = 0; i < 20; i++) - { - if (ImGui::Selectable(matte_names[i], color_check == matte_ids[i])) - { - if (main_color == 0) - primary_color = matte_ids[i]; - else - secondary_color = matte_ids[i]; - g_fiber_pool->queue_job([] - { - VEHICLE::SET_VEHICLE_COLOURS(player_vehicle, primary_color, secondary_color); - }); - } - } - break; - } - case 3: //Metals - { - for (int i = 0; i < 5; i++) - { - if (ImGui::Selectable(metal_names[i], color_check == metal_ids[i])) - { - if (main_color == 0) - primary_color = metal_ids[i]; - else - secondary_color = metal_ids[i]; - g_fiber_pool->queue_job([] - { - VEHICLE::SET_VEHICLE_COLOURS(player_vehicle, primary_color, secondary_color); - }); - } - } - break; - } - case 4: //Pearlescent - { - for (int i = 0; i < 74; i++) - { - if (ImGui::Selectable(classic_names[i], color_check == classic_ids[i])) - { - pearlescent = classic_ids[i]; - g_fiber_pool->queue_job([] - { - VEHICLE::SET_VEHICLE_EXTRA_COLOURS(player_vehicle, pearlescent, wheel_color); - }); - } - } - break; - } - case 5: //Wheel Color - { - for (int i = 0; i < 74; i++) - { - if (ImGui::Selectable(classic_names[i], color_check == classic_ids[i])) - { - wheel_color = classic_ids[i]; - g_fiber_pool->queue_job([] - { - VEHICLE::SET_VEHICLE_EXTRA_COLOURS(player_vehicle, pearlescent, wheel_color); - }); - } - } - break; - } - case 6: //Interior Color - { - for (int i = 0; i < 74; i++) - { - if (ImGui::Selectable(classic_names[i], color_check == classic_ids[i])) - { - interior_color = classic_ids[i]; - g_fiber_pool->queue_job([] - { - VEHICLE::SET_VEHICLE_INTERIOR_COLOR_(player_vehicle, interior_color); - }); - } - } - break; - } - case 7: //Dashboard Color - { - for (int i = 0; i < 74; i++) - { - if (ImGui::Selectable(classic_names[i], color_check == classic_ids[i])) - { - dashboard_color = classic_ids[i]; - g_fiber_pool->queue_job([] - { - VEHICLE::SET_VEHICLE_DASHBOARD_COLOR_(player_vehicle, dashboard_color); - }); - } - } - break; - } - } - ImGui::ListBoxFooter(); - ImGui::EndGroup(); - } - - ImGui::Separator(); - - if (ImGui::CollapsingHeader("Custom Color")) - { - ImGui::PushItemWidth(400); - static float color[3]{}; - static int color_type{}; - if (ImGui::ColorPicker3("Custom VehColor", color, ImGuiColorEditFlags_NoAlpha | ImGuiColorEditFlags_NoDragDrop | ImGuiColorEditFlags_NoOptions | ImGuiColorEditFlags_DisplayRGB | ImGuiColorEditFlags_DisplayHex)) - { - g_fiber_pool->queue_job([] - { - switch (color_type) - { - case 0: - VEHICLE::SET_VEHICLE_CUSTOM_PRIMARY_COLOUR(player_vehicle, (int)(color[0] * 255), (int)(color[1] * 255), (int)(color[2] * 255)); - break; - case 1: - VEHICLE::SET_VEHICLE_CUSTOM_SECONDARY_COLOUR(player_vehicle, (int)(color[0] * 255), (int)(color[1] * 255), (int)(color[2] * 255)); - break; - case 2: - VEHICLE::SET_VEHICLE_TYRE_SMOKE_COLOR(player_vehicle, (int)(color[0] * 255), (int)(color[1] * 255), (int)(color[2] * 255)); + repeated = true; break; } - }); - } - ImGui::BeginGroup(); - if (ImGui::RadioButton("Primary", &color_type, 0)) - { - g_fiber_pool->queue_job([] + } + + if (!repeated) { - int color_get[3]; - VEHICLE::GET_VEHICLE_CUSTOM_PRIMARY_COLOUR(player_vehicle, &color_get[0], &color_get[1], &color_get[2]); - color[0] = (float)color_get[0] / 255; - color[1] = (float)color_get[1] / 255; - color[2] = (float)color_get[2] / 255; - }); + mod_names[mod] = mod_name; + } + } + mod_display_names[slot] = mod_names; } - if (ImGui::RadioButton("Secondary", &color_type, 1)) + } + } + }); + + if (slot_display_names.empty()) + { + return; + } + + components::button("Start LS Customs", [] { + g->vehicle.ls_customs = true; + }); + ImGui::SameLine(); + if (components::button("Max Vehicle")) + { + g_fiber_pool->queue_job([] { + vehicle::max_vehicle(self::veh); + + // refresh mod names + player_vehicle = 0; + }); + } + + ImGui::Separator(); + components::small_text("Mod Options"); + + if (ImGui::Checkbox("Bulletproof Tires", &can_tires_burst)) + { + g_fiber_pool->queue_job([] { + VEHICLE::SET_VEHICLE_TYRES_CAN_BURST(player_vehicle, !can_tires_burst); + }); + } + ImGui::SameLine(); + if (ImGui::Checkbox("Turbo", &turbo)) + { + g_fiber_pool->queue_job([] { + VEHICLE::TOGGLE_VEHICLE_MOD(player_vehicle, MOD_TURBO, turbo); + }); + } + ImGui::SameLine(); + if (ImGui::Checkbox("Tiresmoke", &tiresmoke)) + { + g_fiber_pool->queue_job([] { + VEHICLE::TOGGLE_VEHICLE_MOD(player_vehicle, MOD_TYRE_SMOKE, tiresmoke); + }); + } + ImGui::SameLine(); + if (ImGui::Checkbox("Xenon", &xenon)) + { + g_fiber_pool->queue_job([] { + VEHICLE::TOGGLE_VEHICLE_MOD(player_vehicle, MOD_XENON_LIGHTS, xenon); + }); + } + + + static char plate[9] = { 0 }; + ImGui::SetNextItemWidth(200.f); + components::input_text_with_hint("##plate", "Plate Number", plate, sizeof(plate), ImGuiInputTextFlags_None, [] { + g->spawn.plate = plate; + }); + ImGui::SameLine(); + if (components::button("Change Plate Number")) + { + g_fiber_pool->queue_job([] { + vehicle::set_plate(self::veh, plate); + }); + } + + ImGui::SetNextItemWidth(200); + if (ImGui::BeginCombo("Plate Style", vehicle_plate_types[plate_type].name)) + { + for (int i = 0; i < PLATE_TYPE_SIZE; i++) + { + auto item = vehicle_plate_types[i]; + + if (ImGui::Selectable(item.name, (int)item.type == plate_type)) + { + if (plate_type != item.type) { - g_fiber_pool->queue_job([] - { - int color_get[3]; - VEHICLE::GET_VEHICLE_CUSTOM_SECONDARY_COLOUR(player_vehicle, &color_get[0], &color_get[1], &color_get[2]); - color[0] = (float)color_get[0] / 255; - color[1] = (float)color_get[1] / 255; - color[2] = (float)color_get[2] / 255; - }); + plate_type = item.type; + VEHICLE::SET_VEHICLE_NUMBER_PLATE_TEXT_INDEX(player_vehicle, plate_type); } - if (tiresmoke) + } + + if (item.type == plate_type) + { + ImGui::SetItemDefaultFocus(); + } + } + + ImGui::EndCombo(); + } + + + + + if (!is_bike) + { + static int windowtint{}; + static char* windowtint_combo[] = { "None", "Black", "Dark", "Light" }; + + ImGui::SetNextItemWidth(200); + if (ImGui::Combo("Window Tint", &windowtint, windowtint_combo, IM_ARRAYSIZE(windowtint_combo))) + { + g_fiber_pool->queue_job([] { + VEHICLE::SET_VEHICLE_WINDOW_TINT(player_vehicle, windowtint); + }); + } + + ImGui::SetNextItemWidth(200); + if (ImGui::BeginCombo("Wheel Type", vehicle_wheel_types[wheel_type].c_str())) + { + for (const auto& [type, name] : vehicle_wheel_types) + { + if (ImGui::Selectable(name.c_str(), (int)type == wheel_type)) { - if (ImGui::RadioButton("Tire Smoke", &color_type, 2)) + if (wheel_type != type) { - g_fiber_pool->queue_job([] - { - int color_get[3]; - VEHICLE::GET_VEHICLE_TYRE_SMOKE_COLOR(player_vehicle, &color_get[0], &color_get[1], &color_get[2]); - color[0] = (float)color_get[0] / 255; - color[1] = (float)color_get[1] / 255; - color[2] = (float)color_get[2] / 255; - }); + wheel_type = type; + + g_fiber_pool->queue_job([] { + VEHICLE::SET_VEHICLE_WHEEL_TYPE(player_vehicle, wheel_type); + VEHICLE::SET_VEHICLE_MOD(player_vehicle, MOD_FRONTWHEEL, 0, false); + selected_slot = MOD_FRONTWHEEL; + + // refresh mod names + player_vehicle = 0; + }); } } - if (ImGui::Button("Remove Custom Color")) + + if (type == wheel_type) { - g_fiber_pool->queue_job([] - { - VEHICLE::CLEAR_VEHICLE_CUSTOM_PRIMARY_COLOUR(player_vehicle); - VEHICLE::CLEAR_VEHICLE_CUSTOM_SECONDARY_COLOUR(player_vehicle); - VEHICLE::SET_VEHICLE_COLOURS(player_vehicle, primary_color, secondary_color); - }); + ImGui::SetItemDefaultFocus(); } - ImGui::EndGroup(); - ImGui::PopItemWidth(); } - ImGui::TreePop(); + + ImGui::EndCombo(); } } + + ImGui::Separator(); + + if (ImGui::ListBoxHeader("Slot", ImVec2(200, 200))) + { + for (const auto& [slot, name] : slot_display_names) + { + if (ImGui::Selectable(name.c_str(), slot == selected_slot)) + { + selected_slot = slot; + } + } + ImGui::ListBoxFooter(); + } + + if (selected_slot != -1) + { + ImGui::SameLine(); + if (ImGui::ListBoxHeader("Mod", ImVec2(200, 200))) + { + for (const auto& it : mod_display_names[selected_slot]) + { + const auto& mod = it.first; + const auto& name = it.second; + + if (ImGui::Selectable(name.c_str(), mod == owned_mods[selected_slot])) + { + g_fiber_pool->queue_job([&mod] { + NETWORK::NETWORK_REQUEST_CONTROL_OF_ENTITY(self::veh); + VEHICLE::SET_VEHICLE_MOD(player_vehicle, selected_slot, mod, false); + owned_mods[selected_slot] = VEHICLE::GET_VEHICLE_MOD(player_vehicle, selected_slot); + }); + } + } + ImGui::ListBoxFooter(); + } + } + + ImGui::Separator(); + components::small_text("Color Options"); + + + static const char* classic_names[] = { "Black", "Carbon Black", "Graphite", "Anthracite Black", "Black Steel", "Dark Steel", "Silver", "Bluish Silver", "Rolled Steel", "Shadow SIlver", "Stone Silver", "Midnight Silver", "Cast Iron Silver", "Red", "Torino Red", "Formula Red", "Lava Red", "Blaze Red", "Grace Red", "Garnet Red", "Sunset Red", "Cabernet Red", "Wine Red", "Candy Red", "Hot Pink", "Pfister Pink", "Salmon Pink", "Sunrise Orange", "Orange", "Bright Orange", "Gold", "Bronze", "Yellow", "Race Yellow", "Dew Yellow", "Dark Green", "Racing Green", "Sea Green", "Olive Green", "Bright Green", "Gasoline Green", "Lime Green", "Midnight Blue", "Galaxy Blue", "Dark Blue", "Saxon Blue", "Blue", "Mariner Blue", "Harbor Blue", "Diamond Blue", "Surf Blue", "Nautical Blue", "Racing Blue", "Ultra Blue", "Light Blue", "Chocolate Brown", "Bison Brown", "Creek Brown", "Feltzer Brown", "Maple Brown", "Beechwood Brown", "Sienna Brown", "Saddle Brown", "Moss Brown", "Woodbeech Brown", "Straw Brown", "Sandy Brown", "Bleached Brown", "Schafter Purple", "Spinnaker Purple", "Midnight Purple", "Bright Purple", "Cream", "Ice White", "Frost White" }; + static int classic_ids[] = { COLOR_CLASSIC_BLACK, COLOR_CLASSIC_CARBON_BLACK, COLOR_CLASSIC_GRAPHITE, COLOR_CLASSIC_ANHRACITE_BLACK, COLOR_CLASSIC_BLACK_STEEL, COLOR_CLASSIC_DARK_STEEL, COLOR_CLASSIC_SILVER, COLOR_CLASSIC_BLUISH_SILVER, COLOR_CLASSIC_ROLLED_STEEL, COLOR_CLASSIC_SHADOW_SILVER, COLOR_CLASSIC_STONE_SILVER, COLOR_CLASSIC_MIDNIGHT_SILVER, COLOR_CLASSIC_CAST_IRON_SILVER, COLOR_CLASSIC_RED, COLOR_CLASSIC_TORINO_RED, COLOR_CLASSIC_FORMULA_RED, COLOR_CLASSIC_LAVA_RED, COLOR_CLASSIC_BLAZE_RED, COLOR_CLASSIC_GRACE_RED, COLOR_CLASSIC_GARNET_RED, COLOR_CLASSIC_SUNSET_RED, COLOR_CLASSIC_CABERNET_RED, COLOR_CLASSIC_WINE_RED, COLOR_CLASSIC_CANDY_RED, COLOR_CLASSIC_HOT_PINK, COLOR_CLASSIC_PFSITER_PINK, COLOR_CLASSIC_SALMON_PINK, COLOR_CLASSIC_SUNRISE_ORANGE, COLOR_CLASSIC_ORANGE, COLOR_CLASSIC_BRIGHT_ORANGE, COLOR_CLASSIC_GOLD, COLOR_CLASSIC_BRONZE, COLOR_CLASSIC_YELLOW, COLOR_CLASSIC_RACE_YELLOW, COLOR_CLASSIC_DEW_YELLOW, COLOR_CLASSIC_DARK_GREEN, COLOR_CLASSIC_RACING_GREEN, COLOR_CLASSIC_SEA_GREEN, COLOR_CLASSIC_OLIVE_GREEN, COLOR_CLASSIC_BRIGHT_GREEN, COLOR_CLASSIC_GASOLINE_GREEN, COLOR_CLASSIC_LIME_GREEN, COLOR_CLASSIC_MIDNIGHT_BLUE, COLOR_CLASSIC_GALAXY_BLUE, COLOR_CLASSIC_DARK_BLUE, COLOR_CLASSIC_SAXON_BLUE, COLOR_CLASSIC_BLUE, COLOR_CLASSIC_MARINER_BLUE, COLOR_CLASSIC_HARBOR_BLUE, COLOR_CLASSIC_DIAMOND_BLUE, COLOR_CLASSIC_SURF_BLUE, COLOR_CLASSIC_NAUTICAL_BLUE, COLOR_CLASSIC_RACING_BLUE, COLOR_CLASSIC_ULTRA_BLUE, COLOR_CLASSIC_LIGHT_BLUE, COLOR_CLASSIC_CHOCOLATE_BROWN, COLOR_CLASSIC_BISON_BROWN, COLOR_CLASSIC_CREEEN_BROWN, COLOR_CLASSIC_FELTZER_BROWN, COLOR_CLASSIC_MAPLE_BROWN, COLOR_CLASSIC_BEECHWOOD_BROWN, COLOR_CLASSIC_SIENNA_BROWN, COLOR_CLASSIC_SADDLE_BROWN, COLOR_CLASSIC_MOSS_BROWN, COLOR_CLASSIC_WOODBEECH_BROWN, COLOR_CLASSIC_STRAW_BROWN, COLOR_CLASSIC_SANDY_BROWN, COLOR_CLASSIC_BLEACHED_BROWN, COLOR_CLASSIC_SCHAFTER_PURPLE, COLOR_CLASSIC_SPINNAKER_PURPLE, COLOR_CLASSIC_MIDNIGHT_PURPLE, COLOR_CLASSIC_BRIGHT_PURPLE, COLOR_CLASSIC_CREAM, COLOR_CLASSIC_ICE_WHITE, COLOR_CLASSIC_FROST_WHITE }; + static const char* matte_names[] = { "Black", "Gray", "Light Gray", "Ice White", "Blue", "Dark Blue", "Midnight Blue", "Midnight Purple", "Shafter Purple", "Red", "Dark Red", "Orange", "Yellow", "Lime Green", "Green", "Forest Green", "Foliage Green", "Olive Drab", "Dark Earth", "Desert Tan" }; + static int matte_ids[] = { COLOR_MATTE_BLACK, COLOR_MATTE_GRAY, COLOR_MATTE_LIGHT_GRAY, COLOR_MATTE_ICE_WHITE, COLOR_MATTE_BLUE, COLOR_MATTE_DARK_BLUE, COLOR_MATTE_MIDNIGHT_BLUE, COLOR_MATTE_MIDNIGHT_PURPLE, COLOR_MATTE_SCHAFTER_PURPLE, COLOR_MATTE_RED, COLOR_MATTE_DARK_RED, COLOR_MATTE_ORANGE, COLOR_MATTE_YELLOW, COLOR_MATTE_LIME_GREEN, COLOR_MATTE_GREEN, COLOR_MATTE_FOREST_GREEN, COLOR_MATTE_FOLIAGE_GREEN, COLOR_MATTE_OLIVE_DARB, COLOR_MATTE_DARK_EARTH, COLOR_MATTE_DESERT_TAN }; + static const char* metal_names[] = { "Brushed Steel", "Brushed Black Steel", "Brushed Aluminium", "Pure Gold", "Brushed Gold" }; + static int metal_ids[] = { COLOR_METALS_BRUSHED_STEEL, COLOR_METALS_BRUSHED_BLACK_STEEL, COLOR_METALS_BRUSHED_ALUMINUM, COLOR_METALS_PURE_GOLD, COLOR_METALS_BRUSHED_GOLD }; + + static int color_to_change = 0; + static int color_btn_clicked = 1; + static int color_type = 8; + + if (ImGui::RadioButton("Primary", &color_to_change, 0)) + { + color_btn_clicked = 1; + } + ImGui::SameLine(); + if (ImGui::RadioButton("Secondary", &color_to_change, 1)) + { + color_btn_clicked = 1; + } + ImGui::SameLine(); + if (ImGui::RadioButton("Tire Smake", &color_to_change, 2)) + { + color_btn_clicked = 1; + } + ImGui::SameLine(); + if (ImGui::Button("Remove Custom Color")) + { + g_fiber_pool->queue_job([] { + VEHICLE::CLEAR_VEHICLE_CUSTOM_PRIMARY_COLOUR(player_vehicle); + VEHICLE::CLEAR_VEHICLE_CUSTOM_SECONDARY_COLOUR(player_vehicle); + VEHICLE::SET_VEHICLE_COLOURS(player_vehicle, primary_color, secondary_color); + }); + } + + ImGui::Separator(); + + ImGui::BeginGroup(); + + if (color_to_change == 0 || color_to_change == 1) + { + // primary and secondary color + + if (ImGui::ListBoxHeader("##colors", ImVec2(200, 254))) + { + if (ImGui::Selectable("Custom", color_type == 8, ImGuiSelectableFlags_SelectOnClick)) + { + color_type = 8; + } + if (ImGui::Selectable("Chrome", color_type == 0)) + { + color_type = 0; + } + if (ImGui::Selectable("Classic", color_type == 1)) + { + color_type = 1; + } + if (ImGui::Selectable("Matte", color_type == 2)) + { + color_type = 2; + } + if (ImGui::Selectable("Metals", color_type == 3)) + { + color_type = 3; + } + if (ImGui::Selectable("Pearlescent", color_type == 4)) + { + color_type = 4; + } + if (ImGui::Selectable("Wheel Color", color_type == 5)) + { + color_type = 5; + } + if (ImGui::Selectable("Interior Color", color_type == 6)) + { + color_type = 6; + } + if (ImGui::Selectable("Dashboard Color", color_type == 7)) + { + color_type = 7; + } + ImGui::ListBoxFooter(); + } + } + else + { + // tyre smoke color + + color_type = 8; + ImGui::Text(""); + } + + if (color_type == 8) + { + // custom color + + static float color[3] = { 1, 1, 1 }; + + ImGui::SameLine(); + ImGui::SetNextItemWidth(212); + if (ImGui::ColorPicker3("Custom VehColor", color, ImGuiColorEditFlags_NoAlpha | ImGuiColorEditFlags_NoDragDrop | ImGuiColorEditFlags_NoOptions | ImGuiColorEditFlags_DisplayRGB | ImGuiColorEditFlags_DisplayHex)) + { + g_fiber_pool->queue_job([] { + switch (color_to_change) + { + case 0: + VEHICLE::SET_VEHICLE_CUSTOM_PRIMARY_COLOUR(player_vehicle, (int)(color[0] * 255), (int)(color[1] * 255), (int)(color[2] * 255)); + break; + case 1: + VEHICLE::SET_VEHICLE_CUSTOM_SECONDARY_COLOUR(player_vehicle, (int)(color[0] * 255), (int)(color[1] * 255), (int)(color[2] * 255)); + break; + case 2: + VEHICLE::SET_VEHICLE_TYRE_SMOKE_COLOR(player_vehicle, (int)(color[0] * 255), (int)(color[1] * 255), (int)(color[2] * 255)); + break; + } + }); + } + + if (color_btn_clicked == 1) + { + g_fiber_pool->queue_job([] { + int color_get[3]; + + if (color_to_change == 0) + { + VEHICLE::GET_VEHICLE_CUSTOM_PRIMARY_COLOUR(player_vehicle, &color_get[0], &color_get[1], &color_get[2]); + } + else if (color_to_change == 1) + { + VEHICLE::GET_VEHICLE_CUSTOM_SECONDARY_COLOUR(player_vehicle, &color_get[0], &color_get[1], &color_get[2]); + } + else if (color_to_change == 2) + { + VEHICLE::GET_VEHICLE_TYRE_SMOKE_COLOR(player_vehicle, &color_get[0], &color_get[1], &color_get[2]); + } + + color[0] = (float)color_get[0] / 255; + color[1] = (float)color_get[1] / 255; + color[2] = (float)color_get[2] / 255; + }); + + color_btn_clicked = 0; + } + + } + else + { + // standard color + + int color_check = 0; + switch (color_type) + { + case 4: + color_check = pearlescent; + break; + case 5: + color_check = wheel_color; + break; + case 6: + color_check = interior_color; + break; + case 7: + color_check = dashboard_color; + break; + default: + color_check = (color_to_change == 0) ? primary_color : secondary_color; + } + + ImGui::SameLine(); + if (ImGui::ListBoxHeader("##color", ImVec2(200, 254))) + { + switch (color_type) + { + case 0: //Chrome + { + if (ImGui::Selectable("Chrome", color_check == COLOR_CHROME)) + { + if (color_to_change == 0) + primary_color = COLOR_CHROME; + else + secondary_color = COLOR_CHROME; + g_fiber_pool->queue_job([] { + VEHICLE::SET_VEHICLE_COLOURS(player_vehicle, primary_color, secondary_color); + }); + } + break; + } + case 1: //Classic + { + for (int i = 0; i < 74; i++) + { + if (ImGui::Selectable(classic_names[i], color_check == classic_ids[i])) + { + if (color_to_change == 0) + primary_color = classic_ids[i]; + else + secondary_color = classic_ids[i]; + g_fiber_pool->queue_job([] { + VEHICLE::SET_VEHICLE_COLOURS(player_vehicle, primary_color, secondary_color); + }); + } + } + break; + } + case 2: //Matte + { + for (int i = 0; i < 20; i++) + { + if (ImGui::Selectable(matte_names[i], color_check == matte_ids[i])) + { + if (color_to_change == 0) + primary_color = matte_ids[i]; + else + secondary_color = matte_ids[i]; + g_fiber_pool->queue_job([] { + VEHICLE::SET_VEHICLE_COLOURS(player_vehicle, primary_color, secondary_color); + }); + } + } + break; + } + case 3: //Metals + { + for (int i = 0; i < 5; i++) + { + if (ImGui::Selectable(metal_names[i], color_check == metal_ids[i])) + { + if (color_to_change == 0) + primary_color = metal_ids[i]; + else + secondary_color = metal_ids[i]; + g_fiber_pool->queue_job([] { + VEHICLE::SET_VEHICLE_COLOURS(player_vehicle, primary_color, secondary_color); + }); + } + } + break; + } + case 4: //Pearlescent + { + for (int i = 0; i < 74; i++) + { + if (ImGui::Selectable(classic_names[i], color_check == classic_ids[i])) + { + pearlescent = classic_ids[i]; + g_fiber_pool->queue_job([] { + VEHICLE::SET_VEHICLE_EXTRA_COLOURS(player_vehicle, pearlescent, wheel_color); + }); + } + } + break; + } + case 5: //Wheel Color + { + for (int i = 0; i < 74; i++) + { + if (ImGui::Selectable(classic_names[i], color_check == classic_ids[i])) + { + wheel_color = classic_ids[i]; + g_fiber_pool->queue_job([] { + VEHICLE::SET_VEHICLE_EXTRA_COLOURS(player_vehicle, pearlescent, wheel_color); + }); + } + } + break; + } + case 6: //Interior Color + { + for (int i = 0; i < 74; i++) + { + if (ImGui::Selectable(classic_names[i], color_check == classic_ids[i])) + { + interior_color = classic_ids[i]; + g_fiber_pool->queue_job([] { + VEHICLE::SET_VEHICLE_INTERIOR_COLOR_(player_vehicle, interior_color); + }); + } + } + break; + } + case 7: //Dashboard Color + { + for (int i = 0; i < 74; i++) + { + if (ImGui::Selectable(classic_names[i], color_check == classic_ids[i])) + { + dashboard_color = classic_ids[i]; + g_fiber_pool->queue_job([] { + VEHICLE::SET_VEHICLE_DASHBOARD_COLOR_(player_vehicle, dashboard_color); + }); + } + } + break; + } + } + ImGui::ListBoxFooter(); + } + } + + ImGui::EndGroup(); } } diff --git a/BigBaseV2/src/views/vehicle/view_pv.cpp b/BigBaseV2/src/views/vehicle/view_pv.cpp index 813bc07f..6d36e51c 100644 --- a/BigBaseV2/src/views/vehicle/view_pv.cpp +++ b/BigBaseV2/src/views/vehicle/view_pv.cpp @@ -52,7 +52,7 @@ namespace big }); g_mobile_service->refresh_personal_vehicles(); - if (ImGui::ListBoxHeader("##personal_veh_list", { 300, static_cast(*g_pointers->m_resolution_y - 184 - 38 * num_of_rows) })) + if (ImGui::ListBoxHeader("###personal_veh_list", { 300, static_cast(*g_pointers->m_resolution_y - 184 - 38 * num_of_rows) })) { if (g_mobile_service->personal_vehicles().empty()) @@ -77,60 +77,58 @@ namespace big display_name.find(lower_search) != std::string::npos || display_manufacturer.find(lower_search) != std::string::npos ) { - ImGui::PushID(personal_veh->get_id()); - if (ImGui::Selectable(label.c_str(), false)) { + ImGui::PushID('v' << 24 & personal_veh->get_id()); + components::selectable(label, false, [&personal_veh] { if (g->clone_pv.spawn_clone) { - g_fiber_pool->queue_job([&personal_veh] { - auto vehicle_idx = personal_veh->get_vehicle_idx(); - auto veh_data = vehicle::get_vehicle_data_from_vehicle_idx(vehicle_idx); + auto vehicle_idx = personal_veh->get_vehicle_idx(); + auto veh_data = vehicle::get_vehicle_data_from_vehicle_idx(vehicle_idx); - float y_offset = 0; + float y_offset = 0; - if (PED::IS_PED_IN_ANY_VEHICLE(self::ped, false)) - { - y_offset = 10.f; - } - else if (!g->spawn.spawn_inside) - { - y_offset = 5.f; - } + if (self::veh != 0) + { + y_offset = 10.f; + } + else if (!g->clone_pv.spawn_inside) + { + y_offset = 5.f; + } - auto spawn_location = ENTITY::GET_OFFSET_FROM_ENTITY_IN_WORLD_COORDS(self::ped, 0.f, y_offset, 0.f); - float spawn_heading = ENTITY::GET_ENTITY_HEADING(self::ped); + auto spawn_location = ENTITY::GET_OFFSET_FROM_ENTITY_IN_WORLD_COORDS(self::ped, 0.f, y_offset, 0.f); + float spawn_heading = ENTITY::GET_ENTITY_HEADING(self::ped); - const char* spawn_plate = plate; - if (g->clone_pv.clone_plate) - { - spawn_plate = personal_veh->get_plate(); - } + const char* spawn_plate = plate; + if (g->clone_pv.clone_plate) + { + spawn_plate = personal_veh->get_plate(); + } - auto veh = vehicle::clone(veh_data, spawn_location, spawn_heading); + auto veh = vehicle::clone(veh_data, spawn_location, spawn_heading); - if (g->clone_pv.spawn_inside) - { - vehicle::telport_into_veh(veh); - } + if (g->clone_pv.spawn_inside) + { + vehicle::telport_into_veh(veh); + } - if (g->clone_pv.spawn_maxed) - { - vehicle::max_vehicle(veh); - } + if (g->clone_pv.spawn_maxed) + { + vehicle::max_vehicle(veh); + } - vehicle::set_plate(veh, spawn_plate); - }); + vehicle::set_plate(veh, spawn_plate); } else { strcpy(search, ""); lower_search = search; - g_fiber_pool->queue_job([&personal_veh] { - personal_veh->summon(); - }); + personal_veh->summon(); } - } + + g_vehicle_preview_service->stop_preview(); + }); ImGui::PopID(); if (g->clone_pv.preview_vehicle && ImGui::IsItemHovered()) diff --git a/BigBaseV2/src/views/vehicle/view_spawn.cpp b/BigBaseV2/src/views/vehicle/view_spawn.cpp index 90279f4c..d0001c8a 100644 --- a/BigBaseV2/src/views/vehicle/view_spawn.cpp +++ b/BigBaseV2/src/views/vehicle/view_spawn.cpp @@ -6,7 +6,8 @@ namespace big { - void view::spawn() { + void view::spawn() + { ImGui::SetWindowSize({ 0.f, (float)*g_pointers->m_resolution_y }, ImGuiCond_Always); ImGui::Checkbox("Preview", &g->spawn.preview_vehicle); @@ -52,12 +53,12 @@ namespace big display_name.find(lower_search) != std::string::npos || display_manufacturer.find(lower_search) != std::string::npos ) { - //ImGui::PushID(item.hash); + ImGui::PushID(item.hash); components::selectable(item.display_name, false, [item] { float y_offset = 0; - if (PED::IS_PED_IN_ANY_VEHICLE(self::ped, false)) + if (self::veh != 0) { y_offset = 10.f; } @@ -85,7 +86,7 @@ namespace big g_vehicle_preview_service->stop_preview(); }); - //ImGui::PopID(); + ImGui::PopID(); if (g->spawn.preview_vehicle && ImGui::IsItemHovered()) { diff --git a/BigBaseV2/src/views/vehicle/view_vehicle.cpp b/BigBaseV2/src/views/vehicle/view_vehicle.cpp index d3fd0661..34db5af1 100644 --- a/BigBaseV2/src/views/vehicle/view_vehicle.cpp +++ b/BigBaseV2/src/views/vehicle/view_vehicle.cpp @@ -4,17 +4,55 @@ #include "script.hpp" #include "util/vehicle.hpp" #include "views/view.hpp" - +#include "util/mobile.hpp" namespace big { - void view::vehicle() { + void view::vehicle() + { + components::button("MMI Fix All PV", [] { + int amount_fixed = mobile::mors_mutual::fix_all(); + g_notification_service->push("Mobile", + fmt::format("{} vehicle{} been fixed.", amount_fixed, amount_fixed == 1 ? " has" : "s have") + ); + }); + ImGui::SameLine(); + components::button("Repair", [] { + vehicle::repair(self::veh); + }); + + ImGui::Separator(); + + components::button("Teleport to PV", [] { + Vehicle veh = globals::get_personal_vehicle(); + teleport::into_vehicle(veh); + }); + ImGui::SameLine(); + components::button("Bring PV", [] { + Vehicle veh = globals::get_personal_vehicle(); + vehicle::bring(veh, self::pos, true); + }); + ImGui::SameLine(); + components::button("Bring Closest Vehicle", [] { + Vehicle veh = vehicle::get_closest_to_location(self::pos, 200); + vehicle::bring(veh, self::pos, true, -1); + }); + + ImGui::Separator(); + + components::small_text("General"); + ImGui::BeginGroup(); - ImGui::Checkbox("Can Be Targeted", &g->vehicle.is_targetable); ImGui::Checkbox("God Mode", &g->vehicle.god_mode); ImGui::Checkbox("Horn Boost", &g->vehicle.horn_boost); ImGui::Checkbox("Vehicle Jump", &g->vehicle.vehicle_jump); + + ImGui::EndGroup(); + ImGui::SameLine(); + ImGui::BeginGroup(); + ImGui::Checkbox("Instant Brake", &g->vehicle.instant_brake); + ImGui::Checkbox("Can Be Targeted", &g->vehicle.is_targetable); ImGui::Checkbox("Drive On Water", &g->vehicle.drive_on_water); ImGui::EndGroup(); @@ -22,31 +60,7 @@ namespace big ImGui::BeginGroup(); ImGui::Checkbox("Seatbelt", &g->vehicle.seatbelt); - - components::button("Repair", [] { - vehicle::repair(self::veh); - }); - - components::button("Instant in personal vehicle", [] { - if (!*g_pointers->m_is_session_started) return g_notification_service->push_warning("WARNING", "Go into GTA V Online to use this option"); - - vehicle::go_into_personal_vehicle(); - }); - - if (ImGui::TreeNode("Paint")) - { - ImGui::ListBox("RGB Type", &g->vehicle.rainbow_paint, vehicle::rgb_types, 3); - - if (g->vehicle.rainbow_paint) - { - ImGui::SliderInt("RGB Speed", &g->rgb.speed, 1, 10); - } - - ImGui::TreePop(); - } - ImGui::Checkbox("Turn Signals", &g->vehicle.turn_signals); - if (g->vehicle.turn_signals) { ImGui::Checkbox("Fully Automatic Signal", &g->vehicle.auto_turn_signals); @@ -56,91 +70,133 @@ namespace big ImGui::Separator(); - components::small_text("Auto Drive"); + components::small_text("Proofs"); - components::button("Drive To Waypoint", [] { - - g->vehicle.auto_drive_to_waypoint = true; - }); - - components::button("Wander", [] { - - g->vehicle.auto_drive_wander = true; - }); - - ImGui::SliderInt("Top Speed", &g->vehicle.auto_drive_speed, 1, 200); - - components::button("E-Stop", [] { - - g->vehicle.auto_drive_to_waypoint = false; - g->vehicle.auto_drive_wander = false; - VEHICLE::SET_VEHICLE_FORWARD_SPEED(self::veh, 0); - TASK::CLEAR_VEHICLE_TASKS_(self::veh); - TASK::CLEAR_PED_TASKS(self::ped); - }); - - if (ImGui::ListBox("Driving Style", &g->vehicle.driving_style_id, vehicle::driving_style_names, 2)) + if (ImGui::Button("Check all")) { - g->vehicle.driving_style_flags = vehicle::driving_styles[g->vehicle.driving_style_id]; - g_notification_service->push_warning("Auto Drive", fmt::format("Driving style set to {}.", vehicle::driving_style_names[g->vehicle.driving_style_id])); + g->vehicle.proof_bullet = true; + g->vehicle.proof_fire = true; + g->vehicle.proof_collision = true; + g->vehicle.proof_melee = true; + g->vehicle.proof_explosion = true; + g->vehicle.proof_steam = true; + g->vehicle.proof_water = true; } - ImGui::Separator(); - - components::small_text("Vehicle Fly"); - - ImGui::Checkbox("Enabled", &g->vehicle.fly.enabled); ImGui::SameLine(); - ImGui::Checkbox("Disable Collision", &g->vehicle.fly.no_collision); - ImGui::Checkbox("Don't Stop", &g->vehicle.fly.dont_stop); + if (ImGui::Button("Uncheck all")) + { + g->vehicle.proof_bullet = false; + g->vehicle.proof_fire = false; + g->vehicle.proof_collision = false; + g->vehicle.proof_melee = false; + g->vehicle.proof_explosion = false; + g->vehicle.proof_steam = false; + g->vehicle.proof_water = false; + } + + ImGui::BeginGroup(); + + ImGui::Checkbox("Bullet", &g->vehicle.proof_bullet); + ImGui::Checkbox("Fire", &g->vehicle.proof_fire); + + ImGui::EndGroup(); ImGui::SameLine(); - ImGui::Checkbox("Stop On Exit", &g->vehicle.fly.stop_on_exit); + ImGui::BeginGroup(); - ImGui::SliderFloat("Speed", &g->vehicle.fly.speed, 1.f, 100.f, "%.0f", 1); + ImGui::Checkbox("Collision", &g->vehicle.proof_collision); + ImGui::Checkbox("Melee", &g->vehicle.proof_melee); - ImGui::Separator(); + ImGui::EndGroup(); + ImGui::SameLine(); + ImGui::BeginGroup(); - components::small_text("LS Customs"); + ImGui::Checkbox("Explosion", &g->vehicle.proof_explosion); + ImGui::Checkbox("Steam", &g->vehicle.proof_steam); - components::button("Start LS Customs", [] { - g->vehicle.ls_customs = true; - }); + ImGui::EndGroup(); + ImGui::SameLine(); + ImGui::BeginGroup(); + + ImGui::Checkbox("Water", &g->vehicle.proof_water); + + ImGui::EndGroup(); ImGui::Separator(); components::small_text("Speedo Meter"); - SpeedoMeter selected = g->vehicle.speedo_meter.type; + SpeedoMeter* speed_meter_type_ptr = &g->vehicle.speedo_meter.type; - ImGui::Text("Type:"); - if (ImGui::BeginCombo("###speedo_type", speedo_meters[(int)selected].name)) + if (ImGui::BeginCombo("Format", speedo_meters[(int)*speed_meter_type_ptr].name)) { - for (const speedo_meter& speedo : speedo_meters) + for (const auto& speedo : speedo_meters) { - if (ImGui::Selectable(speedo.name, speedo.id == selected)) + if (ImGui::Selectable(speedo.name, speedo.id == *speed_meter_type_ptr)) { - g->vehicle.speedo_meter.type = speedo.id; + *speed_meter_type_ptr = speedo.id; } - if (speedo.id == selected) + if (speedo.id == *speed_meter_type_ptr) + { ImGui::SetItemDefaultFocus(); + } } ImGui::EndCombo(); } - ImGui::Text("Position"); - - float pos[2]; - pos[0] = g->vehicle.speedo_meter.x; - pos[1] = g->vehicle.speedo_meter.y; - if (ImGui::SliderFloat2("###speedo_pos", pos, .001f, .999f, "%.3f")) + if (*speed_meter_type_ptr != SpeedoMeter::DISABLED) { - g->vehicle.speedo_meter.x = pos[0]; - g->vehicle.speedo_meter.y = pos[1]; + ImGui::Text("Position (X, Y)"); + + float pos[2] = { g->vehicle.speedo_meter.x, g->vehicle.speedo_meter.y }; + + if (ImGui::SliderFloat2("###speedo_pos", pos, .001f, .999f, "%.3f")) + { + g->vehicle.speedo_meter.x = pos[0]; + g->vehicle.speedo_meter.y = pos[1]; + } + + ImGui::SameLine(); + + ImGui::Checkbox("Left Sided", &g->vehicle.speedo_meter.left_side); } - ImGui::Checkbox("Left Sided", &g->vehicle.speedo_meter.left_side); + + g->vehicle.proof_mask = 0; + if (g->vehicle.god_mode) + { + g->vehicle.proof_mask |= static_cast(eEntityProofs::GOD); + } + if (g->vehicle.proof_bullet) + { + g->vehicle.proof_mask |= static_cast(eEntityProofs::BULLET); + } + if (g->vehicle.proof_fire) + { + g->vehicle.proof_mask |= static_cast(eEntityProofs::FIRE); + } + if (g->vehicle.proof_collision) + { + g->vehicle.proof_mask |= static_cast(eEntityProofs::COLLISION); + } + if (g->vehicle.proof_melee) + { + g->vehicle.proof_mask |= static_cast(eEntityProofs::MELEE); + } + if (g->vehicle.proof_explosion) + { + g->vehicle.proof_mask |= static_cast(eEntityProofs::EXPLOSION); + } + if (g->vehicle.proof_steam) + { + g->vehicle.proof_mask |= static_cast(eEntityProofs::STEAM); + } + if (g->vehicle.proof_water) + { + g->vehicle.proof_mask |= static_cast(eEntityProofs::WATER); + } } } diff --git a/BigBaseV2/src/views/vehicle/view_vehicle_fun.cpp b/BigBaseV2/src/views/vehicle/view_vehicle_fun.cpp new file mode 100644 index 00000000..eb689ee9 --- /dev/null +++ b/BigBaseV2/src/views/vehicle/view_vehicle_fun.cpp @@ -0,0 +1,103 @@ +#include "core/data/speedo_meters.hpp" +#include "fiber_pool.hpp" +#include "gui/handling/handling_tabs.hpp" +#include "script.hpp" +#include "util/vehicle.hpp" +#include "views/view.hpp" +#include "util/mobile.hpp" + +namespace big +{ + void view::vehicle_fun() + { + components::small_text("Auto Drive"); + + components::button("Drive To Waypoint", [] { + g->vehicle.auto_drive_to_waypoint = true; + }); + ImGui::SameLine(); + components::button("Wander", [] { + g->vehicle.auto_drive_wander = true; + }); + ImGui::SameLine(); + components::button("Emergency Stop", [] { + g->vehicle.auto_drive_to_waypoint = false; + g->vehicle.auto_drive_wander = false; + VEHICLE::SET_VEHICLE_FORWARD_SPEED(self::veh, 0); + TASK::CLEAR_VEHICLE_TASKS_(self::veh); + TASK::CLEAR_PED_TASKS(self::ped); + }); + + ImGui::SliderInt("Top Speed", &g->vehicle.auto_drive_speed, 1, 200); + + if (ImGui::BeginCombo("Driving Style", vehicle::driving_style_names[g->vehicle.driving_style_id])) + { + for (int i = 0; i < 2; i++) + { + if (ImGui::Selectable(vehicle::driving_style_names[i], g->vehicle.driving_style_id == i)) + { + g->vehicle.driving_style_id = i; + g_notification_service->push_warning("Auto Drive", fmt::format("Driving style set to {}.", vehicle::driving_style_names[i])); + } + + if (g->vehicle.driving_style_id == i) + { + ImGui::SetItemDefaultFocus(); + } + } + + ImGui::EndCombo(); + } + + ImGui::Separator(); + + components::small_text("Rainbow Paint"); + + ImGui::SetNextItemWidth(120); + if (ImGui::BeginCombo("RGB Type", vehicle::rgb_types[g->vehicle.rainbow_paint])) + { + for (int i = 0; i < 3; i++) + { + bool itemSelected = g->vehicle.rainbow_paint == i; + + if (ImGui::Selectable(vehicle::rgb_types[i], itemSelected)) + { + g->vehicle.rainbow_paint = i; + } + + if (itemSelected) + { + ImGui::SetItemDefaultFocus(); + } + } + + ImGui::EndCombo(); + } + if (g->vehicle.rainbow_paint != 0) + { + ImGui::SameLine(); + ImGui::SetNextItemWidth(150); + ImGui::SliderInt("RGB Speed", &g->rgb.speed, 1, 10); + } + + ImGui::Separator(); + + components::small_text("Vehicle Fly"); + + ImGui::BeginGroup(); + + ImGui::Checkbox("Enabled", &g->vehicle.fly.enabled); + ImGui::Checkbox("Don't Stop", &g->vehicle.fly.dont_stop); + + ImGui::EndGroup(); + ImGui::SameLine(); + ImGui::BeginGroup(); + + ImGui::Checkbox("Disable Collision", &g->vehicle.fly.no_collision); + ImGui::Checkbox("Stop On Exit", &g->vehicle.fly.stop_on_exit); + + ImGui::EndGroup(); + + ImGui::SliderFloat("Speed", &g->vehicle.fly.speed, 1.f, 100.f, "%.0f", 1); + } +} diff --git a/BigBaseV2/src/views/view.hpp b/BigBaseV2/src/views/view.hpp index c50ba761..7a2a842d 100644 --- a/BigBaseV2/src/views/view.hpp +++ b/BigBaseV2/src/views/view.hpp @@ -34,6 +34,7 @@ namespace big static void settings(); static void spawn(); static void pv(); + static void vehicle_fun(); static void spoofing(); static void teleport(); static void vehicle();