Arma Reforger Explorer 1.7.0.54
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
Loading...
Searching...
No Matches
EditablePrefabsLabel_VehicleType.c
Go to the documentation of this file.
3{
4 [Attribute()]
5 protected float m_TruckMassValue;
6
7 [Attribute()]
8 protected float m_APCArmorValue;
9
10 //------------------------------------------------------------------------------------------------
11 override bool GetLabelValid(WorldEditorAPI api, IEntitySource entitySource, IEntityComponentSource componentSource, string targetPath, EEditableEntityType entityType, notnull array<EEditableEntityLabel> authoredLabels, out EEditableEntityLabel label)
12 {
13 if (entityType != EEditableEntityType.VEHICLE || authoredLabels.Contains(EEditableEntityLabel.VEHICLE_HELICOPTER))
14 return false;
15
16 IEntityComponentSource turretComponent = SCR_BaseContainerTools.FindComponentSource(entitySource, TurretComponent);
17 IEntityComponentSource vehicleDamageComponent = SCR_BaseContainerTools.FindComponentSource(entitySource, SCR_VehicleDamageManagerComponent);
18 if (turretComponent)
19 {
20 label = EEditableEntityLabel.VEHICLE_TURRET;
21 return true;
22 }
23
24 if (!vehicleDamageComponent)
25 return false;
26
27 BaseContainerList vehicleHitzones = vehicleDamageComponent.GetObjectArray("Additional hit zones");
28 if (vehicleHitzones)
29 {
30 BaseContainer vehicleTotalHitzone = vehicleHitzones.Get(0);
31 int hpMax;
32 if (vehicleTotalHitzone && vehicleTotalHitzone.Get("HPMax", hpMax) && hpMax >= m_APCArmorValue)
33 {
34 label = EEditableEntityLabel.VEHICLE_APC;
35 return true;
36 }
37 }
38
39 IEntityComponentSource rigidBodyComponent = SCR_BaseContainerTools.FindComponentSource(entitySource, "RigidBody");
40
41 float vehicleMass;
42 if (rigidBodyComponent && rigidBodyComponent.Get("Mass", vehicleMass))
43 {
44 if (vehicleMass >= m_TruckMassValue)
45 label = EEditableEntityLabel.VEHICLE_TRUCK;
46 else
47 label = EEditableEntityLabel.VEHICLE_CAR;
48
49 return true;
50 }
51
52 return false;
53 }
54}
EEditableEntityLabel
SCR_AIAnimation_Loitering BaseContainerProps
Commanding menu commanding element class.
class SCR_CampaignHintStorage SCR_BaseContainerCustomTitleEnum(EHint, "m_eHintId")
void SCR_VehicleDamageManagerComponent(IEntityComponentSource src, IEntity ent, IEntity parent)
override bool GetLabelValid(WorldEditorAPI api, IEntitySource entitySource, IEntityComponentSource componentSource, string targetPath, EEditableEntityType entityType, notnull array< EEditableEntityLabel > authoredLabels, out EEditableEntityLabel label)
EEditableEntityType
Defines type of SCR_EditableEntityComponent. Assigned automatically based on IEntity inheritance.
SCR_FieldOfViewSettings Attribute