Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions resource/dist/ModelExtras.ini
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ DirtFX = 1 # Vehicle dirt effect (dirt
ExhaustFx = 1 # Vehicle exhaust/smoke effects
ExtraWheels = 1 # Support for additional wheels for automobiles
HDLicensePlate = 1 # Improved license plates for vehicles
Neon = 1 # Vehicle neon lights
PedCols = 1 # Ped variation colors like VCS
RollbackBed = 1 # Rollback bed for pickup trucks
RotatingWheelHubs = 1 # Wheel hubs that rotate along with the wheels
Expand Down
15 changes: 14 additions & 1 deletion src/ModelExtrasAPI.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
#include "features/exhausts.h"
#include "features/backfire.h"
#include "features/pedcols.h"
#include "features/neon.h"
#include <algorithm>
#include <cstring>

Expand Down Expand Up @@ -437,5 +438,17 @@ float ME_GetSirenPointLightMul() {
return LightsConfig::Get().fSirenPointLightMul;
}

} // extern "C"
// Neon API
bool ME_HasNeonData(int modelIndex) {
const auto *pJson = DataMgr::Find(modelIndex);
return pJson && pJson->contains("neon");
}

bool ME_IsVehicleNeonActive(CVehicle *pVeh) {
if (!CBaseFeature::IsEnabled(eFeatureMatrix::Neon) || !pVeh) return false;
if (pVeh->m_fHealth <= 0.0f || pVeh->IsUpsideDown() || pVeh->bSubmergedInWater) return false;
if (!CarUtil::AreLightsOn(pVeh)) return false;
return ME_HasNeonData(pVeh->m_nModelIndex);
}

} // extern "C"
5 changes: 5 additions & 0 deletions src/ModelExtrasAPI.h
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ enum ME_FeatureID
ME_RollbackBed,
ME_Clock,
ME_ExtraWheels,
ME_Neon,
ME_FeatureCount
};

Expand Down Expand Up @@ -218,6 +219,10 @@ extern "C"
ME_WRAPPER float ME_GetPointLightIntensity();
ME_WRAPPER float ME_GetSirenPointLightMul();

// Neon API
ME_WRAPPER bool ME_HasNeonData(int modelIndex);
ME_WRAPPER bool ME_IsVehicleNeonActive(CVehicle *pVeh);

#ifdef __cplusplus
}
#endif
1 change: 1 addition & 0 deletions src/enums/featurematrix.h
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ enum class eFeatureMatrix
RollbackBed,
Clock,
ExtraWheels,
Neon,

FeatureCount
};
Loading
Loading