Fix veh spawn crash, handling editor errors

This commit is contained in:
Grinch_ 2022-01-28 19:10:56 +06:00
parent ba389f1ab7
commit 42677147f1
9 changed files with 136 additions and 98 deletions

View File

@ -37,6 +37,7 @@ private:
static void PlayAnimation(std::string& rootKey, std::string& anim, std::string& ifp); static void PlayAnimation(std::string& rootKey, std::string& anim, std::string& ifp);
static void RemoveAnimation(std::string& rootKey, std::string& anim, std::string& ifp); static void RemoveAnimation(std::string& rootKey, std::string& anim, std::string& ifp);
#ifdef GTASA #ifdef GTASA
static void PlayCutscene(std::string& rootKey, std::string& cutsceneId, std::string& interior); static void PlayCutscene(std::string& rootKey, std::string& cutsceneId, std::string& interior);
#elif GTAVC #elif GTAVC

View File

@ -37,7 +37,7 @@ void CheatMenu::DrawWindow()
ImGui::PushStyleVar(ImGuiStyleVar_FramePadding, ImGui::PushStyleVar(ImGuiStyleVar_FramePadding,
ImVec2(ImGui::GetWindowWidth() / 85, ImGui::GetWindowHeight() / 200)); ImVec2(ImGui::GetWindowWidth() / 85, ImGui::GetWindowHeight() / 200));
ProcessMenuPages(); ProcessPages();
if (m_bSizeChangedExternal) if (m_bSizeChangedExternal)
m_bSizeChangedExternal = false; m_bSizeChangedExternal = false;
@ -62,7 +62,7 @@ void CheatMenu::DrawWindow()
DrawOverlay(); DrawOverlay();
} }
void CheatMenu::ProcessMenuPages() void CheatMenu::ProcessPages()
{ {
static void* pCallback; static void* pCallback;
ImVec2 size = Ui::GetSize(3, false); ImVec2 size = Ui::GetSize(3, false);

View File

@ -44,7 +44,7 @@ private:
static void ShowAnniversaryPage(); static void ShowAnniversaryPage();
static void ShowUpdatePage(); static void ShowUpdatePage();
static void ShowWelcomePage(); static void ShowWelcomePage();
static void ProcessMenuPages(); static void ProcessPages();
static inline std::vector<HeaderData> m_headerList static inline std::vector<HeaderData> m_headerList
{ {

View File

@ -2,60 +2,57 @@
#include "filehandler.h" #include "filehandler.h"
// TODO: Clean up this mess, use structures instead? // TODO: Clean up this mess, use structures instead?
void FileHandler::GenerateHandlingFile(int pHandling, std::map<int, std::string>& storeMap) void FileHandler::GenerateHandlingFile(tHandlingData *pHandling, std::map<int, std::string>& storeMap)
{ {
FILE* fp = fopen("handling.txt", "w"); FILE* fp = fopen("handling.txt", "w");
std::string handlingId = storeMap[FindPlayerPed()->m_pVehicle->m_nModelIndex]; std::string handlingId = storeMap[FindPlayerPed()->m_pVehicle->m_nModelIndex];
float fMass = patch::Get<float>(pHandling + 0x4); float mass = pHandling->m_fMass;
float fTurnMass = patch::Get<float>(pHandling + 0xC); float turnMass = pHandling->m_fTurnMass;
float fDragMult = patch::Get<float>(pHandling + 0x10); float dragMult = pHandling->m_fDragMult;
float CentreOfMassX = patch::Get<float>(pHandling + 0x14); CVector centreOfMass = pHandling->m_vecCentreOfMass;
float CentreOfMassY = patch::Get<float>(pHandling + 0x18); int percentSubmerged = pHandling->m_nPercentSubmerged;
float CentreOfMassZ = patch::Get<float>(pHandling + 0x1C); float tractionMultiplier = pHandling->m_fTractionMultiplier;
int nPercentSubmerged = patch::Get<int>(pHandling + 0x20); float tractionLoss = pHandling->m_fTractionLoss;
float fTractionMultiplier = patch::Get<float>(pHandling + 0x28); float tractionBias = pHandling->m_fTractionBias;
float fTractionLoss = patch::Get<float>(pHandling + 0xA4); float engineAcceleration = pHandling->m_transmissionData.m_fEngineAcceleration * 12500;
float TractionBias = patch::Get<float>(pHandling + 0xA8); float engineInertia = pHandling->m_transmissionData.m_fEngineInertia;
float fEngineAcceleration = patch::Get<float>(pHandling + 0x7C) * 12500; int driveType = pHandling->m_transmissionData.m_nDriveType;
float fEngineInertia = patch::Get<float>(pHandling + 0x80); int engineType = pHandling->m_transmissionData.m_nEngineType;
int nDriveType = patch::Get<BYTE>(pHandling + 0x74); float brakeDeceleration = pHandling->m_fBrakeDeceleration * 2500;
int nEngineType = patch::Get<BYTE>(pHandling + 0x75); float brakeBias = pHandling->m_fBrakeBias;
float BrakeDeceleration = patch::Get<float>(pHandling + 0x94) * 2500; int abs = pHandling->m_bABS;
float BrakeBias = patch::Get<float>(pHandling + 0x98); float steeringLock = pHandling->m_fSteeringLock;
int ABS = patch::Get<BYTE>(pHandling + 0x9C); float susForceLevel = pHandling->m_fSuspensionForceLevel;
float SteeringLock = patch::Get<float>(pHandling + 0xA0); float susDampingLevel = pHandling->m_fSuspensionDampingLevel;
float SuspensionForceLevel = patch::Get<float>(pHandling + 0xAC); float susHighSpdComDamp = pHandling->m_fSuspensionHighSpdComDamp;
float SuspensionDampingLevel = patch::Get<float>(pHandling + 0xB0); float susUpperLimit = pHandling->m_fSuspensionUpperLimit;
float SuspensionHighSpdComDamp = patch::Get<float>(pHandling + 0xB4); float susLowerLimit = pHandling->m_fSuspensionLowerLimit;
float Suspension_upper_limit = patch::Get<float>(pHandling + 0xB8); float susBias = pHandling->m_fSuspensionBiasBetweenFrontAndRear;
float Suspension_lower_limit = patch::Get<float>(pHandling + 0xBC); float antiDiveMul = pHandling->m_fSuspensionAntiDiveMultiplier;
float Suspension_bias = patch::Get<float>(pHandling + 0xC0); float cdm = pHandling->m_fCollisionDamageMultiplier / (2000.0f * (1.0 / mass));
float Suspension_anti_dive_multiplier = patch::Get<float>(pHandling + 0xC4); int monetaryValue = pHandling->m_nMonetaryValue;
float fCollisionDamageMultiplier = patch::Get<float>(pHandling + 0xC8) * 0.338; int maxVelocity = pHandling->m_transmissionData.m_fMaxGearVelocity / *(float*)0xC2B9BC;
int nMonetaryValue = patch::Get<int>(pHandling + 0xD8); int modelFlags = pHandling->m_nModelFlags;
int MaxVelocity = patch::Get<float>(pHandling + 0x84); int handlingFlags = pHandling->m_nHandlingFlags;
MaxVelocity = MaxVelocity * 206 + (MaxVelocity - 0.918668) * 1501; int frontLight = pHandling->m_nFrontLights;
int modelFlags = patch::Get<int>(pHandling + 0xCC); int rearLight = pHandling->m_nRearLights;
int handlingFlags = patch::Get<int>(pHandling + 0xD0); int animGrp = pHandling->m_nAnimGroup;
int front_lights = patch::Get<BYTE>(pHandling + 0xDC); int numGears = pHandling->m_transmissionData.m_nNumberOfGears;
int rear_lights = patch::Get<BYTE>(pHandling + 0xDD); float seatOffsetDistance = pHandling->m_fSeatOffsetDistance;
int vehicle_anim_group = patch::Get<BYTE>(pHandling + 0xDE);
int nNumberOfGears = patch::Get<BYTE>(pHandling + 0x76);
float fSeatOffsetDistance = patch::Get<float>(pHandling + 0xD4);
// TODO: make this more readable // TODO: make this more readable
fprintf( fprintf(
fp, fp,
"\n%s\t%.5g\t%.5g\t%.5g\t%.5g\t%.5g\t%.5g\t%d\t%.5g\t%.5g\t%.5g\t%d\t%d\t%.5g\t%.5g\t%c\t%c\t%.5g\t%.5g\t%d\t%.5g\t%.5g\t%.5g\t%.5g\t%.5g\t%.5g\t%.5g\t%.5g\t%.5g\t%.5g\t%d\t%d\t%d\t%d\t%d\t%d", "\n%s\t%.5g\t%.5g\t%.5g\t%.5g\t%.5g\t%.5g\t%d\t%.5g\t%.5g\t%.5g\t%d\t%d\t%.5g\t%.5g\t%c\t%c\t%.5g\t%.5g\t%d\t%.5g\t%.5g\t%.5g\t%.5g\t%.5g\t%.5g\t%.5g\t%.5g\t%.5g\t%.5g\t%d\t%x\t%x\t%d\t%d\t%d",
handlingId.c_str(), fMass, fTurnMass, fDragMult, CentreOfMassX, CentreOfMassY, CentreOfMassZ, nPercentSubmerged, handlingId.c_str(), mass, turnMass, dragMult, centreOfMass.x, centreOfMass.y, centreOfMass.z, percentSubmerged,
fTractionMultiplier, fTractionLoss, TractionBias, nNumberOfGears, tractionMultiplier, tractionLoss, tractionBias, numGears,
MaxVelocity, fEngineAcceleration, fEngineInertia, nDriveType, nEngineType, BrakeDeceleration, BrakeBias, ABS, maxVelocity, engineAcceleration, engineInertia, driveType, engineType, brakeDeceleration, brakeBias, abs,
SteeringLock, SuspensionForceLevel, SuspensionDampingLevel, steeringLock, susForceLevel, susDampingLevel,
SuspensionHighSpdComDamp, Suspension_upper_limit, Suspension_lower_limit, Suspension_bias, susHighSpdComDamp, susUpperLimit, susLowerLimit, susBias,
Suspension_anti_dive_multiplier, fSeatOffsetDistance, antiDiveMul, seatOffsetDistance,
fCollisionDamageMultiplier, nMonetaryValue, modelFlags, handlingFlags, front_lights, rear_lights, cdm, monetaryValue, modelFlags, handlingFlags, frontLight, rearLight,
vehicle_anim_group); animGrp);
fclose(fp); fclose(fp);
} }

View File

@ -22,6 +22,6 @@ public:
TODO: Implement something that also parses modloader data TODO: Implement something that also parses modloader data
*/ */
static void FetchHandlingID(std::map<int, std::string>& storeMap); static void FetchHandlingID(std::map<int, std::string>& storeMap);
static void GenerateHandlingFile(int pHandling, std::map<int, std::string>& storeMap); static void GenerateHandlingFile(tHandlingData *pHandling, std::map<int, std::string>& storeMap);
}; };

View File

@ -609,8 +609,7 @@ void Menu::ShowPage()
Ui::CenterdText("Copyright Grinch_ 2019-2022. All rights reserved"); Ui::CenterdText("Copyright Grinch_ 2019-2022. All rights reserved");
ImGui::Dummy(ImVec2(0, 30)); ImGui::Dummy(ImVec2(0, 30));
static ImGuiTableFlags flags = ImGuiTableFlags_RowBg | ImGuiTableFlags_ScrollY; if (ImGui::BeginTable("Hall of Fame", 2, ImGuiTableFlags_ScrollY))
if (ImGui::BeginTable("Hall of Fame", 2, flags))
{ {
ImGui::TableSetupColumn("Name", ImGuiTableColumnFlags_WidthFixed, 100); ImGui::TableSetupColumn("Name", ImGuiTableColumnFlags_WidthFixed, 100);
ImGui::TableSetupColumn("Credits"); ImGui::TableSetupColumn("Credits");
@ -626,13 +625,31 @@ void Menu::ShowPage()
ImGui::TableNextColumn(); ImGui::TableNextColumn();
ImGui::Text("DKPac22"); ImGui::Text("DKPac22");
ImGui::TableNextColumn(); ImGui::TableNextColumn();
ImGui::Text("Vehicle texturing code"); ImGui::Text("Plugin SDK, vehicle texture code");
ImGui::TableNextRow(); ImGui::TableNextRow();
ImGui::TableNextColumn(); ImGui::TableNextColumn();
ImGui::Text("Junior-Djjr"); ImGui::Text("Junior-Djjr");
ImGui::TableNextColumn(); ImGui::TableNextColumn();
ImGui::Text("Code & suggestions"); ImGui::Text("Code & suggestions");
ImGui::TableNextRow();
ImGui::TableNextColumn();
ImGui::Text("Ocornut");
ImGui::TableNextColumn();
ImGui::Text("ImGui");
ImGui::TableNextRow();
ImGui::TableNextColumn();
ImGui::Text("Rebzzel");
ImGui::TableNextColumn();
ImGui::Text("Keiro");
ImGui::TableNextRow();
ImGui::TableNextColumn();
ImGui::Text("TsudaKageyu");
ImGui::TableNextColumn();
ImGui::Text("MinHook");
ImGui::EndTable(); ImGui::EndTable();
} }

View File

@ -7,7 +7,9 @@
#include <CPopulation.h> #include <CPopulation.h>
#include <CDamageManager.h> #include <CDamageManager.h>
#ifdef GTASA #ifdef GTASA
#include "tHandlingData.h"
#include "neon.h" #include "neon.h"
#include "paint.h" #include "paint.h"
#endif #endif
@ -326,7 +328,7 @@ void Vehicle::SpawnVehicle(std::string& rootkey, std::string& vehName, std::stri
int interior = BY_GAME(player->m_nAreaCode, player->m_nInterior, 0); int interior = BY_GAME(player->m_nAreaCode, player->m_nInterior, 0);
CVector pos = player->GetPosition(); CVector pos = player->GetPosition();
int speed = 0; float speed = 0;
bool bInVehicle = Command<Commands::IS_CHAR_IN_ANY_CAR>(hplayer); bool bInVehicle = Command<Commands::IS_CHAR_IN_ANY_CAR>(hplayer);
if (bInVehicle && m_Spawner::m_bSpawnInside) if (bInVehicle && m_Spawner::m_bSpawnInside)
@ -1218,10 +1220,10 @@ void Vehicle::ShowPage()
{ {
ImGui::Spacing(); ImGui::Spacing();
CBaseModelInfo* info = CModelInfo::GetModelInfo(pPlayer->m_pVehicle->m_nModelIndex); // https://github.com/multitheftauto/mtasa-blue/blob/16769b8d1c94e2b9fe6323dcba46d1305f87a190/Client/game_sa/CModelInfoSA.h#L213
int pHandling = patch::Get<WORD>((int)info + 0x4A, false); CBaseModelInfo* pInfo = CModelInfo::GetModelInfo(pPlayer->m_pVehicle->m_nModelIndex);
pHandling *= 0xE0; int handlingID = patch::Get<WORD>((int)pInfo + 74, false); // CBaseModelInfo + 74 = handlingID
pHandling += 0xC2B9DC; tHandlingData *pHandlingData = reinterpret_cast<tHandlingData*>(0xC2B9DC + (handlingID * 224)); // sizeof(tHandlingData) = 224
if (ImGui::Button("Reset handling", ImVec2(Ui::GetSize(3)))) if (ImGui::Button("Reset handling", ImVec2(Ui::GetSize(3))))
{ {
@ -1233,76 +1235,97 @@ void Vehicle::ShowPage()
if (ImGui::Button("Save to file", ImVec2(Ui::GetSize(3)))) if (ImGui::Button("Save to file", ImVec2(Ui::GetSize(3))))
{ {
FileHandler::GenerateHandlingFile(pHandling, m_VehicleIDE); FileHandler::GenerateHandlingFile(pHandlingData, m_VehicleIDE);
SetHelpMessage("Handling saved", false, false, false); SetHelpMessage("Handling saved", false, false, false);
} }
ImGui::SameLine(); ImGui::SameLine();
if (ImGui::Button("Read more", ImVec2(Ui::GetSize(3)))) if (ImGui::Button("Read more", ImVec2(Ui::GetSize(3))))
{
ShellExecute(NULL, "open", "https://projectcerbera.com/gta/sa/tutorials/handling", NULL, NULL, ShellExecute(NULL, "open", "https://projectcerbera.com/gta/sa/tutorials/handling", NULL, NULL,
SW_SHOWNORMAL); SW_SHOWNORMAL);
}
ImGui::Spacing(); ImGui::Spacing();
ImGui::BeginChild("HandlingChild"); ImGui::BeginChild("HandlingChild");
static std::vector<Ui::NamedValue> abs{ {"On", 1}, {"Off", 0} }; static std::vector<Ui::NamedValue> abs{ {"On", 1}, {"Off", 0} };
Ui::EditRadioButtonAddressEx("Abs", pHandling + 0x9C, abs); Ui::EditRadioButtonAddressEx("Abs", (int)&pHandlingData->m_bABS, abs);
Ui::EditFloat("Anti dive multiplier", pHandling + 0xC4, 0.0f, 0.0f, 1.0f); Ui::EditFloat("Anti dive multiplier", (int)&pHandlingData->m_fSuspensionAntiDiveMultiplier, 0.0f, 0.0f, 1.0f);
Ui::EditFloat("Brake bias", pHandling + 0x98, 0.0f, 0.0f, 1.0f); Ui::EditFloat("Brake bias", (int)&pHandlingData->m_fBrakeBias, 0.0f, 0.0f, 1.0f);
Ui::EditFloat("Brake deceleration", pHandling + 0x94, 0.0f, 0.0f, 20.0f, 2500.0f);
Ui::EditFloat("Centre of mass X", pHandling + 0x14, -10.0f, -10.0f, 10.0f); // Brake deceleration calculation
Ui::EditFloat("Centre of mass Y", pHandling + 0x18, -10.0f, -10.0f, 10.0f); float BrakeDeceleration = pHandlingData->m_fBrakeDeceleration * 2500;
Ui::EditFloat("Centre of mass Z", pHandling + 0x1C, -10.0f, -10.0f, 10.0f); Ui::EditFloat("Brake deceleration", (int)&pHandlingData->m_fBrakeDeceleration, 0.0f, 0.0f, 20.0f, 2500.0f);
Ui::EditFloat("Collision damage multiplier", pHandling + 0xC8, 0.0f, 0.0f, 1.0f, 0.3381f); pHandlingData->m_fBrakeDeceleration = BrakeDeceleration / 2500;
Ui::EditFloat("Damping level", pHandling + 0xB0, -10.0f, -10.0f, 10.0f); // test later
Ui::EditFloat("Drag mult", pHandling + 0x10, 0.0f, 0.0f, 30.0f); Ui::EditFloat("Centre of mass X", (int)&pHandlingData->m_vecCentreOfMass.x, -10.0f, -10.0f, 10.0f);
Ui::EditFloat("Centre of mass Y", (int)&pHandlingData->m_vecCentreOfMass.y, -10.0f, -10.0f, 10.0f);
Ui::EditFloat("Centre of mass Z", (int)&pHandlingData->m_vecCentreOfMass.z, -10.0f, -10.0f, 10.0f);
// CDM calculations
float factor = (1.0 / pHandlingData->m_fMass);
float fCDM = pHandlingData->m_fCollisionDamageMultiplier / (2000.0f * factor);
Ui::EditFloat("Collision damage multiplier", (int)&fCDM, 0.0f, 0.0f, 1.0f, 0.3381f);
pHandlingData->m_fCollisionDamageMultiplier = factor * fCDM * 2000.0f;
Ui::EditFloat("Damping level", (int)&pHandlingData->m_fSuspensionDampingLevel, -10.0f, -10.0f, 10.0f); // test later
Ui::EditFloat("Drag mult", (int)&pHandlingData->m_fDragMult, 0.0f, 0.0f, 30.0f);
static std::vector<Ui::NamedValue> drive_type static std::vector<Ui::NamedValue> drive_type
{ {
{"Front wheel drive", 70}, {"Rear wheel drive", 82}, {"Four wheel drive", 52} {"Front wheel drive", 70}, {"Rear wheel drive", 82}, {"Four wheel drive", 52}
}; };
Ui::EditRadioButtonAddressEx("Drive type", pHandling + 0x74, drive_type); Ui::EditRadioButtonAddressEx("Drive type", (int)&pHandlingData->m_transmissionData.m_nDriveType, drive_type);
Ui::EditFloat("Engine acceleration", pHandling + 0x7C, 0.0f, 0.0f, 49.0f, 12500.0f); // Engine acceleration calculation
Ui::EditFloat("Engine inertia", pHandling + 0x80, 0.1f, 0.1f, 400.0f); float fEngineAcceleration = pHandlingData->m_transmissionData.m_fEngineAcceleration * 12500;
Ui::EditFloat("Engine acceleration", (int)&fEngineAcceleration, 0.0f, 0.0f, 49.0f, 12500.0f);
pHandlingData->m_transmissionData.m_fEngineAcceleration = fEngineAcceleration / 12500;
Ui::EditFloat("Engine inertia", (int)&pHandlingData->m_transmissionData.m_fEngineInertia, 0.1f, 0.1f, 400.0f);
static std::vector<Ui::NamedValue> engine_type{ {"Petrol", 80}, {"Diseal", 68}, {"Electric", 69} }; static std::vector<Ui::NamedValue> engine_type{ {"Petrol", 80}, {"Diseal", 68}, {"Electric", 69} };
Ui::EditRadioButtonAddressEx("Engine type", pHandling + 0x75, engine_type); Ui::EditRadioButtonAddressEx("Engine type", (int)&pHandlingData->m_transmissionData.m_nEngineType, engine_type);
std::vector<Ui::NamedValue> front_lights{ {"Long", 0}, {"Small", 1}, {"Big", 2}, {"Tall", 3} }; std::vector<Ui::NamedValue> front_lights{ {"Long", 0}, {"Small", 1}, {"Big", 2}, {"Tall", 3} };
Ui::EditRadioButtonAddressEx("Front lights", pHandling + 0xDC, front_lights); Ui::EditRadioButtonAddressEx("Front lights", (int)&pHandlingData->m_nFrontLights, front_lights);
Ui::EditFloat("Force level", pHandling + 0xAC, -10.0f, -10.0f, 10.0f); // test later Ui::EditFloat("Force level", (int)&pHandlingData->m_fSuspensionForceLevel, -10.0f, -10.0f, 10.0f); // test later
Ui::EditBits("Handling flags", pHandling + 0xD0, m_HandlingFlagNames); Ui::EditBits("Handling flags", (int)&pHandlingData->m_nHandlingFlags, m_HandlingFlagNames);
Ui::EditFloat("High speed damping", pHandling + 0xB4, -10.0f, -10.0f, 10.0f); // test later Ui::EditFloat("High speed damping", (int)&pHandlingData->m_fSuspensionDampingLevel, -10.0f, -10.0f, 10.0f); // test later
Ui::EditFloat("Lower limit", pHandling + 0xBC, -10.0f, -10.0f, 10.0f); // test later Ui::EditFloat("Lower limit", (int)&pHandlingData->m_fSuspensionLowerLimit, -10.0f, -10.0f, 10.0f); // test later
Ui::EditFloat("Mass", pHandling + 0x4, 1.0f, 1.0f, 50000.0f); Ui::EditFloat("Mass", (int)&pHandlingData->m_fMass, 1.0f, 1.0f, 50000.0f);
///fcommon.UpdateAddress({ name = 'Max velocity',address = phandling + 0x84 ,size = 4,min = 0,max = 2,is_float = true,cvalue = 0.01 , save = false }) // Max Velocity calculation
int MaxVelocity = pHandlingData->m_transmissionData.m_fMaxGearVelocity / *(float*)0xC2B9BC;
Ui::EditFloat("Max velocity", (int)&MaxVelocity, 1.0f, 1.0f, 1000.0f);
pHandlingData->m_transmissionData.m_fMaxGearVelocity = MaxVelocity * (*(float*)0xC2B9BC);
Ui::EditBits("Model flags", pHandling + 0xCC, m_ModelFlagNames); Ui::EditBits("Model flags", (int)&pHandlingData->m_nModelFlags, m_ModelFlagNames);
Ui::EditAddress<int>("Monetary value", pHandling + 0xD8, 1, 1, 100000); Ui::EditAddress<int>("Monetary value", (int)&pHandlingData->m_nMonetaryValue, 1, 1, 100000);
Ui::EditAddress<BYTE>("Number of gears", pHandling + 0x76, 1, 1, 10); Ui::EditAddress<BYTE>("Number of gears", (int)&pHandlingData->m_transmissionData.m_nNumberOfGears, 1, 1, 10);
Ui::EditAddress<BYTE>("Percent submerged", pHandling + 0x20, 10, 10, 120); Ui::EditAddress<BYTE>("Percent submerged", (int)&pHandlingData->m_nPercentSubmerged, 10, 10, 120);
static std::vector<Ui::NamedValue> rear_lights{ {"Long", 0}, {"Small", 1}, {"Big", 2}, {"Tall", 3} }; static std::vector<Ui::NamedValue> rear_lights{ {"Long", 0}, {"Small", 1}, {"Big", 2}, {"Tall", 3} };
Ui::EditRadioButtonAddressEx("Rear lights", pHandling + 0xDD, rear_lights); Ui::EditRadioButtonAddressEx("Rear lights", (int)&pHandlingData->m_nRearLights, rear_lights);
Ui::EditFloat("Seat offset distance", pHandling + 0xD4, 0.0f, 0.0f, 1.0f); Ui::EditFloat("Seat offset distance", (int)&pHandlingData->m_fSeatOffsetDistance, 0.0f, 0.0f, 1.0f);
Ui::EditFloat("Steering lock", pHandling + 0xA0, 10.0f, 10.0f, 50.0f); Ui::EditFloat("Steering lock", (int)&pHandlingData->m_fSteeringLock, 10.0f, 10.0f, 50.0f);
Ui::EditFloat("Suspension bias", pHandling + 0xC0, 0.0f, 0.0f, 1.0f); Ui::EditFloat("Suspension bias", (int)&pHandlingData->m_fSuspensionBiasBetweenFrontAndRear, 0.0f, 0.0f, 1.0f);
Ui::EditFloat("Traction bias", pHandling + 0xA8, 0.0f, 0.0f, 1.0f); Ui::EditFloat("Traction bias", (int)&pHandlingData->m_fTractionBias, 0.0f, 0.0f, 1.0f);
Ui::EditFloat("Traction loss", pHandling + 0xA4, 0.0f, 0.0f, 1.0f); Ui::EditFloat("Traction loss", (int)&pHandlingData->m_fTractionLoss, 0.0f, 0.0f, 1.0f);
Ui::EditFloat("Traction multiplier", pHandling + 0x28, 0.5f, 0.5f, 2.0f); Ui::EditFloat("Traction multiplier", (int)&pHandlingData->m_fTractionMultiplier, 0.5f, 0.5f, 2.0f);
Ui::EditFloat("Turn mass", pHandling + 0xC, 20.0f, 20.0f, 1000.0f); // test later Ui::EditFloat("Turn mass", (int)&pHandlingData->m_fTurnMass, 20.0f, 20.0f, 1000.0f); // test later
Ui::EditFloat("Upper limit", pHandling + 0xB8, -1.0f, -1.0f, 1.0f); Ui::EditFloat("Upper limit", (int)&pHandlingData->m_fSuspensionUpperLimit, -1.0f, -1.0f, 1.0f);
Ui::EditAddress<BYTE>("Vehicle anim group", pHandling + 0xDE, 0, 0, 20); Ui::EditAddress<BYTE>("Vehicle anim group", (int)&pHandlingData->m_nAnimGroup, 0, 0, 20);
ImGui::EndChild(); ImGui::EndChild();

View File

@ -57,7 +57,7 @@ private:
}; };
#ifdef GTASA #ifdef GTASA
static inline std::vector<std::string>(m_HandlingFlagNames) = // 32 flags static inline std::vector<std::string> m_HandlingFlagNames = // 32 flags
{ {
"1G_BOOST", "2G_BOOST", "NPC_ANTI_ROLL", "NPC_NEUTRAL_HANDL", "NO_HANDBRAKE", "STEER_REARWHEELS", "1G_BOOST", "2G_BOOST", "NPC_ANTI_ROLL", "NPC_NEUTRAL_HANDL", "NO_HANDBRAKE", "STEER_REARWHEELS",
"HB_REARWHEEL_STEER", "ALT_STEER_OPT", "HB_REARWHEEL_STEER", "ALT_STEER_OPT",
@ -69,7 +69,7 @@ private:
"Unused 4" "Unused 4"
}; };
static inline std::vector<std::string>(m_ModelFlagNames) = // 32 flags static inline std::vector<std::string> m_ModelFlagNames = // 32 flags
{ {
"IS_VAN", "IS_BUS", "IS_LOW", "IS_BIG", "REVERSE_BONNET", "HANGING_BOOT", "TAILGATE_BOOT", "NOSWING_BOOT", "IS_VAN", "IS_BUS", "IS_LOW", "IS_BIG", "REVERSE_BONNET", "HANGING_BOOT", "TAILGATE_BOOT", "NOSWING_BOOT",
"NO_DOORS", "TANDEM_SEATS", "NO_DOORS", "TANDEM_SEATS",

View File

@ -2,5 +2,5 @@
#define MENU_NAME "Cheat Menu" #define MENU_NAME "Cheat Menu"
#define MENU_VERSION_NUMBER "3.1" #define MENU_VERSION_NUMBER "3.1"
#define MENU_VERSION MENU_VERSION_NUMBER"-beta" #define MENU_VERSION MENU_VERSION_NUMBER"-beta"
#define BUILD_NUMBER "20220122" #define BUILD_NUMBER "20220128"
#define MENU_TITLE MENU_NAME " v" MENU_VERSION #define MENU_TITLE MENU_NAME " v" MENU_VERSION