From 7af4a1a84d9df4c127673cf99c98963d54f4306d Mon Sep 17 00:00:00 2001 From: Carlos Menezes Date: Tue, 19 Mar 2024 11:06:09 +0000 Subject: [PATCH 01/12] chore: rename client properties --- client/src/classes/Audio.cpp | 2 +- client/src/classes/Blip.cpp | 2 +- client/src/classes/Checkpoint.cpp | 2 +- client/src/classes/Handling.cpp | 2 +- client/src/classes/LocalObject.cpp | 17 ++++++++--------- client/src/classes/LocalPed.cpp | 5 ++--- client/src/classes/LocalVehicle.cpp | 5 ++--- client/src/classes/Marker.cpp | 2 +- client/src/classes/Player.cpp | 2 +- client/src/classes/RmlDocument.cpp | 4 ++-- client/src/classes/RmlElement.cpp | 4 ++-- client/src/classes/Vehicle.cpp | 7 +++---- client/src/classes/VirtualEntity.cpp | 2 +- client/src/classes/WebView.cpp | 6 +++--- 14 files changed, 29 insertions(+), 33 deletions(-) diff --git a/client/src/classes/Audio.cpp b/client/src/classes/Audio.cpp index 66d7da297..a1dc10d55 100644 --- a/client/src/classes/Audio.cpp +++ b/client/src/classes/Audio.cpp @@ -11,7 +11,7 @@ extern js::Class audioClass("Audio", [](js::ClassTemplate& tpl) tpl.Property<&alt::IAudio::GetOutputs>("outputs"); tpl.Property<&alt::IAudio::GetCurrentTime>("currentTime"); tpl.Property<&alt::IAudio::GetMaxTime>("maxTime"); - tpl.Property<&alt::IAudio::IsPlaying>("isPlaying"); + tpl.Property<&alt::IAudio::IsPlaying>("playing"); tpl.Method<&alt::IAudio::AddOutput>("addOutput"); tpl.Method<&alt::IAudio::RemoveOutput>("removeOutput"); diff --git a/client/src/classes/Blip.cpp b/client/src/classes/Blip.cpp index 3cff3fe20..d6d2fdede 100644 --- a/client/src/classes/Blip.cpp +++ b/client/src/classes/Blip.cpp @@ -17,7 +17,7 @@ extern js::Class blipClass("Blip", &sharedBlipClass, nullptr, [](js::ClassTempla tpl.BindToType(alt::IBaseObject::Type::BLIP); tpl.Property<&alt::IBlip::GetGameID>("scriptID"); - tpl.Property<&alt::IBlip::IsStreamedIn>("isStreamedIn"); + tpl.Property<&alt::IBlip::IsStreamedIn>("streamedIn"); tpl.GetByID(); tpl.GetByRemoteID(); diff --git a/client/src/classes/Checkpoint.cpp b/client/src/classes/Checkpoint.cpp index 4ec12aa8e..c6d6fffe0 100644 --- a/client/src/classes/Checkpoint.cpp +++ b/client/src/classes/Checkpoint.cpp @@ -17,7 +17,7 @@ extern js::Class checkpointClass("Checkpoint", &sharedCheckpointClass, nullptr, tpl.BindToType(alt::IBaseObject::Type::CHECKPOINT); tpl.Property<&alt::ICheckpoint::GetGameID>("scriptID"); - tpl.Property<&alt::ICheckpoint::IsStreamedIn>("isStreamedIn"); + tpl.Property<&alt::ICheckpoint::IsStreamedIn>("streamedIn"); tpl.GetByID(); tpl.GetByRemoteID(); diff --git a/client/src/classes/Handling.cpp b/client/src/classes/Handling.cpp index 4582fdc1d..0b9cedcea 100644 --- a/client/src/classes/Handling.cpp +++ b/client/src/classes/Handling.cpp @@ -1394,7 +1394,7 @@ extern js::Class handlingClass("Handling", [](js::ClassTemplate& tpl) tpl.Property("modelFlags", ModelFlagsGetter, ModelFlagsSetter); tpl.Property("handlingFlags", HandlingFlagsGetter, HandlingFlagsSetter); tpl.Property("damageFlags", DamageFlagsGetter, DamageFlagsSetter); - tpl.Property("isModified", IsModified); + tpl.Property("modified", IsModified); tpl.Method("reset", Reset); }, true); diff --git a/client/src/classes/LocalObject.cpp b/client/src/classes/LocalObject.cpp index a95772912..20f05fdcc 100644 --- a/client/src/classes/LocalObject.cpp +++ b/client/src/classes/LocalObject.cpp @@ -13,8 +13,7 @@ static void GetByScriptID(js::FunctionContext& ctx) if(!ctx.GetArg(0, scriptId)) return; auto obj = alt::ICore::Instance().GetWorldObjectByScriptID(scriptId); - if (obj && obj->GetType() == alt::IBaseObject::Type::LOCAL_OBJECT) - return ctx.Return(obj); + if(obj && obj->GetType() == alt::IBaseObject::Type::LOCAL_OBJECT) return ctx.Return(obj); ctx.Return(nullptr); } @@ -26,10 +25,10 @@ static void SetComponentTintIndex(js::FunctionContext& ctx) alt::ILocalObject* weaponObject = ctx.GetThisObject(); uint32_t componentType; - if (!ctx.GetArg(0, componentType)) return; + if(!ctx.GetArg(0, componentType)) return; uint32_t tintIndex; - if (!ctx.GetArg(1, tintIndex)) return; + if(!ctx.GetArg(1, tintIndex)) return; weaponObject->SetComponentTintIndex(componentType, tintIndex); } @@ -78,15 +77,15 @@ extern js::Class localObjectClass("LocalObject", &objectClass, nullptr, [](js::C tpl.Property<&alt::ILocalObject::GetModel, &alt::ILocalObject::SetModel>("model"); tpl.Property<&alt::ILocalObject::GetAlpha, &alt::ILocalObject::SetAlpha>("alpha"); - tpl.Property<&alt::ILocalObject::IsDynamic>("isDynamic"); + tpl.Property<&alt::ILocalObject::IsDynamic>("dynamic"); tpl.Property<&alt::ILocalObject::GetLodDistance, &alt::ILocalObject::SetLodDistance>("lodDistance"); tpl.Property<&alt::ILocalObject::HasGravity, &alt::ILocalObject::ToggleGravity>("hasGravity"); - tpl.Property<&alt::ILocalObject::IsCollisionEnabled>("isCollisionEnabled"); + tpl.Property<&alt::ILocalObject::IsCollisionEnabled>("collisionEnabled"); tpl.Property<&alt::ILocalObject::IsPositionFrozen, &alt::ILocalObject::SetPositionFrozen>("positionFrozen"); tpl.Property<&alt::ILocalObject::GetTextureVariation, &alt::ILocalObject::SetTextureVariation>("textureVariation"); - tpl.Property<&alt::ILocalObject::IsWorldObject>("isWorldObject"); - tpl.Property<&alt::ILocalObject::IsWeaponObject>("isWeaponObject"); - tpl.Property<&alt::ILocalObject::IsStreamedIn>("isStreamedIn"); + tpl.Property<&alt::ILocalObject::IsWorldObject>("worldObject"); + tpl.Property<&alt::ILocalObject::IsWeaponObject>("weaponObject"); + tpl.Property<&alt::ILocalObject::IsStreamedIn>("streamedIn"); tpl.Property<&alt::ILocalObject::UsesStreaming>("useStreaming"); tpl.Property<&alt::ILocalObject::GetStreamingDistance>("streamingDistance"); tpl.Property<&alt::ILocalObject::GetVisible, &alt::ILocalObject::SetVisible>("visible"); diff --git a/client/src/classes/LocalPed.cpp b/client/src/classes/LocalPed.cpp index 8f66bdd48..5774258ee 100644 --- a/client/src/classes/LocalPed.cpp +++ b/client/src/classes/LocalPed.cpp @@ -27,8 +27,7 @@ static void GetByScriptID(js::FunctionContext& ctx) if(!ctx.GetArg(0, scriptId)) return; auto obj = alt::ICore::Instance().GetWorldObjectByScriptID(scriptId); - if (obj && obj->GetType() == alt::IBaseObject::Type::LOCAL_PED) - return ctx.Return(obj); + if(obj && obj->GetType() == alt::IBaseObject::Type::LOCAL_PED) return ctx.Return(obj); ctx.Return(nullptr); } @@ -43,7 +42,7 @@ extern js::Class localPedClass("LocalPed", &pedClass, nullptr, [](js::ClassTempl tpl.Property<&alt::ILocalPed::GetStreamingDistance>("streamingDistance"); tpl.Property<&alt::ILocalPed::IsVisible, &alt::ILocalPed::SetVisible>("visible"); tpl.Property<&alt::ILocalPed::GetScriptID>("scriptID"); - tpl.Property<&alt::ILocalPed::IsStreamedIn>("isStreamedIn"); + tpl.Property<&alt::ILocalPed::IsStreamedIn>("streamedIn"); tpl.GetByID(); tpl.StaticFunction("getByScriptID", &GetByScriptID); diff --git a/client/src/classes/LocalVehicle.cpp b/client/src/classes/LocalVehicle.cpp index 5136c1c94..e39bdc6dd 100644 --- a/client/src/classes/LocalVehicle.cpp +++ b/client/src/classes/LocalVehicle.cpp @@ -27,8 +27,7 @@ static void GetByScriptID(js::FunctionContext& ctx) if(!ctx.GetArg(0, scriptId)) return; auto obj = alt::ICore::Instance().GetWorldObjectByScriptID(scriptId); - if (obj && obj->GetType() == alt::IBaseObject::Type::LOCAL_VEHICLE) - return ctx.Return(obj); + if(obj && obj->GetType() == alt::IBaseObject::Type::LOCAL_VEHICLE) return ctx.Return(obj); ctx.Return(nullptr); } @@ -43,7 +42,7 @@ extern js::Class localVehicleClass("LocalVehicle", &vehicleClass, nullptr, [](js tpl.Property<&alt::ILocalPed::GetStreamingDistance>("streamingDistance"); tpl.Property<&alt::ILocalPed::IsVisible, &alt::ILocalPed::SetVisible>("visible"); tpl.Property<&alt::ILocalPed::GetScriptID>("scriptID"); - tpl.Property<&alt::ILocalPed::IsStreamedIn>("isStreamedIn"); + tpl.Property<&alt::ILocalPed::IsStreamedIn>("streamedIn"); tpl.GetByID(); tpl.StaticFunction("getByScriptID", &GetByScriptID); diff --git a/client/src/classes/Marker.cpp b/client/src/classes/Marker.cpp index 6bdf7b464..8ba4fba97 100644 --- a/client/src/classes/Marker.cpp +++ b/client/src/classes/Marker.cpp @@ -6,7 +6,7 @@ extern js::Class markerClass("Marker", &sharedMarkerClass, nullptr, [](js::Class { tpl.BindToType(alt::IBaseObject::Type::MARKER); - tpl.Property<&alt::IMarker::IsStreamedIn>("isStreamedIn"); + tpl.Property<&alt::IMarker::IsStreamedIn>("streamedIn"); tpl.GetByID(); tpl.GetByRemoteID(); diff --git a/client/src/classes/Player.cpp b/client/src/classes/Player.cpp index be446e7e0..a5e4268c1 100644 --- a/client/src/classes/Player.cpp +++ b/client/src/classes/Player.cpp @@ -35,7 +35,7 @@ extern js::Class playerClass("Player", &sharedPlayerClass, nullptr, [](js::Class { tpl.BindToType(alt::IBaseObject::Type::PLAYER); - tpl.Property<&alt::IPlayer::IsTalking>("isTalking"); + tpl.Property<&alt::IPlayer::IsTalking>("talking"); tpl.Property<&alt::IPlayer::GetMicLevel>("micLevel"); tpl.Property<&alt::IPlayer::GetTaskData>("taskData"); tpl.Property<&alt::IPlayer::GetSpatialVolume, &alt::IPlayer::SetSpatialVolume>("spatialVolume"); diff --git a/client/src/classes/RmlDocument.cpp b/client/src/classes/RmlDocument.cpp index 05193e154..768b42c7e 100644 --- a/client/src/classes/RmlDocument.cpp +++ b/client/src/classes/RmlDocument.cpp @@ -52,8 +52,8 @@ extern js::Class rmlDocumentClass("RmlDocument", &rmlElementClass, nullptr, [](j tpl.Property<&alt::IRmlDocument::GetTitle, &alt::IRmlDocument::SetTitle>("title"); tpl.Property<&alt::IRmlDocument::GetSourceUrl>("sourceUrl"); - tpl.Property<&alt::IRmlDocument::IsVisible>("isVisible"); - tpl.Property<&alt::IRmlDocument::IsModal>("isModal"); + tpl.Property<&alt::IRmlDocument::IsVisible>("visible"); + tpl.Property<&alt::IRmlDocument::IsModal>("modal"); tpl.Property<&alt::IRmlDocument::GetBody>("body"); tpl.Method("show", Show); diff --git a/client/src/classes/RmlElement.cpp b/client/src/classes/RmlElement.cpp index 14f1189bb..156b25e9b 100644 --- a/client/src/classes/RmlElement.cpp +++ b/client/src/classes/RmlElement.cpp @@ -64,7 +64,7 @@ extern js::Class rmlElementClass("RmlElement", &baseObjectClass, nullptr, [](js: tpl.Property<&alt::IRmlElement::GetFocusedElement>("focusedElement"); tpl.Property<&alt::IRmlElement::GetTagName>("tagName"); tpl.Property<&alt::IRmlElement::GetRmlID, &alt::IRmlElement::SetRmlID>("rmlID"); - tpl.Property<&alt::IRmlElement::IsOwned>("isOwned"); + tpl.Property<&alt::IRmlElement::IsOwned>("owned"); tpl.Property<&alt::IRmlElement::GetAbsoluteLeft>("absoluteLeft"); tpl.Property<&alt::IRmlElement::GetAbsoluteTop>("absoluteTop"); tpl.Property<&alt::IRmlElement::GetClientLeft>("clientLeft"); @@ -79,7 +79,7 @@ extern js::Class rmlElementClass("RmlElement", &baseObjectClass, nullptr, [](js: tpl.Property<&alt::IRmlElement::GetScrollTop, &alt::IRmlElement::SetScrollTop>("scrollTop"); tpl.Property<&alt::IRmlElement::GetScrollWidth>("scrollWidth"); tpl.Property<&alt::IRmlElement::GetScrollHeight>("scrollHeight"); - tpl.Property<&alt::IRmlElement::IsVisible>("isVisible"); + tpl.Property<&alt::IRmlElement::IsVisible>("visible"); tpl.Property<&alt::IRmlElement::GetParent>("parent"); tpl.Property<&alt::IRmlElement::GetNextSibling>("nextSibling"); tpl.Property<&alt::IRmlElement::GetPreviousSibling>("previousSibling"); diff --git a/client/src/classes/Vehicle.cpp b/client/src/classes/Vehicle.cpp index 01b1ca368..e0251bcf0 100644 --- a/client/src/classes/Vehicle.cpp +++ b/client/src/classes/Vehicle.cpp @@ -17,8 +17,7 @@ static void GetByScriptID(js::FunctionContext& ctx) if(!ctx.GetArg(0, scriptId)) return; auto obj = alt::ICore::Instance().GetWorldObjectByScriptID(scriptId); - if (obj && (obj->GetType() == alt::IBaseObject::Type::VEHICLE || obj->GetType() == alt::IBaseObject::Type::LOCAL_VEHICLE)) - return ctx.Return(obj); + if(obj && (obj->GetType() == alt::IBaseObject::Type::VEHICLE || obj->GetType() == alt::IBaseObject::Type::LOCAL_VEHICLE)) return ctx.Return(obj); ctx.Return(nullptr); } @@ -37,11 +36,11 @@ extern js::Class vehicleClass("Vehicle", &sharedVehicleClass, nullptr, [](js::Cl tpl.Property<&alt::IVehicle::GetCurrentRPM, &alt::IVehicle::SetCurrentRPM>("rpm"); tpl.Property<&alt::IVehicle::GetWheelsCount>("wheelsCount"); tpl.Property<&alt::IVehicle::GetSpeedVector>("speedVector"); - tpl.Property<&alt::IVehicle::IsHandlingModified>("isHandlingModified"); + tpl.Property<&alt::IVehicle::IsHandlingModified>("handlingModified"); tpl.Property<&alt::IVehicle::GetLightsIndicator, &alt::IVehicle::SetLightsIndicator>("indicatorLights"); tpl.Property<&alt::IVehicle::GetSeatCount>("seatCount"); tpl.Property<&alt::IVehicle::GetOccupiedSeatsCount>("occupiedSeatsCount"); - tpl.Property<&alt::IVehicle::IsTaxiLightOn>("isTaxiLightOn"); + tpl.Property<&alt::IVehicle::IsTaxiLightOn>("taxiLightOn"); tpl.Property<&alt::IVehicle::GetEngineTemperature, &alt::IVehicle::SetEngineTemperature>("engineTemperature"); tpl.Property<&alt::IVehicle::GetFuelLevel, &alt::IVehicle::SetFuelLevel>("fuelLevel"); tpl.Property<&alt::IVehicle::GetOilLevel, &alt::IVehicle::SetOilLevel>("oilLevel"); diff --git a/client/src/classes/VirtualEntity.cpp b/client/src/classes/VirtualEntity.cpp index a866de02e..7a0cd0f1e 100644 --- a/client/src/classes/VirtualEntity.cpp +++ b/client/src/classes/VirtualEntity.cpp @@ -7,7 +7,7 @@ extern js::Class virtualEntityClass("VirtualEntity", &sharedVirtualEntityClass, { tpl.BindToType(alt::IBaseObject::Type::VIRTUAL_ENTITY); - tpl.Property<&alt::IVirtualEntity::IsStreamedIn>("isStreamedIn"); + tpl.Property<&alt::IVirtualEntity::IsStreamedIn>("streamedIn"); tpl.GetByID(); tpl.GetByRemoteID(); diff --git a/client/src/classes/WebView.cpp b/client/src/classes/WebView.cpp index 328284f27..054e3bc88 100644 --- a/client/src/classes/WebView.cpp +++ b/client/src/classes/WebView.cpp @@ -55,9 +55,9 @@ extern js::Class webViewClass("WebView", &baseObjectClass, [](js::ClassTemplate& tpl.Property("focused", FocusedGetter, FocusedSetter); tpl.Property<&alt::IWebView::GetUrl, &alt::IWebView::SetUrl>("url"); tpl.Property<&alt::IWebView::IsVisible, &alt::IWebView::SetVisible>("visible"); - tpl.Property<&alt::IWebView::IsOverlay>("isOverlay"); - tpl.Property<&alt::IWebView::IsLoaded>("isLoaded"); - tpl.Property<&alt::IWebView::IsReady>("isReady"); + tpl.Property<&alt::IWebView::IsOverlay>("overlay"); + tpl.Property<&alt::IWebView::IsLoaded>("loaded"); + tpl.Property<&alt::IWebView::IsReady>("ready"); tpl.Property<&alt::IWebView::GetSize, &alt::IWebView::SetSize>("size"); tpl.Property<&alt::IWebView::GetPosition, &alt::IWebView::SetPosition>("pos"); tpl.Property<&alt::IWebView::GetOutputs>("outputs"); From 08155a1a761274c352cf059524c9985f2846365c Mon Sep 17 00:00:00 2001 From: Carlos Menezes Date: Tue, 19 Mar 2024 11:08:59 +0000 Subject: [PATCH 02/12] chore: format `Handling.cpp` --- client/src/classes/Handling.cpp | 305 ++++++++++++++++---------------- 1 file changed, 152 insertions(+), 153 deletions(-) diff --git a/client/src/classes/Handling.cpp b/client/src/classes/Handling.cpp index 0b9cedcea..60957ddea 100644 --- a/client/src/classes/Handling.cpp +++ b/client/src/classes/Handling.cpp @@ -310,7 +310,7 @@ static void DriveInertiaSetter(js::PropertyContext& ctx) static void ClutchChangeRateScaleUpShiftGetter(js::PropertyContext& ctx) { - if (!ctx.CheckExtraInternalFieldValue()) return; + if(!ctx.CheckExtraInternalFieldValue()) return; alt::IVehicle* vehicle = ctx.GetExtraInternalFieldValue(); ctx.Return(vehicle->GetHandling()->GetClutchChangeRateScaleUpShift()); @@ -318,11 +318,11 @@ static void ClutchChangeRateScaleUpShiftGetter(js::PropertyContext& ctx) static void ClutchChangeRateScaleUpShiftSetter(js::PropertyContext& ctx) { - if (!ctx.CheckExtraInternalFieldValue()) return; + if(!ctx.CheckExtraInternalFieldValue()) return; alt::IVehicle* vehicle = ctx.GetExtraInternalFieldValue(); float value; - if (!ctx.GetValue(value)) return; + if(!ctx.GetValue(value)) return; vehicle->ReplaceHandling(); vehicle->GetHandling()->SetClutchChangeRateScaleUpShift(value); @@ -330,7 +330,7 @@ static void ClutchChangeRateScaleUpShiftSetter(js::PropertyContext& ctx) static void ClutchChangeRateScaleDownShiftGetter(js::PropertyContext& ctx) { - if (!ctx.CheckExtraInternalFieldValue()) return; + if(!ctx.CheckExtraInternalFieldValue()) return; alt::IVehicle* vehicle = ctx.GetExtraInternalFieldValue(); ctx.Return(vehicle->GetHandling()->GetClutchChangeRateScaleDownShift()); @@ -338,20 +338,19 @@ static void ClutchChangeRateScaleDownShiftGetter(js::PropertyContext& ctx) static void ClutchChangeRateScaleDownShiftSetter(js::PropertyContext& ctx) { - if (!ctx.CheckExtraInternalFieldValue()) return; + if(!ctx.CheckExtraInternalFieldValue()) return; alt::IVehicle* vehicle = ctx.GetExtraInternalFieldValue(); float value; - if (!ctx.GetValue(value)) return; + if(!ctx.GetValue(value)) return; vehicle->ReplaceHandling(); vehicle->GetHandling()->SetClutchChangeRateScaleDownShift(value); } - static void InitialDriveForceGetter(js::PropertyContext& ctx) { - if (!ctx.CheckExtraInternalFieldValue()) return; + if(!ctx.CheckExtraInternalFieldValue()) return; alt::IVehicle* vehicle = ctx.GetExtraInternalFieldValue(); ctx.Return(vehicle->GetHandling()->GetInitialDriveForce()); @@ -359,11 +358,11 @@ static void InitialDriveForceGetter(js::PropertyContext& ctx) static void InitialDriveForceSetter(js::PropertyContext& ctx) { - if (!ctx.CheckExtraInternalFieldValue()) return; + if(!ctx.CheckExtraInternalFieldValue()) return; alt::IVehicle* vehicle = ctx.GetExtraInternalFieldValue(); float value; - if (!ctx.GetValue(value)) return; + if(!ctx.GetValue(value)) return; vehicle->ReplaceHandling(); vehicle->GetHandling()->SetInitialDriveForce(value); @@ -371,7 +370,7 @@ static void InitialDriveForceSetter(js::PropertyContext& ctx) static void DriveMaxFlatVelGetter(js::PropertyContext& ctx) { - if (!ctx.CheckExtraInternalFieldValue()) return; + if(!ctx.CheckExtraInternalFieldValue()) return; alt::IVehicle* vehicle = ctx.GetExtraInternalFieldValue(); ctx.Return(vehicle->GetHandling()->GetDriveMaxFlatVel()); @@ -379,11 +378,11 @@ static void DriveMaxFlatVelGetter(js::PropertyContext& ctx) static void DriveMaxFlatVelSetter(js::PropertyContext& ctx) { - if (!ctx.CheckExtraInternalFieldValue()) return; + if(!ctx.CheckExtraInternalFieldValue()) return; alt::IVehicle* vehicle = ctx.GetExtraInternalFieldValue(); float value; - if (!ctx.GetValue(value)) return; + if(!ctx.GetValue(value)) return; vehicle->ReplaceHandling(); vehicle->GetHandling()->SetDriveMaxFlatVel(value); @@ -391,7 +390,7 @@ static void DriveMaxFlatVelSetter(js::PropertyContext& ctx) static void InitialDriveMaxFlatVelGetter(js::PropertyContext& ctx) { - if (!ctx.CheckExtraInternalFieldValue()) return; + if(!ctx.CheckExtraInternalFieldValue()) return; alt::IVehicle* vehicle = ctx.GetExtraInternalFieldValue(); ctx.Return(vehicle->GetHandling()->GetInitialDriveMaxFlatVel()); @@ -399,11 +398,11 @@ static void InitialDriveMaxFlatVelGetter(js::PropertyContext& ctx) static void InitialDriveMaxFlatVelSetter(js::PropertyContext& ctx) { - if (!ctx.CheckExtraInternalFieldValue()) return; + if(!ctx.CheckExtraInternalFieldValue()) return; alt::IVehicle* vehicle = ctx.GetExtraInternalFieldValue(); float value; - if (!ctx.GetValue(value)) return; + if(!ctx.GetValue(value)) return; vehicle->ReplaceHandling(); vehicle->GetHandling()->SetInitialDriveMaxFlatVel(value); @@ -411,7 +410,7 @@ static void InitialDriveMaxFlatVelSetter(js::PropertyContext& ctx) static void BrakeForceGetter(js::PropertyContext& ctx) { - if (!ctx.CheckExtraInternalFieldValue()) return; + if(!ctx.CheckExtraInternalFieldValue()) return; alt::IVehicle* vehicle = ctx.GetExtraInternalFieldValue(); ctx.Return(vehicle->GetHandling()->GetBrakeForce()); @@ -419,11 +418,11 @@ static void BrakeForceGetter(js::PropertyContext& ctx) static void BrakeForceSetter(js::PropertyContext& ctx) { - if (!ctx.CheckExtraInternalFieldValue()) return; + if(!ctx.CheckExtraInternalFieldValue()) return; alt::IVehicle* vehicle = ctx.GetExtraInternalFieldValue(); float value; - if (!ctx.GetValue(value)) return; + if(!ctx.GetValue(value)) return; vehicle->ReplaceHandling(); vehicle->GetHandling()->SetBrakeForce(value); @@ -431,7 +430,7 @@ static void BrakeForceSetter(js::PropertyContext& ctx) static void BrakeBiasFrontGetter(js::PropertyContext& ctx) { - if (!ctx.CheckExtraInternalFieldValue()) return; + if(!ctx.CheckExtraInternalFieldValue()) return; alt::IVehicle* vehicle = ctx.GetExtraInternalFieldValue(); ctx.Return(vehicle->GetHandling()->GetBrakeBiasFront()); @@ -439,11 +438,11 @@ static void BrakeBiasFrontGetter(js::PropertyContext& ctx) static void BrakeBiasFrontSetter(js::PropertyContext& ctx) { - if (!ctx.CheckExtraInternalFieldValue()) return; + if(!ctx.CheckExtraInternalFieldValue()) return; alt::IVehicle* vehicle = ctx.GetExtraInternalFieldValue(); float value; - if (!ctx.GetValue(value)) return; + if(!ctx.GetValue(value)) return; vehicle->ReplaceHandling(); vehicle->GetHandling()->SetBrakeBiasFront(value); @@ -451,7 +450,7 @@ static void BrakeBiasFrontSetter(js::PropertyContext& ctx) static void BrakeBiasRearGetter(js::PropertyContext& ctx) { - if (!ctx.CheckExtraInternalFieldValue()) return; + if(!ctx.CheckExtraInternalFieldValue()) return; alt::IVehicle* vehicle = ctx.GetExtraInternalFieldValue(); ctx.Return(vehicle->GetHandling()->GetBrakeBiasRear()); @@ -459,11 +458,11 @@ static void BrakeBiasRearGetter(js::PropertyContext& ctx) static void BrakeBiasRearSetter(js::PropertyContext& ctx) { - if (!ctx.CheckExtraInternalFieldValue()) return; + if(!ctx.CheckExtraInternalFieldValue()) return; alt::IVehicle* vehicle = ctx.GetExtraInternalFieldValue(); float value; - if (!ctx.GetValue(value)) return; + if(!ctx.GetValue(value)) return; vehicle->ReplaceHandling(); vehicle->GetHandling()->SetBrakeBiasRear(value); @@ -471,7 +470,7 @@ static void BrakeBiasRearSetter(js::PropertyContext& ctx) static void HandBrakeForceGetter(js::PropertyContext& ctx) { - if (!ctx.CheckExtraInternalFieldValue()) return; + if(!ctx.CheckExtraInternalFieldValue()) return; alt::IVehicle* vehicle = ctx.GetExtraInternalFieldValue(); ctx.Return(vehicle->GetHandling()->GetHandBrakeForce()); @@ -479,11 +478,11 @@ static void HandBrakeForceGetter(js::PropertyContext& ctx) static void HandBrakeForceSetter(js::PropertyContext& ctx) { - if (!ctx.CheckExtraInternalFieldValue()) return; + if(!ctx.CheckExtraInternalFieldValue()) return; alt::IVehicle* vehicle = ctx.GetExtraInternalFieldValue(); float value; - if (!ctx.GetValue(value)) return; + if(!ctx.GetValue(value)) return; vehicle->ReplaceHandling(); vehicle->GetHandling()->SetHandBrakeForce(value); @@ -491,7 +490,7 @@ static void HandBrakeForceSetter(js::PropertyContext& ctx) static void SteeringLockGetter(js::PropertyContext& ctx) { - if (!ctx.CheckExtraInternalFieldValue()) return; + if(!ctx.CheckExtraInternalFieldValue()) return; alt::IVehicle* vehicle = ctx.GetExtraInternalFieldValue(); ctx.Return(vehicle->GetHandling()->GetSteeringLock()); @@ -499,11 +498,11 @@ static void SteeringLockGetter(js::PropertyContext& ctx) static void SteeringLockSetter(js::PropertyContext& ctx) { - if (!ctx.CheckExtraInternalFieldValue()) return; + if(!ctx.CheckExtraInternalFieldValue()) return; alt::IVehicle* vehicle = ctx.GetExtraInternalFieldValue(); float value; - if (!ctx.GetValue(value)) return; + if(!ctx.GetValue(value)) return; vehicle->ReplaceHandling(); vehicle->GetHandling()->SetSteeringLock(value); @@ -511,7 +510,7 @@ static void SteeringLockSetter(js::PropertyContext& ctx) static void SteeringLockRatioGetter(js::PropertyContext& ctx) { - if (!ctx.CheckExtraInternalFieldValue()) return; + if(!ctx.CheckExtraInternalFieldValue()) return; alt::IVehicle* vehicle = ctx.GetExtraInternalFieldValue(); ctx.Return(vehicle->GetHandling()->GetSteeringLockRatio()); @@ -519,11 +518,11 @@ static void SteeringLockRatioGetter(js::PropertyContext& ctx) static void SteeringLockRatioSetter(js::PropertyContext& ctx) { - if (!ctx.CheckExtraInternalFieldValue()) return; + if(!ctx.CheckExtraInternalFieldValue()) return; alt::IVehicle* vehicle = ctx.GetExtraInternalFieldValue(); float value; - if (!ctx.GetValue(value)) return; + if(!ctx.GetValue(value)) return; vehicle->ReplaceHandling(); vehicle->GetHandling()->SetSteeringLockRatio(value); @@ -531,7 +530,7 @@ static void SteeringLockRatioSetter(js::PropertyContext& ctx) static void TractionCurveMaxGetter(js::PropertyContext& ctx) { - if (!ctx.CheckExtraInternalFieldValue()) return; + if(!ctx.CheckExtraInternalFieldValue()) return; alt::IVehicle* vehicle = ctx.GetExtraInternalFieldValue(); ctx.Return(vehicle->GetHandling()->GetTractionCurveMax()); @@ -539,11 +538,11 @@ static void TractionCurveMaxGetter(js::PropertyContext& ctx) static void TractionCurveMaxSetter(js::PropertyContext& ctx) { - if (!ctx.CheckExtraInternalFieldValue()) return; + if(!ctx.CheckExtraInternalFieldValue()) return; alt::IVehicle* vehicle = ctx.GetExtraInternalFieldValue(); float value; - if (!ctx.GetValue(value)) return; + if(!ctx.GetValue(value)) return; vehicle->ReplaceHandling(); vehicle->GetHandling()->SetTractionCurveMax(value); @@ -551,7 +550,7 @@ static void TractionCurveMaxSetter(js::PropertyContext& ctx) static void TractionCurveMaxRatioGetter(js::PropertyContext& ctx) { - if (!ctx.CheckExtraInternalFieldValue()) return; + if(!ctx.CheckExtraInternalFieldValue()) return; alt::IVehicle* vehicle = ctx.GetExtraInternalFieldValue(); ctx.Return(vehicle->GetHandling()->GetTractionCurveMaxRatio()); @@ -559,11 +558,11 @@ static void TractionCurveMaxRatioGetter(js::PropertyContext& ctx) static void TractionCurveMaxRatioSetter(js::PropertyContext& ctx) { - if (!ctx.CheckExtraInternalFieldValue()) return; + if(!ctx.CheckExtraInternalFieldValue()) return; alt::IVehicle* vehicle = ctx.GetExtraInternalFieldValue(); float value; - if (!ctx.GetValue(value)) return; + if(!ctx.GetValue(value)) return; vehicle->ReplaceHandling(); vehicle->GetHandling()->SetTractionCurveMaxRatio(value); @@ -571,7 +570,7 @@ static void TractionCurveMaxRatioSetter(js::PropertyContext& ctx) static void TractionCurveMinGetter(js::PropertyContext& ctx) { - if (!ctx.CheckExtraInternalFieldValue()) return; + if(!ctx.CheckExtraInternalFieldValue()) return; alt::IVehicle* vehicle = ctx.GetExtraInternalFieldValue(); ctx.Return(vehicle->GetHandling()->GetTractionCurveMin()); @@ -579,11 +578,11 @@ static void TractionCurveMinGetter(js::PropertyContext& ctx) static void TractionCurveMinSetter(js::PropertyContext& ctx) { - if (!ctx.CheckExtraInternalFieldValue()) return; + if(!ctx.CheckExtraInternalFieldValue()) return; alt::IVehicle* vehicle = ctx.GetExtraInternalFieldValue(); float value; - if (!ctx.GetValue(value)) return; + if(!ctx.GetValue(value)) return; vehicle->ReplaceHandling(); vehicle->GetHandling()->SetTractionCurveMin(value); @@ -591,7 +590,7 @@ static void TractionCurveMinSetter(js::PropertyContext& ctx) static void TractionCurveMinRatioGetter(js::PropertyContext& ctx) { - if (!ctx.CheckExtraInternalFieldValue()) return; + if(!ctx.CheckExtraInternalFieldValue()) return; alt::IVehicle* vehicle = ctx.GetExtraInternalFieldValue(); ctx.Return(vehicle->GetHandling()->GetTractionCurveMinRatio()); @@ -599,11 +598,11 @@ static void TractionCurveMinRatioGetter(js::PropertyContext& ctx) static void TractionCurveMinRatioSetter(js::PropertyContext& ctx) { - if (!ctx.CheckExtraInternalFieldValue()) return; + if(!ctx.CheckExtraInternalFieldValue()) return; alt::IVehicle* vehicle = ctx.GetExtraInternalFieldValue(); float value; - if (!ctx.GetValue(value)) return; + if(!ctx.GetValue(value)) return; vehicle->ReplaceHandling(); vehicle->GetHandling()->SetTractionCurveMinRatio(value); @@ -611,7 +610,7 @@ static void TractionCurveMinRatioSetter(js::PropertyContext& ctx) static void TractionCurveLateralGetter(js::PropertyContext& ctx) { - if (!ctx.CheckExtraInternalFieldValue()) return; + if(!ctx.CheckExtraInternalFieldValue()) return; alt::IVehicle* vehicle = ctx.GetExtraInternalFieldValue(); ctx.Return(vehicle->GetHandling()->GetTractionCurveLateral()); @@ -619,11 +618,11 @@ static void TractionCurveLateralGetter(js::PropertyContext& ctx) static void TractionCurveLateralSetter(js::PropertyContext& ctx) { - if (!ctx.CheckExtraInternalFieldValue()) return; + if(!ctx.CheckExtraInternalFieldValue()) return; alt::IVehicle* vehicle = ctx.GetExtraInternalFieldValue(); float value; - if (!ctx.GetValue(value)) return; + if(!ctx.GetValue(value)) return; vehicle->ReplaceHandling(); vehicle->GetHandling()->SetTractionCurveLateral(value); @@ -631,7 +630,7 @@ static void TractionCurveLateralSetter(js::PropertyContext& ctx) static void TractionCurveLateralRatioGetter(js::PropertyContext& ctx) { - if (!ctx.CheckExtraInternalFieldValue()) return; + if(!ctx.CheckExtraInternalFieldValue()) return; alt::IVehicle* vehicle = ctx.GetExtraInternalFieldValue(); ctx.Return(vehicle->GetHandling()->GetTractionCurveLateralRatio()); @@ -639,11 +638,11 @@ static void TractionCurveLateralRatioGetter(js::PropertyContext& ctx) static void TractionCurveLateralRatioSetter(js::PropertyContext& ctx) { - if (!ctx.CheckExtraInternalFieldValue()) return; + if(!ctx.CheckExtraInternalFieldValue()) return; alt::IVehicle* vehicle = ctx.GetExtraInternalFieldValue(); float value; - if (!ctx.GetValue(value)) return; + if(!ctx.GetValue(value)) return; vehicle->ReplaceHandling(); vehicle->GetHandling()->SetTractionCurveLateralRatio(value); @@ -651,7 +650,7 @@ static void TractionCurveLateralRatioSetter(js::PropertyContext& ctx) static void TractionSpringDeltaMaxGetter(js::PropertyContext& ctx) { - if (!ctx.CheckExtraInternalFieldValue()) return; + if(!ctx.CheckExtraInternalFieldValue()) return; alt::IVehicle* vehicle = ctx.GetExtraInternalFieldValue(); ctx.Return(vehicle->GetHandling()->GetTractionSpringDeltaMax()); @@ -659,11 +658,11 @@ static void TractionSpringDeltaMaxGetter(js::PropertyContext& ctx) static void TractionSpringDeltaMaxSetter(js::PropertyContext& ctx) { - if (!ctx.CheckExtraInternalFieldValue()) return; + if(!ctx.CheckExtraInternalFieldValue()) return; alt::IVehicle* vehicle = ctx.GetExtraInternalFieldValue(); float value; - if (!ctx.GetValue(value)) return; + if(!ctx.GetValue(value)) return; vehicle->ReplaceHandling(); vehicle->GetHandling()->SetTractionSpringDeltaMax(value); @@ -671,7 +670,7 @@ static void TractionSpringDeltaMaxSetter(js::PropertyContext& ctx) static void TractionSpringDeltaMaxRatioGetter(js::PropertyContext& ctx) { - if (!ctx.CheckExtraInternalFieldValue()) return; + if(!ctx.CheckExtraInternalFieldValue()) return; alt::IVehicle* vehicle = ctx.GetExtraInternalFieldValue(); ctx.Return(vehicle->GetHandling()->GetTractionSpringDeltaMaxRatio()); @@ -679,11 +678,11 @@ static void TractionSpringDeltaMaxRatioGetter(js::PropertyContext& ctx) static void TractionSpringDeltaMaxRatioSetter(js::PropertyContext& ctx) { - if (!ctx.CheckExtraInternalFieldValue()) return; + if(!ctx.CheckExtraInternalFieldValue()) return; alt::IVehicle* vehicle = ctx.GetExtraInternalFieldValue(); float value; - if (!ctx.GetValue(value)) return; + if(!ctx.GetValue(value)) return; vehicle->ReplaceHandling(); vehicle->GetHandling()->SetTractionSpringDeltaMaxRatio(value); @@ -691,7 +690,7 @@ static void TractionSpringDeltaMaxRatioSetter(js::PropertyContext& ctx) static void LowSpeedTractionLossMultGetter(js::PropertyContext& ctx) { - if (!ctx.CheckExtraInternalFieldValue()) return; + if(!ctx.CheckExtraInternalFieldValue()) return; alt::IVehicle* vehicle = ctx.GetExtraInternalFieldValue(); ctx.Return(vehicle->GetHandling()->GetLowSpeedTractionLossMult()); @@ -699,11 +698,11 @@ static void LowSpeedTractionLossMultGetter(js::PropertyContext& ctx) static void LowSpeedTractionLossMultSetter(js::PropertyContext& ctx) { - if (!ctx.CheckExtraInternalFieldValue()) return; + if(!ctx.CheckExtraInternalFieldValue()) return; alt::IVehicle* vehicle = ctx.GetExtraInternalFieldValue(); float value; - if (!ctx.GetValue(value)) return; + if(!ctx.GetValue(value)) return; vehicle->ReplaceHandling(); vehicle->GetHandling()->SetLowSpeedTractionLossMult(value); @@ -711,7 +710,7 @@ static void LowSpeedTractionLossMultSetter(js::PropertyContext& ctx) static void CamberStiffnessGetter(js::PropertyContext& ctx) { - if (!ctx.CheckExtraInternalFieldValue()) return; + if(!ctx.CheckExtraInternalFieldValue()) return; alt::IVehicle* vehicle = ctx.GetExtraInternalFieldValue(); ctx.Return(vehicle->GetHandling()->GetCamberStiffness()); @@ -719,11 +718,11 @@ static void CamberStiffnessGetter(js::PropertyContext& ctx) static void CamberStiffnessSetter(js::PropertyContext& ctx) { - if (!ctx.CheckExtraInternalFieldValue()) return; + if(!ctx.CheckExtraInternalFieldValue()) return; alt::IVehicle* vehicle = ctx.GetExtraInternalFieldValue(); float value; - if (!ctx.GetValue(value)) return; + if(!ctx.GetValue(value)) return; vehicle->ReplaceHandling(); vehicle->GetHandling()->SetCamberStiffness(value); @@ -731,7 +730,7 @@ static void CamberStiffnessSetter(js::PropertyContext& ctx) static void TractionBiasFrontGetter(js::PropertyContext& ctx) { - if (!ctx.CheckExtraInternalFieldValue()) return; + if(!ctx.CheckExtraInternalFieldValue()) return; alt::IVehicle* vehicle = ctx.GetExtraInternalFieldValue(); ctx.Return(vehicle->GetHandling()->GetTractionBiasFront()); @@ -739,11 +738,11 @@ static void TractionBiasFrontGetter(js::PropertyContext& ctx) static void TractionBiasFrontSetter(js::PropertyContext& ctx) { - if (!ctx.CheckExtraInternalFieldValue()) return; + if(!ctx.CheckExtraInternalFieldValue()) return; alt::IVehicle* vehicle = ctx.GetExtraInternalFieldValue(); float value; - if (!ctx.GetValue(value)) return; + if(!ctx.GetValue(value)) return; vehicle->ReplaceHandling(); vehicle->GetHandling()->SetTractionBiasFront(value); @@ -751,7 +750,7 @@ static void TractionBiasFrontSetter(js::PropertyContext& ctx) static void TractionBiasRearGetter(js::PropertyContext& ctx) { - if (!ctx.CheckExtraInternalFieldValue()) return; + if(!ctx.CheckExtraInternalFieldValue()) return; alt::IVehicle* vehicle = ctx.GetExtraInternalFieldValue(); ctx.Return(vehicle->GetHandling()->GetTractionBiasRear()); @@ -759,11 +758,11 @@ static void TractionBiasRearGetter(js::PropertyContext& ctx) static void TractionBiasRearSetter(js::PropertyContext& ctx) { - if (!ctx.CheckExtraInternalFieldValue()) return; + if(!ctx.CheckExtraInternalFieldValue()) return; alt::IVehicle* vehicle = ctx.GetExtraInternalFieldValue(); float value; - if (!ctx.GetValue(value)) return; + if(!ctx.GetValue(value)) return; vehicle->ReplaceHandling(); vehicle->GetHandling()->SetTractionBiasRear(value); @@ -771,7 +770,7 @@ static void TractionBiasRearSetter(js::PropertyContext& ctx) static void TractionLossMultGetter(js::PropertyContext& ctx) { - if (!ctx.CheckExtraInternalFieldValue()) return; + if(!ctx.CheckExtraInternalFieldValue()) return; alt::IVehicle* vehicle = ctx.GetExtraInternalFieldValue(); ctx.Return(vehicle->GetHandling()->GetTractionLossMult()); @@ -779,11 +778,11 @@ static void TractionLossMultGetter(js::PropertyContext& ctx) static void TractionLossMultSetter(js::PropertyContext& ctx) { - if (!ctx.CheckExtraInternalFieldValue()) return; + if(!ctx.CheckExtraInternalFieldValue()) return; alt::IVehicle* vehicle = ctx.GetExtraInternalFieldValue(); float value; - if (!ctx.GetValue(value)) return; + if(!ctx.GetValue(value)) return; vehicle->ReplaceHandling(); vehicle->GetHandling()->SetTractionLossMult(value); @@ -791,7 +790,7 @@ static void TractionLossMultSetter(js::PropertyContext& ctx) static void SuspensionForceGetter(js::PropertyContext& ctx) { - if (!ctx.CheckExtraInternalFieldValue()) return; + if(!ctx.CheckExtraInternalFieldValue()) return; alt::IVehicle* vehicle = ctx.GetExtraInternalFieldValue(); ctx.Return(vehicle->GetHandling()->GetSuspensionForce()); @@ -799,11 +798,11 @@ static void SuspensionForceGetter(js::PropertyContext& ctx) static void SuspensionForceSetter(js::PropertyContext& ctx) { - if (!ctx.CheckExtraInternalFieldValue()) return; + if(!ctx.CheckExtraInternalFieldValue()) return; alt::IVehicle* vehicle = ctx.GetExtraInternalFieldValue(); float value; - if (!ctx.GetValue(value)) return; + if(!ctx.GetValue(value)) return; vehicle->ReplaceHandling(); vehicle->GetHandling()->SetSuspensionForce(value); @@ -811,7 +810,7 @@ static void SuspensionForceSetter(js::PropertyContext& ctx) static void SuspensionCompDampGetter(js::PropertyContext& ctx) { - if (!ctx.CheckExtraInternalFieldValue()) return; + if(!ctx.CheckExtraInternalFieldValue()) return; alt::IVehicle* vehicle = ctx.GetExtraInternalFieldValue(); ctx.Return(vehicle->GetHandling()->GetSuspensionCompDamp()); @@ -819,11 +818,11 @@ static void SuspensionCompDampGetter(js::PropertyContext& ctx) static void SuspensionCompDampSetter(js::PropertyContext& ctx) { - if (!ctx.CheckExtraInternalFieldValue()) return; + if(!ctx.CheckExtraInternalFieldValue()) return; alt::IVehicle* vehicle = ctx.GetExtraInternalFieldValue(); float value; - if (!ctx.GetValue(value)) return; + if(!ctx.GetValue(value)) return; vehicle->ReplaceHandling(); vehicle->GetHandling()->SetSuspensionCompDamp(value); @@ -831,7 +830,7 @@ static void SuspensionCompDampSetter(js::PropertyContext& ctx) static void SuspensionReboundDampGetter(js::PropertyContext& ctx) { - if (!ctx.CheckExtraInternalFieldValue()) return; + if(!ctx.CheckExtraInternalFieldValue()) return; alt::IVehicle* vehicle = ctx.GetExtraInternalFieldValue(); ctx.Return(vehicle->GetHandling()->GetSuspensionReboundDamp()); @@ -839,11 +838,11 @@ static void SuspensionReboundDampGetter(js::PropertyContext& ctx) static void SuspensionReboundDampSetter(js::PropertyContext& ctx) { - if (!ctx.CheckExtraInternalFieldValue()) return; + if(!ctx.CheckExtraInternalFieldValue()) return; alt::IVehicle* vehicle = ctx.GetExtraInternalFieldValue(); float value; - if (!ctx.GetValue(value)) return; + if(!ctx.GetValue(value)) return; vehicle->ReplaceHandling(); vehicle->GetHandling()->SetSuspensionReboundDamp(value); @@ -851,7 +850,7 @@ static void SuspensionReboundDampSetter(js::PropertyContext& ctx) static void SuspensionUpperLimitGetter(js::PropertyContext& ctx) { - if (!ctx.CheckExtraInternalFieldValue()) return; + if(!ctx.CheckExtraInternalFieldValue()) return; alt::IVehicle* vehicle = ctx.GetExtraInternalFieldValue(); ctx.Return(vehicle->GetHandling()->GetSuspensionUpperLimit()); @@ -859,11 +858,11 @@ static void SuspensionUpperLimitGetter(js::PropertyContext& ctx) static void SuspensionUpperLimitSetter(js::PropertyContext& ctx) { - if (!ctx.CheckExtraInternalFieldValue()) return; + if(!ctx.CheckExtraInternalFieldValue()) return; alt::IVehicle* vehicle = ctx.GetExtraInternalFieldValue(); float value; - if (!ctx.GetValue(value)) return; + if(!ctx.GetValue(value)) return; vehicle->ReplaceHandling(); vehicle->GetHandling()->SetSuspensionUpperLimit(value); @@ -871,7 +870,7 @@ static void SuspensionUpperLimitSetter(js::PropertyContext& ctx) static void SuspensionLowerLimitGetter(js::PropertyContext& ctx) { - if (!ctx.CheckExtraInternalFieldValue()) return; + if(!ctx.CheckExtraInternalFieldValue()) return; alt::IVehicle* vehicle = ctx.GetExtraInternalFieldValue(); ctx.Return(vehicle->GetHandling()->GetSuspensionLowerLimit()); @@ -879,11 +878,11 @@ static void SuspensionLowerLimitGetter(js::PropertyContext& ctx) static void SuspensionLowerLimitSetter(js::PropertyContext& ctx) { - if (!ctx.CheckExtraInternalFieldValue()) return; + if(!ctx.CheckExtraInternalFieldValue()) return; alt::IVehicle* vehicle = ctx.GetExtraInternalFieldValue(); float value; - if (!ctx.GetValue(value)) return; + if(!ctx.GetValue(value)) return; vehicle->ReplaceHandling(); vehicle->GetHandling()->SetSuspensionLowerLimit(value); @@ -891,7 +890,7 @@ static void SuspensionLowerLimitSetter(js::PropertyContext& ctx) static void SuspensionRaiseGetter(js::PropertyContext& ctx) { - if (!ctx.CheckExtraInternalFieldValue()) return; + if(!ctx.CheckExtraInternalFieldValue()) return; alt::IVehicle* vehicle = ctx.GetExtraInternalFieldValue(); ctx.Return(vehicle->GetHandling()->GetSuspensionRaise()); @@ -899,11 +898,11 @@ static void SuspensionRaiseGetter(js::PropertyContext& ctx) static void SuspensionRaiseSetter(js::PropertyContext& ctx) { - if (!ctx.CheckExtraInternalFieldValue()) return; + if(!ctx.CheckExtraInternalFieldValue()) return; alt::IVehicle* vehicle = ctx.GetExtraInternalFieldValue(); float value; - if (!ctx.GetValue(value)) return; + if(!ctx.GetValue(value)) return; vehicle->ReplaceHandling(); vehicle->GetHandling()->SetSuspensionRaise(value); @@ -911,7 +910,7 @@ static void SuspensionRaiseSetter(js::PropertyContext& ctx) static void SuspensionBiasFrontGetter(js::PropertyContext& ctx) { - if (!ctx.CheckExtraInternalFieldValue()) return; + if(!ctx.CheckExtraInternalFieldValue()) return; alt::IVehicle* vehicle = ctx.GetExtraInternalFieldValue(); ctx.Return(vehicle->GetHandling()->GetSuspensionBiasFront()); @@ -919,11 +918,11 @@ static void SuspensionBiasFrontGetter(js::PropertyContext& ctx) static void SuspensionBiasFrontSetter(js::PropertyContext& ctx) { - if (!ctx.CheckExtraInternalFieldValue()) return; + if(!ctx.CheckExtraInternalFieldValue()) return; alt::IVehicle* vehicle = ctx.GetExtraInternalFieldValue(); float value; - if (!ctx.GetValue(value)) return; + if(!ctx.GetValue(value)) return; vehicle->ReplaceHandling(); vehicle->GetHandling()->SetSuspensionBiasFront(value); @@ -931,7 +930,7 @@ static void SuspensionBiasFrontSetter(js::PropertyContext& ctx) static void SuspensionBiasRearGetter(js::PropertyContext& ctx) { - if (!ctx.CheckExtraInternalFieldValue()) return; + if(!ctx.CheckExtraInternalFieldValue()) return; alt::IVehicle* vehicle = ctx.GetExtraInternalFieldValue(); ctx.Return(vehicle->GetHandling()->GetSuspensionBiasRear()); @@ -939,11 +938,11 @@ static void SuspensionBiasRearGetter(js::PropertyContext& ctx) static void SuspensionBiasRearSetter(js::PropertyContext& ctx) { - if (!ctx.CheckExtraInternalFieldValue()) return; + if(!ctx.CheckExtraInternalFieldValue()) return; alt::IVehicle* vehicle = ctx.GetExtraInternalFieldValue(); float value; - if (!ctx.GetValue(value)) return; + if(!ctx.GetValue(value)) return; vehicle->ReplaceHandling(); vehicle->GetHandling()->SetSuspensionBiasRear(value); @@ -951,7 +950,7 @@ static void SuspensionBiasRearSetter(js::PropertyContext& ctx) static void AntiRollBarForceGetter(js::PropertyContext& ctx) { - if (!ctx.CheckExtraInternalFieldValue()) return; + if(!ctx.CheckExtraInternalFieldValue()) return; alt::IVehicle* vehicle = ctx.GetExtraInternalFieldValue(); ctx.Return(vehicle->GetHandling()->GetAntiRollBarForce()); @@ -959,11 +958,11 @@ static void AntiRollBarForceGetter(js::PropertyContext& ctx) static void AntiRollBarForceSetter(js::PropertyContext& ctx) { - if (!ctx.CheckExtraInternalFieldValue()) return; + if(!ctx.CheckExtraInternalFieldValue()) return; alt::IVehicle* vehicle = ctx.GetExtraInternalFieldValue(); float value; - if (!ctx.GetValue(value)) return; + if(!ctx.GetValue(value)) return; vehicle->ReplaceHandling(); vehicle->GetHandling()->SetAntiRollBarForce(value); @@ -971,7 +970,7 @@ static void AntiRollBarForceSetter(js::PropertyContext& ctx) static void AntiRollBarBiasFrontGetter(js::PropertyContext& ctx) { - if (!ctx.CheckExtraInternalFieldValue()) return; + if(!ctx.CheckExtraInternalFieldValue()) return; alt::IVehicle* vehicle = ctx.GetExtraInternalFieldValue(); ctx.Return(vehicle->GetHandling()->GetAntiRollBarBiasFront()); @@ -979,11 +978,11 @@ static void AntiRollBarBiasFrontGetter(js::PropertyContext& ctx) static void AntiRollBarBiasFrontSetter(js::PropertyContext& ctx) { - if (!ctx.CheckExtraInternalFieldValue()) return; + if(!ctx.CheckExtraInternalFieldValue()) return; alt::IVehicle* vehicle = ctx.GetExtraInternalFieldValue(); float value; - if (!ctx.GetValue(value)) return; + if(!ctx.GetValue(value)) return; vehicle->ReplaceHandling(); vehicle->GetHandling()->SetAntiRollBarBiasFront(value); @@ -991,7 +990,7 @@ static void AntiRollBarBiasFrontSetter(js::PropertyContext& ctx) static void AntiRollBarBiasRearGetter(js::PropertyContext& ctx) { - if (!ctx.CheckExtraInternalFieldValue()) return; + if(!ctx.CheckExtraInternalFieldValue()) return; alt::IVehicle* vehicle = ctx.GetExtraInternalFieldValue(); ctx.Return(vehicle->GetHandling()->GetAntiRollBarBiasRear()); @@ -999,11 +998,11 @@ static void AntiRollBarBiasRearGetter(js::PropertyContext& ctx) static void AntiRollBarBiasRearSetter(js::PropertyContext& ctx) { - if (!ctx.CheckExtraInternalFieldValue()) return; + if(!ctx.CheckExtraInternalFieldValue()) return; alt::IVehicle* vehicle = ctx.GetExtraInternalFieldValue(); float value; - if (!ctx.GetValue(value)) return; + if(!ctx.GetValue(value)) return; vehicle->ReplaceHandling(); vehicle->GetHandling()->SetAntiRollBarBiasRear(value); @@ -1011,7 +1010,7 @@ static void AntiRollBarBiasRearSetter(js::PropertyContext& ctx) static void RollCentreHeightFrontGetter(js::PropertyContext& ctx) { - if (!ctx.CheckExtraInternalFieldValue()) return; + if(!ctx.CheckExtraInternalFieldValue()) return; alt::IVehicle* vehicle = ctx.GetExtraInternalFieldValue(); ctx.Return(vehicle->GetHandling()->GetRollCentreHeightFront()); @@ -1019,11 +1018,11 @@ static void RollCentreHeightFrontGetter(js::PropertyContext& ctx) static void RollCentreHeightFrontSetter(js::PropertyContext& ctx) { - if (!ctx.CheckExtraInternalFieldValue()) return; + if(!ctx.CheckExtraInternalFieldValue()) return; alt::IVehicle* vehicle = ctx.GetExtraInternalFieldValue(); float value; - if (!ctx.GetValue(value)) return; + if(!ctx.GetValue(value)) return; vehicle->ReplaceHandling(); vehicle->GetHandling()->SetRollCentreHeightFront(value); @@ -1031,7 +1030,7 @@ static void RollCentreHeightFrontSetter(js::PropertyContext& ctx) static void RollCentreHeightRearGetter(js::PropertyContext& ctx) { - if (!ctx.CheckExtraInternalFieldValue()) return; + if(!ctx.CheckExtraInternalFieldValue()) return; alt::IVehicle* vehicle = ctx.GetExtraInternalFieldValue(); ctx.Return(vehicle->GetHandling()->GetRollCentreHeightRear()); @@ -1039,11 +1038,11 @@ static void RollCentreHeightRearGetter(js::PropertyContext& ctx) static void RollCentreHeightRearSetter(js::PropertyContext& ctx) { - if (!ctx.CheckExtraInternalFieldValue()) return; + if(!ctx.CheckExtraInternalFieldValue()) return; alt::IVehicle* vehicle = ctx.GetExtraInternalFieldValue(); float value; - if (!ctx.GetValue(value)) return; + if(!ctx.GetValue(value)) return; vehicle->ReplaceHandling(); vehicle->GetHandling()->SetRollCentreHeightRear(value); @@ -1051,7 +1050,7 @@ static void RollCentreHeightRearSetter(js::PropertyContext& ctx) static void CollisionDamageMultGetter(js::PropertyContext& ctx) { - if (!ctx.CheckExtraInternalFieldValue()) return; + if(!ctx.CheckExtraInternalFieldValue()) return; alt::IVehicle* vehicle = ctx.GetExtraInternalFieldValue(); ctx.Return(vehicle->GetHandling()->GetCollisionDamageMult()); @@ -1059,11 +1058,11 @@ static void CollisionDamageMultGetter(js::PropertyContext& ctx) static void CollisionDamageMultSetter(js::PropertyContext& ctx) { - if (!ctx.CheckExtraInternalFieldValue()) return; + if(!ctx.CheckExtraInternalFieldValue()) return; alt::IVehicle* vehicle = ctx.GetExtraInternalFieldValue(); float value; - if (!ctx.GetValue(value)) return; + if(!ctx.GetValue(value)) return; vehicle->ReplaceHandling(); vehicle->GetHandling()->SetCollisionDamageMult(value); @@ -1071,7 +1070,7 @@ static void CollisionDamageMultSetter(js::PropertyContext& ctx) static void WeaponDamageMultGetter(js::PropertyContext& ctx) { - if (!ctx.CheckExtraInternalFieldValue()) return; + if(!ctx.CheckExtraInternalFieldValue()) return; alt::IVehicle* vehicle = ctx.GetExtraInternalFieldValue(); ctx.Return(vehicle->GetHandling()->GetWeaponDamageMult()); @@ -1079,11 +1078,11 @@ static void WeaponDamageMultGetter(js::PropertyContext& ctx) static void WeaponDamageMultSetter(js::PropertyContext& ctx) { - if (!ctx.CheckExtraInternalFieldValue()) return; + if(!ctx.CheckExtraInternalFieldValue()) return; alt::IVehicle* vehicle = ctx.GetExtraInternalFieldValue(); float value; - if (!ctx.GetValue(value)) return; + if(!ctx.GetValue(value)) return; vehicle->ReplaceHandling(); vehicle->GetHandling()->SetWeaponDamageMult(value); @@ -1091,7 +1090,7 @@ static void WeaponDamageMultSetter(js::PropertyContext& ctx) static void DeformationDamageMultGetter(js::PropertyContext& ctx) { - if (!ctx.CheckExtraInternalFieldValue()) return; + if(!ctx.CheckExtraInternalFieldValue()) return; alt::IVehicle* vehicle = ctx.GetExtraInternalFieldValue(); ctx.Return(vehicle->GetHandling()->GetDeformationDamageMult()); @@ -1099,11 +1098,11 @@ static void DeformationDamageMultGetter(js::PropertyContext& ctx) static void DeformationDamageMultSetter(js::PropertyContext& ctx) { - if (!ctx.CheckExtraInternalFieldValue()) return; + if(!ctx.CheckExtraInternalFieldValue()) return; alt::IVehicle* vehicle = ctx.GetExtraInternalFieldValue(); float value; - if (!ctx.GetValue(value)) return; + if(!ctx.GetValue(value)) return; vehicle->ReplaceHandling(); vehicle->GetHandling()->SetDeformationDamageMult(value); @@ -1111,7 +1110,7 @@ static void DeformationDamageMultSetter(js::PropertyContext& ctx) static void EngineDamageMultGetter(js::PropertyContext& ctx) { - if (!ctx.CheckExtraInternalFieldValue()) return; + if(!ctx.CheckExtraInternalFieldValue()) return; alt::IVehicle* vehicle = ctx.GetExtraInternalFieldValue(); ctx.Return(vehicle->GetHandling()->GetEngineDamageMult()); @@ -1119,11 +1118,11 @@ static void EngineDamageMultGetter(js::PropertyContext& ctx) static void EngineDamageMultSetter(js::PropertyContext& ctx) { - if (!ctx.CheckExtraInternalFieldValue()) return; + if(!ctx.CheckExtraInternalFieldValue()) return; alt::IVehicle* vehicle = ctx.GetExtraInternalFieldValue(); float value; - if (!ctx.GetValue(value)) return; + if(!ctx.GetValue(value)) return; vehicle->ReplaceHandling(); vehicle->GetHandling()->SetEngineDamageMult(value); @@ -1131,7 +1130,7 @@ static void EngineDamageMultSetter(js::PropertyContext& ctx) static void PetrolTankVolumeGetter(js::PropertyContext& ctx) { - if (!ctx.CheckExtraInternalFieldValue()) return; + if(!ctx.CheckExtraInternalFieldValue()) return; alt::IVehicle* vehicle = ctx.GetExtraInternalFieldValue(); ctx.Return(vehicle->GetHandling()->GetPetrolTankVolume()); @@ -1139,11 +1138,11 @@ static void PetrolTankVolumeGetter(js::PropertyContext& ctx) static void PetrolTankVolumeSetter(js::PropertyContext& ctx) { - if (!ctx.CheckExtraInternalFieldValue()) return; + if(!ctx.CheckExtraInternalFieldValue()) return; alt::IVehicle* vehicle = ctx.GetExtraInternalFieldValue(); float value; - if (!ctx.GetValue(value)) return; + if(!ctx.GetValue(value)) return; vehicle->ReplaceHandling(); vehicle->GetHandling()->SetPetrolTankVolume(value); @@ -1151,7 +1150,7 @@ static void PetrolTankVolumeSetter(js::PropertyContext& ctx) static void OilVolumeGetter(js::PropertyContext& ctx) { - if (!ctx.CheckExtraInternalFieldValue()) return; + if(!ctx.CheckExtraInternalFieldValue()) return; alt::IVehicle* vehicle = ctx.GetExtraInternalFieldValue(); ctx.Return(vehicle->GetHandling()->GetOilVolume()); @@ -1159,11 +1158,11 @@ static void OilVolumeGetter(js::PropertyContext& ctx) static void OilVolumeSetter(js::PropertyContext& ctx) { - if (!ctx.CheckExtraInternalFieldValue()) return; + if(!ctx.CheckExtraInternalFieldValue()) return; alt::IVehicle* vehicle = ctx.GetExtraInternalFieldValue(); float value; - if (!ctx.GetValue(value)) return; + if(!ctx.GetValue(value)) return; vehicle->ReplaceHandling(); vehicle->GetHandling()->SetOilVolume(value); @@ -1171,7 +1170,7 @@ static void OilVolumeSetter(js::PropertyContext& ctx) static void SeatOffsetDistXGetter(js::PropertyContext& ctx) { - if (!ctx.CheckExtraInternalFieldValue()) return; + if(!ctx.CheckExtraInternalFieldValue()) return; alt::IVehicle* vehicle = ctx.GetExtraInternalFieldValue(); ctx.Return(vehicle->GetHandling()->GetSeatOffsetDistX()); @@ -1179,11 +1178,11 @@ static void SeatOffsetDistXGetter(js::PropertyContext& ctx) static void SeatOffsetDistXSetter(js::PropertyContext& ctx) { - if (!ctx.CheckExtraInternalFieldValue()) return; + if(!ctx.CheckExtraInternalFieldValue()) return; alt::IVehicle* vehicle = ctx.GetExtraInternalFieldValue(); float value; - if (!ctx.GetValue(value)) return; + if(!ctx.GetValue(value)) return; vehicle->ReplaceHandling(); vehicle->GetHandling()->SetSeatOffsetDistX(value); @@ -1191,7 +1190,7 @@ static void SeatOffsetDistXSetter(js::PropertyContext& ctx) static void SeatOffsetDistYGetter(js::PropertyContext& ctx) { - if (!ctx.CheckExtraInternalFieldValue()) return; + if(!ctx.CheckExtraInternalFieldValue()) return; alt::IVehicle* vehicle = ctx.GetExtraInternalFieldValue(); ctx.Return(vehicle->GetHandling()->GetSeatOffsetDistY()); @@ -1199,11 +1198,11 @@ static void SeatOffsetDistYGetter(js::PropertyContext& ctx) static void SeatOffsetDistYSetter(js::PropertyContext& ctx) { - if (!ctx.CheckExtraInternalFieldValue()) return; + if(!ctx.CheckExtraInternalFieldValue()) return; alt::IVehicle* vehicle = ctx.GetExtraInternalFieldValue(); float value; - if (!ctx.GetValue(value)) return; + if(!ctx.GetValue(value)) return; vehicle->ReplaceHandling(); vehicle->GetHandling()->SetSeatOffsetDistY(value); @@ -1211,7 +1210,7 @@ static void SeatOffsetDistYSetter(js::PropertyContext& ctx) static void SeatOffsetDistZGetter(js::PropertyContext& ctx) { - if (!ctx.CheckExtraInternalFieldValue()) return; + if(!ctx.CheckExtraInternalFieldValue()) return; alt::IVehicle* vehicle = ctx.GetExtraInternalFieldValue(); ctx.Return(vehicle->GetHandling()->GetSeatOffsetDistZ()); @@ -1219,11 +1218,11 @@ static void SeatOffsetDistZGetter(js::PropertyContext& ctx) static void SeatOffsetDistZSetter(js::PropertyContext& ctx) { - if (!ctx.CheckExtraInternalFieldValue()) return; + if(!ctx.CheckExtraInternalFieldValue()) return; alt::IVehicle* vehicle = ctx.GetExtraInternalFieldValue(); float value; - if (!ctx.GetValue(value)) return; + if(!ctx.GetValue(value)) return; vehicle->ReplaceHandling(); vehicle->GetHandling()->SetSeatOffsetDistZ(value); @@ -1231,7 +1230,7 @@ static void SeatOffsetDistZSetter(js::PropertyContext& ctx) static void MonetaryValueGetter(js::PropertyContext& ctx) { - if (!ctx.CheckExtraInternalFieldValue()) return; + if(!ctx.CheckExtraInternalFieldValue()) return; alt::IVehicle* vehicle = ctx.GetExtraInternalFieldValue(); ctx.Return(vehicle->GetHandling()->GetMonetaryValue()); @@ -1239,11 +1238,11 @@ static void MonetaryValueGetter(js::PropertyContext& ctx) static void MonetaryValueSetter(js::PropertyContext& ctx) { - if (!ctx.CheckExtraInternalFieldValue()) return; + if(!ctx.CheckExtraInternalFieldValue()) return; alt::IVehicle* vehicle = ctx.GetExtraInternalFieldValue(); uint32_t value; - if (!ctx.GetValue(value)) return; + if(!ctx.GetValue(value)) return; vehicle->ReplaceHandling(); vehicle->GetHandling()->SetMonetaryValue(value); @@ -1251,7 +1250,7 @@ static void MonetaryValueSetter(js::PropertyContext& ctx) static void ModelFlagsGetter(js::PropertyContext& ctx) { - if (!ctx.CheckExtraInternalFieldValue()) return; + if(!ctx.CheckExtraInternalFieldValue()) return; alt::IVehicle* vehicle = ctx.GetExtraInternalFieldValue(); ctx.Return(vehicle->GetHandling()->GetModelFlags()); @@ -1259,11 +1258,11 @@ static void ModelFlagsGetter(js::PropertyContext& ctx) static void ModelFlagsSetter(js::PropertyContext& ctx) { - if (!ctx.CheckExtraInternalFieldValue()) return; + if(!ctx.CheckExtraInternalFieldValue()) return; alt::IVehicle* vehicle = ctx.GetExtraInternalFieldValue(); uint32_t value; - if (!ctx.GetValue(value)) return; + if(!ctx.GetValue(value)) return; vehicle->ReplaceHandling(); vehicle->GetHandling()->SetModelFlags(value); @@ -1271,7 +1270,7 @@ static void ModelFlagsSetter(js::PropertyContext& ctx) static void HandlingFlagsGetter(js::PropertyContext& ctx) { - if (!ctx.CheckExtraInternalFieldValue()) return; + if(!ctx.CheckExtraInternalFieldValue()) return; alt::IVehicle* vehicle = ctx.GetExtraInternalFieldValue(); ctx.Return(vehicle->GetHandling()->GetHandlingFlags()); @@ -1279,11 +1278,11 @@ static void HandlingFlagsGetter(js::PropertyContext& ctx) static void HandlingFlagsSetter(js::PropertyContext& ctx) { - if (!ctx.CheckExtraInternalFieldValue()) return; + if(!ctx.CheckExtraInternalFieldValue()) return; alt::IVehicle* vehicle = ctx.GetExtraInternalFieldValue(); uint32_t value; - if (!ctx.GetValue(value)) return; + if(!ctx.GetValue(value)) return; vehicle->ReplaceHandling(); vehicle->GetHandling()->SetHandlingFlags(value); @@ -1291,7 +1290,7 @@ static void HandlingFlagsSetter(js::PropertyContext& ctx) static void DamageFlagsGetter(js::PropertyContext& ctx) { - if (!ctx.CheckExtraInternalFieldValue()) return; + if(!ctx.CheckExtraInternalFieldValue()) return; alt::IVehicle* vehicle = ctx.GetExtraInternalFieldValue(); ctx.Return(vehicle->GetHandling()->GetDamageFlags()); @@ -1299,11 +1298,11 @@ static void DamageFlagsGetter(js::PropertyContext& ctx) static void DamageFlagsSetter(js::PropertyContext& ctx) { - if (!ctx.CheckExtraInternalFieldValue()) return; + if(!ctx.CheckExtraInternalFieldValue()) return; alt::IVehicle* vehicle = ctx.GetExtraInternalFieldValue(); uint32_t value; - if (!ctx.GetValue(value)) return; + if(!ctx.GetValue(value)) return; vehicle->ReplaceHandling(); vehicle->GetHandling()->SetDamageFlags(value); @@ -1311,7 +1310,7 @@ static void DamageFlagsSetter(js::PropertyContext& ctx) static void IsModified(js::PropertyContext& ctx) { - if (!ctx.CheckExtraInternalFieldValue()) return; + if(!ctx.CheckExtraInternalFieldValue()) return; alt::IVehicle* vehicle = ctx.GetExtraInternalFieldValue(); ctx.Return(vehicle->IsHandlingModified()); @@ -1319,7 +1318,7 @@ static void IsModified(js::PropertyContext& ctx) static void Reset(js::FunctionContext& ctx) { - if (!ctx.CheckExtraInternalFieldValue()) return; + if(!ctx.CheckExtraInternalFieldValue()) return; alt::IVehicle* vehicle = ctx.GetExtraInternalFieldValue(); vehicle->ResetHandling(); From d2878344ab356f343770aab151536966e19d348f Mon Sep 17 00:00:00 2001 From: Carlos Menezes Date: Tue, 19 Mar 2024 12:24:15 +0000 Subject: [PATCH 03/12] chore: client compat --- client/js/compatibility/classes/audio.js | 4 ---- client/js/compatibility/classes/blip.js | 4 ++++ client/js/compatibility/classes/checkpoint.js | 4 ++++ .../js/compatibility/classes/localObject.js | 16 +++++++++++++-- client/js/compatibility/classes/localPed.js | 4 ++++ .../js/compatibility/classes/localVehicle.js | 4 ++++ client/js/compatibility/classes/marker.js | 4 ++++ client/js/compatibility/classes/player.js | 4 ++++ .../js/compatibility/classes/rmlDocument.js | 8 ++++++++ client/js/compatibility/classes/rmlElement.js | 8 ++++++++ client/js/compatibility/classes/vehicle.js | 8 ++++++++ .../js/compatibility/classes/virtualEntity.js | 4 ++++ client/js/compatibility/classes/webview.js | 20 +++++++++++++++---- 13 files changed, 82 insertions(+), 10 deletions(-) diff --git a/client/js/compatibility/classes/audio.js b/client/js/compatibility/classes/audio.js index 18aa8d13c..299908e94 100644 --- a/client/js/compatibility/classes/audio.js +++ b/client/js/compatibility/classes/audio.js @@ -29,10 +29,6 @@ class Audio extends alt.Audio { return this.listeners[eventName] ?? []; } - get playing() { - return this.isPlaying; - } - getOutputs() { return this.outputs; } diff --git a/client/js/compatibility/classes/blip.js b/client/js/compatibility/classes/blip.js index 782683311..0278e3b10 100644 --- a/client/js/compatibility/classes/blip.js +++ b/client/js/compatibility/classes/blip.js @@ -13,6 +13,10 @@ class Blip extends alt.Blip { static get count() { return alt.Blip.all.length; } + + get isStreamedIn() { + return this.streamedIn; + } } extendClassWithProperties(Blip, null, SharedBlip); diff --git a/client/js/compatibility/classes/checkpoint.js b/client/js/compatibility/classes/checkpoint.js index 10daf96de..be992af2c 100644 --- a/client/js/compatibility/classes/checkpoint.js +++ b/client/js/compatibility/classes/checkpoint.js @@ -29,6 +29,10 @@ class Checkpoint extends alt.Checkpoint { static get count() { return alt.Checkpoint.all.length; } + + get isStreamedIn() { + return this.streamedIn; + } } alt.Checkpoint.setFactory(Checkpoint); diff --git a/client/js/compatibility/classes/localObject.js b/client/js/compatibility/classes/localObject.js index 7baea1406..5d07e432c 100644 --- a/client/js/compatibility/classes/localObject.js +++ b/client/js/compatibility/classes/localObject.js @@ -27,8 +27,20 @@ class LocalObject extends alt.LocalObject { return alt.LocalObject.all.length; } - get dynamic() { - return this.isDynamic; + get isCollisionEnabled() { + return this.collisionEnabled; + } + + get isWorldObject() { + return this.worldObject; + } + + get isWeaponObject() { + return this.weaponObject; + } + + get isStreamedIn() { + return this.streamedIn; } attachToEntity(...args) { diff --git a/client/js/compatibility/classes/localPed.js b/client/js/compatibility/classes/localPed.js index 6888d3c88..b6c01b290 100644 --- a/client/js/compatibility/classes/localPed.js +++ b/client/js/compatibility/classes/localPed.js @@ -18,6 +18,10 @@ class LocalPed extends alt.LocalPed { return alt.LocalPed.create({ model, dimension, pos, heading, useStreaming, streamingDistance }); } + + get isStreamedIn() { + return this.streamedIn; + } } alt.LocalPed.setFactory(LocalPed); diff --git a/client/js/compatibility/classes/localVehicle.js b/client/js/compatibility/classes/localVehicle.js index 712dd60db..9ba464737 100644 --- a/client/js/compatibility/classes/localVehicle.js +++ b/client/js/compatibility/classes/localVehicle.js @@ -18,6 +18,10 @@ class LocalVehicle extends alt.LocalVehicle { return alt.LocalVehicle.create({ model, dimension, pos, rot, useStreaming, streamingDistance }); } + + get isStreamedIn() { + return this.streamedIn; + } } alt.LocalVehicle.setFactory(LocalVehicle); diff --git a/client/js/compatibility/classes/marker.js b/client/js/compatibility/classes/marker.js index b9deb1125..1d15957e9 100644 --- a/client/js/compatibility/classes/marker.js +++ b/client/js/compatibility/classes/marker.js @@ -19,6 +19,10 @@ class Marker extends alt.Marker { return alt.Marker.create({ type, pos, color, useStreaming, streamingDistance }); } + get isStreamedIn() { + return this.streamedIn; + } + static get count() { return alt.Marker.all.length; } diff --git a/client/js/compatibility/classes/player.js b/client/js/compatibility/classes/player.js index 80f7d95aa..c5b289415 100644 --- a/client/js/compatibility/classes/player.js +++ b/client/js/compatibility/classes/player.js @@ -8,6 +8,10 @@ const { extendClassWithProperties } = requireBinding("shared/compatibility/utils const { SharedPlayer } = requireBinding("shared/compatibility/classes/sharedPlayer.js"); class Player { + get isTalking() { + return this.talking; + } + static get count() { return alt.Player.all.length; } diff --git a/client/js/compatibility/classes/rmlDocument.js b/client/js/compatibility/classes/rmlDocument.js index 7a46f5afa..a499945c2 100644 --- a/client/js/compatibility/classes/rmlDocument.js +++ b/client/js/compatibility/classes/rmlDocument.js @@ -18,6 +18,14 @@ class RmlDocument extends alt.RmlDocument { return alt.RmlDocument.create({ url }); } + + get isVisible() { + return this.visible; + } + + get isModal() { + return this.modal; + } } alt.RmlDocument.setFactory(RmlDocument); diff --git a/client/js/compatibility/classes/rmlElement.js b/client/js/compatibility/classes/rmlElement.js index 22243b3c1..aea103b33 100644 --- a/client/js/compatibility/classes/rmlElement.js +++ b/client/js/compatibility/classes/rmlElement.js @@ -20,6 +20,14 @@ class RmlElement extends alt.RmlElement { this.rmlID = value; } + get isOwned() { + return this.owned; + } + + get isVisible() { + return this.visible; + } + getClassList() { return this.classList; } diff --git a/client/js/compatibility/classes/vehicle.js b/client/js/compatibility/classes/vehicle.js index 3949fb7e9..f23ca70d3 100644 --- a/client/js/compatibility/classes/vehicle.js +++ b/client/js/compatibility/classes/vehicle.js @@ -54,6 +54,14 @@ class Vehicle { this.batteryLightState = state; } + get isHandlingModified() { + return this.handlingModified; + } + + get isTaxiLightOn() { + return this.taxiLightOn; + } + static get count() { return alt.Vehicle.all.length; } diff --git a/client/js/compatibility/classes/virtualEntity.js b/client/js/compatibility/classes/virtualEntity.js index f0b894825..9b773c2b5 100644 --- a/client/js/compatibility/classes/virtualEntity.js +++ b/client/js/compatibility/classes/virtualEntity.js @@ -29,6 +29,10 @@ class VirtualEntity extends alt.VirtualEntity { }); } + get isStreamedIn() { + return this.streamedIn; + } + hasStreamSyncedMeta(key) { return this.streamSyncedMeta[key] !== undefined; } diff --git a/client/js/compatibility/classes/webview.js b/client/js/compatibility/classes/webview.js index 3ace69c7a..ef616be19 100644 --- a/client/js/compatibility/classes/webview.js +++ b/client/js/compatibility/classes/webview.js @@ -18,8 +18,8 @@ class WebView extends alt.WebView { let instance = null; if (args.length == 4) { - const [_, isOverlay, pos, size] = args; - instance = alt.WebView.create({ url, isOverlay, pos, size }); + const [_, overlay, pos, size] = args; + instance = alt.WebView.create({ url, overlay, pos, size }); } else if (args.length == 3 && isObject(args[2])) { const [_, pos, size] = args; instance = alt.WebView.create({ url, pos, size }); @@ -30,8 +30,8 @@ class WebView extends alt.WebView { const [_, pos] = args; alt.WebView.create({ url, pos }); } else if (args.length == 2) { - const isOverlay = args[1]; - instance = alt.WebView.create({ url, isOverlay }); + const overlay = args[1]; + instance = alt.WebView.create({ url, overlay }); } else { instance = alt.WebView.create({ url }); } @@ -55,6 +55,18 @@ class WebView extends alt.WebView { this.visible = state; } + get isOverlay() { + return this.overlay; + } + + get isLoaded() { + return this.loaded; + } + + get isReady() { + return this.ready; + } + focus() { this.focused = true; } From 62b34737a9a7b02a1bfebb2ed5495418e190cd15 Mon Sep 17 00:00:00 2001 From: Carlos Menezes Date: Tue, 19 Mar 2024 12:51:33 +0000 Subject: [PATCH 04/12] chore: rename missing properties in client module --- client/src/classes/TextLabel.cpp | 4 ++-- client/src/classes/WebView.cpp | 2 +- client/src/factories/AudioFactory.cpp | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/client/src/classes/TextLabel.cpp b/client/src/classes/TextLabel.cpp index 6fc7cba1c..932e3e87a 100644 --- a/client/src/classes/TextLabel.cpp +++ b/client/src/classes/TextLabel.cpp @@ -6,9 +6,9 @@ extern js::Class textLabelClass("TextLabel", &worldObjectClass, nullptr, [](js:: { tpl.BindToType(alt::IBaseObject::Type::TEXT_LABEL); - tpl.Property<&alt::ITextLabel::IsStreamedIn>("isStreamedIn"); + tpl.Property<&alt::ITextLabel::IsStreamedIn>("streamedIn"); - tpl.Property<&alt::ITextLabel::IsGlobal>("isGlobal"); + tpl.Property<&alt::ITextLabel::IsGlobal>("global"); tpl.Property<&alt::ITextLabel::GetTarget>("target"); tpl.Property<&alt::ITextLabel::IsVisible, &alt::ITextLabel::SetVisible>("visible"); tpl.Property<&alt::ITextLabel::GetColor, &alt::ITextLabel::SetColor>("color"); diff --git a/client/src/classes/WebView.cpp b/client/src/classes/WebView.cpp index 054e3bc88..3cc9e2554 100644 --- a/client/src/classes/WebView.cpp +++ b/client/src/classes/WebView.cpp @@ -69,7 +69,7 @@ extern js::Class webViewClass("WebView", &baseObjectClass, [](js::ClassTemplate& tpl.Method<&alt::IWebView::AddOutput>("addOutput"); tpl.Method<&alt::IWebView::RemoveOutput>("removeOutput"); - tpl.StaticProperty("isGpuAccelerationActive", GpuAccelerationActiveGetter); + tpl.StaticProperty("gpuAccelerationActive", GpuAccelerationActiveGetter); tpl.GetByID(); }); diff --git a/client/src/factories/AudioFactory.cpp b/client/src/factories/AudioFactory.cpp index 306e10fca..2dec98240 100644 --- a/client/src/factories/AudioFactory.cpp +++ b/client/src/factories/AudioFactory.cpp @@ -9,7 +9,7 @@ static js::FactoryHandler audioFactory(alt::IBaseObject::Type::AUDIO, [](js::Obj float volume; if(!args.Get("volume", volume)) return nullptr; - bool isRadio = args.Get("isRadio", false); + bool isRadio = args.Get("radio", false); bool clearCache = args.Get("clearCache", true); js::IResource* resource = args.GetResource(); From d95963f8001e7b3d4ca7783071df6e5b50fd2a6b Mon Sep 17 00:00:00 2001 From: Carlos Menezes Date: Tue, 19 Mar 2024 12:52:00 +0000 Subject: [PATCH 05/12] chore: client types --- types/client/index.d.ts | 42 ++++++++++++++++++++--------------------- 1 file changed, 21 insertions(+), 21 deletions(-) diff --git a/types/client/index.d.ts b/types/client/index.d.ts index 2b4271933..8a31afcc3 100644 --- a/types/client/index.d.ts +++ b/types/client/index.d.ts @@ -65,7 +65,7 @@ declare module "@altv/client" { export interface AudioCreateOptions { source: string; volume: number; - isRadio?: boolean; // default: false + radio?: boolean; // default: false clearCache?: boolean; // default: true } @@ -77,7 +77,6 @@ declare module "@altv/client" { readonly outputs: ReadonlyArray; readonly currentTime: number; readonly maxTime: number; - readonly isPlaying: boolean; readonly listeners: ReadonlyMap Promise | void>>; addOutput(output: AudioOutput): void; @@ -252,7 +251,7 @@ declare module "@altv/client" { export abstract class Blip extends WorldObject { readonly scriptID: number; - readonly isStreamedIn: boolean; + readonly streamedIn: boolean; readonly global: boolean; readonly isAttached: boolean; readonly attachedTo?: Entity; @@ -317,6 +316,7 @@ declare module "@altv/client" { export abstract class Marker extends WorldObject { readonly isGlobal: boolean; readonly streamingDistance: number; + readonly streamedIn: boolean; readonly meta: MarkerMeta & Record; @@ -377,7 +377,7 @@ declare module "@altv/client" { export abstract class Checkpoint extends ColShape { readonly scriptID: number; - readonly isStreamedIn: boolean; + readonly streamedIn: boolean; checkpointType: number; radius: number; @@ -563,14 +563,14 @@ declare module "@altv/client" { get model(): number; set model(value: number | string); alpha: number; - readonly isDynamic: boolean; + readonly dynamic: boolean; lodDistance: number; hasGravity: number; - readonly isCollisionEnabled: boolean; + readonly collisionEnabled: boolean; positionFrozen: boolean; textureVariation: number; - readonly isWorldObject: boolean; - readonly isWeaponObject: boolean; + readonly worldObject: boolean; + readonly weaponObject: boolean; readonly useStreaming: boolean; readonly streamingDistance: number; visible: boolean; @@ -657,7 +657,7 @@ declare module "@altv/client" { readonly streamingDistance: number; visible: boolean; readonly scriptID: number; - readonly isStreamedIn: boolean; + readonly streamedIn: boolean; public waitForSpawn(timeout?: number): Promise; @@ -707,7 +707,7 @@ declare module "@altv/client" { readonly streamingDistance: number; visible: boolean; readonly scriptID: number; - readonly isStreamedIn: boolean; + readonly streamedIn: boolean; public waitForSpawn(timeout?: number): Promise; @@ -738,7 +738,7 @@ declare module "@altv/client" { export abstract class Player extends Entity { readonly name: string; - readonly isTalking: boolean; + readonly talking: boolean; readonly micLevel: number; readonly taskData: string; spatialVolume: number; @@ -806,8 +806,8 @@ declare module "@altv/client" { export abstract class RmlDocument extends RmlElement { title: string; readonly sourceUrl: string; - readonly isVisible: boolean; - readonly isModal: boolean; + readonly visible: boolean; + readonly modal: boolean; readonly body: RmlElement; @@ -844,7 +844,7 @@ declare module "@altv/client" { readonly focusedElement?: RmlElement; readonly tagName: string; rmlID: string; - readonly isOwned: boolean; + readonly owned: boolean; readonly absoluteLeft: number; readonly absoluteTop: number; readonly clientLeft: number; @@ -859,7 +859,7 @@ declare module "@altv/client" { scrollTop: number; readonly scrollWidth: number; readonly scrollHeight: number; - readonly isVisible: boolean; + readonly visible: boolean; readonly parent?: RmlElement; readonly nextSibling?: RmlElement; @@ -923,8 +923,8 @@ declare module "@altv/client" { } export abstract class TextLabel extends WorldObject { - readonly isStreamedIn: boolean; - readonly isGlobal: boolean; + readonly streamedIn: boolean; + readonly global: boolean; readonly target: Entity; visible: boolean; color: altShared.RGBA; @@ -1022,11 +1022,11 @@ declare module "@altv/client" { readonly rpm: number; readonly speedVector: altShared.Vector3; readonly handling: Handling; - readonly isHandlingModified: boolean; + readonly handlingModified: boolean; indicatorLights: number; seatCount: number; readonly occupiedSeatsCount: number; - readonly isTaxiLightOn: boolean; + readonly taxiLightOn: boolean; engineTemperature: number; fuelLevel: number; oilLevel: number; @@ -1123,7 +1123,7 @@ declare module "@altv/client" { } export abstract class VirtualEntity extends WorldObject { - readonly isStreamedIn: boolean; + readonly streamedIn: boolean; readonly group: VirtualEntityGroup; readonly streamingDistance: number; @@ -1278,7 +1278,7 @@ declare module "@altv/client" { public onDestroy?(): void; static readonly all: ReadonlyArray; - static readonly isGpuAccelerationActive: boolean; + static readonly gpuAccelerationActive: boolean; static create(options: _WebViewCreateOptionsDrawable): WebView; static create(options: _WebViewCreateOptionsOverlay): WebView; From fc981b79e126d740e435a94d4bc1d8869dd6cc02 Mon Sep 17 00:00:00 2001 From: Carlos Menezes Date: Wed, 20 Mar 2024 14:52:59 +0000 Subject: [PATCH 06/12] Revert "chore: client compat" This reverts commit d2878344ab356f343770aab151536966e19d348f. --- client/js/compatibility/classes/audio.js | 4 ++++ client/js/compatibility/classes/blip.js | 4 ---- client/js/compatibility/classes/checkpoint.js | 4 ---- .../js/compatibility/classes/localObject.js | 16 ++------------- client/js/compatibility/classes/localPed.js | 4 ---- .../js/compatibility/classes/localVehicle.js | 4 ---- client/js/compatibility/classes/marker.js | 4 ---- client/js/compatibility/classes/player.js | 4 ---- .../js/compatibility/classes/rmlDocument.js | 8 -------- client/js/compatibility/classes/rmlElement.js | 8 -------- client/js/compatibility/classes/vehicle.js | 8 -------- .../js/compatibility/classes/virtualEntity.js | 4 ---- client/js/compatibility/classes/webview.js | 20 ++++--------------- 13 files changed, 10 insertions(+), 82 deletions(-) diff --git a/client/js/compatibility/classes/audio.js b/client/js/compatibility/classes/audio.js index 299908e94..18aa8d13c 100644 --- a/client/js/compatibility/classes/audio.js +++ b/client/js/compatibility/classes/audio.js @@ -29,6 +29,10 @@ class Audio extends alt.Audio { return this.listeners[eventName] ?? []; } + get playing() { + return this.isPlaying; + } + getOutputs() { return this.outputs; } diff --git a/client/js/compatibility/classes/blip.js b/client/js/compatibility/classes/blip.js index 0278e3b10..782683311 100644 --- a/client/js/compatibility/classes/blip.js +++ b/client/js/compatibility/classes/blip.js @@ -13,10 +13,6 @@ class Blip extends alt.Blip { static get count() { return alt.Blip.all.length; } - - get isStreamedIn() { - return this.streamedIn; - } } extendClassWithProperties(Blip, null, SharedBlip); diff --git a/client/js/compatibility/classes/checkpoint.js b/client/js/compatibility/classes/checkpoint.js index be992af2c..10daf96de 100644 --- a/client/js/compatibility/classes/checkpoint.js +++ b/client/js/compatibility/classes/checkpoint.js @@ -29,10 +29,6 @@ class Checkpoint extends alt.Checkpoint { static get count() { return alt.Checkpoint.all.length; } - - get isStreamedIn() { - return this.streamedIn; - } } alt.Checkpoint.setFactory(Checkpoint); diff --git a/client/js/compatibility/classes/localObject.js b/client/js/compatibility/classes/localObject.js index 5d07e432c..7baea1406 100644 --- a/client/js/compatibility/classes/localObject.js +++ b/client/js/compatibility/classes/localObject.js @@ -27,20 +27,8 @@ class LocalObject extends alt.LocalObject { return alt.LocalObject.all.length; } - get isCollisionEnabled() { - return this.collisionEnabled; - } - - get isWorldObject() { - return this.worldObject; - } - - get isWeaponObject() { - return this.weaponObject; - } - - get isStreamedIn() { - return this.streamedIn; + get dynamic() { + return this.isDynamic; } attachToEntity(...args) { diff --git a/client/js/compatibility/classes/localPed.js b/client/js/compatibility/classes/localPed.js index b6c01b290..6888d3c88 100644 --- a/client/js/compatibility/classes/localPed.js +++ b/client/js/compatibility/classes/localPed.js @@ -18,10 +18,6 @@ class LocalPed extends alt.LocalPed { return alt.LocalPed.create({ model, dimension, pos, heading, useStreaming, streamingDistance }); } - - get isStreamedIn() { - return this.streamedIn; - } } alt.LocalPed.setFactory(LocalPed); diff --git a/client/js/compatibility/classes/localVehicle.js b/client/js/compatibility/classes/localVehicle.js index 9ba464737..712dd60db 100644 --- a/client/js/compatibility/classes/localVehicle.js +++ b/client/js/compatibility/classes/localVehicle.js @@ -18,10 +18,6 @@ class LocalVehicle extends alt.LocalVehicle { return alt.LocalVehicle.create({ model, dimension, pos, rot, useStreaming, streamingDistance }); } - - get isStreamedIn() { - return this.streamedIn; - } } alt.LocalVehicle.setFactory(LocalVehicle); diff --git a/client/js/compatibility/classes/marker.js b/client/js/compatibility/classes/marker.js index 1d15957e9..b9deb1125 100644 --- a/client/js/compatibility/classes/marker.js +++ b/client/js/compatibility/classes/marker.js @@ -19,10 +19,6 @@ class Marker extends alt.Marker { return alt.Marker.create({ type, pos, color, useStreaming, streamingDistance }); } - get isStreamedIn() { - return this.streamedIn; - } - static get count() { return alt.Marker.all.length; } diff --git a/client/js/compatibility/classes/player.js b/client/js/compatibility/classes/player.js index c5b289415..80f7d95aa 100644 --- a/client/js/compatibility/classes/player.js +++ b/client/js/compatibility/classes/player.js @@ -8,10 +8,6 @@ const { extendClassWithProperties } = requireBinding("shared/compatibility/utils const { SharedPlayer } = requireBinding("shared/compatibility/classes/sharedPlayer.js"); class Player { - get isTalking() { - return this.talking; - } - static get count() { return alt.Player.all.length; } diff --git a/client/js/compatibility/classes/rmlDocument.js b/client/js/compatibility/classes/rmlDocument.js index a499945c2..7a46f5afa 100644 --- a/client/js/compatibility/classes/rmlDocument.js +++ b/client/js/compatibility/classes/rmlDocument.js @@ -18,14 +18,6 @@ class RmlDocument extends alt.RmlDocument { return alt.RmlDocument.create({ url }); } - - get isVisible() { - return this.visible; - } - - get isModal() { - return this.modal; - } } alt.RmlDocument.setFactory(RmlDocument); diff --git a/client/js/compatibility/classes/rmlElement.js b/client/js/compatibility/classes/rmlElement.js index aea103b33..22243b3c1 100644 --- a/client/js/compatibility/classes/rmlElement.js +++ b/client/js/compatibility/classes/rmlElement.js @@ -20,14 +20,6 @@ class RmlElement extends alt.RmlElement { this.rmlID = value; } - get isOwned() { - return this.owned; - } - - get isVisible() { - return this.visible; - } - getClassList() { return this.classList; } diff --git a/client/js/compatibility/classes/vehicle.js b/client/js/compatibility/classes/vehicle.js index f23ca70d3..3949fb7e9 100644 --- a/client/js/compatibility/classes/vehicle.js +++ b/client/js/compatibility/classes/vehicle.js @@ -54,14 +54,6 @@ class Vehicle { this.batteryLightState = state; } - get isHandlingModified() { - return this.handlingModified; - } - - get isTaxiLightOn() { - return this.taxiLightOn; - } - static get count() { return alt.Vehicle.all.length; } diff --git a/client/js/compatibility/classes/virtualEntity.js b/client/js/compatibility/classes/virtualEntity.js index 9b773c2b5..f0b894825 100644 --- a/client/js/compatibility/classes/virtualEntity.js +++ b/client/js/compatibility/classes/virtualEntity.js @@ -29,10 +29,6 @@ class VirtualEntity extends alt.VirtualEntity { }); } - get isStreamedIn() { - return this.streamedIn; - } - hasStreamSyncedMeta(key) { return this.streamSyncedMeta[key] !== undefined; } diff --git a/client/js/compatibility/classes/webview.js b/client/js/compatibility/classes/webview.js index ef616be19..3ace69c7a 100644 --- a/client/js/compatibility/classes/webview.js +++ b/client/js/compatibility/classes/webview.js @@ -18,8 +18,8 @@ class WebView extends alt.WebView { let instance = null; if (args.length == 4) { - const [_, overlay, pos, size] = args; - instance = alt.WebView.create({ url, overlay, pos, size }); + const [_, isOverlay, pos, size] = args; + instance = alt.WebView.create({ url, isOverlay, pos, size }); } else if (args.length == 3 && isObject(args[2])) { const [_, pos, size] = args; instance = alt.WebView.create({ url, pos, size }); @@ -30,8 +30,8 @@ class WebView extends alt.WebView { const [_, pos] = args; alt.WebView.create({ url, pos }); } else if (args.length == 2) { - const overlay = args[1]; - instance = alt.WebView.create({ url, overlay }); + const isOverlay = args[1]; + instance = alt.WebView.create({ url, isOverlay }); } else { instance = alt.WebView.create({ url }); } @@ -55,18 +55,6 @@ class WebView extends alt.WebView { this.visible = state; } - get isOverlay() { - return this.overlay; - } - - get isLoaded() { - return this.loaded; - } - - get isReady() { - return this.ready; - } - focus() { this.focused = true; } From a9912fbe66ebfd026771c93a341756deb5b26324 Mon Sep 17 00:00:00 2001 From: Carlos Menezes Date: Wed, 20 Mar 2024 14:53:25 +0000 Subject: [PATCH 07/12] Revert "chore: rename client properties" This reverts commit 7af4a1a84d9df4c127673cf99c98963d54f4306d. --- client/src/classes/Audio.cpp | 2 +- client/src/classes/Blip.cpp | 2 +- client/src/classes/Checkpoint.cpp | 2 +- client/src/classes/Handling.cpp | 2 +- client/src/classes/LocalObject.cpp | 17 +++++++++-------- client/src/classes/LocalPed.cpp | 5 +++-- client/src/classes/LocalVehicle.cpp | 5 +++-- client/src/classes/Marker.cpp | 2 +- client/src/classes/Player.cpp | 2 +- client/src/classes/RmlDocument.cpp | 4 ++-- client/src/classes/RmlElement.cpp | 4 ++-- client/src/classes/Vehicle.cpp | 7 ++++--- client/src/classes/VirtualEntity.cpp | 2 +- client/src/classes/WebView.cpp | 6 +++--- 14 files changed, 33 insertions(+), 29 deletions(-) diff --git a/client/src/classes/Audio.cpp b/client/src/classes/Audio.cpp index a1dc10d55..66d7da297 100644 --- a/client/src/classes/Audio.cpp +++ b/client/src/classes/Audio.cpp @@ -11,7 +11,7 @@ extern js::Class audioClass("Audio", [](js::ClassTemplate& tpl) tpl.Property<&alt::IAudio::GetOutputs>("outputs"); tpl.Property<&alt::IAudio::GetCurrentTime>("currentTime"); tpl.Property<&alt::IAudio::GetMaxTime>("maxTime"); - tpl.Property<&alt::IAudio::IsPlaying>("playing"); + tpl.Property<&alt::IAudio::IsPlaying>("isPlaying"); tpl.Method<&alt::IAudio::AddOutput>("addOutput"); tpl.Method<&alt::IAudio::RemoveOutput>("removeOutput"); diff --git a/client/src/classes/Blip.cpp b/client/src/classes/Blip.cpp index d6d2fdede..3cff3fe20 100644 --- a/client/src/classes/Blip.cpp +++ b/client/src/classes/Blip.cpp @@ -17,7 +17,7 @@ extern js::Class blipClass("Blip", &sharedBlipClass, nullptr, [](js::ClassTempla tpl.BindToType(alt::IBaseObject::Type::BLIP); tpl.Property<&alt::IBlip::GetGameID>("scriptID"); - tpl.Property<&alt::IBlip::IsStreamedIn>("streamedIn"); + tpl.Property<&alt::IBlip::IsStreamedIn>("isStreamedIn"); tpl.GetByID(); tpl.GetByRemoteID(); diff --git a/client/src/classes/Checkpoint.cpp b/client/src/classes/Checkpoint.cpp index c6d6fffe0..4ec12aa8e 100644 --- a/client/src/classes/Checkpoint.cpp +++ b/client/src/classes/Checkpoint.cpp @@ -17,7 +17,7 @@ extern js::Class checkpointClass("Checkpoint", &sharedCheckpointClass, nullptr, tpl.BindToType(alt::IBaseObject::Type::CHECKPOINT); tpl.Property<&alt::ICheckpoint::GetGameID>("scriptID"); - tpl.Property<&alt::ICheckpoint::IsStreamedIn>("streamedIn"); + tpl.Property<&alt::ICheckpoint::IsStreamedIn>("isStreamedIn"); tpl.GetByID(); tpl.GetByRemoteID(); diff --git a/client/src/classes/Handling.cpp b/client/src/classes/Handling.cpp index 60957ddea..1b6542dad 100644 --- a/client/src/classes/Handling.cpp +++ b/client/src/classes/Handling.cpp @@ -1393,7 +1393,7 @@ extern js::Class handlingClass("Handling", [](js::ClassTemplate& tpl) tpl.Property("modelFlags", ModelFlagsGetter, ModelFlagsSetter); tpl.Property("handlingFlags", HandlingFlagsGetter, HandlingFlagsSetter); tpl.Property("damageFlags", DamageFlagsGetter, DamageFlagsSetter); - tpl.Property("modified", IsModified); + tpl.Property("isModified", IsModified); tpl.Method("reset", Reset); }, true); diff --git a/client/src/classes/LocalObject.cpp b/client/src/classes/LocalObject.cpp index 20f05fdcc..a95772912 100644 --- a/client/src/classes/LocalObject.cpp +++ b/client/src/classes/LocalObject.cpp @@ -13,7 +13,8 @@ static void GetByScriptID(js::FunctionContext& ctx) if(!ctx.GetArg(0, scriptId)) return; auto obj = alt::ICore::Instance().GetWorldObjectByScriptID(scriptId); - if(obj && obj->GetType() == alt::IBaseObject::Type::LOCAL_OBJECT) return ctx.Return(obj); + if (obj && obj->GetType() == alt::IBaseObject::Type::LOCAL_OBJECT) + return ctx.Return(obj); ctx.Return(nullptr); } @@ -25,10 +26,10 @@ static void SetComponentTintIndex(js::FunctionContext& ctx) alt::ILocalObject* weaponObject = ctx.GetThisObject(); uint32_t componentType; - if(!ctx.GetArg(0, componentType)) return; + if (!ctx.GetArg(0, componentType)) return; uint32_t tintIndex; - if(!ctx.GetArg(1, tintIndex)) return; + if (!ctx.GetArg(1, tintIndex)) return; weaponObject->SetComponentTintIndex(componentType, tintIndex); } @@ -77,15 +78,15 @@ extern js::Class localObjectClass("LocalObject", &objectClass, nullptr, [](js::C tpl.Property<&alt::ILocalObject::GetModel, &alt::ILocalObject::SetModel>("model"); tpl.Property<&alt::ILocalObject::GetAlpha, &alt::ILocalObject::SetAlpha>("alpha"); - tpl.Property<&alt::ILocalObject::IsDynamic>("dynamic"); + tpl.Property<&alt::ILocalObject::IsDynamic>("isDynamic"); tpl.Property<&alt::ILocalObject::GetLodDistance, &alt::ILocalObject::SetLodDistance>("lodDistance"); tpl.Property<&alt::ILocalObject::HasGravity, &alt::ILocalObject::ToggleGravity>("hasGravity"); - tpl.Property<&alt::ILocalObject::IsCollisionEnabled>("collisionEnabled"); + tpl.Property<&alt::ILocalObject::IsCollisionEnabled>("isCollisionEnabled"); tpl.Property<&alt::ILocalObject::IsPositionFrozen, &alt::ILocalObject::SetPositionFrozen>("positionFrozen"); tpl.Property<&alt::ILocalObject::GetTextureVariation, &alt::ILocalObject::SetTextureVariation>("textureVariation"); - tpl.Property<&alt::ILocalObject::IsWorldObject>("worldObject"); - tpl.Property<&alt::ILocalObject::IsWeaponObject>("weaponObject"); - tpl.Property<&alt::ILocalObject::IsStreamedIn>("streamedIn"); + tpl.Property<&alt::ILocalObject::IsWorldObject>("isWorldObject"); + tpl.Property<&alt::ILocalObject::IsWeaponObject>("isWeaponObject"); + tpl.Property<&alt::ILocalObject::IsStreamedIn>("isStreamedIn"); tpl.Property<&alt::ILocalObject::UsesStreaming>("useStreaming"); tpl.Property<&alt::ILocalObject::GetStreamingDistance>("streamingDistance"); tpl.Property<&alt::ILocalObject::GetVisible, &alt::ILocalObject::SetVisible>("visible"); diff --git a/client/src/classes/LocalPed.cpp b/client/src/classes/LocalPed.cpp index 5774258ee..8f66bdd48 100644 --- a/client/src/classes/LocalPed.cpp +++ b/client/src/classes/LocalPed.cpp @@ -27,7 +27,8 @@ static void GetByScriptID(js::FunctionContext& ctx) if(!ctx.GetArg(0, scriptId)) return; auto obj = alt::ICore::Instance().GetWorldObjectByScriptID(scriptId); - if(obj && obj->GetType() == alt::IBaseObject::Type::LOCAL_PED) return ctx.Return(obj); + if (obj && obj->GetType() == alt::IBaseObject::Type::LOCAL_PED) + return ctx.Return(obj); ctx.Return(nullptr); } @@ -42,7 +43,7 @@ extern js::Class localPedClass("LocalPed", &pedClass, nullptr, [](js::ClassTempl tpl.Property<&alt::ILocalPed::GetStreamingDistance>("streamingDistance"); tpl.Property<&alt::ILocalPed::IsVisible, &alt::ILocalPed::SetVisible>("visible"); tpl.Property<&alt::ILocalPed::GetScriptID>("scriptID"); - tpl.Property<&alt::ILocalPed::IsStreamedIn>("streamedIn"); + tpl.Property<&alt::ILocalPed::IsStreamedIn>("isStreamedIn"); tpl.GetByID(); tpl.StaticFunction("getByScriptID", &GetByScriptID); diff --git a/client/src/classes/LocalVehicle.cpp b/client/src/classes/LocalVehicle.cpp index e39bdc6dd..5136c1c94 100644 --- a/client/src/classes/LocalVehicle.cpp +++ b/client/src/classes/LocalVehicle.cpp @@ -27,7 +27,8 @@ static void GetByScriptID(js::FunctionContext& ctx) if(!ctx.GetArg(0, scriptId)) return; auto obj = alt::ICore::Instance().GetWorldObjectByScriptID(scriptId); - if(obj && obj->GetType() == alt::IBaseObject::Type::LOCAL_VEHICLE) return ctx.Return(obj); + if (obj && obj->GetType() == alt::IBaseObject::Type::LOCAL_VEHICLE) + return ctx.Return(obj); ctx.Return(nullptr); } @@ -42,7 +43,7 @@ extern js::Class localVehicleClass("LocalVehicle", &vehicleClass, nullptr, [](js tpl.Property<&alt::ILocalPed::GetStreamingDistance>("streamingDistance"); tpl.Property<&alt::ILocalPed::IsVisible, &alt::ILocalPed::SetVisible>("visible"); tpl.Property<&alt::ILocalPed::GetScriptID>("scriptID"); - tpl.Property<&alt::ILocalPed::IsStreamedIn>("streamedIn"); + tpl.Property<&alt::ILocalPed::IsStreamedIn>("isStreamedIn"); tpl.GetByID(); tpl.StaticFunction("getByScriptID", &GetByScriptID); diff --git a/client/src/classes/Marker.cpp b/client/src/classes/Marker.cpp index 8ba4fba97..6bdf7b464 100644 --- a/client/src/classes/Marker.cpp +++ b/client/src/classes/Marker.cpp @@ -6,7 +6,7 @@ extern js::Class markerClass("Marker", &sharedMarkerClass, nullptr, [](js::Class { tpl.BindToType(alt::IBaseObject::Type::MARKER); - tpl.Property<&alt::IMarker::IsStreamedIn>("streamedIn"); + tpl.Property<&alt::IMarker::IsStreamedIn>("isStreamedIn"); tpl.GetByID(); tpl.GetByRemoteID(); diff --git a/client/src/classes/Player.cpp b/client/src/classes/Player.cpp index a5e4268c1..be446e7e0 100644 --- a/client/src/classes/Player.cpp +++ b/client/src/classes/Player.cpp @@ -35,7 +35,7 @@ extern js::Class playerClass("Player", &sharedPlayerClass, nullptr, [](js::Class { tpl.BindToType(alt::IBaseObject::Type::PLAYER); - tpl.Property<&alt::IPlayer::IsTalking>("talking"); + tpl.Property<&alt::IPlayer::IsTalking>("isTalking"); tpl.Property<&alt::IPlayer::GetMicLevel>("micLevel"); tpl.Property<&alt::IPlayer::GetTaskData>("taskData"); tpl.Property<&alt::IPlayer::GetSpatialVolume, &alt::IPlayer::SetSpatialVolume>("spatialVolume"); diff --git a/client/src/classes/RmlDocument.cpp b/client/src/classes/RmlDocument.cpp index 768b42c7e..05193e154 100644 --- a/client/src/classes/RmlDocument.cpp +++ b/client/src/classes/RmlDocument.cpp @@ -52,8 +52,8 @@ extern js::Class rmlDocumentClass("RmlDocument", &rmlElementClass, nullptr, [](j tpl.Property<&alt::IRmlDocument::GetTitle, &alt::IRmlDocument::SetTitle>("title"); tpl.Property<&alt::IRmlDocument::GetSourceUrl>("sourceUrl"); - tpl.Property<&alt::IRmlDocument::IsVisible>("visible"); - tpl.Property<&alt::IRmlDocument::IsModal>("modal"); + tpl.Property<&alt::IRmlDocument::IsVisible>("isVisible"); + tpl.Property<&alt::IRmlDocument::IsModal>("isModal"); tpl.Property<&alt::IRmlDocument::GetBody>("body"); tpl.Method("show", Show); diff --git a/client/src/classes/RmlElement.cpp b/client/src/classes/RmlElement.cpp index 156b25e9b..14f1189bb 100644 --- a/client/src/classes/RmlElement.cpp +++ b/client/src/classes/RmlElement.cpp @@ -64,7 +64,7 @@ extern js::Class rmlElementClass("RmlElement", &baseObjectClass, nullptr, [](js: tpl.Property<&alt::IRmlElement::GetFocusedElement>("focusedElement"); tpl.Property<&alt::IRmlElement::GetTagName>("tagName"); tpl.Property<&alt::IRmlElement::GetRmlID, &alt::IRmlElement::SetRmlID>("rmlID"); - tpl.Property<&alt::IRmlElement::IsOwned>("owned"); + tpl.Property<&alt::IRmlElement::IsOwned>("isOwned"); tpl.Property<&alt::IRmlElement::GetAbsoluteLeft>("absoluteLeft"); tpl.Property<&alt::IRmlElement::GetAbsoluteTop>("absoluteTop"); tpl.Property<&alt::IRmlElement::GetClientLeft>("clientLeft"); @@ -79,7 +79,7 @@ extern js::Class rmlElementClass("RmlElement", &baseObjectClass, nullptr, [](js: tpl.Property<&alt::IRmlElement::GetScrollTop, &alt::IRmlElement::SetScrollTop>("scrollTop"); tpl.Property<&alt::IRmlElement::GetScrollWidth>("scrollWidth"); tpl.Property<&alt::IRmlElement::GetScrollHeight>("scrollHeight"); - tpl.Property<&alt::IRmlElement::IsVisible>("visible"); + tpl.Property<&alt::IRmlElement::IsVisible>("isVisible"); tpl.Property<&alt::IRmlElement::GetParent>("parent"); tpl.Property<&alt::IRmlElement::GetNextSibling>("nextSibling"); tpl.Property<&alt::IRmlElement::GetPreviousSibling>("previousSibling"); diff --git a/client/src/classes/Vehicle.cpp b/client/src/classes/Vehicle.cpp index e0251bcf0..01b1ca368 100644 --- a/client/src/classes/Vehicle.cpp +++ b/client/src/classes/Vehicle.cpp @@ -17,7 +17,8 @@ static void GetByScriptID(js::FunctionContext& ctx) if(!ctx.GetArg(0, scriptId)) return; auto obj = alt::ICore::Instance().GetWorldObjectByScriptID(scriptId); - if(obj && (obj->GetType() == alt::IBaseObject::Type::VEHICLE || obj->GetType() == alt::IBaseObject::Type::LOCAL_VEHICLE)) return ctx.Return(obj); + if (obj && (obj->GetType() == alt::IBaseObject::Type::VEHICLE || obj->GetType() == alt::IBaseObject::Type::LOCAL_VEHICLE)) + return ctx.Return(obj); ctx.Return(nullptr); } @@ -36,11 +37,11 @@ extern js::Class vehicleClass("Vehicle", &sharedVehicleClass, nullptr, [](js::Cl tpl.Property<&alt::IVehicle::GetCurrentRPM, &alt::IVehicle::SetCurrentRPM>("rpm"); tpl.Property<&alt::IVehicle::GetWheelsCount>("wheelsCount"); tpl.Property<&alt::IVehicle::GetSpeedVector>("speedVector"); - tpl.Property<&alt::IVehicle::IsHandlingModified>("handlingModified"); + tpl.Property<&alt::IVehicle::IsHandlingModified>("isHandlingModified"); tpl.Property<&alt::IVehicle::GetLightsIndicator, &alt::IVehicle::SetLightsIndicator>("indicatorLights"); tpl.Property<&alt::IVehicle::GetSeatCount>("seatCount"); tpl.Property<&alt::IVehicle::GetOccupiedSeatsCount>("occupiedSeatsCount"); - tpl.Property<&alt::IVehicle::IsTaxiLightOn>("taxiLightOn"); + tpl.Property<&alt::IVehicle::IsTaxiLightOn>("isTaxiLightOn"); tpl.Property<&alt::IVehicle::GetEngineTemperature, &alt::IVehicle::SetEngineTemperature>("engineTemperature"); tpl.Property<&alt::IVehicle::GetFuelLevel, &alt::IVehicle::SetFuelLevel>("fuelLevel"); tpl.Property<&alt::IVehicle::GetOilLevel, &alt::IVehicle::SetOilLevel>("oilLevel"); diff --git a/client/src/classes/VirtualEntity.cpp b/client/src/classes/VirtualEntity.cpp index 7a0cd0f1e..a866de02e 100644 --- a/client/src/classes/VirtualEntity.cpp +++ b/client/src/classes/VirtualEntity.cpp @@ -7,7 +7,7 @@ extern js::Class virtualEntityClass("VirtualEntity", &sharedVirtualEntityClass, { tpl.BindToType(alt::IBaseObject::Type::VIRTUAL_ENTITY); - tpl.Property<&alt::IVirtualEntity::IsStreamedIn>("streamedIn"); + tpl.Property<&alt::IVirtualEntity::IsStreamedIn>("isStreamedIn"); tpl.GetByID(); tpl.GetByRemoteID(); diff --git a/client/src/classes/WebView.cpp b/client/src/classes/WebView.cpp index 3cc9e2554..405ebc0bf 100644 --- a/client/src/classes/WebView.cpp +++ b/client/src/classes/WebView.cpp @@ -55,9 +55,9 @@ extern js::Class webViewClass("WebView", &baseObjectClass, [](js::ClassTemplate& tpl.Property("focused", FocusedGetter, FocusedSetter); tpl.Property<&alt::IWebView::GetUrl, &alt::IWebView::SetUrl>("url"); tpl.Property<&alt::IWebView::IsVisible, &alt::IWebView::SetVisible>("visible"); - tpl.Property<&alt::IWebView::IsOverlay>("overlay"); - tpl.Property<&alt::IWebView::IsLoaded>("loaded"); - tpl.Property<&alt::IWebView::IsReady>("ready"); + tpl.Property<&alt::IWebView::IsOverlay>("isOverlay"); + tpl.Property<&alt::IWebView::IsLoaded>("isLoaded"); + tpl.Property<&alt::IWebView::IsReady>("isReady"); tpl.Property<&alt::IWebView::GetSize, &alt::IWebView::SetSize>("size"); tpl.Property<&alt::IWebView::GetPosition, &alt::IWebView::SetPosition>("pos"); tpl.Property<&alt::IWebView::GetOutputs>("outputs"); From 05f30428a9a86f1b97602289e911524d98846a3f Mon Sep 17 00:00:00 2001 From: Carlos Menezes Date: Wed, 20 Mar 2024 14:54:41 +0000 Subject: [PATCH 08/12] Revert "chore: format `Handling.cpp`" This reverts commit 08155a1a761274c352cf059524c9985f2846365c. --- client/src/classes/Handling.cpp | 305 ++++++++++++++++---------------- 1 file changed, 153 insertions(+), 152 deletions(-) diff --git a/client/src/classes/Handling.cpp b/client/src/classes/Handling.cpp index 1b6542dad..4582fdc1d 100644 --- a/client/src/classes/Handling.cpp +++ b/client/src/classes/Handling.cpp @@ -310,7 +310,7 @@ static void DriveInertiaSetter(js::PropertyContext& ctx) static void ClutchChangeRateScaleUpShiftGetter(js::PropertyContext& ctx) { - if(!ctx.CheckExtraInternalFieldValue()) return; + if (!ctx.CheckExtraInternalFieldValue()) return; alt::IVehicle* vehicle = ctx.GetExtraInternalFieldValue(); ctx.Return(vehicle->GetHandling()->GetClutchChangeRateScaleUpShift()); @@ -318,11 +318,11 @@ static void ClutchChangeRateScaleUpShiftGetter(js::PropertyContext& ctx) static void ClutchChangeRateScaleUpShiftSetter(js::PropertyContext& ctx) { - if(!ctx.CheckExtraInternalFieldValue()) return; + if (!ctx.CheckExtraInternalFieldValue()) return; alt::IVehicle* vehicle = ctx.GetExtraInternalFieldValue(); float value; - if(!ctx.GetValue(value)) return; + if (!ctx.GetValue(value)) return; vehicle->ReplaceHandling(); vehicle->GetHandling()->SetClutchChangeRateScaleUpShift(value); @@ -330,7 +330,7 @@ static void ClutchChangeRateScaleUpShiftSetter(js::PropertyContext& ctx) static void ClutchChangeRateScaleDownShiftGetter(js::PropertyContext& ctx) { - if(!ctx.CheckExtraInternalFieldValue()) return; + if (!ctx.CheckExtraInternalFieldValue()) return; alt::IVehicle* vehicle = ctx.GetExtraInternalFieldValue(); ctx.Return(vehicle->GetHandling()->GetClutchChangeRateScaleDownShift()); @@ -338,19 +338,20 @@ static void ClutchChangeRateScaleDownShiftGetter(js::PropertyContext& ctx) static void ClutchChangeRateScaleDownShiftSetter(js::PropertyContext& ctx) { - if(!ctx.CheckExtraInternalFieldValue()) return; + if (!ctx.CheckExtraInternalFieldValue()) return; alt::IVehicle* vehicle = ctx.GetExtraInternalFieldValue(); float value; - if(!ctx.GetValue(value)) return; + if (!ctx.GetValue(value)) return; vehicle->ReplaceHandling(); vehicle->GetHandling()->SetClutchChangeRateScaleDownShift(value); } + static void InitialDriveForceGetter(js::PropertyContext& ctx) { - if(!ctx.CheckExtraInternalFieldValue()) return; + if (!ctx.CheckExtraInternalFieldValue()) return; alt::IVehicle* vehicle = ctx.GetExtraInternalFieldValue(); ctx.Return(vehicle->GetHandling()->GetInitialDriveForce()); @@ -358,11 +359,11 @@ static void InitialDriveForceGetter(js::PropertyContext& ctx) static void InitialDriveForceSetter(js::PropertyContext& ctx) { - if(!ctx.CheckExtraInternalFieldValue()) return; + if (!ctx.CheckExtraInternalFieldValue()) return; alt::IVehicle* vehicle = ctx.GetExtraInternalFieldValue(); float value; - if(!ctx.GetValue(value)) return; + if (!ctx.GetValue(value)) return; vehicle->ReplaceHandling(); vehicle->GetHandling()->SetInitialDriveForce(value); @@ -370,7 +371,7 @@ static void InitialDriveForceSetter(js::PropertyContext& ctx) static void DriveMaxFlatVelGetter(js::PropertyContext& ctx) { - if(!ctx.CheckExtraInternalFieldValue()) return; + if (!ctx.CheckExtraInternalFieldValue()) return; alt::IVehicle* vehicle = ctx.GetExtraInternalFieldValue(); ctx.Return(vehicle->GetHandling()->GetDriveMaxFlatVel()); @@ -378,11 +379,11 @@ static void DriveMaxFlatVelGetter(js::PropertyContext& ctx) static void DriveMaxFlatVelSetter(js::PropertyContext& ctx) { - if(!ctx.CheckExtraInternalFieldValue()) return; + if (!ctx.CheckExtraInternalFieldValue()) return; alt::IVehicle* vehicle = ctx.GetExtraInternalFieldValue(); float value; - if(!ctx.GetValue(value)) return; + if (!ctx.GetValue(value)) return; vehicle->ReplaceHandling(); vehicle->GetHandling()->SetDriveMaxFlatVel(value); @@ -390,7 +391,7 @@ static void DriveMaxFlatVelSetter(js::PropertyContext& ctx) static void InitialDriveMaxFlatVelGetter(js::PropertyContext& ctx) { - if(!ctx.CheckExtraInternalFieldValue()) return; + if (!ctx.CheckExtraInternalFieldValue()) return; alt::IVehicle* vehicle = ctx.GetExtraInternalFieldValue(); ctx.Return(vehicle->GetHandling()->GetInitialDriveMaxFlatVel()); @@ -398,11 +399,11 @@ static void InitialDriveMaxFlatVelGetter(js::PropertyContext& ctx) static void InitialDriveMaxFlatVelSetter(js::PropertyContext& ctx) { - if(!ctx.CheckExtraInternalFieldValue()) return; + if (!ctx.CheckExtraInternalFieldValue()) return; alt::IVehicle* vehicle = ctx.GetExtraInternalFieldValue(); float value; - if(!ctx.GetValue(value)) return; + if (!ctx.GetValue(value)) return; vehicle->ReplaceHandling(); vehicle->GetHandling()->SetInitialDriveMaxFlatVel(value); @@ -410,7 +411,7 @@ static void InitialDriveMaxFlatVelSetter(js::PropertyContext& ctx) static void BrakeForceGetter(js::PropertyContext& ctx) { - if(!ctx.CheckExtraInternalFieldValue()) return; + if (!ctx.CheckExtraInternalFieldValue()) return; alt::IVehicle* vehicle = ctx.GetExtraInternalFieldValue(); ctx.Return(vehicle->GetHandling()->GetBrakeForce()); @@ -418,11 +419,11 @@ static void BrakeForceGetter(js::PropertyContext& ctx) static void BrakeForceSetter(js::PropertyContext& ctx) { - if(!ctx.CheckExtraInternalFieldValue()) return; + if (!ctx.CheckExtraInternalFieldValue()) return; alt::IVehicle* vehicle = ctx.GetExtraInternalFieldValue(); float value; - if(!ctx.GetValue(value)) return; + if (!ctx.GetValue(value)) return; vehicle->ReplaceHandling(); vehicle->GetHandling()->SetBrakeForce(value); @@ -430,7 +431,7 @@ static void BrakeForceSetter(js::PropertyContext& ctx) static void BrakeBiasFrontGetter(js::PropertyContext& ctx) { - if(!ctx.CheckExtraInternalFieldValue()) return; + if (!ctx.CheckExtraInternalFieldValue()) return; alt::IVehicle* vehicle = ctx.GetExtraInternalFieldValue(); ctx.Return(vehicle->GetHandling()->GetBrakeBiasFront()); @@ -438,11 +439,11 @@ static void BrakeBiasFrontGetter(js::PropertyContext& ctx) static void BrakeBiasFrontSetter(js::PropertyContext& ctx) { - if(!ctx.CheckExtraInternalFieldValue()) return; + if (!ctx.CheckExtraInternalFieldValue()) return; alt::IVehicle* vehicle = ctx.GetExtraInternalFieldValue(); float value; - if(!ctx.GetValue(value)) return; + if (!ctx.GetValue(value)) return; vehicle->ReplaceHandling(); vehicle->GetHandling()->SetBrakeBiasFront(value); @@ -450,7 +451,7 @@ static void BrakeBiasFrontSetter(js::PropertyContext& ctx) static void BrakeBiasRearGetter(js::PropertyContext& ctx) { - if(!ctx.CheckExtraInternalFieldValue()) return; + if (!ctx.CheckExtraInternalFieldValue()) return; alt::IVehicle* vehicle = ctx.GetExtraInternalFieldValue(); ctx.Return(vehicle->GetHandling()->GetBrakeBiasRear()); @@ -458,11 +459,11 @@ static void BrakeBiasRearGetter(js::PropertyContext& ctx) static void BrakeBiasRearSetter(js::PropertyContext& ctx) { - if(!ctx.CheckExtraInternalFieldValue()) return; + if (!ctx.CheckExtraInternalFieldValue()) return; alt::IVehicle* vehicle = ctx.GetExtraInternalFieldValue(); float value; - if(!ctx.GetValue(value)) return; + if (!ctx.GetValue(value)) return; vehicle->ReplaceHandling(); vehicle->GetHandling()->SetBrakeBiasRear(value); @@ -470,7 +471,7 @@ static void BrakeBiasRearSetter(js::PropertyContext& ctx) static void HandBrakeForceGetter(js::PropertyContext& ctx) { - if(!ctx.CheckExtraInternalFieldValue()) return; + if (!ctx.CheckExtraInternalFieldValue()) return; alt::IVehicle* vehicle = ctx.GetExtraInternalFieldValue(); ctx.Return(vehicle->GetHandling()->GetHandBrakeForce()); @@ -478,11 +479,11 @@ static void HandBrakeForceGetter(js::PropertyContext& ctx) static void HandBrakeForceSetter(js::PropertyContext& ctx) { - if(!ctx.CheckExtraInternalFieldValue()) return; + if (!ctx.CheckExtraInternalFieldValue()) return; alt::IVehicle* vehicle = ctx.GetExtraInternalFieldValue(); float value; - if(!ctx.GetValue(value)) return; + if (!ctx.GetValue(value)) return; vehicle->ReplaceHandling(); vehicle->GetHandling()->SetHandBrakeForce(value); @@ -490,7 +491,7 @@ static void HandBrakeForceSetter(js::PropertyContext& ctx) static void SteeringLockGetter(js::PropertyContext& ctx) { - if(!ctx.CheckExtraInternalFieldValue()) return; + if (!ctx.CheckExtraInternalFieldValue()) return; alt::IVehicle* vehicle = ctx.GetExtraInternalFieldValue(); ctx.Return(vehicle->GetHandling()->GetSteeringLock()); @@ -498,11 +499,11 @@ static void SteeringLockGetter(js::PropertyContext& ctx) static void SteeringLockSetter(js::PropertyContext& ctx) { - if(!ctx.CheckExtraInternalFieldValue()) return; + if (!ctx.CheckExtraInternalFieldValue()) return; alt::IVehicle* vehicle = ctx.GetExtraInternalFieldValue(); float value; - if(!ctx.GetValue(value)) return; + if (!ctx.GetValue(value)) return; vehicle->ReplaceHandling(); vehicle->GetHandling()->SetSteeringLock(value); @@ -510,7 +511,7 @@ static void SteeringLockSetter(js::PropertyContext& ctx) static void SteeringLockRatioGetter(js::PropertyContext& ctx) { - if(!ctx.CheckExtraInternalFieldValue()) return; + if (!ctx.CheckExtraInternalFieldValue()) return; alt::IVehicle* vehicle = ctx.GetExtraInternalFieldValue(); ctx.Return(vehicle->GetHandling()->GetSteeringLockRatio()); @@ -518,11 +519,11 @@ static void SteeringLockRatioGetter(js::PropertyContext& ctx) static void SteeringLockRatioSetter(js::PropertyContext& ctx) { - if(!ctx.CheckExtraInternalFieldValue()) return; + if (!ctx.CheckExtraInternalFieldValue()) return; alt::IVehicle* vehicle = ctx.GetExtraInternalFieldValue(); float value; - if(!ctx.GetValue(value)) return; + if (!ctx.GetValue(value)) return; vehicle->ReplaceHandling(); vehicle->GetHandling()->SetSteeringLockRatio(value); @@ -530,7 +531,7 @@ static void SteeringLockRatioSetter(js::PropertyContext& ctx) static void TractionCurveMaxGetter(js::PropertyContext& ctx) { - if(!ctx.CheckExtraInternalFieldValue()) return; + if (!ctx.CheckExtraInternalFieldValue()) return; alt::IVehicle* vehicle = ctx.GetExtraInternalFieldValue(); ctx.Return(vehicle->GetHandling()->GetTractionCurveMax()); @@ -538,11 +539,11 @@ static void TractionCurveMaxGetter(js::PropertyContext& ctx) static void TractionCurveMaxSetter(js::PropertyContext& ctx) { - if(!ctx.CheckExtraInternalFieldValue()) return; + if (!ctx.CheckExtraInternalFieldValue()) return; alt::IVehicle* vehicle = ctx.GetExtraInternalFieldValue(); float value; - if(!ctx.GetValue(value)) return; + if (!ctx.GetValue(value)) return; vehicle->ReplaceHandling(); vehicle->GetHandling()->SetTractionCurveMax(value); @@ -550,7 +551,7 @@ static void TractionCurveMaxSetter(js::PropertyContext& ctx) static void TractionCurveMaxRatioGetter(js::PropertyContext& ctx) { - if(!ctx.CheckExtraInternalFieldValue()) return; + if (!ctx.CheckExtraInternalFieldValue()) return; alt::IVehicle* vehicle = ctx.GetExtraInternalFieldValue(); ctx.Return(vehicle->GetHandling()->GetTractionCurveMaxRatio()); @@ -558,11 +559,11 @@ static void TractionCurveMaxRatioGetter(js::PropertyContext& ctx) static void TractionCurveMaxRatioSetter(js::PropertyContext& ctx) { - if(!ctx.CheckExtraInternalFieldValue()) return; + if (!ctx.CheckExtraInternalFieldValue()) return; alt::IVehicle* vehicle = ctx.GetExtraInternalFieldValue(); float value; - if(!ctx.GetValue(value)) return; + if (!ctx.GetValue(value)) return; vehicle->ReplaceHandling(); vehicle->GetHandling()->SetTractionCurveMaxRatio(value); @@ -570,7 +571,7 @@ static void TractionCurveMaxRatioSetter(js::PropertyContext& ctx) static void TractionCurveMinGetter(js::PropertyContext& ctx) { - if(!ctx.CheckExtraInternalFieldValue()) return; + if (!ctx.CheckExtraInternalFieldValue()) return; alt::IVehicle* vehicle = ctx.GetExtraInternalFieldValue(); ctx.Return(vehicle->GetHandling()->GetTractionCurveMin()); @@ -578,11 +579,11 @@ static void TractionCurveMinGetter(js::PropertyContext& ctx) static void TractionCurveMinSetter(js::PropertyContext& ctx) { - if(!ctx.CheckExtraInternalFieldValue()) return; + if (!ctx.CheckExtraInternalFieldValue()) return; alt::IVehicle* vehicle = ctx.GetExtraInternalFieldValue(); float value; - if(!ctx.GetValue(value)) return; + if (!ctx.GetValue(value)) return; vehicle->ReplaceHandling(); vehicle->GetHandling()->SetTractionCurveMin(value); @@ -590,7 +591,7 @@ static void TractionCurveMinSetter(js::PropertyContext& ctx) static void TractionCurveMinRatioGetter(js::PropertyContext& ctx) { - if(!ctx.CheckExtraInternalFieldValue()) return; + if (!ctx.CheckExtraInternalFieldValue()) return; alt::IVehicle* vehicle = ctx.GetExtraInternalFieldValue(); ctx.Return(vehicle->GetHandling()->GetTractionCurveMinRatio()); @@ -598,11 +599,11 @@ static void TractionCurveMinRatioGetter(js::PropertyContext& ctx) static void TractionCurveMinRatioSetter(js::PropertyContext& ctx) { - if(!ctx.CheckExtraInternalFieldValue()) return; + if (!ctx.CheckExtraInternalFieldValue()) return; alt::IVehicle* vehicle = ctx.GetExtraInternalFieldValue(); float value; - if(!ctx.GetValue(value)) return; + if (!ctx.GetValue(value)) return; vehicle->ReplaceHandling(); vehicle->GetHandling()->SetTractionCurveMinRatio(value); @@ -610,7 +611,7 @@ static void TractionCurveMinRatioSetter(js::PropertyContext& ctx) static void TractionCurveLateralGetter(js::PropertyContext& ctx) { - if(!ctx.CheckExtraInternalFieldValue()) return; + if (!ctx.CheckExtraInternalFieldValue()) return; alt::IVehicle* vehicle = ctx.GetExtraInternalFieldValue(); ctx.Return(vehicle->GetHandling()->GetTractionCurveLateral()); @@ -618,11 +619,11 @@ static void TractionCurveLateralGetter(js::PropertyContext& ctx) static void TractionCurveLateralSetter(js::PropertyContext& ctx) { - if(!ctx.CheckExtraInternalFieldValue()) return; + if (!ctx.CheckExtraInternalFieldValue()) return; alt::IVehicle* vehicle = ctx.GetExtraInternalFieldValue(); float value; - if(!ctx.GetValue(value)) return; + if (!ctx.GetValue(value)) return; vehicle->ReplaceHandling(); vehicle->GetHandling()->SetTractionCurveLateral(value); @@ -630,7 +631,7 @@ static void TractionCurveLateralSetter(js::PropertyContext& ctx) static void TractionCurveLateralRatioGetter(js::PropertyContext& ctx) { - if(!ctx.CheckExtraInternalFieldValue()) return; + if (!ctx.CheckExtraInternalFieldValue()) return; alt::IVehicle* vehicle = ctx.GetExtraInternalFieldValue(); ctx.Return(vehicle->GetHandling()->GetTractionCurveLateralRatio()); @@ -638,11 +639,11 @@ static void TractionCurveLateralRatioGetter(js::PropertyContext& ctx) static void TractionCurveLateralRatioSetter(js::PropertyContext& ctx) { - if(!ctx.CheckExtraInternalFieldValue()) return; + if (!ctx.CheckExtraInternalFieldValue()) return; alt::IVehicle* vehicle = ctx.GetExtraInternalFieldValue(); float value; - if(!ctx.GetValue(value)) return; + if (!ctx.GetValue(value)) return; vehicle->ReplaceHandling(); vehicle->GetHandling()->SetTractionCurveLateralRatio(value); @@ -650,7 +651,7 @@ static void TractionCurveLateralRatioSetter(js::PropertyContext& ctx) static void TractionSpringDeltaMaxGetter(js::PropertyContext& ctx) { - if(!ctx.CheckExtraInternalFieldValue()) return; + if (!ctx.CheckExtraInternalFieldValue()) return; alt::IVehicle* vehicle = ctx.GetExtraInternalFieldValue(); ctx.Return(vehicle->GetHandling()->GetTractionSpringDeltaMax()); @@ -658,11 +659,11 @@ static void TractionSpringDeltaMaxGetter(js::PropertyContext& ctx) static void TractionSpringDeltaMaxSetter(js::PropertyContext& ctx) { - if(!ctx.CheckExtraInternalFieldValue()) return; + if (!ctx.CheckExtraInternalFieldValue()) return; alt::IVehicle* vehicle = ctx.GetExtraInternalFieldValue(); float value; - if(!ctx.GetValue(value)) return; + if (!ctx.GetValue(value)) return; vehicle->ReplaceHandling(); vehicle->GetHandling()->SetTractionSpringDeltaMax(value); @@ -670,7 +671,7 @@ static void TractionSpringDeltaMaxSetter(js::PropertyContext& ctx) static void TractionSpringDeltaMaxRatioGetter(js::PropertyContext& ctx) { - if(!ctx.CheckExtraInternalFieldValue()) return; + if (!ctx.CheckExtraInternalFieldValue()) return; alt::IVehicle* vehicle = ctx.GetExtraInternalFieldValue(); ctx.Return(vehicle->GetHandling()->GetTractionSpringDeltaMaxRatio()); @@ -678,11 +679,11 @@ static void TractionSpringDeltaMaxRatioGetter(js::PropertyContext& ctx) static void TractionSpringDeltaMaxRatioSetter(js::PropertyContext& ctx) { - if(!ctx.CheckExtraInternalFieldValue()) return; + if (!ctx.CheckExtraInternalFieldValue()) return; alt::IVehicle* vehicle = ctx.GetExtraInternalFieldValue(); float value; - if(!ctx.GetValue(value)) return; + if (!ctx.GetValue(value)) return; vehicle->ReplaceHandling(); vehicle->GetHandling()->SetTractionSpringDeltaMaxRatio(value); @@ -690,7 +691,7 @@ static void TractionSpringDeltaMaxRatioSetter(js::PropertyContext& ctx) static void LowSpeedTractionLossMultGetter(js::PropertyContext& ctx) { - if(!ctx.CheckExtraInternalFieldValue()) return; + if (!ctx.CheckExtraInternalFieldValue()) return; alt::IVehicle* vehicle = ctx.GetExtraInternalFieldValue(); ctx.Return(vehicle->GetHandling()->GetLowSpeedTractionLossMult()); @@ -698,11 +699,11 @@ static void LowSpeedTractionLossMultGetter(js::PropertyContext& ctx) static void LowSpeedTractionLossMultSetter(js::PropertyContext& ctx) { - if(!ctx.CheckExtraInternalFieldValue()) return; + if (!ctx.CheckExtraInternalFieldValue()) return; alt::IVehicle* vehicle = ctx.GetExtraInternalFieldValue(); float value; - if(!ctx.GetValue(value)) return; + if (!ctx.GetValue(value)) return; vehicle->ReplaceHandling(); vehicle->GetHandling()->SetLowSpeedTractionLossMult(value); @@ -710,7 +711,7 @@ static void LowSpeedTractionLossMultSetter(js::PropertyContext& ctx) static void CamberStiffnessGetter(js::PropertyContext& ctx) { - if(!ctx.CheckExtraInternalFieldValue()) return; + if (!ctx.CheckExtraInternalFieldValue()) return; alt::IVehicle* vehicle = ctx.GetExtraInternalFieldValue(); ctx.Return(vehicle->GetHandling()->GetCamberStiffness()); @@ -718,11 +719,11 @@ static void CamberStiffnessGetter(js::PropertyContext& ctx) static void CamberStiffnessSetter(js::PropertyContext& ctx) { - if(!ctx.CheckExtraInternalFieldValue()) return; + if (!ctx.CheckExtraInternalFieldValue()) return; alt::IVehicle* vehicle = ctx.GetExtraInternalFieldValue(); float value; - if(!ctx.GetValue(value)) return; + if (!ctx.GetValue(value)) return; vehicle->ReplaceHandling(); vehicle->GetHandling()->SetCamberStiffness(value); @@ -730,7 +731,7 @@ static void CamberStiffnessSetter(js::PropertyContext& ctx) static void TractionBiasFrontGetter(js::PropertyContext& ctx) { - if(!ctx.CheckExtraInternalFieldValue()) return; + if (!ctx.CheckExtraInternalFieldValue()) return; alt::IVehicle* vehicle = ctx.GetExtraInternalFieldValue(); ctx.Return(vehicle->GetHandling()->GetTractionBiasFront()); @@ -738,11 +739,11 @@ static void TractionBiasFrontGetter(js::PropertyContext& ctx) static void TractionBiasFrontSetter(js::PropertyContext& ctx) { - if(!ctx.CheckExtraInternalFieldValue()) return; + if (!ctx.CheckExtraInternalFieldValue()) return; alt::IVehicle* vehicle = ctx.GetExtraInternalFieldValue(); float value; - if(!ctx.GetValue(value)) return; + if (!ctx.GetValue(value)) return; vehicle->ReplaceHandling(); vehicle->GetHandling()->SetTractionBiasFront(value); @@ -750,7 +751,7 @@ static void TractionBiasFrontSetter(js::PropertyContext& ctx) static void TractionBiasRearGetter(js::PropertyContext& ctx) { - if(!ctx.CheckExtraInternalFieldValue()) return; + if (!ctx.CheckExtraInternalFieldValue()) return; alt::IVehicle* vehicle = ctx.GetExtraInternalFieldValue(); ctx.Return(vehicle->GetHandling()->GetTractionBiasRear()); @@ -758,11 +759,11 @@ static void TractionBiasRearGetter(js::PropertyContext& ctx) static void TractionBiasRearSetter(js::PropertyContext& ctx) { - if(!ctx.CheckExtraInternalFieldValue()) return; + if (!ctx.CheckExtraInternalFieldValue()) return; alt::IVehicle* vehicle = ctx.GetExtraInternalFieldValue(); float value; - if(!ctx.GetValue(value)) return; + if (!ctx.GetValue(value)) return; vehicle->ReplaceHandling(); vehicle->GetHandling()->SetTractionBiasRear(value); @@ -770,7 +771,7 @@ static void TractionBiasRearSetter(js::PropertyContext& ctx) static void TractionLossMultGetter(js::PropertyContext& ctx) { - if(!ctx.CheckExtraInternalFieldValue()) return; + if (!ctx.CheckExtraInternalFieldValue()) return; alt::IVehicle* vehicle = ctx.GetExtraInternalFieldValue(); ctx.Return(vehicle->GetHandling()->GetTractionLossMult()); @@ -778,11 +779,11 @@ static void TractionLossMultGetter(js::PropertyContext& ctx) static void TractionLossMultSetter(js::PropertyContext& ctx) { - if(!ctx.CheckExtraInternalFieldValue()) return; + if (!ctx.CheckExtraInternalFieldValue()) return; alt::IVehicle* vehicle = ctx.GetExtraInternalFieldValue(); float value; - if(!ctx.GetValue(value)) return; + if (!ctx.GetValue(value)) return; vehicle->ReplaceHandling(); vehicle->GetHandling()->SetTractionLossMult(value); @@ -790,7 +791,7 @@ static void TractionLossMultSetter(js::PropertyContext& ctx) static void SuspensionForceGetter(js::PropertyContext& ctx) { - if(!ctx.CheckExtraInternalFieldValue()) return; + if (!ctx.CheckExtraInternalFieldValue()) return; alt::IVehicle* vehicle = ctx.GetExtraInternalFieldValue(); ctx.Return(vehicle->GetHandling()->GetSuspensionForce()); @@ -798,11 +799,11 @@ static void SuspensionForceGetter(js::PropertyContext& ctx) static void SuspensionForceSetter(js::PropertyContext& ctx) { - if(!ctx.CheckExtraInternalFieldValue()) return; + if (!ctx.CheckExtraInternalFieldValue()) return; alt::IVehicle* vehicle = ctx.GetExtraInternalFieldValue(); float value; - if(!ctx.GetValue(value)) return; + if (!ctx.GetValue(value)) return; vehicle->ReplaceHandling(); vehicle->GetHandling()->SetSuspensionForce(value); @@ -810,7 +811,7 @@ static void SuspensionForceSetter(js::PropertyContext& ctx) static void SuspensionCompDampGetter(js::PropertyContext& ctx) { - if(!ctx.CheckExtraInternalFieldValue()) return; + if (!ctx.CheckExtraInternalFieldValue()) return; alt::IVehicle* vehicle = ctx.GetExtraInternalFieldValue(); ctx.Return(vehicle->GetHandling()->GetSuspensionCompDamp()); @@ -818,11 +819,11 @@ static void SuspensionCompDampGetter(js::PropertyContext& ctx) static void SuspensionCompDampSetter(js::PropertyContext& ctx) { - if(!ctx.CheckExtraInternalFieldValue()) return; + if (!ctx.CheckExtraInternalFieldValue()) return; alt::IVehicle* vehicle = ctx.GetExtraInternalFieldValue(); float value; - if(!ctx.GetValue(value)) return; + if (!ctx.GetValue(value)) return; vehicle->ReplaceHandling(); vehicle->GetHandling()->SetSuspensionCompDamp(value); @@ -830,7 +831,7 @@ static void SuspensionCompDampSetter(js::PropertyContext& ctx) static void SuspensionReboundDampGetter(js::PropertyContext& ctx) { - if(!ctx.CheckExtraInternalFieldValue()) return; + if (!ctx.CheckExtraInternalFieldValue()) return; alt::IVehicle* vehicle = ctx.GetExtraInternalFieldValue(); ctx.Return(vehicle->GetHandling()->GetSuspensionReboundDamp()); @@ -838,11 +839,11 @@ static void SuspensionReboundDampGetter(js::PropertyContext& ctx) static void SuspensionReboundDampSetter(js::PropertyContext& ctx) { - if(!ctx.CheckExtraInternalFieldValue()) return; + if (!ctx.CheckExtraInternalFieldValue()) return; alt::IVehicle* vehicle = ctx.GetExtraInternalFieldValue(); float value; - if(!ctx.GetValue(value)) return; + if (!ctx.GetValue(value)) return; vehicle->ReplaceHandling(); vehicle->GetHandling()->SetSuspensionReboundDamp(value); @@ -850,7 +851,7 @@ static void SuspensionReboundDampSetter(js::PropertyContext& ctx) static void SuspensionUpperLimitGetter(js::PropertyContext& ctx) { - if(!ctx.CheckExtraInternalFieldValue()) return; + if (!ctx.CheckExtraInternalFieldValue()) return; alt::IVehicle* vehicle = ctx.GetExtraInternalFieldValue(); ctx.Return(vehicle->GetHandling()->GetSuspensionUpperLimit()); @@ -858,11 +859,11 @@ static void SuspensionUpperLimitGetter(js::PropertyContext& ctx) static void SuspensionUpperLimitSetter(js::PropertyContext& ctx) { - if(!ctx.CheckExtraInternalFieldValue()) return; + if (!ctx.CheckExtraInternalFieldValue()) return; alt::IVehicle* vehicle = ctx.GetExtraInternalFieldValue(); float value; - if(!ctx.GetValue(value)) return; + if (!ctx.GetValue(value)) return; vehicle->ReplaceHandling(); vehicle->GetHandling()->SetSuspensionUpperLimit(value); @@ -870,7 +871,7 @@ static void SuspensionUpperLimitSetter(js::PropertyContext& ctx) static void SuspensionLowerLimitGetter(js::PropertyContext& ctx) { - if(!ctx.CheckExtraInternalFieldValue()) return; + if (!ctx.CheckExtraInternalFieldValue()) return; alt::IVehicle* vehicle = ctx.GetExtraInternalFieldValue(); ctx.Return(vehicle->GetHandling()->GetSuspensionLowerLimit()); @@ -878,11 +879,11 @@ static void SuspensionLowerLimitGetter(js::PropertyContext& ctx) static void SuspensionLowerLimitSetter(js::PropertyContext& ctx) { - if(!ctx.CheckExtraInternalFieldValue()) return; + if (!ctx.CheckExtraInternalFieldValue()) return; alt::IVehicle* vehicle = ctx.GetExtraInternalFieldValue(); float value; - if(!ctx.GetValue(value)) return; + if (!ctx.GetValue(value)) return; vehicle->ReplaceHandling(); vehicle->GetHandling()->SetSuspensionLowerLimit(value); @@ -890,7 +891,7 @@ static void SuspensionLowerLimitSetter(js::PropertyContext& ctx) static void SuspensionRaiseGetter(js::PropertyContext& ctx) { - if(!ctx.CheckExtraInternalFieldValue()) return; + if (!ctx.CheckExtraInternalFieldValue()) return; alt::IVehicle* vehicle = ctx.GetExtraInternalFieldValue(); ctx.Return(vehicle->GetHandling()->GetSuspensionRaise()); @@ -898,11 +899,11 @@ static void SuspensionRaiseGetter(js::PropertyContext& ctx) static void SuspensionRaiseSetter(js::PropertyContext& ctx) { - if(!ctx.CheckExtraInternalFieldValue()) return; + if (!ctx.CheckExtraInternalFieldValue()) return; alt::IVehicle* vehicle = ctx.GetExtraInternalFieldValue(); float value; - if(!ctx.GetValue(value)) return; + if (!ctx.GetValue(value)) return; vehicle->ReplaceHandling(); vehicle->GetHandling()->SetSuspensionRaise(value); @@ -910,7 +911,7 @@ static void SuspensionRaiseSetter(js::PropertyContext& ctx) static void SuspensionBiasFrontGetter(js::PropertyContext& ctx) { - if(!ctx.CheckExtraInternalFieldValue()) return; + if (!ctx.CheckExtraInternalFieldValue()) return; alt::IVehicle* vehicle = ctx.GetExtraInternalFieldValue(); ctx.Return(vehicle->GetHandling()->GetSuspensionBiasFront()); @@ -918,11 +919,11 @@ static void SuspensionBiasFrontGetter(js::PropertyContext& ctx) static void SuspensionBiasFrontSetter(js::PropertyContext& ctx) { - if(!ctx.CheckExtraInternalFieldValue()) return; + if (!ctx.CheckExtraInternalFieldValue()) return; alt::IVehicle* vehicle = ctx.GetExtraInternalFieldValue(); float value; - if(!ctx.GetValue(value)) return; + if (!ctx.GetValue(value)) return; vehicle->ReplaceHandling(); vehicle->GetHandling()->SetSuspensionBiasFront(value); @@ -930,7 +931,7 @@ static void SuspensionBiasFrontSetter(js::PropertyContext& ctx) static void SuspensionBiasRearGetter(js::PropertyContext& ctx) { - if(!ctx.CheckExtraInternalFieldValue()) return; + if (!ctx.CheckExtraInternalFieldValue()) return; alt::IVehicle* vehicle = ctx.GetExtraInternalFieldValue(); ctx.Return(vehicle->GetHandling()->GetSuspensionBiasRear()); @@ -938,11 +939,11 @@ static void SuspensionBiasRearGetter(js::PropertyContext& ctx) static void SuspensionBiasRearSetter(js::PropertyContext& ctx) { - if(!ctx.CheckExtraInternalFieldValue()) return; + if (!ctx.CheckExtraInternalFieldValue()) return; alt::IVehicle* vehicle = ctx.GetExtraInternalFieldValue(); float value; - if(!ctx.GetValue(value)) return; + if (!ctx.GetValue(value)) return; vehicle->ReplaceHandling(); vehicle->GetHandling()->SetSuspensionBiasRear(value); @@ -950,7 +951,7 @@ static void SuspensionBiasRearSetter(js::PropertyContext& ctx) static void AntiRollBarForceGetter(js::PropertyContext& ctx) { - if(!ctx.CheckExtraInternalFieldValue()) return; + if (!ctx.CheckExtraInternalFieldValue()) return; alt::IVehicle* vehicle = ctx.GetExtraInternalFieldValue(); ctx.Return(vehicle->GetHandling()->GetAntiRollBarForce()); @@ -958,11 +959,11 @@ static void AntiRollBarForceGetter(js::PropertyContext& ctx) static void AntiRollBarForceSetter(js::PropertyContext& ctx) { - if(!ctx.CheckExtraInternalFieldValue()) return; + if (!ctx.CheckExtraInternalFieldValue()) return; alt::IVehicle* vehicle = ctx.GetExtraInternalFieldValue(); float value; - if(!ctx.GetValue(value)) return; + if (!ctx.GetValue(value)) return; vehicle->ReplaceHandling(); vehicle->GetHandling()->SetAntiRollBarForce(value); @@ -970,7 +971,7 @@ static void AntiRollBarForceSetter(js::PropertyContext& ctx) static void AntiRollBarBiasFrontGetter(js::PropertyContext& ctx) { - if(!ctx.CheckExtraInternalFieldValue()) return; + if (!ctx.CheckExtraInternalFieldValue()) return; alt::IVehicle* vehicle = ctx.GetExtraInternalFieldValue(); ctx.Return(vehicle->GetHandling()->GetAntiRollBarBiasFront()); @@ -978,11 +979,11 @@ static void AntiRollBarBiasFrontGetter(js::PropertyContext& ctx) static void AntiRollBarBiasFrontSetter(js::PropertyContext& ctx) { - if(!ctx.CheckExtraInternalFieldValue()) return; + if (!ctx.CheckExtraInternalFieldValue()) return; alt::IVehicle* vehicle = ctx.GetExtraInternalFieldValue(); float value; - if(!ctx.GetValue(value)) return; + if (!ctx.GetValue(value)) return; vehicle->ReplaceHandling(); vehicle->GetHandling()->SetAntiRollBarBiasFront(value); @@ -990,7 +991,7 @@ static void AntiRollBarBiasFrontSetter(js::PropertyContext& ctx) static void AntiRollBarBiasRearGetter(js::PropertyContext& ctx) { - if(!ctx.CheckExtraInternalFieldValue()) return; + if (!ctx.CheckExtraInternalFieldValue()) return; alt::IVehicle* vehicle = ctx.GetExtraInternalFieldValue(); ctx.Return(vehicle->GetHandling()->GetAntiRollBarBiasRear()); @@ -998,11 +999,11 @@ static void AntiRollBarBiasRearGetter(js::PropertyContext& ctx) static void AntiRollBarBiasRearSetter(js::PropertyContext& ctx) { - if(!ctx.CheckExtraInternalFieldValue()) return; + if (!ctx.CheckExtraInternalFieldValue()) return; alt::IVehicle* vehicle = ctx.GetExtraInternalFieldValue(); float value; - if(!ctx.GetValue(value)) return; + if (!ctx.GetValue(value)) return; vehicle->ReplaceHandling(); vehicle->GetHandling()->SetAntiRollBarBiasRear(value); @@ -1010,7 +1011,7 @@ static void AntiRollBarBiasRearSetter(js::PropertyContext& ctx) static void RollCentreHeightFrontGetter(js::PropertyContext& ctx) { - if(!ctx.CheckExtraInternalFieldValue()) return; + if (!ctx.CheckExtraInternalFieldValue()) return; alt::IVehicle* vehicle = ctx.GetExtraInternalFieldValue(); ctx.Return(vehicle->GetHandling()->GetRollCentreHeightFront()); @@ -1018,11 +1019,11 @@ static void RollCentreHeightFrontGetter(js::PropertyContext& ctx) static void RollCentreHeightFrontSetter(js::PropertyContext& ctx) { - if(!ctx.CheckExtraInternalFieldValue()) return; + if (!ctx.CheckExtraInternalFieldValue()) return; alt::IVehicle* vehicle = ctx.GetExtraInternalFieldValue(); float value; - if(!ctx.GetValue(value)) return; + if (!ctx.GetValue(value)) return; vehicle->ReplaceHandling(); vehicle->GetHandling()->SetRollCentreHeightFront(value); @@ -1030,7 +1031,7 @@ static void RollCentreHeightFrontSetter(js::PropertyContext& ctx) static void RollCentreHeightRearGetter(js::PropertyContext& ctx) { - if(!ctx.CheckExtraInternalFieldValue()) return; + if (!ctx.CheckExtraInternalFieldValue()) return; alt::IVehicle* vehicle = ctx.GetExtraInternalFieldValue(); ctx.Return(vehicle->GetHandling()->GetRollCentreHeightRear()); @@ -1038,11 +1039,11 @@ static void RollCentreHeightRearGetter(js::PropertyContext& ctx) static void RollCentreHeightRearSetter(js::PropertyContext& ctx) { - if(!ctx.CheckExtraInternalFieldValue()) return; + if (!ctx.CheckExtraInternalFieldValue()) return; alt::IVehicle* vehicle = ctx.GetExtraInternalFieldValue(); float value; - if(!ctx.GetValue(value)) return; + if (!ctx.GetValue(value)) return; vehicle->ReplaceHandling(); vehicle->GetHandling()->SetRollCentreHeightRear(value); @@ -1050,7 +1051,7 @@ static void RollCentreHeightRearSetter(js::PropertyContext& ctx) static void CollisionDamageMultGetter(js::PropertyContext& ctx) { - if(!ctx.CheckExtraInternalFieldValue()) return; + if (!ctx.CheckExtraInternalFieldValue()) return; alt::IVehicle* vehicle = ctx.GetExtraInternalFieldValue(); ctx.Return(vehicle->GetHandling()->GetCollisionDamageMult()); @@ -1058,11 +1059,11 @@ static void CollisionDamageMultGetter(js::PropertyContext& ctx) static void CollisionDamageMultSetter(js::PropertyContext& ctx) { - if(!ctx.CheckExtraInternalFieldValue()) return; + if (!ctx.CheckExtraInternalFieldValue()) return; alt::IVehicle* vehicle = ctx.GetExtraInternalFieldValue(); float value; - if(!ctx.GetValue(value)) return; + if (!ctx.GetValue(value)) return; vehicle->ReplaceHandling(); vehicle->GetHandling()->SetCollisionDamageMult(value); @@ -1070,7 +1071,7 @@ static void CollisionDamageMultSetter(js::PropertyContext& ctx) static void WeaponDamageMultGetter(js::PropertyContext& ctx) { - if(!ctx.CheckExtraInternalFieldValue()) return; + if (!ctx.CheckExtraInternalFieldValue()) return; alt::IVehicle* vehicle = ctx.GetExtraInternalFieldValue(); ctx.Return(vehicle->GetHandling()->GetWeaponDamageMult()); @@ -1078,11 +1079,11 @@ static void WeaponDamageMultGetter(js::PropertyContext& ctx) static void WeaponDamageMultSetter(js::PropertyContext& ctx) { - if(!ctx.CheckExtraInternalFieldValue()) return; + if (!ctx.CheckExtraInternalFieldValue()) return; alt::IVehicle* vehicle = ctx.GetExtraInternalFieldValue(); float value; - if(!ctx.GetValue(value)) return; + if (!ctx.GetValue(value)) return; vehicle->ReplaceHandling(); vehicle->GetHandling()->SetWeaponDamageMult(value); @@ -1090,7 +1091,7 @@ static void WeaponDamageMultSetter(js::PropertyContext& ctx) static void DeformationDamageMultGetter(js::PropertyContext& ctx) { - if(!ctx.CheckExtraInternalFieldValue()) return; + if (!ctx.CheckExtraInternalFieldValue()) return; alt::IVehicle* vehicle = ctx.GetExtraInternalFieldValue(); ctx.Return(vehicle->GetHandling()->GetDeformationDamageMult()); @@ -1098,11 +1099,11 @@ static void DeformationDamageMultGetter(js::PropertyContext& ctx) static void DeformationDamageMultSetter(js::PropertyContext& ctx) { - if(!ctx.CheckExtraInternalFieldValue()) return; + if (!ctx.CheckExtraInternalFieldValue()) return; alt::IVehicle* vehicle = ctx.GetExtraInternalFieldValue(); float value; - if(!ctx.GetValue(value)) return; + if (!ctx.GetValue(value)) return; vehicle->ReplaceHandling(); vehicle->GetHandling()->SetDeformationDamageMult(value); @@ -1110,7 +1111,7 @@ static void DeformationDamageMultSetter(js::PropertyContext& ctx) static void EngineDamageMultGetter(js::PropertyContext& ctx) { - if(!ctx.CheckExtraInternalFieldValue()) return; + if (!ctx.CheckExtraInternalFieldValue()) return; alt::IVehicle* vehicle = ctx.GetExtraInternalFieldValue(); ctx.Return(vehicle->GetHandling()->GetEngineDamageMult()); @@ -1118,11 +1119,11 @@ static void EngineDamageMultGetter(js::PropertyContext& ctx) static void EngineDamageMultSetter(js::PropertyContext& ctx) { - if(!ctx.CheckExtraInternalFieldValue()) return; + if (!ctx.CheckExtraInternalFieldValue()) return; alt::IVehicle* vehicle = ctx.GetExtraInternalFieldValue(); float value; - if(!ctx.GetValue(value)) return; + if (!ctx.GetValue(value)) return; vehicle->ReplaceHandling(); vehicle->GetHandling()->SetEngineDamageMult(value); @@ -1130,7 +1131,7 @@ static void EngineDamageMultSetter(js::PropertyContext& ctx) static void PetrolTankVolumeGetter(js::PropertyContext& ctx) { - if(!ctx.CheckExtraInternalFieldValue()) return; + if (!ctx.CheckExtraInternalFieldValue()) return; alt::IVehicle* vehicle = ctx.GetExtraInternalFieldValue(); ctx.Return(vehicle->GetHandling()->GetPetrolTankVolume()); @@ -1138,11 +1139,11 @@ static void PetrolTankVolumeGetter(js::PropertyContext& ctx) static void PetrolTankVolumeSetter(js::PropertyContext& ctx) { - if(!ctx.CheckExtraInternalFieldValue()) return; + if (!ctx.CheckExtraInternalFieldValue()) return; alt::IVehicle* vehicle = ctx.GetExtraInternalFieldValue(); float value; - if(!ctx.GetValue(value)) return; + if (!ctx.GetValue(value)) return; vehicle->ReplaceHandling(); vehicle->GetHandling()->SetPetrolTankVolume(value); @@ -1150,7 +1151,7 @@ static void PetrolTankVolumeSetter(js::PropertyContext& ctx) static void OilVolumeGetter(js::PropertyContext& ctx) { - if(!ctx.CheckExtraInternalFieldValue()) return; + if (!ctx.CheckExtraInternalFieldValue()) return; alt::IVehicle* vehicle = ctx.GetExtraInternalFieldValue(); ctx.Return(vehicle->GetHandling()->GetOilVolume()); @@ -1158,11 +1159,11 @@ static void OilVolumeGetter(js::PropertyContext& ctx) static void OilVolumeSetter(js::PropertyContext& ctx) { - if(!ctx.CheckExtraInternalFieldValue()) return; + if (!ctx.CheckExtraInternalFieldValue()) return; alt::IVehicle* vehicle = ctx.GetExtraInternalFieldValue(); float value; - if(!ctx.GetValue(value)) return; + if (!ctx.GetValue(value)) return; vehicle->ReplaceHandling(); vehicle->GetHandling()->SetOilVolume(value); @@ -1170,7 +1171,7 @@ static void OilVolumeSetter(js::PropertyContext& ctx) static void SeatOffsetDistXGetter(js::PropertyContext& ctx) { - if(!ctx.CheckExtraInternalFieldValue()) return; + if (!ctx.CheckExtraInternalFieldValue()) return; alt::IVehicle* vehicle = ctx.GetExtraInternalFieldValue(); ctx.Return(vehicle->GetHandling()->GetSeatOffsetDistX()); @@ -1178,11 +1179,11 @@ static void SeatOffsetDistXGetter(js::PropertyContext& ctx) static void SeatOffsetDistXSetter(js::PropertyContext& ctx) { - if(!ctx.CheckExtraInternalFieldValue()) return; + if (!ctx.CheckExtraInternalFieldValue()) return; alt::IVehicle* vehicle = ctx.GetExtraInternalFieldValue(); float value; - if(!ctx.GetValue(value)) return; + if (!ctx.GetValue(value)) return; vehicle->ReplaceHandling(); vehicle->GetHandling()->SetSeatOffsetDistX(value); @@ -1190,7 +1191,7 @@ static void SeatOffsetDistXSetter(js::PropertyContext& ctx) static void SeatOffsetDistYGetter(js::PropertyContext& ctx) { - if(!ctx.CheckExtraInternalFieldValue()) return; + if (!ctx.CheckExtraInternalFieldValue()) return; alt::IVehicle* vehicle = ctx.GetExtraInternalFieldValue(); ctx.Return(vehicle->GetHandling()->GetSeatOffsetDistY()); @@ -1198,11 +1199,11 @@ static void SeatOffsetDistYGetter(js::PropertyContext& ctx) static void SeatOffsetDistYSetter(js::PropertyContext& ctx) { - if(!ctx.CheckExtraInternalFieldValue()) return; + if (!ctx.CheckExtraInternalFieldValue()) return; alt::IVehicle* vehicle = ctx.GetExtraInternalFieldValue(); float value; - if(!ctx.GetValue(value)) return; + if (!ctx.GetValue(value)) return; vehicle->ReplaceHandling(); vehicle->GetHandling()->SetSeatOffsetDistY(value); @@ -1210,7 +1211,7 @@ static void SeatOffsetDistYSetter(js::PropertyContext& ctx) static void SeatOffsetDistZGetter(js::PropertyContext& ctx) { - if(!ctx.CheckExtraInternalFieldValue()) return; + if (!ctx.CheckExtraInternalFieldValue()) return; alt::IVehicle* vehicle = ctx.GetExtraInternalFieldValue(); ctx.Return(vehicle->GetHandling()->GetSeatOffsetDistZ()); @@ -1218,11 +1219,11 @@ static void SeatOffsetDistZGetter(js::PropertyContext& ctx) static void SeatOffsetDistZSetter(js::PropertyContext& ctx) { - if(!ctx.CheckExtraInternalFieldValue()) return; + if (!ctx.CheckExtraInternalFieldValue()) return; alt::IVehicle* vehicle = ctx.GetExtraInternalFieldValue(); float value; - if(!ctx.GetValue(value)) return; + if (!ctx.GetValue(value)) return; vehicle->ReplaceHandling(); vehicle->GetHandling()->SetSeatOffsetDistZ(value); @@ -1230,7 +1231,7 @@ static void SeatOffsetDistZSetter(js::PropertyContext& ctx) static void MonetaryValueGetter(js::PropertyContext& ctx) { - if(!ctx.CheckExtraInternalFieldValue()) return; + if (!ctx.CheckExtraInternalFieldValue()) return; alt::IVehicle* vehicle = ctx.GetExtraInternalFieldValue(); ctx.Return(vehicle->GetHandling()->GetMonetaryValue()); @@ -1238,11 +1239,11 @@ static void MonetaryValueGetter(js::PropertyContext& ctx) static void MonetaryValueSetter(js::PropertyContext& ctx) { - if(!ctx.CheckExtraInternalFieldValue()) return; + if (!ctx.CheckExtraInternalFieldValue()) return; alt::IVehicle* vehicle = ctx.GetExtraInternalFieldValue(); uint32_t value; - if(!ctx.GetValue(value)) return; + if (!ctx.GetValue(value)) return; vehicle->ReplaceHandling(); vehicle->GetHandling()->SetMonetaryValue(value); @@ -1250,7 +1251,7 @@ static void MonetaryValueSetter(js::PropertyContext& ctx) static void ModelFlagsGetter(js::PropertyContext& ctx) { - if(!ctx.CheckExtraInternalFieldValue()) return; + if (!ctx.CheckExtraInternalFieldValue()) return; alt::IVehicle* vehicle = ctx.GetExtraInternalFieldValue(); ctx.Return(vehicle->GetHandling()->GetModelFlags()); @@ -1258,11 +1259,11 @@ static void ModelFlagsGetter(js::PropertyContext& ctx) static void ModelFlagsSetter(js::PropertyContext& ctx) { - if(!ctx.CheckExtraInternalFieldValue()) return; + if (!ctx.CheckExtraInternalFieldValue()) return; alt::IVehicle* vehicle = ctx.GetExtraInternalFieldValue(); uint32_t value; - if(!ctx.GetValue(value)) return; + if (!ctx.GetValue(value)) return; vehicle->ReplaceHandling(); vehicle->GetHandling()->SetModelFlags(value); @@ -1270,7 +1271,7 @@ static void ModelFlagsSetter(js::PropertyContext& ctx) static void HandlingFlagsGetter(js::PropertyContext& ctx) { - if(!ctx.CheckExtraInternalFieldValue()) return; + if (!ctx.CheckExtraInternalFieldValue()) return; alt::IVehicle* vehicle = ctx.GetExtraInternalFieldValue(); ctx.Return(vehicle->GetHandling()->GetHandlingFlags()); @@ -1278,11 +1279,11 @@ static void HandlingFlagsGetter(js::PropertyContext& ctx) static void HandlingFlagsSetter(js::PropertyContext& ctx) { - if(!ctx.CheckExtraInternalFieldValue()) return; + if (!ctx.CheckExtraInternalFieldValue()) return; alt::IVehicle* vehicle = ctx.GetExtraInternalFieldValue(); uint32_t value; - if(!ctx.GetValue(value)) return; + if (!ctx.GetValue(value)) return; vehicle->ReplaceHandling(); vehicle->GetHandling()->SetHandlingFlags(value); @@ -1290,7 +1291,7 @@ static void HandlingFlagsSetter(js::PropertyContext& ctx) static void DamageFlagsGetter(js::PropertyContext& ctx) { - if(!ctx.CheckExtraInternalFieldValue()) return; + if (!ctx.CheckExtraInternalFieldValue()) return; alt::IVehicle* vehicle = ctx.GetExtraInternalFieldValue(); ctx.Return(vehicle->GetHandling()->GetDamageFlags()); @@ -1298,11 +1299,11 @@ static void DamageFlagsGetter(js::PropertyContext& ctx) static void DamageFlagsSetter(js::PropertyContext& ctx) { - if(!ctx.CheckExtraInternalFieldValue()) return; + if (!ctx.CheckExtraInternalFieldValue()) return; alt::IVehicle* vehicle = ctx.GetExtraInternalFieldValue(); uint32_t value; - if(!ctx.GetValue(value)) return; + if (!ctx.GetValue(value)) return; vehicle->ReplaceHandling(); vehicle->GetHandling()->SetDamageFlags(value); @@ -1310,7 +1311,7 @@ static void DamageFlagsSetter(js::PropertyContext& ctx) static void IsModified(js::PropertyContext& ctx) { - if(!ctx.CheckExtraInternalFieldValue()) return; + if (!ctx.CheckExtraInternalFieldValue()) return; alt::IVehicle* vehicle = ctx.GetExtraInternalFieldValue(); ctx.Return(vehicle->IsHandlingModified()); @@ -1318,7 +1319,7 @@ static void IsModified(js::PropertyContext& ctx) static void Reset(js::FunctionContext& ctx) { - if(!ctx.CheckExtraInternalFieldValue()) return; + if (!ctx.CheckExtraInternalFieldValue()) return; alt::IVehicle* vehicle = ctx.GetExtraInternalFieldValue(); vehicle->ResetHandling(); From 937d76707bcff9d2909b401e010130ee42eb3506 Mon Sep 17 00:00:00 2001 From: Carlos Menezes Date: Wed, 20 Mar 2024 14:54:44 +0000 Subject: [PATCH 09/12] Revert "chore: rename missing properties in client module" This reverts commit 62b34737a9a7b02a1bfebb2ed5495418e190cd15. --- client/src/classes/TextLabel.cpp | 4 ++-- client/src/classes/WebView.cpp | 2 +- client/src/factories/AudioFactory.cpp | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/client/src/classes/TextLabel.cpp b/client/src/classes/TextLabel.cpp index 932e3e87a..6fc7cba1c 100644 --- a/client/src/classes/TextLabel.cpp +++ b/client/src/classes/TextLabel.cpp @@ -6,9 +6,9 @@ extern js::Class textLabelClass("TextLabel", &worldObjectClass, nullptr, [](js:: { tpl.BindToType(alt::IBaseObject::Type::TEXT_LABEL); - tpl.Property<&alt::ITextLabel::IsStreamedIn>("streamedIn"); + tpl.Property<&alt::ITextLabel::IsStreamedIn>("isStreamedIn"); - tpl.Property<&alt::ITextLabel::IsGlobal>("global"); + tpl.Property<&alt::ITextLabel::IsGlobal>("isGlobal"); tpl.Property<&alt::ITextLabel::GetTarget>("target"); tpl.Property<&alt::ITextLabel::IsVisible, &alt::ITextLabel::SetVisible>("visible"); tpl.Property<&alt::ITextLabel::GetColor, &alt::ITextLabel::SetColor>("color"); diff --git a/client/src/classes/WebView.cpp b/client/src/classes/WebView.cpp index 405ebc0bf..328284f27 100644 --- a/client/src/classes/WebView.cpp +++ b/client/src/classes/WebView.cpp @@ -69,7 +69,7 @@ extern js::Class webViewClass("WebView", &baseObjectClass, [](js::ClassTemplate& tpl.Method<&alt::IWebView::AddOutput>("addOutput"); tpl.Method<&alt::IWebView::RemoveOutput>("removeOutput"); - tpl.StaticProperty("gpuAccelerationActive", GpuAccelerationActiveGetter); + tpl.StaticProperty("isGpuAccelerationActive", GpuAccelerationActiveGetter); tpl.GetByID(); }); diff --git a/client/src/factories/AudioFactory.cpp b/client/src/factories/AudioFactory.cpp index 2dec98240..306e10fca 100644 --- a/client/src/factories/AudioFactory.cpp +++ b/client/src/factories/AudioFactory.cpp @@ -9,7 +9,7 @@ static js::FactoryHandler audioFactory(alt::IBaseObject::Type::AUDIO, [](js::Obj float volume; if(!args.Get("volume", volume)) return nullptr; - bool isRadio = args.Get("radio", false); + bool isRadio = args.Get("isRadio", false); bool clearCache = args.Get("clearCache", true); js::IResource* resource = args.GetResource(); From a82f14dc9d6e415509e351e6e55157e637080209 Mon Sep 17 00:00:00 2001 From: Carlos Menezes Date: Wed, 20 Mar 2024 14:55:20 +0000 Subject: [PATCH 10/12] Revert "chore: client types" This reverts commit d95963f8001e7b3d4ca7783071df6e5b50fd2a6b. --- types/client/index.d.ts | 42 ++++++++++++++++++++--------------------- 1 file changed, 21 insertions(+), 21 deletions(-) diff --git a/types/client/index.d.ts b/types/client/index.d.ts index 8a31afcc3..2b4271933 100644 --- a/types/client/index.d.ts +++ b/types/client/index.d.ts @@ -65,7 +65,7 @@ declare module "@altv/client" { export interface AudioCreateOptions { source: string; volume: number; - radio?: boolean; // default: false + isRadio?: boolean; // default: false clearCache?: boolean; // default: true } @@ -77,6 +77,7 @@ declare module "@altv/client" { readonly outputs: ReadonlyArray; readonly currentTime: number; readonly maxTime: number; + readonly isPlaying: boolean; readonly listeners: ReadonlyMap Promise | void>>; addOutput(output: AudioOutput): void; @@ -251,7 +252,7 @@ declare module "@altv/client" { export abstract class Blip extends WorldObject { readonly scriptID: number; - readonly streamedIn: boolean; + readonly isStreamedIn: boolean; readonly global: boolean; readonly isAttached: boolean; readonly attachedTo?: Entity; @@ -316,7 +317,6 @@ declare module "@altv/client" { export abstract class Marker extends WorldObject { readonly isGlobal: boolean; readonly streamingDistance: number; - readonly streamedIn: boolean; readonly meta: MarkerMeta & Record; @@ -377,7 +377,7 @@ declare module "@altv/client" { export abstract class Checkpoint extends ColShape { readonly scriptID: number; - readonly streamedIn: boolean; + readonly isStreamedIn: boolean; checkpointType: number; radius: number; @@ -563,14 +563,14 @@ declare module "@altv/client" { get model(): number; set model(value: number | string); alpha: number; - readonly dynamic: boolean; + readonly isDynamic: boolean; lodDistance: number; hasGravity: number; - readonly collisionEnabled: boolean; + readonly isCollisionEnabled: boolean; positionFrozen: boolean; textureVariation: number; - readonly worldObject: boolean; - readonly weaponObject: boolean; + readonly isWorldObject: boolean; + readonly isWeaponObject: boolean; readonly useStreaming: boolean; readonly streamingDistance: number; visible: boolean; @@ -657,7 +657,7 @@ declare module "@altv/client" { readonly streamingDistance: number; visible: boolean; readonly scriptID: number; - readonly streamedIn: boolean; + readonly isStreamedIn: boolean; public waitForSpawn(timeout?: number): Promise; @@ -707,7 +707,7 @@ declare module "@altv/client" { readonly streamingDistance: number; visible: boolean; readonly scriptID: number; - readonly streamedIn: boolean; + readonly isStreamedIn: boolean; public waitForSpawn(timeout?: number): Promise; @@ -738,7 +738,7 @@ declare module "@altv/client" { export abstract class Player extends Entity { readonly name: string; - readonly talking: boolean; + readonly isTalking: boolean; readonly micLevel: number; readonly taskData: string; spatialVolume: number; @@ -806,8 +806,8 @@ declare module "@altv/client" { export abstract class RmlDocument extends RmlElement { title: string; readonly sourceUrl: string; - readonly visible: boolean; - readonly modal: boolean; + readonly isVisible: boolean; + readonly isModal: boolean; readonly body: RmlElement; @@ -844,7 +844,7 @@ declare module "@altv/client" { readonly focusedElement?: RmlElement; readonly tagName: string; rmlID: string; - readonly owned: boolean; + readonly isOwned: boolean; readonly absoluteLeft: number; readonly absoluteTop: number; readonly clientLeft: number; @@ -859,7 +859,7 @@ declare module "@altv/client" { scrollTop: number; readonly scrollWidth: number; readonly scrollHeight: number; - readonly visible: boolean; + readonly isVisible: boolean; readonly parent?: RmlElement; readonly nextSibling?: RmlElement; @@ -923,8 +923,8 @@ declare module "@altv/client" { } export abstract class TextLabel extends WorldObject { - readonly streamedIn: boolean; - readonly global: boolean; + readonly isStreamedIn: boolean; + readonly isGlobal: boolean; readonly target: Entity; visible: boolean; color: altShared.RGBA; @@ -1022,11 +1022,11 @@ declare module "@altv/client" { readonly rpm: number; readonly speedVector: altShared.Vector3; readonly handling: Handling; - readonly handlingModified: boolean; + readonly isHandlingModified: boolean; indicatorLights: number; seatCount: number; readonly occupiedSeatsCount: number; - readonly taxiLightOn: boolean; + readonly isTaxiLightOn: boolean; engineTemperature: number; fuelLevel: number; oilLevel: number; @@ -1123,7 +1123,7 @@ declare module "@altv/client" { } export abstract class VirtualEntity extends WorldObject { - readonly streamedIn: boolean; + readonly isStreamedIn: boolean; readonly group: VirtualEntityGroup; readonly streamingDistance: number; @@ -1278,7 +1278,7 @@ declare module "@altv/client" { public onDestroy?(): void; static readonly all: ReadonlyArray; - static readonly gpuAccelerationActive: boolean; + static readonly isGpuAccelerationActive: boolean; static create(options: _WebViewCreateOptionsDrawable): WebView; static create(options: _WebViewCreateOptionsOverlay): WebView; From 79af3bd04f683c6898d5dc7844f1aa5c8d1eaae4 Mon Sep 17 00:00:00 2001 From: Carlos Menezes Date: Wed, 20 Mar 2024 23:55:59 +0000 Subject: [PATCH 11/12] chore: refactor WebView constructor --- client/js/compatibility/classes/webview.js | 8 ++++---- client/src/factories/WebViewFactory.cpp | 4 ++-- types/client/index.d.ts | 4 ++-- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/client/js/compatibility/classes/webview.js b/client/js/compatibility/classes/webview.js index 3ace69c7a..33ba5bc62 100644 --- a/client/js/compatibility/classes/webview.js +++ b/client/js/compatibility/classes/webview.js @@ -18,8 +18,8 @@ class WebView extends alt.WebView { let instance = null; if (args.length == 4) { - const [_, isOverlay, pos, size] = args; - instance = alt.WebView.create({ url, isOverlay, pos, size }); + const [_, overlay, pos, size] = args; + instance = alt.WebView.create({ url, overlay, pos, size }); } else if (args.length == 3 && isObject(args[2])) { const [_, pos, size] = args; instance = alt.WebView.create({ url, pos, size }); @@ -30,8 +30,8 @@ class WebView extends alt.WebView { const [_, pos] = args; alt.WebView.create({ url, pos }); } else if (args.length == 2) { - const isOverlay = args[1]; - instance = alt.WebView.create({ url, isOverlay }); + const overlay = args[1]; + instance = alt.WebView.create({ url, overlay }); } else { instance = alt.WebView.create({ url }); } diff --git a/client/src/factories/WebViewFactory.cpp b/client/src/factories/WebViewFactory.cpp index 24c5e38ca..7ae948f11 100644 --- a/client/src/factories/WebViewFactory.cpp +++ b/client/src/factories/WebViewFactory.cpp @@ -20,8 +20,8 @@ static js::FactoryHandler webViewFactory(alt::IBaseObject::Type::WEBVIEW, [](js: { alt::Vector2i pos = args.Get("pos", {0, 0}); alt::Vector2i size = args.Get("size", {0, 0}); - bool isVisible = args.Get("isVisible", true); - bool isOverlay = args.Get("isOverlay", false); + bool isVisible = args.Get("visible", true); + bool isOverlay = args.Get("overlay", false); return alt::ICore::Instance().CreateWebView(url, pos, size, isVisible, isOverlay, args.GetResource()->GetResource()); } diff --git a/types/client/index.d.ts b/types/client/index.d.ts index 2b4271933..41b4da672 100644 --- a/types/client/index.d.ts +++ b/types/client/index.d.ts @@ -1232,8 +1232,8 @@ declare module "@altv/client" { url: string; pos?: altShared.IVector2; // default: { x: 0, y: 0 } size?: altShared.IVector2; // default: { x: 0, y: 0 } - isVisible?: boolean; // default: true - isOverlay?: boolean; // default: false + visible?: boolean; // default: true + overlay?: boolean; // default: false } export abstract class WebView extends BaseObject { From 3ff47eef9435256c90e4ac4311f01db82b99b3e2 Mon Sep 17 00:00:00 2001 From: Carlos Menezes Date: Sat, 23 Mar 2024 18:20:49 +0000 Subject: [PATCH 12/12] chore: refactor Audio constructor --- client/src/factories/AudioFactory.cpp | 2 +- types/client/index.d.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/client/src/factories/AudioFactory.cpp b/client/src/factories/AudioFactory.cpp index 306e10fca..2dec98240 100644 --- a/client/src/factories/AudioFactory.cpp +++ b/client/src/factories/AudioFactory.cpp @@ -9,7 +9,7 @@ static js::FactoryHandler audioFactory(alt::IBaseObject::Type::AUDIO, [](js::Obj float volume; if(!args.Get("volume", volume)) return nullptr; - bool isRadio = args.Get("isRadio", false); + bool isRadio = args.Get("radio", false); bool clearCache = args.Get("clearCache", true); js::IResource* resource = args.GetResource(); diff --git a/types/client/index.d.ts b/types/client/index.d.ts index 41b4da672..831b47f62 100644 --- a/types/client/index.d.ts +++ b/types/client/index.d.ts @@ -65,7 +65,7 @@ declare module "@altv/client" { export interface AudioCreateOptions { source: string; volume: number; - isRadio?: boolean; // default: false + radio?: boolean; // default: false clearCache?: boolean; // default: true }