Arma Reforger Explorer 1.7.0.54
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
Loading...
Searching...
No Matches
SCR_SightsHasIlluminationCondition.c
Go to the documentation of this file.
3{
4 [Attribute("0", UIWidgets.CheckBox, desc: "True - find illumination of controlled turret | False - find current weapon in hand illumination")]
5 protected bool m_bCheckTurret;
6
7 //------------------------------------------------------------------------------------------------
10 {
11 SCR_2DOpticsComponent sights = null;
12
14 {
15 sights = CurrentTurretSight(data);
16 }
17 else
18 {
19 sights = CurrentWeaponSights(data);
20 }
21
22 if (!sights)
23 return false;
24
25 SCR_2DOpticsComponentClass sightsData = SCR_2DOpticsComponentClass.Cast(sights.GetComponentData(sights.GetOwner()));
26 if (!sightsData)
27 return false;
28
29 // Has illumination
30 return GetReturnResult(sightsData.HasIllumination());
31 }
32
33 //------------------------------------------------------------------------------------------------
35 {
37 if (!controlledEntity)
38 return null;
39
40 ChimeraCharacter character = ChimeraCharacter.Cast(controlledEntity);
41 if (!character)
42 return null;
43
44 BaseWeaponManagerComponent weaponManager = character.GetCharacterController().GetWeaponManagerComponent();
45 if (!weaponManager)
46 return null;
47
48 BaseSightsComponent currentSights = weaponManager.GetCurrentSights();
49 if (!currentSights)
50 return null;
51
52 return SCR_2DOpticsComponent.Cast(currentSights);
53 }
54
55 //------------------------------------------------------------------------------------------------
57 {
58 // Current vehicle controller
59 BaseControllerComponent controller = data.GetCurrentVehicleController();
60 if (!controller)
61 return null;
62
63 // Turret
64 IEntity turretEntity = controller.GetOwner();
65 if (!turretEntity)
66 return null;
67
69 if (!turret)
70 return null;
71
72 // Sights
73 return SCR_2DOpticsComponent.Cast(turret.FindComponent(SCR_2DOpticsComponent));
74 }
75}
SCR_AIAnimation_Loitering BaseContainerProps
Commanding menu commanding element class.
Get all prefabs that have the spawner data
UI Textures DeployMenu Briefing conflict_HintBanner_1_UI desc
proto external Managed FindComponent(typename typeName)
A single available action condition representation.
static IEntity GetLocalControlledEntity()
SCR_2DOpticsComponent CurrentTurretSight(SCR_AvailableActionsConditionData data)
override bool IsAvailable(notnull SCR_AvailableActionsConditionData data)
Return true if currently controlled vehicle turret has illumination for sights.
SCR_2DOpticsComponent CurrentWeaponSights(SCR_AvailableActionsConditionData data)
SCR_FieldOfViewSettings Attribute