Skip to content

Commit

Permalink
Merge pull request #443 from itsjustcurtis/master
Browse files Browse the repository at this point in the history
2802.0 compatibility update and functionality
  • Loading branch information
MAFINS authored Dec 23, 2022
2 parents a62abbc + 13632a3 commit 656b91a
Show file tree
Hide file tree
Showing 11 changed files with 190 additions and 46 deletions.
10 changes: 7 additions & 3 deletions Solution/source/Memory/GTAmemory.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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<INT32>(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<INT32>(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<INT32>(4539659) = uSure ? 1 : 0; break;
case eGameVersion::VER_1_0_2802_0: default:
*GTAmemory::GetGlobalPtr<INT32>(4540726) = uSure ? 1 : 0; break;
}
}

Expand Down
19 changes: 14 additions & 5 deletions Solution/source/Menu/Menu.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -590,8 +590,7 @@ void Menu::while_opened()
{
SetSub_closed();
}



}
void Menu::Up(bool playSound)
{
Expand Down Expand Up @@ -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;

Expand All @@ -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
Expand All @@ -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");
Expand Down Expand Up @@ -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;
Expand Down
9 changes: 9 additions & 0 deletions Solution/source/Natives/natives.h
Original file line number Diff line number Diff line change
Expand Up @@ -357,6 +357,7 @@ namespace ENTITY
static void SET_ENTITY_LOAD_COLLISION_FLAG(Entity entity, BOOL toggle) { invoke<Void>(0x0DC7CABAB1E9B67E, entity, toggle); } // 0x0DC7CABAB1E9B67E 0xC52F295B
static BOOL HAS_COLLISION_LOADED_AROUND_ENTITY(Entity entity) { return invoke<BOOL>(0xE9676F61BC0B3321, entity); } // 0xE9676F61BC0B3321 0x851687F9
static void SET_ENTITY_MAX_SPEED(Entity entity, float speed) { invoke<Void>(0x0E46A3FCBDE2A1B1, entity, speed); } // 0x0E46A3FCBDE2A1B1 0x46AFFED3
static void SET_VEHICLE_MAX_SPEED(Vehicle vehicle, float speed) { invoke<Void>(0xBAA045B4E42F3C06, vehicle, speed); } // 0xBAA045B4E42F3C06 b1103
static void SET_ENTITY_ONLY_DAMAGED_BY_PLAYER(Entity entity, BOOL toggle) { invoke<Void>(0x79F020FF9EDC0748, entity, toggle); } // 0x79F020FF9EDC0748 0x4B707F50
static void SET_ENTITY_ONLY_DAMAGED_BY_RELATIONSHIP_GROUP(Entity entity, BOOL p1, Any p2) { invoke<Void>(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<Void>(0xFAEE099C6F890BB8, entity, bulletProof, fireProof, explosionProof, collisionProof, meleeProof, p6, p7, drownProof); } // 0xFAEE099C6F890BB8 0x7E9EAB66
Expand Down Expand Up @@ -1208,6 +1209,8 @@ namespace VEHICLE
static void SET_RENDER_TRAIN_AS_DERAILED(Vehicle train, BOOL toggle) { invoke<Void>(0x317B11A312DF5534, train, toggle); } // 0x317B11A312DF5534 0x899D9092
static void SET_VEHICLE_EXTRA_COLOURS(Vehicle vehicle, int pearlescentColor, int wheelColor) { invoke<Void>(0x2036F561ADD12E33, vehicle, pearlescentColor, wheelColor); } // 0x2036F561ADD12E33 0x515DB2A0
static void GET_VEHICLE_EXTRA_COLOURS(Vehicle vehicle, int* pearlescentColor, int* wheelColor) { invoke<Void>(0x3BC4245933A166F7, vehicle, pearlescentColor, wheelColor); } // 0x3BC4245933A166F7 0x80E4659B
static void GET_VEHICLE_EXTRA_COLOUR_5(Vehicle vehicle, int* color) { invoke<Void>(0x7D1464D472D32136, vehicle, color); }// 0x7D1464D472D32136 b505
static void GET_VEHICLE_EXTRA_COLOUR_6(Vehicle vehicle, int* color) { invoke<Void>(0xB7635E80A5C31BFF, vehicle, color); }// 0xB7635E80A5C31BFF b505
static void STOP_ALL_GARAGE_ACTIVITY() { invoke<Void>(0x0F87E938BDF29D66); } // 0x0F87E938BDF29D66 0x17A0BCE5
static void SET_VEHICLE_FIXED(Vehicle vehicle) { invoke<Void>(0x115722B1B9C14C1C, vehicle); } // 0x115722B1B9C14C1C 0x17469AA1
static void SET_VEHICLE_DEFORMATION_FIXED(Vehicle vehicle) { invoke<Void>(0x953DA1E1B12C0491, vehicle); } // 0x953DA1E1B12C0491 0xDD2920C8
Expand All @@ -1230,6 +1233,9 @@ namespace VEHICLE
static void RAISE_CONVERTIBLE_ROOF(Vehicle vehicle, BOOL instantlyRaise) { invoke<Void>(0x8F5FB35D7E88FC70, vehicle, instantlyRaise); } // 0x8F5FB35D7E88FC70 0xA4E4CBA3
static int GET_CONVERTIBLE_ROOF_STATE(Vehicle vehicle) { return invoke<int>(0xF8C397922FC03F41, vehicle); } // 0xF8C397922FC03F41 0x1B09714D
static BOOL IS_VEHICLE_A_CONVERTIBLE(Vehicle vehicle, BOOL p1) { return invoke<BOOL>(0x52F357A30698BCCE, vehicle, p1); } // 0x52F357A30698BCCE 0x6EF54490
static BOOL TRANSFORM_TO_SUBMARINE(Vehicle vehicle, BOOL noAnimation) { return invoke<BOOL>(0xBE4C854FFDB6EEBE, vehicle, noAnimation); } // 0x52F357A30698BCCE 0x6EF54490
static void TRANSFORM_TO_CAR(Vehicle vehicle, BOOL noAnimation) { invoke<Void>(0x2A69FFD1B42BFF9E, vehicle, noAnimation); } // 0x2A69FFD1B42BFF9E 0xD8B90941 b1290
static BOOL IS_VEHICLE_IN_SUBMARINE_MODE(Vehicle vehicle) { return invoke<BOOL>(0xA77DC70BD689A1E5, vehicle); } // 0xA77DC70BD689A1E5 0xE2FF06DB b1290
static BOOL IS_VEHICLE_STOPPED_AT_TRAFFIC_LIGHTS(Vehicle vehicle) { return invoke<BOOL>(0x2959F696AE390A99, vehicle); } // 0x2959F696AE390A99 0x69200FA4
static void SET_VEHICLE_DAMAGE(Vehicle vehicle, float xOffset, float yOffset, float zOffset, float damage, float radius, BOOL p6) { invoke<Void>(0xA1DD317EA8FD4F29, vehicle, xOffset, yOffset, zOffset, damage, radius, p6); } // 0xA1DD317EA8FD4F29 0x21B458B2
static float GET_VEHICLE_ENGINE_HEALTH(Vehicle vehicle) { return invoke<float>(0xC45D23BAF168AAB8, vehicle); } // 0xC45D23BAF168AAB8 0x8880038A
Expand All @@ -1251,6 +1257,9 @@ namespace VEHICLE
static void SET_VEHICLE_LIVERY(Vehicle vehicle, int livery) { invoke<Void>(0x60BF608F1B8CD1B6, vehicle, livery); } // 0x60BF608F1B8CD1B6 0x7AD87059
static int GET_VEHICLE_LIVERY(Vehicle vehicle) { return invoke<int>(0x2BB9230590DA5E8A, vehicle); } // 0x2BB9230590DA5E8A 0xEC82A51D
static int GET_VEHICLE_LIVERY_COUNT(Vehicle vehicle) { return invoke<int>(0x87B63E25A529D526, vehicle); } // 0x87B63E25A529D526 0xFB0CA947
static void SET_VEHICLE_LIVERY2(Vehicle vehicle, int livery) { invoke<Void>(0xA6D3A8750DC73270, vehicle, livery); } // 0xA6D3A8750DC73270 b505
static int GET_VEHICLE_LIVERY2(Vehicle vehicle) { return invoke<int>(0x60190048C0764A26, vehicle); } // 0x60190048C0764A26 b505
static int GET_VEHICLE_LIVERY2_COUNT(Vehicle vehicle) { return invoke<int>(0x5ECB40269053C0D4, vehicle); } // 0x5ECB40269053C0D4 b505
static BOOL IS_VEHICLE_WINDOW_INTACT(Vehicle vehicle, int windowIndex) { return invoke<BOOL>(0x46E571A0E20D01F1, vehicle, windowIndex); } // 0x46E571A0E20D01F1 0xAC4EF23D
static BOOL ARE_ALL_VEHICLE_WINDOWS_INTACT(Vehicle vehicle) { return invoke<BOOL>(0x11D862A3E977A9EF, vehicle); } // 0x11D862A3E977A9EF 0xBB619744
static BOOL _IS_ANY_VEHICLE_SEAT_EMPTY(Vehicle vehicle) { return invoke<BOOL>(0x2D34FC3BC4ADB780, vehicle); } // 0x2D34FC3BC4ADB780 0x648E685A
Expand Down
5 changes: 3 additions & 2 deletions Solution/source/Scripting/GTAentity.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
Expand Down Expand Up @@ -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
{
Expand Down
5 changes: 4 additions & 1 deletion Solution/source/Scripting/GTAvehicle.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -656,7 +656,10 @@ void GTAvehicle::PaintFade_set(float value)

VehicleRoofState GTAvehicle::RoofState_get() const
{
return static_cast<VehicleRoofState>(GET_CONVERTIBLE_ROOF_STATE(this->mHandle));
if (_IS_THIS_MODEL_AN_AMPHIBIOUS_CAR(this->mHandle))
return static_cast<VehicleRoofState>(1);
else
return static_cast<VehicleRoofState>(GET_CONVERTIBLE_ROOF_STATE(this->mHandle));
}
void GTAvehicle::RoofState_set(VehicleRoofState value)
{
Expand Down
123 changes: 101 additions & 22 deletions Solution/source/Submenus/VehicleModShop.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand All @@ -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)
{
Expand Down Expand Up @@ -644,33 +644,82 @@ 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)
{
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_()
{
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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;
}
Expand Down Expand Up @@ -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 (...)
{
Expand Down Expand Up @@ -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 (...)
{
Expand Down Expand Up @@ -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 (...)
{
Expand Down Expand Up @@ -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 (...)
{
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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());
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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;
Expand Down
Loading

0 comments on commit 656b91a

Please sign in to comment.