diff --git a/Solution/source/Memory/GTAmemory.cpp b/Solution/source/Memory/GTAmemory.cpp index 1fa770b9..f860b0f4 100644 --- a/Solution/source/Memory/GTAmemory.cpp +++ b/Solution/source/Memory/GTAmemory.cpp @@ -1599,6 +1599,7 @@ void GeneralGlobalHax::DisableAnnoyingRecordingUI(bool uSure) void GeneralGlobalHax::EnableBlockedMpVehiclesInSp(bool uSure) { // Has to be updated every patch. + switch (GTAmemory::GetGameVersion()) { case eGameVersion::VER_1_0_757_4_NOSTEAM: case eGameVersion::VER_1_0_757_4_STEAM: @@ -1641,11 +1642,14 @@ void GeneralGlobalHax::EnableBlockedMpVehiclesInSp(bool uSure) case eGameVersion::VER_1_0_2372_0_NOSTEAM: case eGameVersion::VER_1_0_2372_0_STEAM: *GTAmemory::GetGlobalPtr(4270934) = uSure ? 1 : 0; break; case eGameVersion::VER_1_0_2545_0_NOSTEAM: case eGameVersion::VER_1_0_2545_0_STEAM: - case eGameVersion::VER_1_0_2612_0_NOSTEAM: case eGameVersion::VER_1_0_2612_0_STEAM: - case eGameVersion::VER_1_0_2628_0_NOSTEAM: case eGameVersion::VER_1_0_2628_0_STEAM: + case eGameVersion::VER_1_0_2612_1_NOSTEAM: case eGameVersion::VER_1_0_2612_1_STEAM: case eGameVersion::VER_1_0_2628_2_NOSTEAM: case eGameVersion::VER_1_0_2628_2_STEAM: - case eGameVersion::VER_1_0_2699_0_NOSTEAM: case eGameVersion::VER_1_0_2699_0_STEAM: *GTAmemory::GetGlobalPtr(4533757) = uSure ? 1 : 0; break; + case eGameVersion::VER_1_0_2699_0_NOSTEAM: case eGameVersion::VER_1_0_2699_0_STEAM: + case eGameVersion::VER_1_0_2699_16: + *GTAmemory::GetGlobalPtr(4539659) = uSure ? 1 : 0; break; + case eGameVersion::VER_1_0_2802_0: default: + *GTAmemory::GetGlobalPtr(4540726) = uSure ? 1 : 0; break; } } diff --git a/Solution/source/Menu/Menu.cpp b/Solution/source/Menu/Menu.cpp index 7d68e3b3..fd2bb74c 100644 --- a/Solution/source/Menu/Menu.cpp +++ b/Solution/source/Menu/Menu.cpp @@ -590,8 +590,7 @@ void Menu::while_opened() { SetSub_closed(); } - - + } void Menu::Up(bool playSound) { @@ -629,7 +628,7 @@ void Menu::SetSub_previous() { currentsub = currentsub_ar[currentsub_ar_index]; // Get previous submenu from array and set as current submenu currentop = currentop_ar[currentsub_ar_index]; // Get last selected option from array and set as current selected option - + currentsub_ar[currentsub_ar_index] = -2; currentop_ar[currentsub_ar_index] = -2; @@ -639,7 +638,9 @@ void Menu::SetSub_previous() Game::Sound::PlayFrontend_default("BACK"); // Play sound *currentopATM = currentop; + } + void Menu::SetSub_new(INT sub_index) { currentsub_ar_index++; //Increment array index @@ -653,7 +654,10 @@ void Menu::SetSub_new(INT sub_index) totalop = 0; // Reset total number of options var" *currentopATM = currentop; //SetSub_new complete + } + + void Menu::SetSub_closed() { //Game::RequestScript("cellphone_controller"); @@ -840,8 +844,13 @@ void Menu::sub_handler() { submenu_switch(); - if (Menu::currentop > Menu::printingop) { Menu::currentop = Menu::printingop + 1; Menu::Up(false); } - else if (Menu::currentop < 1) { Menu::currentop = 0; Menu::Down(false); } + //Does anyone know what the below does? Caused shit when trying to navigate back and retain menu position - IJC + + if (Menu::currentsub != SUB::MODSHOP) + { + if (Menu::currentop > Menu::printingop) { Menu::currentop = Menu::printingop + 1; Menu::Up(false); } + else if (Menu::currentop < 1) { Menu::currentop = 0; Menu::Down(false); } + } //// These czechs is kill //if (currentop < 1) currentop = 1; diff --git a/Solution/source/Natives/natives.h b/Solution/source/Natives/natives.h index c82b0ecb..2ae44f15 100644 --- a/Solution/source/Natives/natives.h +++ b/Solution/source/Natives/natives.h @@ -357,6 +357,7 @@ namespace ENTITY static void SET_ENTITY_LOAD_COLLISION_FLAG(Entity entity, BOOL toggle) { invoke(0x0DC7CABAB1E9B67E, entity, toggle); } // 0x0DC7CABAB1E9B67E 0xC52F295B static BOOL HAS_COLLISION_LOADED_AROUND_ENTITY(Entity entity) { return invoke(0xE9676F61BC0B3321, entity); } // 0xE9676F61BC0B3321 0x851687F9 static void SET_ENTITY_MAX_SPEED(Entity entity, float speed) { invoke(0x0E46A3FCBDE2A1B1, entity, speed); } // 0x0E46A3FCBDE2A1B1 0x46AFFED3 + static void SET_VEHICLE_MAX_SPEED(Vehicle vehicle, float speed) { invoke(0xBAA045B4E42F3C06, vehicle, speed); } // 0xBAA045B4E42F3C06 b1103 static void SET_ENTITY_ONLY_DAMAGED_BY_PLAYER(Entity entity, BOOL toggle) { invoke(0x79F020FF9EDC0748, entity, toggle); } // 0x79F020FF9EDC0748 0x4B707F50 static void SET_ENTITY_ONLY_DAMAGED_BY_RELATIONSHIP_GROUP(Entity entity, BOOL p1, Any p2) { invoke(0x7022BD828FA0B082, entity, p1, p2); } // 0x7022BD828FA0B082 0x202237E2 static void SET_ENTITY_PROOFS(Entity entity, BOOL bulletProof, BOOL fireProof, BOOL explosionProof, BOOL collisionProof, BOOL meleeProof, BOOL p6, BOOL p7, BOOL drownProof) { invoke(0xFAEE099C6F890BB8, entity, bulletProof, fireProof, explosionProof, collisionProof, meleeProof, p6, p7, drownProof); } // 0xFAEE099C6F890BB8 0x7E9EAB66 @@ -1208,6 +1209,8 @@ namespace VEHICLE static void SET_RENDER_TRAIN_AS_DERAILED(Vehicle train, BOOL toggle) { invoke(0x317B11A312DF5534, train, toggle); } // 0x317B11A312DF5534 0x899D9092 static void SET_VEHICLE_EXTRA_COLOURS(Vehicle vehicle, int pearlescentColor, int wheelColor) { invoke(0x2036F561ADD12E33, vehicle, pearlescentColor, wheelColor); } // 0x2036F561ADD12E33 0x515DB2A0 static void GET_VEHICLE_EXTRA_COLOURS(Vehicle vehicle, int* pearlescentColor, int* wheelColor) { invoke(0x3BC4245933A166F7, vehicle, pearlescentColor, wheelColor); } // 0x3BC4245933A166F7 0x80E4659B + static void GET_VEHICLE_EXTRA_COLOUR_5(Vehicle vehicle, int* color) { invoke(0x7D1464D472D32136, vehicle, color); }// 0x7D1464D472D32136 b505 + static void GET_VEHICLE_EXTRA_COLOUR_6(Vehicle vehicle, int* color) { invoke(0xB7635E80A5C31BFF, vehicle, color); }// 0xB7635E80A5C31BFF b505 static void STOP_ALL_GARAGE_ACTIVITY() { invoke(0x0F87E938BDF29D66); } // 0x0F87E938BDF29D66 0x17A0BCE5 static void SET_VEHICLE_FIXED(Vehicle vehicle) { invoke(0x115722B1B9C14C1C, vehicle); } // 0x115722B1B9C14C1C 0x17469AA1 static void SET_VEHICLE_DEFORMATION_FIXED(Vehicle vehicle) { invoke(0x953DA1E1B12C0491, vehicle); } // 0x953DA1E1B12C0491 0xDD2920C8 @@ -1230,6 +1233,9 @@ namespace VEHICLE static void RAISE_CONVERTIBLE_ROOF(Vehicle vehicle, BOOL instantlyRaise) { invoke(0x8F5FB35D7E88FC70, vehicle, instantlyRaise); } // 0x8F5FB35D7E88FC70 0xA4E4CBA3 static int GET_CONVERTIBLE_ROOF_STATE(Vehicle vehicle) { return invoke(0xF8C397922FC03F41, vehicle); } // 0xF8C397922FC03F41 0x1B09714D static BOOL IS_VEHICLE_A_CONVERTIBLE(Vehicle vehicle, BOOL p1) { return invoke(0x52F357A30698BCCE, vehicle, p1); } // 0x52F357A30698BCCE 0x6EF54490 + static BOOL TRANSFORM_TO_SUBMARINE(Vehicle vehicle, BOOL noAnimation) { return invoke(0xBE4C854FFDB6EEBE, vehicle, noAnimation); } // 0x52F357A30698BCCE 0x6EF54490 + static void TRANSFORM_TO_CAR(Vehicle vehicle, BOOL noAnimation) { invoke(0x2A69FFD1B42BFF9E, vehicle, noAnimation); } // 0x2A69FFD1B42BFF9E 0xD8B90941 b1290 + static BOOL IS_VEHICLE_IN_SUBMARINE_MODE(Vehicle vehicle) { return invoke(0xA77DC70BD689A1E5, vehicle); } // 0xA77DC70BD689A1E5 0xE2FF06DB b1290 static BOOL IS_VEHICLE_STOPPED_AT_TRAFFIC_LIGHTS(Vehicle vehicle) { return invoke(0x2959F696AE390A99, vehicle); } // 0x2959F696AE390A99 0x69200FA4 static void SET_VEHICLE_DAMAGE(Vehicle vehicle, float xOffset, float yOffset, float zOffset, float damage, float radius, BOOL p6) { invoke(0xA1DD317EA8FD4F29, vehicle, xOffset, yOffset, zOffset, damage, radius, p6); } // 0xA1DD317EA8FD4F29 0x21B458B2 static float GET_VEHICLE_ENGINE_HEALTH(Vehicle vehicle) { return invoke(0xC45D23BAF168AAB8, vehicle); } // 0xC45D23BAF168AAB8 0x8880038A @@ -1251,6 +1257,9 @@ namespace VEHICLE static void SET_VEHICLE_LIVERY(Vehicle vehicle, int livery) { invoke(0x60BF608F1B8CD1B6, vehicle, livery); } // 0x60BF608F1B8CD1B6 0x7AD87059 static int GET_VEHICLE_LIVERY(Vehicle vehicle) { return invoke(0x2BB9230590DA5E8A, vehicle); } // 0x2BB9230590DA5E8A 0xEC82A51D static int GET_VEHICLE_LIVERY_COUNT(Vehicle vehicle) { return invoke(0x87B63E25A529D526, vehicle); } // 0x87B63E25A529D526 0xFB0CA947 + static void SET_VEHICLE_LIVERY2(Vehicle vehicle, int livery) { invoke(0xA6D3A8750DC73270, vehicle, livery); } // 0xA6D3A8750DC73270 b505 + static int GET_VEHICLE_LIVERY2(Vehicle vehicle) { return invoke(0x60190048C0764A26, vehicle); } // 0x60190048C0764A26 b505 + static int GET_VEHICLE_LIVERY2_COUNT(Vehicle vehicle) { return invoke(0x5ECB40269053C0D4, vehicle); } // 0x5ECB40269053C0D4 b505 static BOOL IS_VEHICLE_WINDOW_INTACT(Vehicle vehicle, int windowIndex) { return invoke(0x46E571A0E20D01F1, vehicle, windowIndex); } // 0x46E571A0E20D01F1 0xAC4EF23D static BOOL ARE_ALL_VEHICLE_WINDOWS_INTACT(Vehicle vehicle) { return invoke(0x11D862A3E977A9EF, vehicle); } // 0x11D862A3E977A9EF 0xBB619744 static BOOL _IS_ANY_VEHICLE_SEAT_EMPTY(Vehicle vehicle) { return invoke(0x2D34FC3BC4ADB780, vehicle); } // 0x2D34FC3BC4ADB780 0x648E685A diff --git a/Solution/source/Scripting/GTAentity.cpp b/Solution/source/Scripting/GTAentity.cpp index 474158a9..9de12eb4 100644 --- a/Solution/source/Scripting/GTAentity.cpp +++ b/Solution/source/Scripting/GTAentity.cpp @@ -357,7 +357,8 @@ float GTAentity::Speed_get() const } void GTAentity::MaxSpeed_set(float value) { - SET_ENTITY_MAX_SPEED(this->mHandle, value); + //SET_ENTITY_MAX_SPEED(this->mHandle, value); + SET_VEHICLE_MAX_SPEED(this->mHandle, value); } Vector3 GTAentity::SpeedVector_get(bool relative) { @@ -521,7 +522,7 @@ Vector3 GTAentity::GetOffsetFromBoneInWorldCoords(int boneIndex, const Vector3& } Vector3 GTAentity::GetOffsetFromBoneInWorldCoords(const std::string& boneLabel, const Vector3& offset) const { - return this->GetOffsetFromBoneInWorldCoords(this->GetBoneIndex(boneLabel), offset); + this->GetOffsetFromBoneInWorldCoords(this->GetBoneIndex(boneLabel), offset); } bool GTAentity::HasBone(const std::string& boneLabel) const { diff --git a/Solution/source/Scripting/GTAvehicle.cpp b/Solution/source/Scripting/GTAvehicle.cpp index 50e517d5..a055d52d 100644 --- a/Solution/source/Scripting/GTAvehicle.cpp +++ b/Solution/source/Scripting/GTAvehicle.cpp @@ -656,7 +656,10 @@ void GTAvehicle::PaintFade_set(float value) VehicleRoofState GTAvehicle::RoofState_get() const { - return static_cast(GET_CONVERTIBLE_ROOF_STATE(this->mHandle)); + if (_IS_THIS_MODEL_AN_AMPHIBIOUS_CAR(this->mHandle)) + return static_cast(1); + else + return static_cast(GET_CONVERTIBLE_ROOF_STATE(this->mHandle)); } void GTAvehicle::RoofState_set(VehicleRoofState value) { diff --git a/Solution/source/Submenus/VehicleModShop.cpp b/Solution/source/Submenus/VehicleModShop.cpp index 56fb0678..4b783653 100644 --- a/Solution/source/Submenus/VehicleModShop.cpp +++ b/Solution/source/Submenus/VehicleModShop.cpp @@ -559,12 +559,12 @@ namespace sub float paintFade = _GET_VEHICLE_PAINT_FADE(Static_12); float dirtLevel = GET_VEHICLE_DIRT_LEVEL(Static_12); - float carvarcol = GET_VEHICLE_COLOUR_COMBINATION(Static_12)+1; + float carvarcol = GET_VEHICLE_COLOUR_COMBINATION(Static_12) + 1; bool set_mspaints_index_4 = 0, set_mspaints_index_3 = 0, set_mspaints_index_5 = 0, set_mspaints_index_6 = 0, paintFade_plus = 0, paintFade_minus = 0, dirtLevel_plus = 0, dirtLevel_minus = 0, - carvarcol_plus = 0, carvarcol_minus = 0; + carvarcol_plus = 0, carvarcol_minus = 0, carvarcol_input = 0, getpaint = true; menuselect = true; @@ -581,7 +581,7 @@ namespace sub AddBreak("---Collateral---"); AddNumber("Paint Fade", paintFade, 2, null, paintFade_plus, paintFade_minus); AddNumber("Dirt Level", dirtLevel, 2, null, dirtLevel_plus, dirtLevel_minus); - AddNumber("CarVariation Colours", carvarcol, 0, null, carvarcol_plus, carvarcol_minus); + AddNumber("CarVariation Colours", carvarcol, 0, carvarcol_input, carvarcol_plus, carvarcol_minus); if (firsttime) { @@ -644,18 +644,47 @@ namespace sub SET_VEHICLE_DIRT_LEVEL(Static_12, dirtLevel); } } + if (carvarcol_input) { + std::string inputStr = Game::InputBox("", 4, "Enter a CarVariation index:", std::to_string(carvarcol)); + if (inputStr.length() > 0) + { + try + { + carvarcol = stoi(inputStr); + SET_VEHICLE_COLOUR_COMBINATION(Static_12, carvarcol - 1); + if (_globalLSC_Customs) + { + lastpaint = getpaintCarUsing_index(Static_12, ms_curr_paint_index); + lastpearl = getpaintCarUsing_index(Static_12, 3); + } + } + catch (...) + { + Game::Print::PrintError_InvalidInput(); + } + } + return; + //OnscreenKeyboard::State::Set(OnscreenKeyboard::Purpose::CustomsPaintIndex, std::string(), 3U, "Enter a paint index:", std::to_string(paintIndex)); + //OnscreenKeyboard::State::arg1._int = Static_12; + //OnscreenKeyboard::State::arg2._int = paintIndex; + } if (carvarcol_plus) { if (carvarcol < GET_NUMBER_OF_VEHICLE_COLOURS(Static_12)) { carvarcol += 1; - SET_VEHICLE_COLOUR_COMBINATION(Static_12, carvarcol-1); + SET_VEHICLE_COLOUR_COMBINATION(Static_12, carvarcol - 1); } else { carvarcol = 1; - SET_VEHICLE_COLOUR_COMBINATION(Static_12, carvarcol-1); + SET_VEHICLE_COLOUR_COMBINATION(Static_12, carvarcol - 1); + } + if (_globalLSC_Customs) + { + lastpaint = getpaintCarUsing_index(Static_12, ms_curr_paint_index); + lastpearl = getpaintCarUsing_index(Static_12, 3); } } if (carvarcol_minus) @@ -663,14 +692,34 @@ namespace sub if (carvarcol > 1) { carvarcol -= 1; - SET_VEHICLE_COLOUR_COMBINATION(Static_12, carvarcol-1); + SET_VEHICLE_COLOUR_COMBINATION(Static_12, carvarcol - 1); } else { carvarcol = GET_NUMBER_OF_VEHICLE_COLOURS(Static_12); - SET_VEHICLE_COLOUR_COMBINATION(Static_12, carvarcol-1); + SET_VEHICLE_COLOUR_COMBINATION(Static_12, carvarcol - 1); + } + if (_globalLSC_Customs) + { + lastpaint = getpaintCarUsing_index(Static_12, ms_curr_paint_index); + lastpearl = getpaintCarUsing_index(Static_12, 3); } } + + /*if (MenuPressTimer::IsButtonTapped(MenuPressTimer::Button::Back)) + { + //getpaint = true; + menuselect = false; + if (IS_ENTITY_A_VEHICLE(Static_12) || ms_curr_paint_index == 10 || ms_curr_paint_index == 11) + paintCarUsing_index(Static_12, ms_curr_paint_index, lastpaint, lastpearl); + if (iscustompaint) + { + if (ms_curr_paint_index == 1) + SET_VEHICLE_CUSTOM_PRIMARY_COLOUR(Static_12, lastr, lastg, lastb); + else if (ms_curr_paint_index == 2) + SET_VEHICLE_CUSTOM_SECONDARY_COLOUR(Static_12, lastr, lastg, lastb); + } + }*/ } void MSPaints2_() { @@ -823,6 +872,7 @@ namespace sub //OnscreenKeyboard::State::arg1._int = Static_12; //OnscreenKeyboard::State::arg2._int = paintIndex; } + if (copypaint) { paintCarUsing_index(Static_12, 3 - ms_curr_paint_index, getpaintCarUsing_index(Static_12, ms_curr_paint_index), -1); @@ -1174,7 +1224,7 @@ namespace sub switch (*Menu::currentopATM) { - case 1:case 2:case 3: + case 2:case 3:case 4: Add_preset_colour_options_previews(ms_paints_rgb_r, ms_paints_rgb_g, ms_paints_rgb_b); break; } @@ -1209,9 +1259,12 @@ namespace sub { int newVal = abs(stoi(inputStr)); if (newVal < 0 || newVal > 255) - throw; - ms_paints_rgb_r = newVal; - rgb_mode_set_carcol(Static_12, ms_paints_rgb_r, ms_paints_rgb_g, ms_paints_rgb_b, ms_paints_rgb_a); + Game::Print::PrintError_InvalidInput(); + else + { + ms_paints_rgb_r = newVal; + rgb_mode_set_carcol(Static_12, ms_paints_rgb_r, ms_paints_rgb_g, ms_paints_rgb_b, ms_paints_rgb_a); + } } catch (...) { @@ -1244,9 +1297,12 @@ namespace sub { int newVal = abs(stoi(inputStr)); if (newVal < 0 || newVal > 255) - throw; - ms_paints_rgb_g = newVal; - rgb_mode_set_carcol(Static_12, ms_paints_rgb_r, ms_paints_rgb_g, ms_paints_rgb_b, ms_paints_rgb_a); + Game::Print::PrintError_InvalidInput(); + else + { + ms_paints_rgb_g = newVal; + rgb_mode_set_carcol(Static_12, ms_paints_rgb_r, ms_paints_rgb_g, ms_paints_rgb_b, ms_paints_rgb_a); + } } catch (...) { @@ -1279,9 +1335,12 @@ namespace sub { int newVal = abs(stoi(inputStr)); if (newVal < 0 || newVal > 255) - throw; - ms_paints_rgb_b = newVal; - rgb_mode_set_carcol(Static_12, ms_paints_rgb_r, ms_paints_rgb_g, ms_paints_rgb_b, ms_paints_rgb_a); + Game::Print::PrintError_InvalidInput(); + else + { + ms_paints_rgb_b = newVal; + rgb_mode_set_carcol(Static_12, ms_paints_rgb_r, ms_paints_rgb_g, ms_paints_rgb_b, ms_paints_rgb_a); + } } catch (...) { @@ -1314,9 +1373,12 @@ namespace sub { int newVal = abs(stoi(inputStr)); if (newVal < 0 || newVal > 255) - throw; - ms_paints_rgb_a = newVal; - rgb_mode_set_carcol(Static_12, ms_paints_rgb_r, ms_paints_rgb_g, ms_paints_rgb_b, ms_paints_rgb_a); + Game::Print::PrintError_InvalidInput(); + else + { + ms_paints_rgb_a = newVal; + rgb_mode_set_carcol(Static_12, ms_paints_rgb_r, ms_paints_rgb_g, ms_paints_rgb_b, ms_paints_rgb_a); + } } catch (...) { @@ -1589,6 +1651,8 @@ namespace sub ms_exh_minus = 0, ms_livery_plus = 0, ms_livery_minus = 0, + ms_livery2_plus = 0, + ms_livery2_minus = 0, ms_turbo_toggle = 0, ms_light_int_1 = 0, ms_light_int_plus = 0, @@ -1623,7 +1687,8 @@ namespace sub ms_brakes = GET_VEHICLE_MOD(Static_12, 12) + 1, ms_susp = GET_VEHICLE_MOD(Static_12, 15) + 1, ms_exh = GET_VEHICLE_MOD(Static_12, 4) + 1, - ms_livery = GET_VEHICLE_LIVERY(Static_12) + 1; + ms_livery = GET_VEHICLE_LIVERY(Static_12) + 1, + ms_livery2 = GET_VEHICLE_LIVERY2(Static_12) + 1; auto rpmMultVal = 1.0f; auto& rpmMultIt = g_multList_rpm.find(vehicle.Handle()); @@ -1720,7 +1785,9 @@ namespace sub AddOption(Game::GetGXTEntry("CMOD_COL0_3", "Emblem"), null, nullFunc, SUB::MS_EMBLEM, true, false); // Crew Emblems CMOD_COL0_3 AddOption(Game::GetGXTEntry("CMOD_MOD_GLD2", "Extras"), SubMS_Extra, nullFunc, -1, true, false); // Extras CMOD_MOD_GLD2 if (GET_VEHICLE_LIVERY_COUNT(Static_12) > 0) - AddNumber(Game::GetGXTEntry("CMOD_COL0_4", "Livery"), ms_livery, 0, null, ms_livery_plus, ms_livery_minus); + AddNumber(Game::GetGXTEntry("CMOD_COL0_4", "Livery"), ms_livery, 0, null, ms_livery_plus, ms_livery_minus); + if (GET_VEHICLE_LIVERY2_COUNT(Static_12) > 0) + AddNumber(Game::GetGXTEntry("Roof Livery", "Roof Livery"), ms_livery2, 0, null, ms_livery2_plus, ms_livery2_minus); AddLocal(Game::GetGXTEntry("CMOD_MOD_TUR", "Turbo"), IS_TOGGLE_MOD_ON(Static_12, VehicleMod::Turbo), ms_turbo_toggle, ms_turbo_toggle); // Turbo AddLocal(Game::GetGXTEntry("CMOD_LGT_1", "Xenon Lights"), IS_TOGGLE_MOD_ON(Static_12, VehicleMod::XenonHeadlights), ms_lights_toggle, ms_lights_toggle); // Xenon lights AddLocal("Lower Suspension", lowersuspension, MSLowerSuspension_, MSLowerSuspension_, true); // Tuners Lower Suspension @@ -1985,6 +2052,17 @@ namespace sub return; } + if (ms_livery2_plus) { + if (ms_livery2 < GET_VEHICLE_LIVERY2_COUNT(Static_12)) ms_livery2++; + SET_VEHICLE_LIVERY2(Static_12, ms_livery2 - 1); + return; + } + if (ms_livery2_minus) { + if (ms_livery2 > 1) ms_livery2--; + SET_VEHICLE_LIVERY2(Static_12, ms_livery2 - 1); + return; + } + if (ms_lights_toggle) { if (IS_TOGGLE_MOD_ON(Static_12, 22)) TOGGLE_VEHICLE_MOD(Static_12, 22, 0); else TOGGLE_VEHICLE_MOD(Static_12, 22, 1); @@ -2831,6 +2909,7 @@ namespace sub __AddOption(get_mod_text_label(Static_12, VehicleMod::FrontWheels, i, false), Static_12, wtype, i, chrtype == 2); } } + if(_globalLSC_Customs) if (MenuPressTimer::IsButtonTapped(MenuPressTimer::Button::Back)) // this has been split out for bikes, see further comments on the original section below (line 2575) { setwheel = false; diff --git a/Solution/source/Submenus/VehicleOptions.cpp b/Solution/source/Submenus/VehicleOptions.cpp index 574be55a..337d6748 100644 --- a/Solution/source/Submenus/VehicleOptions.cpp +++ b/Solution/source/Submenus/VehicleOptions.cpp @@ -130,7 +130,7 @@ namespace sub Model& myVehicleModel = myVehicle.Model(); static int __VechicleOpsFixCar_texterVal = 0; - static std::vector __VechicleOpsFixCar_texter{ "Full", "Keep windows open" }; + static std::vector __VechicleOpsFixCar_texter{ "Full", "Keep Dirt", "Keep windows open", "Keep windows open with Dirt"}; auto& fixCarTexterVal = __VechicleOpsFixCar_texterVal; auto& fixCarTexter = __VechicleOpsFixCar_texter; bool bFixCar_plus = false, bFixCar_minus = false; @@ -273,7 +273,7 @@ namespace sub else { std::vector windowsToOpen; - if (fixCarTexterVal == 1) + if (fixCarTexterVal == 1 || fixCarTexterVal == 3) { for (int i = (int)VehicleWindow::FrontLeftWindow; i < (int)VehicleWindow::Last; i++) { @@ -282,9 +282,11 @@ namespace sub } } + myVehicle.RequestControlOnce(); SET_VEHICLE_FIXED(g_myVeh); - SET_VEHICLE_DIRT_LEVEL(g_myVeh, 0.0f); + if(fixCarTexterVal == 0 || fixCarTexterVal == 2) + SET_VEHICLE_DIRT_LEVEL(g_myVeh, 0.0f); SET_VEHICLE_ENGINE_CAN_DEGRADE(g_myVeh, 0); SET_VEHICLE_ENGINE_HEALTH(g_myVeh, 1250.0f); SET_VEHICLE_PETROL_TANK_HEALTH(g_myVeh, 1250.0f); @@ -293,7 +295,7 @@ namespace sub if (!GET_IS_VEHICLE_ENGINE_RUNNING(g_myVeh)) SET_VEHICLE_ENGINE_ON(g_myVeh, 1, 1); - if (fixCarTexterVal == 1) + if (fixCarTexterVal == 1 || fixCarTexterVal == 3) { for (auto& i : windowsToOpen) { diff --git a/Solution/source/Submenus/VehicleSpawner.cpp b/Solution/source/Submenus/VehicleSpawner.cpp index f7e4c6b1..934d56df 100644 --- a/Solution/source/Submenus/VehicleSpawner.cpp +++ b/Solution/source/Submenus/VehicleSpawner.cpp @@ -199,6 +199,7 @@ namespace sub //} SET_VEHICLE_IS_STOLEN(newcar, false); } + return newcar; } @@ -1876,7 +1877,6 @@ namespace sub g_multList_headlights[ev.Handle()] = nodeVehicleHeadlightIntensity.text().as_float(); } - int opacityLevel = nodeVehicle.child("OpacityLevel").text().as_int(); if (opacityLevel < 255) ev.Alpha_set(opacityLevel); ev.LodDistance_set(nodeVehicle.child("LodDistance").text().as_int()); @@ -2017,6 +2017,32 @@ namespace sub Game::Print::PrintBottomLeft(ss); } + int saveCarVars(GTAvehicle vehicle) + { + std::ofstream outfile; + Model& eModel = vehicle.Model(); + std::string spawnname = GET_DISPLAY_NAME_FROM_VEHICLE_MODEL(eModel.hash); + int color1 = vehicle.PrimaryColour_get(), + color2 = vehicle.SecondaryColour_get(), + color3 = vehicle.PearlescentColour_get(), + color4 = vehicle.RimColour_get(), + color5 = vehicle.InteriorColour_get(), + color6 = vehicle.DashboardColour_get(); + + + outfile.open(dict3 + "\\Carvar colours.txt", std::ios_base::app); // append instead of overwrite + outfile << spawnname << "\n"; + outfile << std::to_string(color1) << "\n"; + outfile << std::to_string(color2) << "\n"; + outfile << std::to_string(color3) << "\n"; + outfile << std::to_string(color4) << "\n"; + outfile << std::to_string(color5) << "\n"; + outfile << std::to_string(color6) << "\n"; + outfile << "\n"; + Game::Print::PrintBottomLeft("Saved Vehicle Carvariations"); + return 0; + } + void Sub_VehSaver() { auto& _searchStr = dict2; @@ -2027,7 +2053,7 @@ namespace sub auto vehicle = GET_VEHICLE_PED_IS_USING(ped); bool isPedInVeh = IS_PED_IN_ANY_VEHICLE(ped, 0) || IS_PED_SITTING_IN_ANY_VEHICLE(ped); - bool save2 = false, bCreateFolderPressed = false; + bool save2 = false, bCreateFolderPressed = false, savecarvar = false; std::vector vfilnames; AddTitle("Saved Vehicles"); @@ -2045,6 +2071,8 @@ namespace sub AddOption("Save Current Vehicle", save2); + //AddOption("Store CarVariations", savecarvar); + AddOption("Create New Folder", bCreateFolderPressed); //get_all_filenames_with_extension(GetPathffA(Pathff::Vehicle, false), ".xml", vfilnames, false); @@ -2135,6 +2163,12 @@ namespace sub } } + if (savecarvar) + { + if (isPedInVeh) + saveCarVars(vehicle); + } + if (bCreateFolderPressed) { std::string inputStr = Game::InputBox("", 28U, "Enter folder name:"); diff --git a/Solution/source/Submenus/VehicleSpawner.h b/Solution/source/Submenus/VehicleSpawner.h index b7834408..1360e3cb 100644 --- a/Solution/source/Submenus/VehicleSpawner.h +++ b/Solution/source/Submenus/VehicleSpawner.h @@ -71,6 +71,7 @@ namespace sub void Sub_VehSaver(); void Sub_VehSaver_InItem(); + int saveCarVars(); } diff --git a/Solution/source/macros.h b/Solution/source/macros.h index b29d7876..2e1d44a5 100644 --- a/Solution/source/macros.h +++ b/Solution/source/macros.h @@ -16,7 +16,7 @@ #define _CRT_SECURE_NO_WARNINGS // version -#define MENYOO_CURRENT_VER_ "1.7.2" +#define MENYOO_CURRENT_VER_ "1.7.3" #define GAME_PLAYERCOUNT 30 diff --git a/Solution/source/main.h b/Solution/source/main.h index 9f1397ee..b8f1f84b 100644 --- a/Solution/source/main.h +++ b/Solution/source/main.h @@ -221,7 +221,7 @@ enum eGameVersion : int VER_1_0_1868_1_STEAM, VER_1_0_1868_1_NOSTEAM, - VER_1_0_1868_4_EPIC, + VER_1_0_1868_4_EGS, VER_1_0_2060_0_STEAM, VER_1_0_2060_0_NOSTEAM, @@ -244,11 +244,8 @@ enum eGameVersion : int VER_1_0_2545_0_STEAM, VER_1_0_2545_0_NOSTEAM, - VER_1_0_2612_0_STEAM, - VER_1_0_2612_0_NOSTEAM, - - VER_1_0_2628_0_STEAM, - VER_1_0_2628_0_NOSTEAM, + VER_1_0_2612_1_STEAM, + VER_1_0_2612_1_NOSTEAM, VER_1_0_2628_2_STEAM, VER_1_0_2628_2_NOSTEAM, @@ -256,6 +253,11 @@ enum eGameVersion : int VER_1_0_2699_0_STEAM, VER_1_0_2699_0_NOSTEAM, + VER_1_0_2699_16, + + VER_1_0_2802_0, + + VER_SIZE, VER_UNK = -1 };