diff --git a/Solution/source/Menu/Menu.cpp b/Solution/source/Menu/Menu.cpp index cccfc867..7d68e3b3 100644 --- a/Solution/source/Menu/Menu.cpp +++ b/Solution/source/Menu/Menu.cpp @@ -160,7 +160,7 @@ std::pair menubindsGamepad = { INPUT_FRONTEND_RB, INPUT_FRONTEND UINT16 menubinds = VirtualKey::F8; UINT16 Menu::currentsub = 0, Menu::LOOCsub = SUB::MAINMENU; -INT Menu::currentop = 0, *Menu::currentopATM = ¤top; +INT Menu::currentop = 0, * Menu::currentopATM = ¤top; INT Menu::currentop_w_breaks = 0; INT Menu::totalop = 0; INT Menu::printingop = 0; @@ -392,8 +392,8 @@ void Menu::titlebox_draw() DRAW_SPRITE("shopui_title_supermod", "shopui_title_supermod", 0.16f + menuPos.x, 0.0989f + menuPos.y, 0.20f, 0.083f, 0.0f, 255, 255, 255, titlebox.A); break; case SUB::WEAPONOPS: case SUB::KABOOMGUN: case SUB::BULLETGUN: case SUB::OBJECTGUN: case SUB::PEDGUN: case SUB::WEAPONOPS_WEAPONFAVOURITES: case SUB::WEAPONOPS_INDIVS_CATEGORIES: case SUB::WEAPONOPS_INDIVS_CATEGORY: case SUB::WEAPONOPS_INDIVS_ITEM: case SUB::WEAPONOPS_INDIVS_ITEM_MODS: case SUB::WEAPONOPS_PARACHUTE: case SUB::WEAPONOPS_LOADOUTS: case SUB::WEAPONOPS_LOADOUTS_INITEM: case SUB::WEAPONOPS_LASERSIGHT: case SUB::FORGEGUN: case SUB::GRAVITYGUN: DRAW_SPRITE("shopui_title_gunclub", "shopui_title_gunclub", 0.16f + menuPos.x, 0.0989f + menuPos.y, 0.20f, 0.083f, 0.0f, 255, 255, 255, titlebox.A); break; - //case SUB::OBJECTSPAWNER_LIGHTINGOPS: case SUB::OBJECTSPAWNER_LIGHT: case SUB::OBJECTSPAWNER_SPOTLIGHT: - //DRAW_SPRITE("shopui_title_movie_masks", "shopui_title_movie_masks", 0.16f + menuPos.x, 0.0989f + menuPos.y, 0.20f, 0.083f, 0.0f, 255, 255, 255, titlebox.A); break; + //case SUB::OBJECTSPAWNER_LIGHTINGOPS: case SUB::OBJECTSPAWNER_LIGHT: case SUB::OBJECTSPAWNER_SPOTLIGHT: + //DRAW_SPRITE("shopui_title_movie_masks", "shopui_title_movie_masks", 0.16f + menuPos.x, 0.0989f + menuPos.y, 0.20f, 0.083f, 0.0f, 255, 255, 255, titlebox.A); break; case SUB::SPAWNVEHICLE: case SUB::SPAWNVEHICLE_OPTIONS: case SUB::SPAWNVEHICLE_ALLCATS: case SUB::SPAWNVEHICLE_FAVOURITES: case SUB::FUNNYVEHICLES: case SUB::VEHICLE_SAVER: case SUB::VEHICLE_SAVER_INITEM: DRAW_SPRITE("shopui_title_carmod2", "shopui_title_carmod2", 0.16f + menuPos.x, 0.0989f + menuPos.y, 0.20f, 0.083f, 0.0f, 255, 255, 255, titlebox.A); break; case SUB::ANIMATIONSUB: case SUB::ANIMATIONSUB_DEER: case SUB::ANIMATIONSUB_GESTSIT: case SUB::ANIMATIONSUB_GUARDREAC: case SUB::ANIMATIONSUB_MISSRAPPEL: case SUB::ANIMATIONSUB_RANDARREST: case SUB::ANIMATIONSUB_SHARK: case SUB::ANIMATIONSUB_SWAT: case SUB::ANIMATIONSUB_CUSTOM: case SUB::ANIMATIONSUB_SETTINGS: case SUB::ANIMATIONSUB_TASKSCENARIOS: case SUB::ANIMATIONSUB_TASKSCENARIOS2: case SUB::MOVEMENTGROUP: @@ -433,7 +433,7 @@ void Menu::background() // Draw background - if (gradients && BG.R < 20 && BG.G < 20 && BG.B< 20) DRAW_SPRITE("CommonMenu", "Gradient_Bgd", 0.16f + menuPos.x, bg_Y + menuPos.y, 0.20f, bg_length, 0.0f, 255, 255, 255, BG.A); + if (gradients && BG.R < 20 && BG.G < 20 && BG.B < 20) DRAW_SPRITE("CommonMenu", "Gradient_Bgd", 0.16f + menuPos.x, bg_Y + menuPos.y, 0.20f, bg_length, 0.0f, 255, 255, 255, BG.A); else DRAW_RECT(0.16f + menuPos.x, bg_Y + menuPos.y, 0.20f, bg_length, BG.R, BG.G, BG.B, BG.A); // Draw scroller indicator rect @@ -590,6 +590,8 @@ void Menu::while_opened() { SetSub_closed(); } + + } void Menu::Up(bool playSound) { @@ -640,7 +642,7 @@ void Menu::SetSub_previous() } void Menu::SetSub_new(INT sub_index) { - currentsub_ar_index++; // Increment array index + currentsub_ar_index++; //Increment array index currentsub_ar[currentsub_ar_index] = currentsub; // Store current submenu index in array currentsub = sub_index; // Set new submenu as current submenu @@ -648,9 +650,9 @@ void Menu::SetSub_new(INT sub_index) currentop = 1; currentop_w_breaks = 1; // Set new selected option as first option in submenu printingop = 0; // Reset currently printing option var - totalop = 0;// Reset total number of options var + totalop = 0; // Reset total number of options var" - *currentopATM = currentop; + *currentopATM = currentop; //SetSub_new complete } void Menu::SetSub_closed() { @@ -1029,9 +1031,9 @@ Vector2 MouseSupport::GetSafezoneBounds() int screenw, screenh; _GET_SCREEN_ACTIVE_RESOLUTION(&screenw, &screenh); float ratio = (float)screenw / screenh; - float wmp = ratio*hmp; + float wmp = ratio * hmp; - return Vector2(round(g*wmp) / 1920, round(g*hmp) / 1080); + return Vector2(round(g * wmp) / 1920, round(g * hmp) / 1080); } Vector2 MouseSupport::MousePosition() @@ -1155,7 +1157,7 @@ void AddTitle(const std::string& text) Game::Print::drawstringGXT(text, OptionY + menuPos.x, 0.1f + offset + menuPos.y); } -void AddOption(std::string text, bool &option_code_bool, void(&callback)(), int submenu_index, bool show_arrow, bool gxt) +void AddOption(std::string text, bool& option_code_bool, void(&callback)(), int submenu_index, bool show_arrow, bool gxt) { char* tempChar; @@ -1171,7 +1173,7 @@ void AddOption(std::string text, bool &option_code_bool, void(&callback)(), int if (Menu::currentop >= GTA_SCROLLOP) { - if (Menu::currentop >(Menu::totalop - GTA_BETOP)) + if (Menu::currentop > (Menu::totalop - GTA_BETOP)) { OptionY = GTA_SCROLLOP + (GTA_BETOP - (Menu::totalop - Menu::printingop)); } @@ -1238,7 +1240,7 @@ void AddOption(std::string text, bool &option_code_bool, void(&callback)(), int else Game::Print::drawstring(text, 0.066f + menuPos.x, OptionY + menuPos.y); } } -inline void AddOption(std::ostream& os, bool &option_code_bool, void(&callback)(), int submenu_index, bool show_arrow, bool gxt) +inline void AddOption(std::ostream& os, bool& option_code_bool, void(&callback)(), int submenu_index, bool show_arrow, bool gxt) { AddOption(dynamic_cast(os).str(), option_code_bool, callback, submenu_index, show_arrow, gxt); } @@ -1300,7 +1302,7 @@ void OptionStatus(BOOL status) } } -void AddToggle(const std::string& text, bool &loop_variable, bool &extra_option_code_ON, bool &extra_option_code_OFF, bool gxt) +void AddToggle(const std::string& text, bool& loop_variable, bool& extra_option_code_ON, bool& extra_option_code_OFF, bool gxt) { null = 0; AddOption(text, null, nullFunc, -1, false, gxt); @@ -1313,7 +1315,7 @@ void AddToggle(const std::string& text, bool &loop_variable, bool &extra_option_ OptionStatus(loop_variable); // Display ON/OFF } -void AddToggle(const std::string& text, bool &loop_variable, void(&callback_ON)(), void(&callback_OFF)(), bool gxt) +void AddToggle(const std::string& text, bool& loop_variable, void(&callback_ON)(), void(&callback_OFF)(), bool gxt) { null = 0; AddOption(text, null, nullFunc, -1, false, gxt); @@ -1326,7 +1328,7 @@ void AddToggle(const std::string& text, bool &loop_variable, void(&callback_ON)( OptionStatus(loop_variable); // Display ON/OFF } -void AddLocal(const std::string& text, BOOL condition, bool &option_code_ON, bool &option_code_OFF, bool gxt) +void AddLocal(const std::string& text, BOOL condition, bool& option_code_ON, bool& option_code_OFF, bool gxt) { null = 0; AddOption(text, null, nullFunc, -1, false, gxt); @@ -1364,7 +1366,7 @@ void AddBreak(const std::string& text) if (Menu::currentop >= GTA_SCROLLOP) { - if (Menu::currentop >(Menu::totalop - GTA_BETOP)) + if (Menu::currentop > (Menu::totalop - GTA_BETOP)) { OptionY = GTA_SCROLLOP + (GTA_BETOP - (Menu::totalop - Menu::printingop)); } @@ -1416,7 +1418,7 @@ void AddBreak(const std::string& text) } } -void AddNumber(const std::string& text, float value, __int8 decimal_places, bool &A_PRESS, bool &RIGHT_PRESS, bool &LEFT_PRESS, bool gxt) +void AddNumber(const std::string& text, float value, __int8 decimal_places, bool& A_PRESS, bool& RIGHT_PRESS, bool& LEFT_PRESS, bool gxt) { null = 0; AddOption(text, null, nullFunc, -1, false, gxt); @@ -1482,7 +1484,7 @@ void draw_tickol_tick_BNW(const PCHAR textureDict, const PCHAR normal, const PCH } inline void draw_tickol_tick(TICKOL tickType) { - RGBA *colour = &optiontext; + RGBA* colour = &optiontext; if (Menu::printingop == *Menu::currentopATM) colour = &selectedtext; PCHAR textureDict, textureName; Vector3 texture_res; @@ -1554,7 +1556,7 @@ inline void draw_tickol_tick(TICKOL tickType) DRAW_SPRITE(textureDict, textureName, get_xcoord_at_menu_rightEdge(texture_res.x, 0.0f, true), OptionY + 0.016f + menuPos.y, texture_res.x, texture_res.y, 0.0f, colour->R, colour->G, colour->B, colour->A); } -void AddTickol(const std::string& text, BOOL condition, bool &option_code_ON, bool &option_code_OFF, TICKOL tickTrue, TICKOL tickFalse, bool gxt) +void AddTickol(const std::string& text, BOOL condition, bool& option_code_ON, bool& option_code_OFF, TICKOL tickTrue, TICKOL tickFalse, bool gxt) { null = 0; AddOption(text, null, nullFunc, -1, false, gxt); @@ -1601,7 +1603,7 @@ void AddTickol(const std::string& text, BOOL condition, void(&callback_ON)(), vo } } template -inline void AddTexter(const std::string& text, int selectedindex, const TA& textarray, bool &A_PRESS, bool &RIGHT_PRESS, bool &LEFT_PRESS, bool gxt) +inline void AddTexter(const std::string& text, int selectedindex, const TA& textarray, bool& A_PRESS, bool& RIGHT_PRESS, bool& LEFT_PRESS, bool gxt) { null = 0; AddOption(text, null, nullFunc, -1, false, gxt); @@ -1666,7 +1668,7 @@ inline void AddTexter(const std::string& text, int selectedindex, const TA& text } } -void AddTexter(const std::string& text, int selectedindex, const std::vector& textarray, bool &A_PRESS, bool &RIGHT_PRESS, bool &LEFT_PRESS, bool gxt) +void AddTexter(const std::string& text, int selectedindex, const std::vector& textarray, bool& A_PRESS, bool& RIGHT_PRESS, bool& LEFT_PRESS, bool gxt) { AddTexter>(text, selectedindex, textarray, A_PRESS, RIGHT_PRESS, LEFT_PRESS, gxt); } @@ -1728,4 +1730,3 @@ bool Add_preset_colour_options(INT& r, INT& g, INT& b) - diff --git a/Solution/source/Menu/MenuConfig.cpp b/Solution/source/Menu/MenuConfig.cpp index 40be92b0..946c1621 100644 --- a/Solution/source/Menu/MenuConfig.cpp +++ b/Solution/source/Menu/MenuConfig.cpp @@ -525,7 +525,7 @@ void MenuConfig::ConfigSave() ini.SetLongValue(section_haxValues, "vehicle_spawner_neons_B", _globalSpawnVehicle_neonCol.B); ini.SetLongValue(section_haxValues, "vehicle_spawner_primary_colour", _globalSpawnVehicle_PrimCol); ini.SetLongValue(section_haxValues, "vehicle_spawner_secondary_colour", _globalSpawnVehicle_SecCol); - ini.SetBoolValue(section_haxValues, "vehicle_spawner_delete_old", _globalLSC_Customs); + ini.SetBoolValue(section_haxValues, "vehicle_menyoo_customs_lsc", _globalLSC_Customs); ini.SetDoubleValue(section_haxValues, "clock", sub::Clock_catind::loop_clock); ini.SetDoubleValue(section_haxValues, "clock_screen_pos_x", sub::Clock_catind::_analogueClockPos.x); diff --git a/Solution/source/Natives/nativeCaller.h b/Solution/source/Natives/nativeCaller.h index d3abc9cc..d93f9c52 100644 --- a/Solution/source/Natives/nativeCaller.h +++ b/Solution/source/Natives/nativeCaller.h @@ -13,7 +13,7 @@ template static inline void nativePush(T value) { UINT64 val64 = 0; - //static_assert(sizeof(T) <= sizeof(UINT64), "error, value size > 64 bit"); + static_assert(sizeof(T) <= sizeof(UINT64), "error, value size > 64 bit"); *reinterpret_cast(&val64) = value; // &val + sizeof(dw) - sizeof(val) nativePush64(val64); } @@ -27,8 +27,8 @@ static inline void nativePush(T value) template static inline R invoke(UINT64 hash, TArgs... args) { - //static_assert(sizeof...(TArgs) <= 25, "Cannot push more than 25 Args to a native"); - //static_assert(sizeof(R) <= 24, "Natives cannot return data types larger than 24 bytes"); + static_assert(sizeof...(TArgs) <= 25, "Cannot push more than 25 Args to a native"); + static_assert(sizeof(R) <= 24, "Natives cannot return data types larger than 24 bytes"); nativeInit(hash); (nativePush(args), ...); return *reinterpret_cast(nativeCall()); @@ -37,7 +37,7 @@ static inline R invoke(UINT64 hash, TArgs... args) template inline R invoke(UINT64 hash) { - //static_assert(sizeof(R) <= 24, "Natives cannot return data types larger than 24 bytes"); + static_assert(sizeof(R) <= 24, "Natives cannot return data types larger than 24 bytes"); nativeInit(hash); return *reinterpret_cast(nativeCall()); } diff --git a/Solution/source/Natives/natives.h b/Solution/source/Natives/natives.h index 79f26189..c82b0ecb 100644 --- a/Solution/source/Natives/natives.h +++ b/Solution/source/Natives/natives.h @@ -653,7 +653,7 @@ namespace PED static Any _0xF033419D1B81FAE8(Any p0) { return invoke(0xF033419D1B81FAE8, p0); } // 0xF033419D1B81FAE8 static BOOL IS_PED_COMPONENT_VARIATION_VALID(Ped ped, int componentId, int drawableId, int textureId) { return invoke(0xE825F6B6CEA7671D, ped, componentId, drawableId, textureId); } // 0xE825F6B6CEA7671D 0x952ABD9A static void SET_PED_COMPONENT_VARIATION(Ped ped, int componentId, int drawableId, int textureId, int paletteId) { invoke(0x262B14F48D29DE80, ped, componentId, drawableId, textureId, paletteId); } // 0x262B14F48D29DE80 0xD4F7B05C - static void SET_PED_RANDOM_COMPONENT_VARIATION(Ped ped, BOOL p1) { invoke(0xC8A9481A01E63C28, ped, p1); } // 0xC8A9481A01E63C28 0x4111BA46 + //static void SET_PED_RANDOM_COMPONENT_VARIATION(Ped ped, BOOL p1) { invoke(0xC8A9481A01E63C28, ped, p1); } // 0xC8A9481A01E63C28 0x4111BA46 static void SET_PED_RANDOM_PROPS(Ped ped) { invoke(0xC44AA05345C992C6, ped); } // 0xC44AA05345C992C6 0xE3318E0E static void SET_PED_DEFAULT_COMPONENT_VARIATION(Ped ped) { invoke(0x45EEE61580806D63, ped); } // 0x45EEE61580806D63 0xC866A984 static void SET_PED_BLEND_FROM_PARENTS(Ped ped, Any p1, Any p2, float p3, float p4) { invoke(0x137BBD05230DB22D, ped, p1, p2, p3, p4); } // 0x137BBD05230DB22D 0x837BD370 @@ -5362,4 +5362,4 @@ namespace UNK3 static Any _NETWORK_SHOP_CASH_TRANSFER_SET_TELEMETRY_NONCE_SEED() { return invoke(0x498C1E05CE5F7877); } // 0x498C1E05CE5F7877 static BOOL _NETWORK_SHOP_SET_TELEMETRY_NONCE_SEED(Any p0) { return invoke(0x9507D4271988E1AE, p0); } // 0x9507D4271988E1AE static char* _GET_ONLINE_VERSION() { return invoke(0xFCA9373EF340AC0A); } // 0xFCA9373EF340AC0A -} +} \ No newline at end of file diff --git a/Solution/source/Natives/natives2.h b/Solution/source/Natives/natives2.h index 238d7a56..82f8be5f 100644 --- a/Solution/source/Natives/natives2.h +++ b/Solution/source/Natives/natives2.h @@ -74,14 +74,19 @@ Hash GET_HASH_KEY(const std::string& value); void add_text_component_long_string(const std::string& text); +namespace PED +{ + static void SET_PED_RANDOM_COMPONENT_VARIATION(Ped ped, bool p1) { invoke(0xC8A9481A01E63C28, ped, p1); } // 0xC8A9481A01E63C28 0x4111BA46 + +} namespace VEHICLE { // Interior colour - static void _0x7D1464D472D32136(Vehicle vehicle, int *interiorColour) { invoke(0x7D1464D472D32136, vehicle, interiorColour); } // 0x7D1464D472D32136 + static void _0x7D1464D472D32136(Vehicle vehicle, int* interiorColour) { invoke(0x7D1464D472D32136, vehicle, interiorColour); } // 0x7D1464D472D32136 static void _0xF40DD601A65F7F19(Vehicle vehicle, int interiorColour) { invoke(0xF40DD601A65F7F19, vehicle, interiorColour); } // 0xF40DD601A65F7F19 // Dashboard colour - static void _0xB7635E80A5C31BFF(Vehicle vehicle, int *dashboardColour) { invoke(0xB7635E80A5C31BFF, vehicle, dashboardColour); } // 0xB7635E80A5C31BFF + static void _0xB7635E80A5C31BFF(Vehicle vehicle, int* dashboardColour) { invoke(0xB7635E80A5C31BFF, vehicle, dashboardColour); } // 0xB7635E80A5C31BFF static void _0x6089CDF6A57F326C(Vehicle vehicle, int dashboardColour) { invoke(0x6089CDF6A57F326C, vehicle, dashboardColour); } // 0x6089CDF6A57F326C // Imp/Exp DLC @@ -106,4 +111,3 @@ namespace WEAPON } - diff --git a/Solution/source/Scripting/Model.cpp b/Solution/source/Scripting/Model.cpp index efeaa83b..c3e8ad39 100644 --- a/Solution/source/Scripting/Model.cpp +++ b/Solution/source/Scripting/Model.cpp @@ -283,13 +283,13 @@ namespace GTAmodel case VEHICLE_RIPLEY: case VEHICLE_PHANTOM: case VEHICLE_AMBULANCE: - case VEHICLE_TYRUS: + //case VEHICLE_TYRUS: case VEHICLE_CARGOPLANE: case VEHICLE_RIOT: case VEHICLE_BUS: case VEHICLE_AIRBUS: - case VEHICLE_TAMPA: - case VEHICLE_TROHPYTRUCK: + //case VEHICLE_TAMPA: + //case VEHICLE_TROHPYTRUCK: //why were these 3 vehicles included? case VEHICLE_CADDY3: return false; } diff --git a/Solution/source/Submenus/VehicleModShop.cpp b/Solution/source/Submenus/VehicleModShop.cpp index 7ce881c2..1e51d219 100644 --- a/Solution/source/Submenus/VehicleModShop.cpp +++ b/Solution/source/Submenus/VehicleModShop.cpp @@ -178,6 +178,11 @@ namespace sub }; INT paintIndex_maxValue = 0; + INT8 selectedpainttype; + INT8 lastwheeltype; + INT8 lastfwheel; + INT8 lastbwheel; + void GetAllPaintIDs() { firsttime = false; @@ -191,6 +196,7 @@ namespace sub if (GetTickCount64() > LoadMaxC) { Game::Print::PrintBottomCentre("Couldn't Load Model, returning"); + firsttime = true; break; } WAIT(0); @@ -221,6 +227,10 @@ namespace sub VEHICLE::GET_VEHICLE_COLOURS(veh, &colour, &second); colourname = VEHICLE::_0xB45085B721EFD38C(veh, 0); std::string colourid = std::to_string(i); + if (colour > paintIndex_maxValue) + paintIndex_maxValue = colour; + if (pearl > paintIndex_maxValue) + paintIndex_maxValue = pearl; // write to relevant vector, depending on painttype switch (painttype) @@ -302,11 +312,11 @@ namespace sub PAINTS_CHAMELEON[i].paint = colour; PAINTS_CHAMELEON[i].pearl = pearl; break; - } - paintIndex_maxValue++; + } + } } - + painttype = null; //unloading test vehicle from memory ENTITY::SET_VEHICLE_AS_NO_LONGER_NEEDED(&veh); VEHICLE::DELETE_VEHICLE(&veh); @@ -397,18 +407,94 @@ namespace sub } } + int lastpaint, lastpearl, lastwheelcol; + bool menuselect = true, getpaint = true; void AddcarcolOption_(const std::string& text, Vehicle vehicle, INT16 colour_index, INT16 pearl_index_ifPrimary) { INT currPaintInd; currPaintInd = getpaintCarUsing_index(vehicle, ms_curr_paint_index); - + if (getpaint) + { + lastpaint = getpaintCarUsing_index(vehicle, ms_curr_paint_index); + lastpearl = getpaintCarUsing_index(vehicle, 3); + getpaint = false; + } bool pressed = false; - AddTickol(text, currPaintInd == colour_index, pressed, pressed, - IS_THIS_MODEL_A_BIKE(GET_ENTITY_MODEL(vehicle)) ? TICKOL::BIKETHING : TICKOL::CARTHING); if (pressed) + + if (_globalLSC_Customs) { - if (IS_ENTITY_A_VEHICLE(vehicle) || ms_curr_paint_index == 10 || ms_curr_paint_index == 11) - paintCarUsing_index(vehicle, ms_curr_paint_index, colour_index, pearl_index_ifPrimary); + std::vector THISMENUPAINT + { + + }; + switch (selectedpainttype) + { + case 0: + THISMENUPAINT = PAINTS_ADDED; + break; + case 1: + THISMENUPAINT = PAINTS_CHROME; + break; + case 2: + THISMENUPAINT = PAINTS_NORMAL; + break; + case 3: + THISMENUPAINT = PAINTS_MATTE; + break; + case 4: + THISMENUPAINT = PAINTS_METALLIC; + break; + case 5: + THISMENUPAINT = PAINTS_METAL; + break; + case 6: + THISMENUPAINT = PAINTS_CHAMELEON; + break; + case 7: + THISMENUPAINT = PAINTS_UTIL; + break; + case 8: + THISMENUPAINT = PAINTS_WORN; + break; + case 9: default: + THISMENUPAINT = PAINTS_WHEELS; + break; + } + + AddTickol(text, THISMENUPAINT[*Menu::currentopATM - 1].paint == colour_index, pressed, pressed, + IS_THIS_MODEL_A_BIKE(GET_ENTITY_MODEL(vehicle)) ? TICKOL::BIKETHING : TICKOL::CARTHING); + { + if (IS_ENTITY_A_VEHICLE(vehicle) && menuselect || ms_curr_paint_index == 10 || ms_curr_paint_index == 11) + paintCarUsing_index(vehicle, ms_curr_paint_index, THISMENUPAINT[*Menu::currentopATM - 1].paint, THISMENUPAINT[*Menu::currentopATM - 1].pearl); + } + if (pressed) + { + getpaint = true; + menuselect = false; + lastpaint = getpaintCarUsing_index(vehicle, ms_curr_paint_index); + lastpearl = getpaintCarUsing_index(vehicle, 3); + if (IS_ENTITY_A_VEHICLE(vehicle) || ms_curr_paint_index == 10 || ms_curr_paint_index == 11) + paintCarUsing_index(vehicle, ms_curr_paint_index, lastpaint, lastpearl); + Menu::SetSub_previous(); + WAIT(10); + return; + } + if (MenuPressTimer::IsButtonTapped(MenuPressTimer::Button::Back)) + { + getpaint = true; + if (IS_ENTITY_A_VEHICLE(vehicle) || ms_curr_paint_index == 10 || ms_curr_paint_index == 11) + paintCarUsing_index(vehicle, ms_curr_paint_index, lastpaint, lastpearl); + } + } + else + { + AddTickol(text, currPaintInd == colour_index, pressed, pressed, + IS_THIS_MODEL_A_BIKE(GET_ENTITY_MODEL(vehicle)) ? TICKOL::BIKETHING : TICKOL::CARTHING); if (pressed) + { + if (IS_ENTITY_A_VEHICLE(vehicle) || ms_curr_paint_index == 10 || ms_curr_paint_index == 11) + paintCarUsing_index(vehicle, ms_curr_paint_index, colour_index, pearl_index_ifPrimary); + } } } /*void AddcarcolModOption_(const std::string& text, Vehicle vehicle, INT16 part, INT16 type, INT paint) @@ -425,7 +511,7 @@ namespace sub } }*/ - + void MSPaints_() { @@ -529,6 +615,7 @@ namespace sub break; } + menuselect = true; AddOption("Chrome", null, nullFunc, SUB::MSPAINTS2_CHROME, true, true); // CMOD_COL1_0 AddOption("Classic", null, nullFunc, SUB::MSPAINTS2_NORMAL, true, true); // CMOD_COL1_1 AddOption("Matte", null, nullFunc, SUB::MSPAINTS2_MATTE, true, true); // CMOD_COL1_5 @@ -546,6 +633,7 @@ namespace sub { AddNumber("Paint Index", paintIndex, 0, paintIndex_input, paintIndex_plus, paintIndex_minus); } + if (ms_curr_paint_index == 1 || ms_curr_paint_index == 2) { AddOption("Random Index", MSPaints_RIndex); @@ -587,12 +675,22 @@ namespace sub if (paintIndex < paintIndex_maxValue) paintIndex++; else paintIndex = 0; paintCarUsing_index(Static_12, ms_curr_paint_index, paintIndex, -1); + if (_globalLSC_Customs) + { + lastpaint = getpaintCarUsing_index(Static_12, ms_curr_paint_index); + lastpearl = getpaintCarUsing_index(Static_12, 3); + } return; } if (paintIndex_minus) { if (paintIndex > 0) paintIndex--; else paintIndex = paintIndex_maxValue; paintCarUsing_index(Static_12, ms_curr_paint_index, paintIndex, -1); + if (_globalLSC_Customs) + { + lastpaint = getpaintCarUsing_index(Static_12, ms_curr_paint_index); + lastpearl = getpaintCarUsing_index(Static_12, 3); + } return; } if (paintIndex_input) { @@ -603,6 +701,11 @@ namespace sub { paintIndex = stoi(inputStr); paintCarUsing_index(Static_12, ms_curr_paint_index, paintIndex, -1); + if (_globalLSC_Customs) + { + lastpaint = getpaintCarUsing_index(Static_12, ms_curr_paint_index); + lastpearl = getpaintCarUsing_index(Static_12, 3); + } } catch (...) { @@ -641,7 +744,7 @@ namespace sub } auto& vPaints = PAINTS_WHEELS; - + selectedpainttype = 9; for (auto& p : vPaints) AddcarcolOption_(p.name, Static_12, p.paint, p.pearl); @@ -695,6 +798,7 @@ namespace sub AddTitle("Extra Colours"); auto& vPaints = PAINTS_ADDED; + selectedpainttype = 0; for (auto& p : vPaints) AddcarcolOption_(p.name, Static_12, p.paint, p.pearl); @@ -703,6 +807,7 @@ namespace sub void Sub_Chrome() { AddTitle("Chrome"); + selectedpainttype = 1; auto& vPaints = PAINTS_CHROME; @@ -713,6 +818,7 @@ namespace sub void Sub_Normal() { AddTitle("Classic"); + selectedpainttype = 2; auto& vPaints = PAINTS_NORMAL; @@ -723,6 +829,7 @@ namespace sub void Sub_Matte() { AddTitle("Matte"); + selectedpainttype = 3; auto& vPaints = PAINTS_MATTE; @@ -733,6 +840,7 @@ namespace sub void Sub_Metallic() { AddTitle("Metallic"); + selectedpainttype = 4; auto& vPaints = PAINTS_METALLIC; @@ -742,6 +850,7 @@ namespace sub void Sub_Metal() { AddTitle("Metal"); + selectedpainttype = 5; auto& vPaints = PAINTS_METAL; @@ -751,6 +860,7 @@ namespace sub void Sub_Chameleon() { AddTitle("Chameleon"); + selectedpainttype = 6; auto& vPaints = PAINTS_CHAMELEON; @@ -761,6 +871,7 @@ namespace sub void Sub_Util() { AddTitle("Utility"); + selectedpainttype = 7; auto& vPaints = PAINTS_UTIL; @@ -770,6 +881,7 @@ namespace sub void Sub_Worn() { AddTitle("Worn"); + selectedpainttype = 8; auto& vPaints = PAINTS_WORN; @@ -1049,7 +1161,7 @@ namespace sub // vehicle - upgrades void set_vehicle_max_upgrades(Vehicle vehicle, bool upgradeIt, bool invincible, INT8 plateType, std::string plateText, - + bool neonIt, UINT8 NeonR, UINT8 NeonG, UINT8 NeonB, INT16 prim_col_index, INT16 sec_col_index) { if (!DOES_ENTITY_EXIST(vehicle) || !IS_ENTITY_A_VEHICLE(vehicle)) @@ -1085,14 +1197,14 @@ namespace sub if (i >= 17 && i <= 22) continue; if (i == 24) - { + { UINT8 modIndex = GET_VEHICLE_MOD(vehicle, 23); SET_VEHICLE_MOD(vehicle, i, modIndex, 0); continue; } UINT8 modIndex = GET_NUM_VEHICLE_MODS(vehicle, i) - 1; if (modIndex > -1) - modIndex = std::rand() % (modIndex + 2) -1 ; + modIndex = std::rand() % (modIndex + 2) - 1; if (i == VehicleMod::Horns) modIndex = 44; // Liberty City Loop SET_VEHICLE_MOD(vehicle, i, modIndex, 0); @@ -1300,7 +1412,7 @@ namespace sub //if (i == VehicleMod::Suspension && Static_12_veh_model.hash == VEHICLE_GLENDALE) continue; if (GET_NUM_VEHICLE_MODS(Static_12, i) > 0) { - lastMod = null; + lastMod = null; AddOption(get_mod_slot_name(Static_12, i, true), pressed, nullFunc, SUB::MSCATALL, true, false); if (pressed) { ms_curr_paint_index = i; @@ -1394,7 +1506,7 @@ namespace sub AddTickol("Sirens", vehicle.SirenActive_get(), bSirenOnTogglePressed, bSirenOnTogglePressed, TICKOL::BOXTICK, TICKOL::BOXBLANK); if (bSirenOnTogglePressed) vehicle.SirenActive_set(!vehicle.SirenActive_get()); } - + AddOption("AUTO UPGRADE", veh_static12_autoUpgrade); AddToggle("LSC Style Part Selection", _globalLSC_Customs); @@ -1814,7 +1926,7 @@ namespace sub if (maxSpeed_input) { std::stringstream ss; - ss << std::fixed << std::setprecision(0) << (maxSpeedMultVal*3.6f); + ss << std::fixed << std::setprecision(0) << (maxSpeedMultVal * 3.6f); std::string oldStr = ss.str(); std::string inputStr = Game::InputBox("", 9U, "", oldStr); @@ -1938,7 +2050,7 @@ namespace sub void MSCatall_() { - Vehicle &vehicle = Static_12; + Vehicle& vehicle = Static_12; if (!DOES_ENTITY_EXIST(vehicle)) { @@ -1947,12 +2059,13 @@ namespace sub } bool setMod = false; - + INT& modType = ms_curr_paint_index, maxMod = GET_NUM_VEHICLE_MODS(vehicle, modType) - 1, currMod = GET_VEHICLE_MOD(vehicle, modType); - if (lastMod == null) lastMod = GET_VEHICLE_MOD(vehicle, modType); + if (lastMod == NULL) + lastMod = GET_VEHICLE_MOD(vehicle, modType); AddTitle(get_mod_slot_name(vehicle, modType, true)); @@ -1963,7 +2076,7 @@ namespace sub setMod = false; AddTickol(get_mod_text_label(vehicle, modType, i, true), currMod == i, setMod, setMod, IS_THIS_MODEL_A_BIKE(GET_ENTITY_MODEL(vehicle)) ? TICKOL::BIKETHING : TICKOL::CARTHING, TICKOL::NONE, false); - SET_VEHICLE_MOD(vehicle, modType, *Menu::currentopATM-2, GET_VEHICLE_MOD_VARIATION(vehicle, modType)); + SET_VEHICLE_MOD(vehicle, modType, *Menu::currentopATM - 2, GET_VEHICLE_MOD_VARIATION(vehicle, modType)); if (setMod) { lastMod = GET_VEHICLE_MOD(vehicle, modType); @@ -2029,6 +2142,10 @@ namespace sub // Wheels + + bool selectwheel = false; + bool setwheel = false; + namespace MSWheels_catind { //bool ms_wheel_windice_pressed = false; @@ -2051,52 +2168,120 @@ namespace sub void __AddpointOption(const std::string& text, INT8 wheelType) { + int& wtype = ms_curr_paint_index, & chrtype = bit_MSPaints_RGB_mode; bool pressed = false; AddOption(text, pressed, nullFunc, -1, true, true); if (pressed) { ms_curr_paint_index = wheelType; - ms_bit_bike_back = wheelType == 6 ? true : false; - Menu::SetSub_delayed = SUB::MSWHEELS2; + if (wheelType == WheelType::BikeWheels) + { + ms_bit_bike_back = true; + Menu::SetSub_delayed = SUB::MSWHEELS2; + } + else + { + ms_bit_bike_back = false; + chrtype = 0; + SET_VEHICLE_WHEEL_TYPE(Static_12, wtype); + ms_max_windices = GET_NUM_VEHICLE_MODS(Static_12, VehicleMod::FrontWheels); + Menu::SetSub_delayed = SUB::MSWHEELS3; + } } } - void __AddOption(const std::string& text, Vehicle vehicle, INT8 wheelType, INT16 wheelIndex, bool isBikeBack) { - INT currWheelType = GET_VEHICLE_WHEEL_TYPE(vehicle); - INT currWheelIndex = GET_VEHICLE_MOD(vehicle, VehicleMod::FrontWheels); + INT currWheelType = -1; + INT currWheelIndex = -1; + if (_globalLSC_Customs) + { + if (selectwheel) + { + currWheelType = lastwheeltype; + currWheelIndex = lastfwheel; + selectwheel = false; + } + bool pressed = false; + if (isBikeBack) + AddTickol(text, currWheelIndex == wheelIndex && currWheelType == wheelType, pressed, pressed, + TICKOL::BIKETHING, TICKOL::NONE, true); + else + AddTickol(text, currWheelIndex == wheelIndex && currWheelType == wheelType, pressed, pressed, + IS_THIS_MODEL_A_BIKE(GET_ENTITY_MODEL(vehicle)) ? TICKOL::BIKETHING : TICKOL::CARTHING, TICKOL::NONE, true); - bool pressed = false; - if (isBikeBack) - AddTickol(text, currWheelIndex == wheelIndex && currWheelType == wheelType, pressed, pressed, - TICKOL::BIKETHING, TICKOL::NONE, true); - else - AddTickol(text, currWheelIndex == wheelIndex && currWheelType == wheelType, pressed, pressed, - IS_THIS_MODEL_A_BIKE(GET_ENTITY_MODEL(vehicle)) ? TICKOL::BIKETHING : TICKOL::CARTHING, TICKOL::NONE, true); - if (pressed) - { - if (IS_ENTITY_A_VEHICLE(vehicle)) + if (setwheel && IS_ENTITY_A_VEHICLE(vehicle)) { GTAvehicle(vehicle).RequestControl(); SET_VEHICLE_WHEEL_TYPE(vehicle, wheelType); if (wheelType == WheelType::BikeWheels) { - isBikeBack ? SET_VEHICLE_MOD(vehicle, VehicleMod::BackWheels, wheelIndex, GET_VEHICLE_MOD_VARIATION(vehicle, VehicleMod::BackWheels)) - : SET_VEHICLE_MOD(vehicle, VehicleMod::FrontWheels, wheelIndex, GET_VEHICLE_MOD_VARIATION(vehicle, VehicleMod::FrontWheels)); + isBikeBack ? SET_VEHICLE_MOD(vehicle, VehicleMod::BackWheels, *Menu::currentopATM - 1, GET_VEHICLE_MOD_VARIATION(vehicle, VehicleMod::BackWheels)) + : SET_VEHICLE_MOD(vehicle, VehicleMod::FrontWheels, *Menu::currentopATM - 1, GET_VEHICLE_MOD_VARIATION(vehicle, VehicleMod::FrontWheels)); } else { - SET_VEHICLE_MOD(vehicle, VehicleMod::FrontWheels, wheelIndex, GET_VEHICLE_MOD_VARIATION(vehicle, VehicleMod::FrontWheels)); - SET_VEHICLE_MOD(vehicle, VehicleMod::BackWheels, wheelIndex, GET_VEHICLE_MOD_VARIATION(vehicle, VehicleMod::BackWheels)); + SET_VEHICLE_MOD(vehicle, VehicleMod::FrontWheels, *Menu::currentopATM - 1, GET_VEHICLE_MOD_VARIATION(vehicle, VehicleMod::FrontWheels)); + SET_VEHICLE_MOD(vehicle, VehicleMod::BackWheels, *Menu::currentopATM - 1, GET_VEHICLE_MOD_VARIATION(vehicle, VehicleMod::BackWheels)); + } + + if (pressed) + { + setwheel = false; + if (wheelType == WheelType::BikeWheels) + { + isBikeBack ? SET_VEHICLE_MOD(vehicle, VehicleMod::BackWheels, *Menu::currentopATM - 1, GET_VEHICLE_MOD_VARIATION(vehicle, VehicleMod::BackWheels)) + : SET_VEHICLE_MOD(vehicle, VehicleMod::FrontWheels, *Menu::currentopATM - 1, GET_VEHICLE_MOD_VARIATION(vehicle, VehicleMod::FrontWheels)); + } + else + { + SET_VEHICLE_MOD(vehicle, VehicleMod::FrontWheels, *Menu::currentopATM - 1, GET_VEHICLE_MOD_VARIATION(vehicle, VehicleMod::FrontWheels)); + SET_VEHICLE_MOD(vehicle, VehicleMod::BackWheels, *Menu::currentopATM - 1, GET_VEHICLE_MOD_VARIATION(vehicle, VehicleMod::BackWheels)); + } + lastfwheel = GET_VEHICLE_MOD(vehicle, VehicleMod::FrontWheels); + lastbwheel = GET_VEHICLE_MOD(vehicle, VehicleMod::BackWheels); + Menu::SetSub_previous(); + return; } } - //ms_old_wtype = GET_VEHICLE_WHEEL_TYPE(Static_12); - //ms_old_windex = GET_VEHICLE_MOD(Static_12, 23); - //ms_old_windexBB = GET_VEHICLE_MOD(Static_12, 24); - //ms_wheel_windice_pressed = true; + + //Game::Print::PrintBottomCentre("~b~Debug -~s~ setwheel:" + std::to_string(setwheel) + ", selectwheel:" + std::to_string(selectwheel) + ", lastfwheel:" + std::to_string(lastfwheel) + ", *Menu::currentopATM - 1" + std::to_string(*Menu::currentopATM - 1) + ", lastwheeltype:" + std::to_string(lastwheeltype)); } + else ///lsccustoms off + { + currWheelType = GET_VEHICLE_WHEEL_TYPE(vehicle); + currWheelIndex = GET_VEHICLE_MOD(vehicle, VehicleMod::FrontWheels); + bool pressed = false; + if (isBikeBack) + AddTickol(text, currWheelIndex == wheelIndex && currWheelType == wheelType, pressed, pressed, + TICKOL::BIKETHING, TICKOL::NONE, true); + else + AddTickol(text, currWheelIndex == wheelIndex && currWheelType == wheelType, pressed, pressed, + IS_THIS_MODEL_A_BIKE(GET_ENTITY_MODEL(vehicle)) ? TICKOL::BIKETHING : TICKOL::CARTHING, TICKOL::NONE, true); + if (pressed) + { + if (IS_ENTITY_A_VEHICLE(vehicle)) + { + GTAvehicle(vehicle).RequestControl(); + SET_VEHICLE_WHEEL_TYPE(vehicle, wheelType); + if (wheelType == WheelType::BikeWheels) + { + isBikeBack ? SET_VEHICLE_MOD(vehicle, VehicleMod::BackWheels, wheelIndex, GET_VEHICLE_MOD_VARIATION(vehicle, VehicleMod::BackWheels)) + : SET_VEHICLE_MOD(vehicle, VehicleMod::FrontWheels, wheelIndex, GET_VEHICLE_MOD_VARIATION(vehicle, VehicleMod::FrontWheels)); + } + else + { + SET_VEHICLE_MOD(vehicle, VehicleMod::FrontWheels, wheelIndex, GET_VEHICLE_MOD_VARIATION(vehicle, VehicleMod::FrontWheels)); + SET_VEHICLE_MOD(vehicle, VehicleMod::BackWheels, wheelIndex, GET_VEHICLE_MOD_VARIATION(vehicle, VehicleMod::BackWheels)); + } + } + //ms_old_wtype = GET_VEHICLE_WHEEL_TYPE(Static_12); + //ms_old_windex = GET_VEHICLE_MOD(Static_12, 23); + //ms_old_windexBB = GET_VEHICLE_MOD(Static_12, 24); + //ms_wheel_windice_pressed = true; + } + } } } @@ -2109,61 +2294,33 @@ namespace sub } using namespace MSWheels_catind; - //ms_wheel_windice_pressed = false; GTAvehicle vehicle = Static_12; - bool set_mspaints_index_4 = 0, - /*wheels_highend_plus = 0, - wheels_highend_minus = 0, - wheels_lowrider_plus = 0, - wheels_lowrider_minus = 0, - wheels_muscle_plus = 0, - wheels_muscle_minus = 0, - wheels_offroad_plus = 0, - wheels_offroad_minus = 0, - wheels_sport_plus = 0, - wheels_sport_minus = 0, - wheels_suv_plus = 0, - wheels_suv_minus = 0, - wheels_tuner_plus = 0, - wheels_tuner_minus = 0, - wheels_bikef_plus = 0, - wheels_bikef_minus = 0, - wheels_bikeb_plus = 0, - wheels_bikeb_minus = 0, - wheels_type_plus = 0, - wheels_type_minus = 0, - wheels_variation_plus = 0, - wheels_variation_minus = 0, - wheels_set_smoke_colour = 0,*/ set_msrgb_index_4 = 0, MSWheelsCustomTyres_ = 0, MSWheelsBPTyresOn_ = 0, MSWheelsDriftTyresOn_ = 0, MSWheelsStockWheels_ = 0; - //Hash Static_12_model = GET_ENTITY_MODEL(Static_12); UINT i; - //INT activeWheelType = GET_VEHICLE_WHEEL_TYPE(Static_12); - - //ms_old_wtype = GET_VEHICLE_WHEEL_TYPE(Static_12); - //ms_old_windex = GET_VEHICLE_MOD(Static_12, 23); - //ms_old_windexBB = GET_VEHICLE_MOD(Static_12, 24); - - //INT wheels_smoke_r, wheels_smoke_g, wheels_smoke_b; - //wheel_no = GET_VEHICLE_MOD(Static_12, 23); if (wheel_no < 0) wheel_no = 0; - //int wheel_noBB = GET_VEHICLE_MOD(Static_12, 24); if (wheel_noBB < 0) wheel_noBB = 0; - //PCHAR ThisOnesActiveText = "ACTIVE"; Model Static_12_veh_model = GET_ENTITY_MODEL(Static_12); + bool isBike = Static_12_veh_model.IsBike(); INT wheel_no = GET_VEHICLE_MOD(Static_12, 23); INT ms_custom_tyres = GET_VEHICLE_MOD_VARIATION(Static_12, 23); BOOL ms_drift_tyres = _GET_DRIFT_TYRES_ENABLED(Static_12); + //if (!selectwheel) + { + lastwheeltype = GET_VEHICLE_WHEEL_TYPE(Static_12); + lastfwheel = GET_VEHICLE_MOD(Static_12, VehicleMod::FrontWheels); + lastbwheel = GET_VEHICLE_MOD(Static_12, VehicleMod::BackWheels); + } //if (ms_custom_tyres == 0) activeWheelType = 1; //GET_VEHICLE_TYRE_SMOKE_COLOR(Static_12, &wheels_smoke_r, &wheels_smoke_g, &wheels_smoke_b); - + selectwheel = true; + setwheel = true; AddTitle(Game::GetGXTEntry("CMOD_MOD_WHEM", "Wheels")); AddOption(Game::GetGXTEntry("CMOD_MOD_WCL", "Rim Colour"), set_mspaints_index_4, nullFunc, -1, true); // Wheel Colour CMOD_MOD_WCL @@ -2172,12 +2329,13 @@ namespace sub for (i = 0; i < vWheelTNames.size(); i++) { - if (i == WheelType::BikeWheels && !Static_12_veh_model.IsBike()) continue; - __AddpointOption(vWheelTNames[i], i); + const bool ibw = (i == WheelType::BikeWheels); + if (!ibw || ibw && isBike) + __AddpointOption(vWheelTNames[i], i); } AddLocal("CMOD_TYR_1", ms_custom_tyres, MSWheelsCustomTyres_, MSWheelsCustomTyres_, true); // Custom Tyres - AddLocal("CMOD_TYR_2", !GET_VEHICLE_TYRES_CAN_BURST(Static_12), MSWheelsBPTyresOn_, MSWheelsBPTyresOn_, true); // Bulletproof Tyres + AddLocal("CMOD_TYR_2", GET_VEHICLE_TYRES_CAN_BURST(Static_12) == FALSE, MSWheelsBPTyresOn_, MSWheelsBPTyresOn_, true); // Bulletproof Tyres AddLocal("Drift Tyres", _GET_DRIFT_TYRES_ENABLED(Static_12), MSWheelsDriftTyresOn_, MSWheelsDriftTyresOn_, true); // Drift Tyres AddOption("Remove Tires", null, nullFunc, SUB::MS_TYRESBURST); @@ -2185,40 +2343,6 @@ namespace sub if (*Menu::currentopATM == Menu::printingop) Add_preset_colour_options_previews(vehicle.TyreSmokeColour_get()); - //RequestControlOfEnt(Static_12); - - - //if (wheels_type_plus){ - // if (activeWheelType < vWheelTNames.size() - 1) activeWheelType++; - // wheel_no = 0; - // SET_VEHICLE_WHEEL_TYPE(Static_12, activeWheelType); - // SET_VEHICLE_MOD(Static_12, 23, wheel_no, ms_custom_tyres); if (is_model_a_bikes(Static_12_model)) SET_VEHICLE_MOD(Static_12, 24, wheel_no, ms_custom_tyres); - // return; - //} - //if (wheels_type_minus){ - // if (activeWheelType > 0) activeWheelType--; - // wheel_no = 0; - // SET_VEHICLE_WHEEL_TYPE(Static_12, activeWheelType); - // SET_VEHICLE_MOD(Static_12, 23, wheel_no, ms_custom_tyres); if (is_model_a_bikes(Static_12_model)) SET_VEHICLE_MOD(Static_12, 24, wheel_no, ms_custom_tyres); - // return; - //} - - //if (wheels_variation_plus){ - // //INT maxWheelCount; - // switch (activeWheelType) - // { - // case SPORT: 48; break; - // case MUSCLE: break; - // case LOWRIDER: break; - // case SUV: break; - // case OFFROAD: break; - // case TUNER: break; - // case BIKE: break; - // case HIGHEND: break; - // } - // return; - //} - if (set_mspaints_index_4) { @@ -2231,178 +2355,8 @@ namespace sub return; } - /*if (wheels_smoke_r_plus){ - if (wheels_smoke_r < 255) wheels_smoke_r++; - else wheels_smoke_r = 0; - wheels_set_smoke_colour = true; - } - if (wheels_smoke_g_plus){ - if (wheels_smoke_g < 255) wheels_smoke_g++; - else wheels_smoke_g = 0; - wheels_set_smoke_colour = true; - } - if (wheels_smoke_b_plus){ - if (wheels_smoke_b < 255) wheels_smoke_b++; - else wheels_smoke_b = 0; - wheels_set_smoke_colour = true; - } - if (wheels_smoke_r_minus){ - if (wheels_smoke_r > 0) wheels_smoke_r--; - else wheels_smoke_r = 255; - wheels_set_smoke_colour = true; - } - if (wheels_smoke_g_minus){ - if (wheels_smoke_g > 0) wheels_smoke_g--; - else wheels_smoke_g = 255; - wheels_set_smoke_colour = true; - } - if (wheels_smoke_b_minus){ - if (wheels_smoke_b > 0) wheels_smoke_b--; - else wheels_smoke_b = 255; - wheels_set_smoke_colour = true; - } - if (wheels_set_smoke_colour){ - TOGGLE_VEHICLE_MOD(Static_12, 20, 1); - SET_VEHICLE_TYRE_SMOKE_COLOR(Static_12, wheels_smoke_r, wheels_smoke_g, wheels_smoke_b); - return; - }*/ - if (set_msrgb_index_4) { bit_MSPaints_RGB_mode = 4; return; } - - - /*if (wheels_highend_plus){ - if (wheel_no < 38) wheel_no++; - else wheel_no = 0; - SET_VEHICLE_WHEEL_TYPE(Static_12, 7); - SET_VEHICLE_MOD(Static_12, 23, wheel_no, ms_custom_tyres); if(is_model_a_bikes(Static_12_model)) SET_VEHICLE_MOD(Static_12, 24, wheel_no, ms_custom_tyres); - return; - } - if (wheels_highend_minus){ - if (wheel_no > 0) wheel_no--; - else (wheel_no = 38); - SET_VEHICLE_WHEEL_TYPE(Static_12, 7); - SET_VEHICLE_MOD(Static_12, 23, wheel_no, ms_custom_tyres); if(is_model_a_bikes(Static_12_model)) SET_VEHICLE_MOD(Static_12, 24, wheel_no, ms_custom_tyres); - return; - } - - if (wheels_lowrider_plus){ - if (wheel_no < 28) wheel_no++; - else wheel_no = 0; - SET_VEHICLE_WHEEL_TYPE(Static_12, 2); - SET_VEHICLE_MOD(Static_12, 23, wheel_no, ms_custom_tyres); if(is_model_a_bikes(Static_12_model)) SET_VEHICLE_MOD(Static_12, 24, wheel_no, ms_custom_tyres); - return; - } - if (wheels_lowrider_minus){ - if (wheel_no > 0) wheel_no--; - else (wheel_no = 28); - SET_VEHICLE_WHEEL_TYPE(Static_12, 2); - SET_VEHICLE_MOD(Static_12, 23, wheel_no, ms_custom_tyres); if(is_model_a_bikes(Static_12_model)) SET_VEHICLE_MOD(Static_12, 24, wheel_no, ms_custom_tyres); - return; - } - - if (wheels_muscle_plus){ - if (wheel_no < 34) wheel_no++; - else wheel_no = 0; - SET_VEHICLE_WHEEL_TYPE(Static_12, 1); - SET_VEHICLE_MOD(Static_12, 23, wheel_no, ms_custom_tyres); if(is_model_a_bikes(Static_12_model)) SET_VEHICLE_MOD(Static_12, 24, wheel_no, ms_custom_tyres); - return; - } - if (wheels_muscle_minus){ - if (wheel_no > 0) wheel_no--; - else (wheel_no = 34); - SET_VEHICLE_WHEEL_TYPE(Static_12, 1); - SET_VEHICLE_MOD(Static_12, 23, wheel_no, ms_custom_tyres); if(is_model_a_bikes(Static_12_model)) SET_VEHICLE_MOD(Static_12, 24, wheel_no, ms_custom_tyres); - return; - } - - if (wheels_offroad_plus){ - if (wheel_no < 18) wheel_no++; - else wheel_no = 0; - SET_VEHICLE_WHEEL_TYPE(Static_12, 4); - SET_VEHICLE_MOD(Static_12, 23, wheel_no, ms_custom_tyres); if(is_model_a_bikes(Static_12_model)) SET_VEHICLE_MOD(Static_12, 24, wheel_no, ms_custom_tyres); - return; - } - if (wheels_offroad_minus){ - if (wheel_no > 0) wheel_no--; - else (wheel_no = 18); - SET_VEHICLE_WHEEL_TYPE(Static_12, 4); - SET_VEHICLE_MOD(Static_12, 23, wheel_no, ms_custom_tyres); if(is_model_a_bikes(Static_12_model)) SET_VEHICLE_MOD(Static_12, 24, wheel_no, ms_custom_tyres); - return; - } - - if (wheels_sport_plus){ - if (wheel_no < 48) wheel_no++; - else wheel_no = 0; - SET_VEHICLE_WHEEL_TYPE(Static_12, 0); - SET_VEHICLE_MOD(Static_12, 23, wheel_no, ms_custom_tyres); if(is_model_a_bikes(Static_12_model)) SET_VEHICLE_MOD(Static_12, 24, wheel_no, ms_custom_tyres); - return; - } - if (wheels_sport_minus){ - if (wheel_no > 0) wheel_no--; - else (wheel_no = 48); - SET_VEHICLE_WHEEL_TYPE(Static_12, 0); - SET_VEHICLE_MOD(Static_12, 23, wheel_no, ms_custom_tyres); if(is_model_a_bikes(Static_12_model)) SET_VEHICLE_MOD(Static_12, 24, wheel_no, ms_custom_tyres); - return; - } - - if (wheels_suv_plus){ - if (wheel_no < 36) wheel_no++; - else wheel_no = 0; - SET_VEHICLE_WHEEL_TYPE(Static_12, 3); - SET_VEHICLE_MOD(Static_12, 23, wheel_no, ms_custom_tyres); if(is_model_a_bikes(Static_12_model)) SET_VEHICLE_MOD(Static_12, 24, wheel_no, ms_custom_tyres); - return; - } - if (wheels_suv_minus){ - if (wheel_no > 0) wheel_no--; - else (wheel_no = 36); - SET_VEHICLE_WHEEL_TYPE(Static_12, 3); - SET_VEHICLE_MOD(Static_12, 23, wheel_no, ms_custom_tyres); if(is_model_a_bikes(Static_12_model)) SET_VEHICLE_MOD(Static_12, 24, wheel_no, ms_custom_tyres); - return; - } - - if (wheels_tuner_plus){ - if (wheel_no < 46) wheel_no++; - else wheel_no = 0; - SET_VEHICLE_WHEEL_TYPE(Static_12, 5); - SET_VEHICLE_MOD(Static_12, 23, wheel_no, ms_custom_tyres); if(is_model_a_bikes(Static_12_model)) SET_VEHICLE_MOD(Static_12, 24, wheel_no, ms_custom_tyres); - return; - } - if (wheels_tuner_minus){ - if (wheel_no > 0) wheel_no--; - else (wheel_no = 46); - SET_VEHICLE_WHEEL_TYPE(Static_12, 5); - SET_VEHICLE_MOD(Static_12, 23, wheel_no, ms_custom_tyres); if(is_model_a_bikes(Static_12_model)) SET_VEHICLE_MOD(Static_12, 24, wheel_no, ms_custom_tyres); - return; - } - if (wheels_bikef_plus){ - if (wheel_no < 26) wheel_no++; - else wheel_no = 0; - SET_VEHICLE_WHEEL_TYPE(Static_12, 6); - SET_VEHICLE_MOD(Static_12, 23, wheel_no, ms_custom_tyres); - return; - } - if (wheels_bikef_minus){ - if (wheel_no > 0) wheel_no--; - else (wheel_no = 26); - SET_VEHICLE_WHEEL_TYPE(Static_12, 6); - SET_VEHICLE_MOD(Static_12, 23, wheel_no, ms_custom_tyres); - return; - } - - if (wheels_bikeb_plus){ - if (wheel_noBB < 26) wheel_noBB++; - else wheel_noBB = 0; - SET_VEHICLE_WHEEL_TYPE(Static_12, 6); - SET_VEHICLE_MOD(Static_12, 24, wheel_noBB, ms_custom_tyres); - return; - } - if (wheels_bikeb_minus){ - if (wheel_noBB > 0) wheel_noBB--; - else (wheel_noBB = 26); - SET_VEHICLE_WHEEL_TYPE(Static_12, 6); - SET_VEHICLE_MOD(Static_12, 24, wheel_noBB, ms_custom_tyres); - return; - }*/ + if (set_msrgb_index_4) { bit_MSPaints_RGB_mode = 4; return; } if (MSWheelsStockWheels_) { @@ -2430,7 +2384,6 @@ namespace sub vehicle.CanTyresDrift_set(!vehicle.CanTyresDrift_get()); return; } - } void MSWheels2_() { @@ -2441,7 +2394,12 @@ namespace sub } using namespace MSWheels_catind; - int &wtype = ms_curr_paint_index, &chrtype = bit_MSPaints_RGB_mode; + int& wtype = ms_curr_paint_index, & chrtype = bit_MSPaints_RGB_mode; + setwheel = true; + + lastwheeltype = 6; + lastfwheel = GET_VEHICLE_MOD(Static_12, VehicleMod::FrontWheels); + lastbwheel = GET_VEHICLE_MOD(Static_12, VehicleMod::BackWheels); AddTitle(vWheelTNames[wtype]); @@ -2452,10 +2410,11 @@ namespace sub // SET_VEHICLE_MOD(Static_12, 24, ms_old_windex, 0); //} - if (wtype == WheelType::Bennys || wtype == WheelType::BennysBespoke) - { - if (ms_bit_bike_back) - { + //if (wtype == WheelType::Bennys || wtype == WheelType::BennysBespoke) + //if (true) //no need to split chrome and normal with addon wheels. + //{ + //if (ms_bit_bike_back) // Can probably remove this whole if statement with this exclusively working for bike wheels now - ijc + //{ bool bFrontPressed = false, bBackPressed = false; AddOption("Front", bFrontPressed, nullFunc, SUB::MSWHEELS3); if (bFrontPressed) { @@ -2469,21 +2428,21 @@ namespace sub SET_VEHICLE_WHEEL_TYPE(Static_12, wtype); ms_max_windices = GET_NUM_VEHICLE_MODS(Static_12, VehicleMod::BackWheels); } - } - else // Not a bike. + //} + /*else // Not a bike. { bool bFrontPressed = false; - AddOption("Front & Rear", bFrontPressed, nullFunc, SUB::MSWHEELS3); if (bFrontPressed) + AddOption("Front & Rear", bFrontPressed, nullFunc, SUB::MSWHEELS3); if (true) //bypass this menu for all but bikes { chrtype = 0; SET_VEHICLE_WHEEL_TYPE(Static_12, wtype); ms_max_windices = GET_NUM_VEHICLE_MODS(Static_12, VehicleMod::FrontWheels); - //Menu::SetSub_delayed = (SUB::MSWHEELS3); - //return; + Menu::SetSub_delayed = SUB::MSWHEELS3; + return; } - } - } - else + }*/ + //} + /*else // Unused - remove? { if (ms_bit_bike_back) { @@ -2536,7 +2495,7 @@ namespace sub ms_max_windices = GET_NUM_VEHICLE_MODS(Static_12, VehicleMod::FrontWheels); } } - } + }*/ } void MSWheels3_() { @@ -2547,8 +2506,7 @@ namespace sub } using namespace MSWheels_catind; - int &wtype = ms_curr_paint_index, &chrtype = bit_MSPaints_RGB_mode, i; - + int& wtype = ms_curr_paint_index, & chrtype = bit_MSPaints_RGB_mode, i; //switch (wtype) //{ //case SPORT: max = 20; break; @@ -2567,29 +2525,36 @@ namespace sub //} //max -= 1; + int windices2; if (wtype == WheelType::BikeWheels) // Bike Normal/Chrome { bool bIsChromeSelected = chrtype == 1 || chrtype == 3; - AddTitle(bIsChromeSelected ? "Chrome" : "Normal"); + AddTitle(bIsChromeSelected ? "Chrome Wheels" : "Bike Wheels"); std::array ids{ 0, 13, 26, 48, ms_max_windices }; for (UINT8 j = bIsChromeSelected ? 1 : 0; j < ids.size(); j += 2) { for (i = ids[j]; i < ids[j + 1]; i++) { - __AddOption(get_mod_text_label(Static_12, VehicleMod::FrontWheels, i, false), Static_12, wtype, i, chrtype > 1); + __AddOption(get_mod_text_label(Static_12, VehicleMod::FrontWheels, i, false), Static_12, wtype, i, chrtype == 2); } } + 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; + (chrtype == 2) ? SET_VEHICLE_MOD(Static_12, VehicleMod::BackWheels, lastbwheel, GET_VEHICLE_MOD_VARIATION(Static_12, VehicleMod::BackWheels)) + : SET_VEHICLE_MOD(Static_12, VehicleMod::FrontWheels, lastfwheel, GET_VEHICLE_MOD_VARIATION(Static_12, VehicleMod::FrontWheels)); + } return; } - else if (wtype == WheelType::Bennys || wtype == WheelType::BennysBespoke) // Benny's + else //if (wtype == WheelType::Bennys || wtype == WheelType::BennysBespoke) // Benny's { - windices2 = ms_max_windices; + windices2 = ms_max_windices; //bypass normal/chrome split i = 0; } - else if (chrtype == 0 || chrtype == 2) // Normal + /*else if (chrtype == 0 || chrtype == 2) // Normal { windices2 = ms_max_windices / 2; i = 0; @@ -2598,13 +2563,26 @@ namespace sub { windices2 = ms_max_windices; i = ms_max_windices / 2; - } - + }*/ bool bIsChromeSelected = chrtype == 1 || chrtype == 3; - AddTitle(bIsChromeSelected ? "Chrome" : "Normal"); + AddTitle(bIsChromeSelected ? "Chrome Wheels" : "Normal Wheels"); for (; i < windices2; i++) { - __AddOption(get_mod_text_label(Static_12, VehicleMod::FrontWheels, i, false), Static_12, wtype, i, chrtype > 1); + __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)) // running this here prevents the sript from working for bikes due to (I believe) the return on line 2459. Moving it to before that section causes a crash when using a car. + { + if (wtype != WheelType::BikeWheels) + { + setwheel = false; + SET_VEHICLE_WHEEL_TYPE(Static_12, lastwheeltype); + SET_VEHICLE_MOD(Static_12, VehicleMod::FrontWheels, lastfwheel, GET_VEHICLE_MOD_VARIATION(Static_12, VehicleMod::FrontWheels)); + SET_VEHICLE_MOD(Static_12, VehicleMod::BackWheels, lastbwheel, GET_VEHICLE_MOD_VARIATION(Static_12, VehicleMod::BackWheels)); + } + } } } void MSTyresBurst_() @@ -2631,7 +2609,7 @@ namespace sub { if (j != i) { - if (vehicle.IsTyreBursted(j), true) + if (vehicle.IsTyreBursted(j)) vTyresBurstedAlready.push_back(j); } } @@ -2667,7 +2645,7 @@ namespace sub { enum MSWINDOWS_MODE : UINT8 { MSWINDOWS_MODE_OPEN, MSWINDOWS_MODE_CLOSE, MSWINDOWS_MODE_BREAK, MSWINDOWS_MODE_FIX, MSWINDOWS_MODE_REMOVE }; UINT8 msWindows_mode = 0; - + const std::vector msWindows_mode_names{ "Open", "Close", "Break", "Fix", "Remove" }; const std::vector msWindows_window_names{ "Front Left", "Front Right", "Back Left", "Back Right" }; //const std::vector msWindows_wintint_names{ "None", "Black", "Dark Smoke", "Light Smoke", "Stock", "Limo", "Green" }; @@ -2748,7 +2726,7 @@ namespace sub // Doors void AddmsdoorsOption_(const std::string& text, GTAvehicle vehicle, VehicleDoor door, UINT8 supposedAction, bool instantly = false, bool loose = false) - { + { auto action = supposedAction; bool conditionForTick = false; @@ -2880,7 +2858,7 @@ namespace sub void MSLights_() { GTAvehicle vehicle = Static_12; - bool bHLightsOnTogglePressed = false; + bool bHLightsOnTogglePressed = false; AddTickol("Headlights", vehicle.LightsOn_get(), bHLightsOnTogglePressed, bHLightsOnTogglePressed, TICKOL::BOXTICK, TICKOL::BOXBLANK); if (bHLightsOnTogglePressed) vehicle.LightsOn_set(!vehicle.LightsOn_get()); bool bLindOnTogglePressed = false; @@ -2923,7 +2901,7 @@ namespace sub vehicle.LeftIndicatorLightOn_set(true); hazard = true; } - + } } @@ -2972,7 +2950,7 @@ namespace sub { VehicleNeonLight::Right,{ 0x92E936A7, "Right" } }, { VehicleNeonLight::Front,{ 0x79ABE687, "Front" } }, { VehicleNeonLight::Back,{ 0x6BECCB09, "Back" } } - }) + }) { bool bPressed_on = false, bPressed_off = false; AddTickol(i.second.second, vehicle.IsNeonLightOn(i.first), bPressed_on, bPressed_off, TICKOL::CARTHING); @@ -3026,7 +3004,4 @@ namespace sub } -} - - - +} \ No newline at end of file diff --git a/Solution/source/macros.h b/Solution/source/macros.h index 3266abcc..82e2aa28 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.0" +#define MENYOO_CURRENT_VER_ "1.7.1" #define GAME_PLAYERCOUNT 30