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_BaseGroupCommand.c
Go to the documentation of this file.
1
//------------------------------------------------------------------------------------------------
2
[
BaseContainerProps
(),
SCR_BaseGroupCommandTitleField
(
"m_sCommandName"
)]
3
class
SCR_BaseGroupCommand
:
SCR_BaseRadialCommand
4
{
5
[
Attribute
(defvalue:
"1"
,
desc
:
"Will the command be shown to leader?"
)]
6
protected
bool
m_bShowToLeader
;
7
8
[
Attribute
(defvalue:
"0"
,
desc
:
"Will the command be shown to member?"
)]
9
protected
bool
m_bShowToMember
;
10
11
[
Attribute
(defvalue:
"0"
,
desc
:
"Will the command be shown while commanding from map?"
)]
12
protected
bool
m_bShowOnMap
;
13
14
[
Attribute
(defvalue:
"0"
,
desc
:
"Is the command available while player is dead?"
)]
15
protected
bool
m_bUsableWhileDead
;
16
17
[
Attribute
(defvalue:
"0"
,
desc
:
"Is the command available while player is unconscious?"
)]
18
protected
bool
m_bUsableWhileUncouscious
;
19
20
[
Attribute
(defvalue:
"0"
,
desc
:
"ID of the gesture in gesture state machine to be played when command is given out. 0 = no gesture"
)]
21
protected
int
m_iGestureID
;
22
23
[
Attribute
(
""
,
UIWidgets
.EditBox,
"Name of the sound event to be played, leave empty for no event"
)]
24
protected
string
m_sSoundEventName
;
25
26
[
Attribute
(defvalue:
"-1"
,
desc
:
"seed for the version of sound event to be played, -1 for random. For valid values refer to audio guide"
)]
27
protected
float
m_fSoundEventSeed
;
28
29
[
Attribute
(defvalue:
"0"
,
desc
:
"Will the command show preview in world before it is given out"
)]
30
protected
bool
m_bShowPreview
;
31
32
[
Attribute
(defvalue:
"1"
,
desc
:
"Will the AI respond with voicelines to given command"
)]
33
protected
bool
m_bPlayAIResponse
;
34
35
[
Attribute
(
SCR_ECommandVisualizationDuration
.BRIEF.ToString(),
UIWidgets
.ComboBox, enums: ParamEnumArray.FromEnum(
SCR_ECommandVisualizationDuration
))]
36
protected
SCR_ECommandVisualizationDuration
m_eVisualizationDuration
;
37
38
[
Attribute
(
"{10A7FB1074F322FC}Configs/Commanding/PlacedCommandInfoDisplay.conf"
,
UIWidgets
.ResourceNamePicker,
params
:
"conf"
,
category
:
"Visualization"
)]
39
protected
ResourceName
m_sInfoDisplayConfig
;
40
41
protected
Widget
m_wVisualizationWidget
;
42
43
//------------------------------------------------------------------------------------------------
44
override
bool
CanRoleShow
()
45
{
46
SCR_PlayerControllerGroupComponent groupController = SCR_PlayerControllerGroupComponent.GetLocalPlayerControllerGroupComponent();
47
if
(!groupController)
48
return
false
;
49
50
bool
isPlayerLeader = groupController.IsPlayerLeaderOwnGroup();
51
if
(isPlayerLeader && !
m_bShowToLeader
)
52
return
false
;
53
54
if
(!isPlayerLeader && !
m_bShowToMember
)
55
return
false
;
56
57
return
true
;
58
}
59
60
//------------------------------------------------------------------------------------------------
61
string
GetSoundEventName
()
62
{
63
return
m_sSoundEventName
;
64
}
65
66
float
GetSoundEventSeed
()
67
{
68
return
m_fSoundEventSeed
;
69
}
70
71
//------------------------------------------------------------------------------------------------
72
bool
CanShowPreview
()
73
{
74
return
m_bShowPreview
;
75
}
76
77
bool
ShouldPlayAIResponse
()
78
{
79
return
m_bPlayAIResponse
;
80
}
81
82
//------------------------------------------------------------------------------------------------
83
override
bool
CanShowOnMap
()
84
{
85
return
m_bShowOnMap
;
86
}
87
88
//------------------------------------------------------------------------------------------------
89
int
GetCommandGestureID
()
90
{
91
return
m_iGestureID
;
92
}
93
94
//------------------------------------------------------------------------------------------------
95
SCR_ECommandVisualizationDuration
GetVisualizationDuration
()
96
{
97
return
m_eVisualizationDuration
;
98
}
99
100
//------------------------------------------------------------------------------------------------
101
override
bool
CanBeShownInCurrentLifeState
()
102
{
103
PlayerController playerController =
GetGame
().GetPlayerController();
104
if
(!playerController)
105
return
false
;
106
107
//returns true because if there is no controlled entity then player is not dead nor uncoscious.
108
ChimeraCharacter
character =
ChimeraCharacter
.Cast(playerController.GetControlledEntity());
109
if
(!character)
110
return
true
;
111
112
//Return true in case of component not found to prevent VME
113
CharacterControllerComponent controller = character.GetCharacterController();
114
if
(!controller)
115
return
true
;
116
117
ECharacterLifeState
lifeState = controller.GetLifeState();
118
if
((!
m_bUsableWhileDead
&& lifeState ==
ECharacterLifeState
.DEAD) || (!
m_bUsableWhileUncouscious
&& lifeState ==
ECharacterLifeState
.INCAPACITATED))
119
return
false
;
120
121
return
true
;
122
}
123
124
//------------------------------------------------------------------------------------------------
125
override
void
VisualizeCommand
(
vector
targetPosition)
126
{
127
if
(!
m_bShowPreview
)
128
return
;
129
130
Resource
resource =
BaseContainerTools
.LoadContainer(
m_sInfoDisplayConfig
);
131
if
(!resource || !resource.IsValid())
132
return
;
133
134
SCR_HUDManagerComponent
hudManager =
SCR_HUDManagerComponent
.
GetHUDManager
();
135
if
(!hudManager)
136
return
;
137
138
SCR_PlacedCommandInfoDisplay
display =
SCR_PlacedCommandInfoDisplay
.Cast(
BaseContainerTools
.CreateInstanceFromContainer(resource.GetResource().ToBaseContainer()));
139
if
(!display)
140
return
;
141
142
SCR_PlayerControllerCommandingComponent commandComp = SCR_PlayerControllerCommandingComponent.GetLocalPlayerControllerCommandingComponent();
143
if
(commandComp)
144
commandComp.SetShownCommand(display);
145
146
hudManager.StartDrawing(display);
147
display.
VisualizeCommand
(targetPosition,
this
);
148
}
149
150
//------------------------------------------------------------------------------------------------
151
override
void
VisualizeCommandPreview
(
vector
targetPosition)
152
{
153
if
(!
m_bShowPreview
)
154
return
;
155
156
Resource
resource =
BaseContainerTools
.LoadContainer(
m_sInfoDisplayConfig
);
157
if
(!resource || !resource.IsValid())
158
return
;
159
160
SCR_PlacedCommandInfoDisplay
display =
SCR_PlacedCommandInfoDisplay
.Cast(
BaseContainerTools
.CreateInstanceFromContainer(resource.GetResource().ToBaseContainer()));
161
if
(!display)
162
return
;
163
164
SCR_HUDManagerComponent
hudManager =
SCR_HUDManagerComponent
.
GetHUDManager
();
165
if
(!hudManager)
166
return
;
167
168
SCR_PlayerControllerCommandingComponent commandComp = SCR_PlayerControllerCommandingComponent.GetLocalPlayerControllerCommandingComponent();
169
if
(commandComp)
170
commandComp.SetShownCommandPreview(display);
171
172
hudManager.StartDrawing(display);
173
display.
SetIsPreview
(
true
);
174
display.
VisualizeCommand
(targetPosition,
this
);
175
}
176
}
GetGame
ArmaReforgerScripted GetGame()
Definition
game.c:1398
BaseContainerProps
SCR_AIAnimation_Loitering BaseContainerProps
Commanding menu commanding element class.
Definition
SCR_AIAnimationWaypoint.c:14
SCR_ECommandVisualizationDuration
SCR_ECommandVisualizationDuration
Definition
SCR_PlayerControllerCommandingComponent.c:1055
desc
UI Textures DeployMenu Briefing conflict_HintBanner_1_UI desc
Definition
SCR_RespawnBriefingComponent.c:17
params
category params
Definition
SCR_SpherePointGeneratorPreviewComponent.c:21
category
params category
Definition
SCR_VehicleDamageManagerComponent.c:302
BaseContainerTools
Definition
BaseContainerTools.c:13
ChimeraCharacter
Definition
ChimeraCharacter.c:13
Resource
Object holding reference to resource. In destructor release the resource.
Definition
Resource.c:25
ResourceName
Definition
ResourceName.c:13
SCR_BaseGroupCommand
Definition
SCR_BaseGroupCommand.c:4
SCR_BaseGroupCommand::ShouldPlayAIResponse
bool ShouldPlayAIResponse()
Definition
SCR_BaseGroupCommand.c:77
SCR_BaseGroupCommand::m_eVisualizationDuration
SCR_ECommandVisualizationDuration m_eVisualizationDuration
Definition
SCR_BaseGroupCommand.c:36
SCR_BaseGroupCommand::m_bShowOnMap
bool m_bShowOnMap
Definition
SCR_BaseGroupCommand.c:12
SCR_BaseGroupCommand::m_bShowToLeader
bool m_bShowToLeader
Definition
SCR_BaseGroupCommand.c:6
SCR_BaseGroupCommand::m_bUsableWhileUncouscious
bool m_bUsableWhileUncouscious
Definition
SCR_BaseGroupCommand.c:18
SCR_BaseGroupCommand::GetSoundEventSeed
float GetSoundEventSeed()
Definition
SCR_BaseGroupCommand.c:66
SCR_BaseGroupCommand::m_sInfoDisplayConfig
ResourceName m_sInfoDisplayConfig
Definition
SCR_BaseGroupCommand.c:39
SCR_BaseGroupCommand::m_bShowToMember
bool m_bShowToMember
Definition
SCR_BaseGroupCommand.c:9
SCR_BaseGroupCommand::m_fSoundEventSeed
float m_fSoundEventSeed
Definition
SCR_BaseGroupCommand.c:27
SCR_BaseGroupCommand::CanRoleShow
override bool CanRoleShow()
Definition
SCR_BaseGroupCommand.c:44
SCR_BaseGroupCommand::m_iGestureID
int m_iGestureID
Definition
SCR_BaseGroupCommand.c:21
SCR_BaseGroupCommand::CanBeShownInCurrentLifeState
override bool CanBeShownInCurrentLifeState()
Definition
SCR_BaseGroupCommand.c:101
SCR_BaseGroupCommand::m_wVisualizationWidget
Widget m_wVisualizationWidget
Definition
SCR_BaseGroupCommand.c:41
SCR_BaseGroupCommand::CanShowOnMap
override bool CanShowOnMap()
Definition
SCR_BaseGroupCommand.c:83
SCR_BaseGroupCommand::VisualizeCommand
override void VisualizeCommand(vector targetPosition)
Definition
SCR_BaseGroupCommand.c:125
SCR_BaseGroupCommand::GetCommandGestureID
int GetCommandGestureID()
Definition
SCR_BaseGroupCommand.c:89
SCR_BaseGroupCommand::m_bPlayAIResponse
bool m_bPlayAIResponse
Definition
SCR_BaseGroupCommand.c:33
SCR_BaseGroupCommand::CanShowPreview
bool CanShowPreview()
Definition
SCR_BaseGroupCommand.c:72
SCR_BaseGroupCommand::GetVisualizationDuration
SCR_ECommandVisualizationDuration GetVisualizationDuration()
Definition
SCR_BaseGroupCommand.c:95
SCR_BaseGroupCommand::GetSoundEventName
string GetSoundEventName()
Definition
SCR_BaseGroupCommand.c:61
SCR_BaseGroupCommand::m_bShowPreview
bool m_bShowPreview
Definition
SCR_BaseGroupCommand.c:30
SCR_BaseGroupCommand::m_bUsableWhileDead
bool m_bUsableWhileDead
Definition
SCR_BaseGroupCommand.c:15
SCR_BaseGroupCommand::VisualizeCommandPreview
override void VisualizeCommandPreview(vector targetPosition)
Definition
SCR_BaseGroupCommand.c:151
SCR_BaseGroupCommand::m_sSoundEventName
string m_sSoundEventName
Definition
SCR_BaseGroupCommand.c:24
SCR_BaseGroupCommandTitleField
Definition
SCR_PlayerCommandsConfig.c:155
SCR_BaseRadialCommand
Definition
SCR_BaseRadialCommand.c:3
SCR_HUDManagerComponent
Definition
SCR_HUDManagerComponent.c:24
SCR_HUDManagerComponent::GetHUDManager
static SCR_HUDManagerComponent GetHUDManager()
Definition
SCR_HUDManagerComponent.c:419
SCR_PlacedCommandInfoDisplay
Definition
SCR_PlacedCommandInfoDisplay.c:2
SCR_PlacedCommandInfoDisplay::VisualizeCommand
void VisualizeCommand(vector targetPosition, SCR_BaseGroupCommand command)
Definition
SCR_PlacedCommandInfoDisplay.c:298
SCR_PlacedCommandInfoDisplay::SetIsPreview
void SetIsPreview(bool isPreview)
Definition
SCR_PlacedCommandInfoDisplay.c:346
UIWidgets
Definition
attributes.c:40
Widget
Definition
Widget.c:13
vector
Definition
vector.c:13
ECharacterLifeState
ECharacterLifeState
Definition
ECharacterLifeState.c:13
Attribute
SCR_FieldOfViewSettings Attribute
Definition
SendGoalMessage.c:170
scripts
Game
Commanding
Commands
SCR_BaseGroupCommand.c
Generated by
1.17.0