Arma Reforger Explorer 1.7.0.54
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
Loading...
Searching...
No Matches
SCR_BaseContinuousEmoteCommand.c
Go to the documentation of this file.
3{
5
6 [Attribute(uiwidget: UIWidgets.SearchComboBox, desc: "Loiter animation", enums: ParamEnumArray.FromEnum(ELoiteringType))]
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
29 if (!characterController)
30 return false;
31
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
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 //------------------------------------------------------------------------------------------------
79 {
80 IEntity playerControlledEntity = GetGame().GetPlayerController().GetControlledEntity();
81 if (!playerControlledEntity)
82 return false;
83
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
Definition EHint.c:11
ArmaReforgerScripted GetGame()
Definition game.c:1398
SCR_AIAnimation_Loitering BaseContainerProps
Commanding menu commanding element class.
UI Textures DeployMenu Briefing conflict_HintBanner_1_UI desc
proto external Managed FindComponent(typename typeName)
Object holding reference to resource. In destructor release the resource.
Definition Resource.c:25
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)
override bool Execute(IEntity cursorTarget, IEntity target, vector targetPosition, int playerID, bool isClient)
ref SCR_ScriptedCharacterInputContext m_pScrInputContext
ref array< ref ECharacterStance > m_aAllowedStances
override bool CanBePerformed(notnull SCR_ChimeraCharacter user)
SCR_HintUIInfo GetHintByType(EHint type)
static int GetLocalPlayerId()
Returns either a valid ID of local player or 0.
ECharacterStance
SCR_FieldOfViewSettings Attribute