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_EmoteBaseCommand.c
Go to the documentation of this file.
1
//------------------------------------------------------------------------------------------------
2
[
BaseContainerProps
(),
SCR_BaseGroupCommandTitleField
(
"m_sCommandName"
)]
3
class
SCR_EmoteBaseCommand
:
SCR_BaseRadialCommand
4
{
5
[
Attribute
(defvalue:
"1"
,
desc
:
"Unequip items in hand before doing emote?"
)]
6
protected
bool
m_bUnequipItems
;
7
8
[
Attribute
(defvalue:
"0"
,
desc
:
"ID of the gesture in gesture state machine to be played, 0 = no gesture"
)]
9
protected
int
m_iGestureID
;
10
11
[
Attribute
(uiwidget:
UIWidgets
.SearchComboBox,
desc
:
"Available stances. All stances allowed if empty"
, enums: ParamEnumArray.FromEnum(
ECharacterStance
))]
12
protected
ref array<ref ECharacterStance>
m_aAllowedStances
;
13
14
//------------------------------------------------------------------------------------------------
15
override
bool
Execute
(
IEntity
cursorTarget,
IEntity
target,
vector
targetPosition,
int
playerID,
bool
isClient)
16
{
17
//TODO: Implement optional local-only commands to safe networking for commands of this style
18
if
(
SCR_PlayerController
.
GetLocalPlayerId
() != playerID)
19
return
true
;
20
21
IEntity
playerControlledEntity =
GetGame
().GetPlayerController().GetControlledEntity();
22
23
if
(!playerControlledEntity)
24
return
false
;
25
26
SCR_CharacterControllerComponent
characterComponent =
SCR_CharacterControllerComponent
.Cast(playerControlledEntity.
FindComponent
(
SCR_CharacterControllerComponent
));
27
if
(!characterComponent)
28
return
false
;
29
30
SCR_GadgetManagerComponent
gadgetManager =
SCR_GadgetManagerComponent
.Cast(playerControlledEntity.
FindComponent
(
SCR_GadgetManagerComponent
));
31
if
(!gadgetManager)
32
return
false
;
33
34
if
(
m_bUnequipItems
&& (gadgetManager.
GetHeldGadget
() || characterComponent.GetWeaponManagerComponent().GetCurrentWeapon()))
35
{
36
if
(characterComponent.IsGadgetInHands())
37
characterComponent.RemoveGadgetFromHand();
38
characterComponent.SelectWeapon(null);
39
40
//Call the animation later when the unequipping of the items is done.
41
GetGame
().GetCallqueue().CallLater(characterComponent.TryStartCharacterGesture, 1500,
false
,
m_iGestureID
, 2000 );
42
43
return
true
;
44
}
45
46
characterComponent.TryStartCharacterGesture(
m_iGestureID
, 2000);
47
return
true
;
48
}
49
50
//------------------------------------------------------------------------------------------------
51
override
bool
CanBePerformed
(notnull SCR_ChimeraCharacter user)
52
{
53
IEntity
playerControlledEntity =
GetGame
().GetPlayerController().GetControlledEntity();
54
55
if
(!playerControlledEntity)
56
return
false
;
57
58
SCR_CharacterControllerComponent
characterComponent =
SCR_CharacterControllerComponent
.Cast(playerControlledEntity.
FindComponent
(
SCR_CharacterControllerComponent
));
59
if
(!characterComponent)
60
return
false
;
61
62
if
(
m_aAllowedStances
.IsEmpty())
63
return
true
;
64
65
return
(
m_aAllowedStances
.Contains(characterComponent.GetStance()));
66
}
67
}
GetGame
ArmaReforgerScripted GetGame()
Definition
game.c:1398
BaseContainerProps
SCR_AIAnimation_Loitering BaseContainerProps
Commanding menu commanding element class.
Definition
SCR_AIAnimationWaypoint.c:14
desc
UI Textures DeployMenu Briefing conflict_HintBanner_1_UI desc
Definition
SCR_RespawnBriefingComponent.c:17
IEntity
Definition
IEntity.c:13
IEntity::FindComponent
proto external Managed FindComponent(typename typeName)
SCR_BaseGroupCommandTitleField
Definition
SCR_PlayerCommandsConfig.c:155
SCR_BaseRadialCommand
Definition
SCR_BaseRadialCommand.c:3
SCR_CharacterControllerComponent
Definition
SCR_CharacterControllerComponent.c:36
SCR_EmoteBaseCommand
Definition
SCR_EmoteBaseCommand.c:4
SCR_EmoteBaseCommand::m_iGestureID
int m_iGestureID
Definition
SCR_EmoteBaseCommand.c:9
SCR_EmoteBaseCommand::m_bUnequipItems
bool m_bUnequipItems
Definition
SCR_EmoteBaseCommand.c:6
SCR_EmoteBaseCommand::Execute
override bool Execute(IEntity cursorTarget, IEntity target, vector targetPosition, int playerID, bool isClient)
Definition
SCR_EmoteBaseCommand.c:15
SCR_EmoteBaseCommand::m_aAllowedStances
ref array< ref ECharacterStance > m_aAllowedStances
Definition
SCR_EmoteBaseCommand.c:12
SCR_EmoteBaseCommand::CanBePerformed
override bool CanBePerformed(notnull SCR_ChimeraCharacter user)
Definition
SCR_EmoteBaseCommand.c:51
SCR_GadgetManagerComponent
Definition
SCR_GadgetManagerComponent.c:140
SCR_GadgetManagerComponent::GetHeldGadget
IEntity GetHeldGadget()
Definition
SCR_GadgetManagerComponent.c:191
SCR_PlayerController
Definition
SCR_PlayerController.c:31
SCR_PlayerController::GetLocalPlayerId
static int GetLocalPlayerId()
Returns either a valid ID of local player or 0.
Definition
SCR_PlayerController.c:481
UIWidgets
Definition
attributes.c:40
vector
Definition
vector.c:13
ECharacterStance
ECharacterStance
Definition
ECharacterStance.c:13
Attribute
SCR_FieldOfViewSettings Attribute
Definition
SendGoalMessage.c:170
scripts
Game
Commanding
Commands
SCR_EmoteBaseCommand.c
Generated by
1.17.0