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_BaseContinuousEmoteCommand.c
Go to the documentation of this file.
1
[
BaseContainerProps
(),
SCR_BaseGroupCommandTitleField
(
"m_sCommandName"
)]
2
class
SCR_ContinuousLoiterCommand
:
SCR_BaseRadialCommand
3
{
4
protected
ref
SCR_ScriptedCharacterInputContext
m_pScrInputContext
;
5
6
[
Attribute
(uiwidget:
UIWidgets
.SearchComboBox,
desc
:
"Loiter animation"
, enums: ParamEnumArray.FromEnum(
ELoiteringType
))]
7
protected
ELoiteringType
m_eLoiterType
;
8
9
[
Attribute
(defvalue:
"1"
,
desc
:
"Unequip items in hand before doing emote?"
)]
10
protected
bool
m_bUnequipItems
;
11
12
[
Attribute
(uiwidget:
UIWidgets
.SearchComboBox,
desc
:
"Available stances. All stances allowed if empty"
, enums: ParamEnumArray.FromEnum(
ECharacterStance
))]
13
protected
ref array<ref ECharacterStance>
m_aAllowedStances
;
14
15
protected
ResourceName
m_sHint
=
"{3D2B20A0A9C3248A}Configs/Hints/GeneralHints.conf"
;
16
17
//------------------------------------------------------------------------------------------------
18
override
bool
Execute
(
IEntity
cursorTarget,
IEntity
target,
vector
targetPosition,
int
playerID,
bool
isClient)
19
{
20
//TODO: Implement optional local-only commands to safe networking for commands of this style
21
if
(
SCR_PlayerController
.
GetLocalPlayerId
() != playerID)
22
return
true
;
23
24
IEntity
playerControlledEntity =
GetGame
().GetPlayerController().GetControlledEntity();
25
if
(!playerControlledEntity)
26
return
false
;
27
28
SCR_CharacterControllerComponent
characterController =
SCR_CharacterControllerComponent
.Cast(playerControlledEntity.
FindComponent
(
SCR_CharacterControllerComponent
));
29
if
(!characterController)
30
return
false
;
31
32
SCR_GadgetManagerComponent
gadgetManager =
SCR_GadgetManagerComponent
.Cast(playerControlledEntity.
FindComponent
(
SCR_GadgetManagerComponent
));
33
if
(!gadgetManager)
34
return
false
;
35
36
if
(characterController.
IsLoitering
())
37
{
38
if
(
m_pScrInputContext
.m_bLoiteringDisablePlayerInput)
39
return
false
;
40
41
characterController.
StopLoitering
(
false
);
42
return
true
;
43
}
44
45
if
(
m_bUnequipItems
&& (gadgetManager.
GetHeldGadget
() || characterController.GetWeaponManagerComponent().GetCurrentWeapon()))
46
{
47
if
(characterController.IsGadgetInHands())
48
characterController.RemoveGadgetFromHand();
49
50
characterController.SelectWeapon(null);
51
52
//Call the animation later when the unequipping of the items is done.
53
GetGame
().GetCallqueue().CallLater(
StartLoiter
, 1500,
false
);
54
return
true
;
55
}
56
57
StartLoiter
();
58
return
true
;
59
}
60
61
//------------------------------------------------------------------------------------------------
62
override
bool
CanBePerformed
(notnull SCR_ChimeraCharacter user)
63
{
64
if
(!user)
65
return
false
;
66
67
SCR_CharacterControllerComponent
characterComponent =
SCR_CharacterControllerComponent
.Cast(user.GetCharacterController());
68
if
(!characterComponent)
69
return
false
;
70
71
if
(
m_aAllowedStances
.IsEmpty())
72
return
true
;
73
74
return
(
m_aAllowedStances
.Contains(characterComponent.GetStance()));
75
}
76
77
//------------------------------------------------------------------------------------------------
78
bool
StartLoiter
()
79
{
80
IEntity
playerControlledEntity =
GetGame
().GetPlayerController().GetControlledEntity();
81
if
(!playerControlledEntity)
82
return
false
;
83
84
SCR_CharacterControllerComponent
characterController =
SCR_CharacterControllerComponent
.Cast(playerControlledEntity.
FindComponent
(
SCR_CharacterControllerComponent
));
85
if
(!characterController)
86
return
false
;
87
88
vector
emptyVector[4];
89
characterController.
StartLoitering
(null,
m_eLoiterType
,
false
,
true
,
false
, emptyVector);
90
91
Resource
holder =
BaseContainerTools
.LoadContainer(
m_sHint
);
92
if
(!holder.IsValid())
93
return
true
;
94
95
//show hint explaining continuous emote
96
BaseContainer
container = holder.GetResource().ToBaseContainer();
97
SCR_GeneralHintStorage
hintStorage =
SCR_GeneralHintStorage
.Cast(
BaseContainerTools
.CreateInstanceFromContainer(container));
98
SCR_HintManagerComponent.ShowHint(hintStorage.
GetHintByType
(
EHint
.EMOTES_INTRO));
99
100
return
true
;
101
}
102
}
EHint
EHint
Definition
EHint.c:11
GetGame
ArmaReforgerScripted GetGame()
Definition
game.c:1398
BaseContainerProps
SCR_AIAnimation_Loitering BaseContainerProps
Commanding menu commanding element class.
Definition
SCR_AIAnimationWaypoint.c:14
ELoiteringType
ELoiteringType
Definition
SCR_LoiterUserAction.c:2
desc
UI Textures DeployMenu Briefing conflict_HintBanner_1_UI desc
Definition
SCR_RespawnBriefingComponent.c:17
BaseContainer
Definition
BaseContainer.c:13
BaseContainerTools
Definition
BaseContainerTools.c:13
IEntity
Definition
IEntity.c:13
IEntity::FindComponent
proto external Managed FindComponent(typename typeName)
Resource
Object holding reference to resource. In destructor release the resource.
Definition
Resource.c:25
ResourceName
Definition
ResourceName.c:13
SCR_BaseGroupCommandTitleField
Definition
SCR_PlayerCommandsConfig.c:155
SCR_BaseRadialCommand
Definition
SCR_BaseRadialCommand.c:3
SCR_CharacterControllerComponent
Definition
SCR_CharacterControllerComponent.c:36
SCR_CharacterControllerComponent::StartLoitering
void StartLoitering(IEntity loiterEntity, int loiteringType, bool holsterWeapon, bool allowRootMotion, bool alignToPosition, vector targetPosition[4]={ "1 0 0", "0 1 0", "0 0 1", "0 0 0" }, bool disableInput=false, SCR_LoiterCustomAnimData customAnimData=SCR_LoiterCustomAnimData.Default)
Definition
SCR_CharacterControllerComponent.c:1472
SCR_CharacterControllerComponent::IsLoitering
bool IsLoitering()
Definition
SCR_CharacterControllerComponent.c:1649
SCR_CharacterControllerComponent::StopLoitering
void StopLoitering(bool terminateFast)
Definition
SCR_CharacterControllerComponent.c:1634
SCR_ContinuousLoiterCommand
Definition
SCR_BaseContinuousEmoteCommand.c:3
SCR_ContinuousLoiterCommand::StartLoiter
bool StartLoiter()
Definition
SCR_BaseContinuousEmoteCommand.c:78
SCR_ContinuousLoiterCommand::m_sHint
ResourceName m_sHint
Definition
SCR_BaseContinuousEmoteCommand.c:15
SCR_ContinuousLoiterCommand::Execute
override bool Execute(IEntity cursorTarget, IEntity target, vector targetPosition, int playerID, bool isClient)
Definition
SCR_BaseContinuousEmoteCommand.c:18
SCR_ContinuousLoiterCommand::m_eLoiterType
ELoiteringType m_eLoiterType
Definition
SCR_BaseContinuousEmoteCommand.c:7
SCR_ContinuousLoiterCommand::m_pScrInputContext
ref SCR_ScriptedCharacterInputContext m_pScrInputContext
Definition
SCR_BaseContinuousEmoteCommand.c:4
SCR_ContinuousLoiterCommand::m_bUnequipItems
bool m_bUnequipItems
Definition
SCR_BaseContinuousEmoteCommand.c:10
SCR_ContinuousLoiterCommand::m_aAllowedStances
ref array< ref ECharacterStance > m_aAllowedStances
Definition
SCR_BaseContinuousEmoteCommand.c:13
SCR_ContinuousLoiterCommand::CanBePerformed
override bool CanBePerformed(notnull SCR_ChimeraCharacter user)
Definition
SCR_BaseContinuousEmoteCommand.c:62
SCR_GadgetManagerComponent
Definition
SCR_GadgetManagerComponent.c:140
SCR_GadgetManagerComponent::GetHeldGadget
IEntity GetHeldGadget()
Definition
SCR_GadgetManagerComponent.c:191
SCR_GeneralHintStorage
Definition
SCR_GeneralHintsConfig.c:3
SCR_GeneralHintStorage::GetHintByType
SCR_HintUIInfo GetHintByType(EHint type)
Definition
SCR_GeneralHintsConfig.c:8
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
SCR_ScriptedCharacterInputContext
Definition
SCR_ScriptedCharacterInputContext.c:2
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_BaseContinuousEmoteCommand.c
Generated by
1.17.0