Arma Reforger Explorer
1.7.0.54
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
Toggle main menu visibility
Loading...
Searching...
No Matches
SCR_SightsHasIlluminationCondition.c
Go to the documentation of this file.
1
[
BaseContainerProps
()]
2
class
SCR_SightsHasIlluminationCondition
:
SCR_AvailableActionCondition
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
//------------------------------------------------------------------------------------------------
9
override
bool
IsAvailable
(notnull
SCR_AvailableActionsConditionData
data
)
10
{
11
SCR_2DOpticsComponent
sights = null;
12
13
if
(
m_bCheckTurret
)
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
//------------------------------------------------------------------------------------------------
34
protected
SCR_2DOpticsComponent
CurrentWeaponSights
(
SCR_AvailableActionsConditionData
data
)
35
{
36
IEntity
controlledEntity =
SCR_PlayerController
.
GetLocalControlledEntity
();
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
//------------------------------------------------------------------------------------------------
56
protected
SCR_2DOpticsComponent
CurrentTurretSight
(
SCR_AvailableActionsConditionData
data
)
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
68
TurretComponent
turret =
TurretComponent
.Cast(turretEntity.
FindComponent
(
TurretComponent
));
69
if
(!turret)
70
return
null;
71
72
// Sights
73
return
SCR_2DOpticsComponent
.Cast(turret.FindComponent(
SCR_2DOpticsComponent
));
74
}
75
}
BaseContainerProps
SCR_AIAnimation_Loitering BaseContainerProps
Commanding menu commanding element class.
Definition
SCR_AIAnimationWaypoint.c:14
data
Get all prefabs that have the spawner data
Definition
SCR_EntityCatalogManagerComponent.c:320
desc
UI Textures DeployMenu Briefing conflict_HintBanner_1_UI desc
Definition
SCR_RespawnBriefingComponent.c:17
BaseSightsComponent
Definition
BaseSightsComponent.c:13
ChimeraCharacter
Definition
ChimeraCharacter.c:13
IEntity
Definition
IEntity.c:13
IEntity::FindComponent
proto external Managed FindComponent(typename typeName)
SCR_2DOpticsComponentClass
Definition
SCR_2DOpticsComponent.c:3
SCR_2DOpticsComponentClass::HasIllumination
bool HasIllumination()
Definition
SCR_2DOpticsComponent.c:123
SCR_2DOpticsComponent
Definition
SCR_2DOpticsComponent.c:294
SCR_AvailableActionCondition
A single available action condition representation.
Definition
SCR_AvailableActionCondition.c:4
SCR_AvailableActionCondition::GetReturnResult
bool GetReturnResult(bool desiredResult)
Definition
SCR_AvailableActionCondition.c:22
SCR_AvailableActionsConditionData
Definition
SCR_AvailableActionsConditionData.c:6
SCR_PlayerController
Definition
SCR_PlayerController.c:31
SCR_PlayerController::GetLocalControlledEntity
static IEntity GetLocalControlledEntity()
Definition
SCR_PlayerController.c:495
SCR_SightsHasIlluminationCondition
Definition
SCR_SightsHasIlluminationCondition.c:3
SCR_SightsHasIlluminationCondition::CurrentTurretSight
SCR_2DOpticsComponent CurrentTurretSight(SCR_AvailableActionsConditionData data)
Definition
SCR_SightsHasIlluminationCondition.c:56
SCR_SightsHasIlluminationCondition::IsAvailable
override bool IsAvailable(notnull SCR_AvailableActionsConditionData data)
Return true if currently controlled vehicle turret has illumination for sights.
Definition
SCR_SightsHasIlluminationCondition.c:9
SCR_SightsHasIlluminationCondition::CurrentWeaponSights
SCR_2DOpticsComponent CurrentWeaponSights(SCR_AvailableActionsConditionData data)
Definition
SCR_SightsHasIlluminationCondition.c:34
SCR_SightsHasIlluminationCondition::m_bCheckTurret
bool m_bCheckTurret
Definition
SCR_SightsHasIlluminationCondition.c:5
TurretComponent
Definition
TurretComponent.c:13
UIWidgets
Definition
attributes.c:40
Attribute
SCR_FieldOfViewSettings Attribute
Definition
SendGoalMessage.c:170
scripts
Game
UI
HUD
AvailableActions
Conditions
Game
Weapon
SCR_SightsHasIlluminationCondition.c
Generated by
1.17.0