DayZ 1.24
Loading...
Searching...
No Matches
ActionManagerBase.c
Go to the documentation of this file.
1class TSelectableActionInfoArray extends array<ref TSelectableActionInfo>
2{
4 {
5 if (this.Count() != other.Count())
6 return false;
7
8 for (int i = 0; i < Count(); ++i)
9 {
12
13 if (ai1.param2 != ai2.param2)
14 return false;
15
16 if (ai1.param3 != ai2.param3)
17 return false;
18 }
19
20 return true;
21 }
22}
23
24class ActionManagerBase
25{
27
28 protected ActionTarget m_TestedActionTarget;
30
31 protected ActionBase m_PrimaryAction;
32 protected ActionTarget m_PrimaryActionTarget;
34 protected ActionBase m_SecondaryAction;
35 protected ActionTarget m_SecondaryActionTarget;
46 protected bool m_ActionWantEndRequest;
47 protected bool m_ActionInputWantEnd;
48 protected bool m_ActionsEnabled;
49 protected bool m_ActionsAvaibale;
50
51 //Pending actions waiting for acknowledgment
53
55
81
82 ActionBase GetRunningAction()
83 {
85 return m_CurrentActionData.m_Action;
86
87 return null;
88 }
89
91 {
93 return m_CurrentActionData.m_MainItem;
94
95 return null;
96 }
97
99 {
101 }
102
104 {
106 {
107 if (m_Interrupted)
110 m_CurrentActionData.m_Action.OnUpdate(m_CurrentActionData);
111 }
112 else if (m_Interrupted)
113 m_Interrupted = false;
114 }
115
136
137 ActionTarget FindActionTarget();
139
140 static ActionBase GetActionVariant(typename actionName)
141 {
143 {
145 ActionBase new_action = ActionBase.Cast(actionName.Spawn());
146
147 new_action.CreateConditionComponents();
148 new_action.SetID(base_action.GetID());
149 new_action.SetInput(base_action.GetInput());
150
151 return new_action;
152 }
153 return null;
154 }
155
156 static ActionBase GetAction(typename actionName)
157 {
160
161 return null;
162 }
163
164 static ActionBase GetAction(int actionID)
165 {
166 return m_ActionsArray.Get(actionID);
167 }
168
170 {
171 return m_PrimaryAction;
172 }
173
175 {
176 return m_SecondaryAction;
177 }
178
183
185 {
187 }
188
193 void SelectNextAction();
194 void SelectPrevAction();
197
202
203 //------------------------------------------------------
205 {
206 if (!m_ActionsEnabled || m_Player.IsSprinting() || m_Player.IsUnconscious() || m_Player.GetCommandModifier_Action() || m_Player.GetCommand_Action() || m_Player.IsEmotePlaying() || m_Player.GetThrowing().IsThrowingAnimationPlaying() || m_Player.GetDayZPlayerInventory().IsProcessing() || m_Player.IsItemsToDelete())
207 return false;
208
210 return false;
211
212 return (pCurrentCommandID == DayZPlayerConstants.COMMANDID_ACTION || pCurrentCommandID == DayZPlayerConstants.COMMANDID_MOVE || pCurrentCommandID == DayZPlayerConstants.COMMANDID_SWIM || pCurrentCommandID == DayZPlayerConstants.COMMANDID_LADDER || pCurrentCommandID == DayZPlayerConstants.COMMANDID_VEHICLE);
213 }
214 //------------------------------------------------------
215 protected void SetActionContext(ActionTarget target, ItemBase item)
216 {
219 }
220
221 //------------------------------------------------------
222
223 int GetActionState(ActionBase action)
224 {
226 return m_CurrentActionData.m_State;
227 return UA_NONE;
228 }
229
230 //---------------------------------
231 // EVENTS
232 //---------------------------------
236 void Interrupt();
237
238 protected void LocalInterrupt()
239 {
241 m_CurrentActionData.m_Action.Interrupt(m_CurrentActionData);
242 else
243 m_Interrupted = false;
244 }
245
246 void OnInteractAction(); //Interact
248
250 {
252 {
254 Debug.ActionLog("n/a", m_CurrentActionData.m_Action.ToString(), "n/a", "OnActionEnd", m_CurrentActionData.m_Player.ToString());
255 Debug.ActionLog("Action data cleared ", this.ToString(), "n/a", "ActionEnd", m_CurrentActionData.m_Player.ToString());
256 }
258 m_CurrentActionData.m_Action.ActionCleanup(m_CurrentActionData);
260
261 m_Player.ResetActionEndInput();
262 }
263
265
267 {
268 return false;
269 }
270
272 {
274 return m_CurrentActionData.m_Action.GetProgress(m_CurrentActionData);
275
276 return 0.0;
277 }
278
280 {
282 return m_CurrentActionData.m_Action.GetState(m_CurrentActionData);
283
284 return UA_NONE;
285 }
286
287 ActionReciveData GetReciveData()
288 {
289 return null;
290 }
291}
override ActionBase GetAction()
override void SelectNextAction()
override void SelectPrevAction()
bool m_Interrupted
ItemBase m_SecondaryActionItem
ref ActionData m_CurrentActionData
ActionBase m_SecondaryAction
ActionTarget m_PrimaryActionTarget
bool m_TertiaryActionEnabled
void SelectFirstActionCategory()
void SetActionContext(ActionTarget target, ItemBase item)
bool IsSelectableActionsChanged()
bool m_ActionsEnabled
ItemBase GetRunningActionMainitem()
GetSelectedActionCategory()
int GetActionState()
ActionTarget m_TestedActionTarget
ActionBase GetContinuousAction()
void LocalInterrupt()
bool m_SelectableActionsHasChanged
void OnActionEnd()
void SelectNextActionCategory()
int GetSelectedActionIndex()
ActionTarget m_SecondaryActionTarget
bool m_ActionsAvaibale
void OnInstantAction(typename user_action_type, Param data=null)
static ActionBase GetActionVariant(typename actionName)
void OnContinuousCancel()
void EnableActions(bool enable)
ActionTarget FindActionTarget()
int m_SelectedActionIndex
void SelectPrevActionCategory()
ActionBase GetSingleUseAction()
void OnSingleUse()
void OnContinuousStart()
bool m_SecondaryActionEnabled
bool m_ActionInputWantEnd
TSelectableActionInfoArray GetSelectableActions()
void RequestEndAction()
bool ActionPossibilityCheck(int pCurrentCommandID)
void OnInteractAction()
ref TSelectableActionInfoArray m_SelectableActions
void EndActionInput()
static ref array< ref ActionBase > m_ActionsArray
float GetActionComponentProgress()
ActionReciveData GetReciveData()
void ActionManagerBase(PlayerBase player)
ItemBase m_TestedActionItem
void Interrupt()
void StartDeliveredAction()
int m_PendingActionAcknowledgmentID
bool m_PrimaryActionEnabled
bool m_ActionWantEndRequest
void OnJumpStart()
ItemBase m_PrimaryActionItem
static ref map< typename, ActionBase > m_ActionNameActionMap
ActionBase m_PrimaryAction
bool OnInputUserDataProcess(int userDataType, ParamsReadContext ctx)
void OnSyncJuncture(int pJunctureID, ParamsReadContext pCtx)
proto string ToString()
DayZPlayer m_Player
Definition Hand_Events.c:42
array< ref PlayerStatBase > Get()
DayZPlayerImplementThrowing GetThrowing()
WeaponManager GetWeaponManager()
DayZPlayerInventory GetDayZPlayerInventory()
bool IsThrowingAnimationPlaying()
Throwing animation after button release.
Definition Debug.c:14
static void ActionLog(string message=LOG_DEFAULT, string plugin=LOG_DEFAULT, string author=LOG_DEFAULT, string label=LOG_DEFAULT, string entity=LOG_DEFAULT)
Definition Debug.c:143
static bool IsActionLogEnable()
Definition Debug.c:719
Base Param Class with no parameters. Used as general purpose parameter overloaded with Param1 to Para...
Definition param.c:12
Serialization general interface. Serializer API works with:
Definition Serializer.c:56
bool IsSameAs(TSelectableActionInfoArray other)
Result for an object found in CGame.IsBoxCollidingGeometryProxy.
DayZPlayerConstants
defined in C++
Definition dayzplayer.c:597
const int UA_AM_ACCEPTED
Definition constants.c:447
const int UA_AM_REJECTED
Definition constants.c:448
const int UA_NONE
Definition constants.c:432
const int UA_AM_PENDING
Definition constants.c:446
proto native volatile void Update()
proto native int GetRunningAction()
returns -1 when no action is running or RELOAD,MECHANISM, ....