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_CharacterHasGadgetCondition.c
Go to the documentation of this file.
1
3
[
BaseContainerProps
()]
4
class
SCR_CharacterHasGadgetCondition
:
SCR_AvailableActionCondition
5
{
6
[
Attribute
(
"1"
,
UIWidgets
.CheckBox,
"Only if gadget is in hands"
,
""
)]
7
protected
bool
m_bEquipped
;
8
9
[
Attribute
(
"0"
,
UIWidgets
.CheckBox,
"Only if gadget is not in hands and in "
,
""
)]
10
protected
bool
m_bNotEquipped
;
11
12
[
Attribute
(
"1"
,
UIWidgets
.CheckBox,
"Specified gadget type"
,
""
)]
13
protected
bool
m_bCheckSpecificGadget
;
14
15
[
Attribute
(defvalue:
SCR_Enum
.GetDefault(EGadgetType.MAP),
UIWidgets
.ComboBox,
"Gadget type"
,
""
, ParamEnumArray.FromEnum(EGadgetType))]
16
protected
EGadgetType
m_eGadget
;
17
18
[
Attribute
(
"0"
,
UIWidgets
.CheckBox,
"Pass if the gadget is turned on"
,
""
)]
19
protected
bool
m_bIsToggledOn
;
20
21
[
Attribute
(
"0"
,
UIWidgets
.CheckBox,
"Pass if the gadget is turned off"
,
""
)]
22
protected
bool
m_bIsToggledOff
;
23
24
//------------------------------------------------------------------------------------------------
27
override
bool
IsAvailable
(notnull
SCR_AvailableActionsConditionData
data
)
28
{
29
bool
equipped;
30
SCR_GadgetComponent gadgetComponent =
data
.GetHeldGadgetComponent();
31
if
(gadgetComponent)
32
{
33
if
(
m_bCheckSpecificGadget
)
34
equipped = gadgetComponent.GetType() ==
m_eGadget
;
35
else
36
equipped =
true
;
37
}
38
39
// Force failure if expected as unequipped while gadget is equipped
40
if
(equipped &&
m_bNotEquipped
)
41
return
false
;
42
43
bool
result;
44
if
(
m_bEquipped
)
45
{
46
result = equipped;
47
}
48
else
49
{
50
// Check gadgets that are not in hands
51
gadgetComponent = null;
52
53
// Force failure if there is no gadget at that point
54
IEntity
gadget =
data
.GetGadget(
m_eGadget
);
55
if
(!gadget)
56
return
false
;
57
58
// Get new gadget component or clear
59
if
(
m_bIsToggledOn
||
m_bIsToggledOff
)
60
gadgetComponent = SCR_GadgetComponent.Cast(gadget.
FindComponent
(SCR_GadgetComponent));
61
62
result =
true
;
63
}
64
65
// Allow only toggled on or off
66
if
(result && (
m_bIsToggledOn
||
m_bIsToggledOff
))
67
{
68
// Pass if either requirement is met
69
bool
isToggledOn = gadgetComponent && gadgetComponent.IsToggledOn();
70
if
(isToggledOn &&
m_bIsToggledOn
)
71
result =
true
;
72
else
if
(!isToggledOn &&
m_bIsToggledOff
)
73
result =
true
;
74
else
75
result =
false
;
76
}
77
78
return
GetReturnResult
(result);
79
}
80
}
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
IEntity
Definition
IEntity.c:13
IEntity::FindComponent
proto external Managed FindComponent(typename typeName)
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_CharacterHasGadgetCondition
Definition
SCR_CharacterHasGadgetCondition.c:5
SCR_CharacterHasGadgetCondition::m_bEquipped
bool m_bEquipped
Definition
SCR_CharacterHasGadgetCondition.c:7
SCR_CharacterHasGadgetCondition::m_bCheckSpecificGadget
bool m_bCheckSpecificGadget
Definition
SCR_CharacterHasGadgetCondition.c:13
SCR_CharacterHasGadgetCondition::m_eGadget
EGadgetType m_eGadget
Definition
SCR_CharacterHasGadgetCondition.c:16
SCR_CharacterHasGadgetCondition::IsAvailable
override bool IsAvailable(notnull SCR_AvailableActionsConditionData data)
Definition
SCR_CharacterHasGadgetCondition.c:27
SCR_CharacterHasGadgetCondition::m_bIsToggledOn
bool m_bIsToggledOn
Definition
SCR_CharacterHasGadgetCondition.c:19
SCR_CharacterHasGadgetCondition::m_bNotEquipped
bool m_bNotEquipped
Definition
SCR_CharacterHasGadgetCondition.c:10
SCR_CharacterHasGadgetCondition::m_bIsToggledOff
bool m_bIsToggledOff
Definition
SCR_CharacterHasGadgetCondition.c:22
SCR_Enum
Definition
SCR_Enum.c:2
UIWidgets
Definition
attributes.c:40
Attribute
SCR_FieldOfViewSettings Attribute
Definition
SendGoalMessage.c:170
scripts
Game
UI
HUD
AvailableActions
Conditions
Game
Character
SCR_CharacterHasGadgetCondition.c
Generated by
1.17.0