DayZ 1.24
Loading...
Searching...
No Matches
ActionManagerBase.c File Reference

Go to the source code of this file.

Classes

class  array< ref TSelectableActionInfo >
 

Functions

void ActionManagerBase (PlayerBase player)
 
ActionBase GetRunningAction ()
 returns -1 when no action is running or RELOAD,MECHANISM, ....
 
ItemBase GetRunningActionMainitem ()
 
void EnableActions (bool enable)
 
void Update (int pCurrentCommandID)
 
void OnSyncJuncture (int pJunctureID, ParamsReadContext pCtx)
 
ActionTarget FindActionTarget ()
 
void StartDeliveredAction ()
 
static ActionBase GetActionVariant (typename actionName)
 
static ActionBase GetAction (typename actionName)
 
static ActionBase GetAction (int actionID)
 
ActionBase GetContinuousAction ()
 
ActionBase GetSingleUseAction ()
 
TSelectableActionInfoArray GetSelectableActions ()
 
int GetSelectedActionIndex ()
 
 GetSelectedActionCategory ()
 
void SelectFirstActionCategory ()
 
void SelectNextActionCategory ()
 
void SelectPrevActionCategory ()
 
void SelectNextAction ()
 
void SelectPrevAction ()
 
void RequestEndAction ()
 
void EndActionInput ()
 
bool IsSelectableActionsChanged ()
 
bool ActionPossibilityCheck (int pCurrentCommandID)
 
void SetActionContext (ActionTarget target, ItemBase item)
 
int GetActionState (ActionBase action)
 
void OnContinuousStart ()
 
void OnContinuousCancel ()
 
void OnSingleUse ()
 
void Interrupt ()
 
void LocalInterrupt ()
 
void OnInteractAction ()
 
void OnInstantAction (typename user_action_type, Param data=null)
 
void OnActionEnd ()
 
void OnJumpStart ()
 
bool OnInputUserDataProcess (int userDataType, ParamsReadContext ctx)
 
float GetActionComponentProgress ()
 
int GetActionState ()
 
ActionReciveData GetReciveData ()
 

Variables

class TSelectableActionInfoArray extends array< ref TSelectableActionInfom_Player
 
ActionTarget m_TestedActionTarget
 
ItemBase m_TestedActionItem
 
ActionBase m_PrimaryAction
 
ActionTarget m_PrimaryActionTarget
 
ItemBase m_PrimaryActionItem
 
ActionBase m_SecondaryAction
 
ActionTarget m_SecondaryActionTarget
 
ItemBase m_SecondaryActionItem
 
bool m_PrimaryActionEnabled
 
bool m_SecondaryActionEnabled
 
bool m_TertiaryActionEnabled
 
ref TSelectableActionInfoArray m_SelectableActions
 
int m_SelectedActionIndex
 
bool m_SelectableActionsHasChanged
 
bool m_Interrupted
 
static ref array< ref ActionBasem_ActionsArray
 
static ref map< typename, ActionBasem_ActionNameActionMap
 
bool m_ActionWantEndRequest
 
bool m_ActionInputWantEnd
 
bool m_ActionsEnabled
 
bool m_ActionsAvaibale
 
int m_PendingActionAcknowledgmentID
 
ref ActionData m_CurrentActionData
 

Function Documentation

◆ ActionManagerBase()

void ActionManagerBase ( PlayerBase player)
protected

Definition at line 56 of file ActionManagerBase.c.

57 {
59 if (m_Player)
60 {
64
66
68 m_Interrupted = false;
69
71 if (!m_ActionsArray)
72 ac.ConstructActions(m_ActionsArray, m_ActionNameActionMap);
73
76 }
77
78 m_ActionsEnabled = true;
79 m_ActionsAvaibale = true;
80 }
bool m_Interrupted
ref ActionData m_CurrentActionData
bool m_ActionsEnabled
bool m_SelectableActionsHasChanged
bool m_ActionsAvaibale
int m_SelectedActionIndex
bool m_ActionInputWantEnd
ref TSelectableActionInfoArray m_SelectableActions
static ref array< ref ActionBase > m_ActionsArray
int m_PendingActionAcknowledgmentID
bool m_ActionWantEndRequest
class TSelectableActionInfoArray extends array< ref TSelectableActionInfo > m_Player
static ref map< typename, ActionBase > m_ActionNameActionMap

References m_ActionInputWantEnd, m_ActionNameActionMap, m_ActionsArray, m_ActionsAvaibale, m_ActionsEnabled, m_ActionWantEndRequest, m_CurrentActionData, m_Interrupted, m_PendingActionAcknowledgmentID, m_Player, m_SelectableActions, m_SelectableActionsHasChanged, and m_SelectedActionIndex.

◆ ActionPossibilityCheck()

bool ActionPossibilityCheck ( int pCurrentCommandID)
protected

Definition at line 204 of file ActionManagerBase.c.

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
209 if (m_Player.GetWeaponManager().IsRunning())
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 }
DayZPlayerConstants
defined in C++
Definition dayzplayer.c:597

References DayZPlayer::GetDayZPlayerInventory(), DayZPlayer::GetThrowing(), DayZPlayer::GetWeaponManager(), WeaponManager::IsRunning(), DayZPlayerImplementThrowing::IsThrowingAnimationPlaying(), m_ActionsEnabled, and m_Player.

Referenced by ActionManagerClient::ActionStart(), ActionManagerClient::Update(), and ActionManagerServer::Update().

◆ EnableActions()

void EnableActions ( bool enable)
protected

Definition at line 98 of file ActionManagerBase.c.

99 {
101 }

References m_ActionsEnabled.

◆ EndActionInput()

void EndActionInput ( )
protected

◆ FindActionTarget()

ActionTarget FindActionTarget ( )
protected

◆ GetAction() [1/2]

static ActionBase GetAction ( int actionID)
staticprotected

Definition at line 164 of file ActionManagerBase.c.

165 {
166 return m_ActionsArray.Get(actionID);
167 }

References m_ActionsArray.

◆ GetAction() [2/2]

static ActionBase GetAction ( typename actionName )
staticprotected

Definition at line 156 of file ActionManagerBase.c.

157 {
160
161 return null;
162 }

References m_ActionNameActionMap.

◆ GetActionComponentProgress()

float GetActionComponentProgress ( )
protected

Definition at line 271 of file ActionManagerBase.c.

272 {
274 return m_CurrentActionData.m_Action.GetProgress(m_CurrentActionData);
275
276 return 0.0;
277 }

References m_CurrentActionData.

◆ GetActionState() [1/2]

int GetActionState ( )
protected

Definition at line 279 of file ActionManagerBase.c.

280 {
282 return m_CurrentActionData.m_Action.GetState(m_CurrentActionData);
283
284 return UA_NONE;
285 }
const int UA_NONE
Definition constants.c:432

References m_CurrentActionData, and UA_NONE.

◆ GetActionState() [2/2]

int GetActionState ( ActionBase action)
protected

Definition at line 223 of file ActionManagerBase.c.

224 {
226 return m_CurrentActionData.m_State;
227 return UA_NONE;
228 }

References m_CurrentActionData, and UA_NONE.

◆ GetActionVariant()

static ActionBase GetActionVariant ( typename actionName )
staticprotected

Definition at line 140 of file ActionManagerBase.c.

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 }

References m_ActionNameActionMap.

◆ GetContinuousAction()

ActionBase GetContinuousAction ( )
protected

Definition at line 169 of file ActionManagerBase.c.

170 {
171 return m_PrimaryAction;
172 }
ActionBase m_PrimaryAction

References m_PrimaryAction.

◆ GetReciveData()

ActionReciveData GetReciveData ( )
protected

Definition at line 287 of file ActionManagerBase.c.

288 {
289 return null;
290 }

◆ GetRunningAction()

ActionBase GetRunningAction ( )
protected

returns -1 when no action is running or RELOAD,MECHANISM, ....

Definition at line 82 of file ActionManagerBase.c.

83 {
85 return m_CurrentActionData.m_Action;
86
87 return null;
88 }

References m_CurrentActionData.

Referenced by ManBase::CanBeRestrained(), ActionManagerClient::FindContextualUserActions(), ManBase::HeadingModel(), and ManBase::OnQuickBarSingleUse().

◆ GetRunningActionMainitem()

ItemBase GetRunningActionMainitem ( )
protected

Definition at line 90 of file ActionManagerBase.c.

91 {
93 return m_CurrentActionData.m_MainItem;
94
95 return null;
96 }

References m_CurrentActionData.

◆ GetSelectableActions()

TSelectableActionInfoArray GetSelectableActions ( )
protected

Definition at line 179 of file ActionManagerBase.c.

180 {
181 return m_SelectableActions;
182 }

References m_SelectableActions.

◆ GetSelectedActionCategory()

GetSelectedActionCategory ( )
protected

◆ GetSelectedActionIndex()

int GetSelectedActionIndex ( )
protected

Definition at line 184 of file ActionManagerBase.c.

185 {
187 }

References m_SelectedActionIndex.

◆ GetSingleUseAction()

ActionBase GetSingleUseAction ( )
protected

Definition at line 174 of file ActionManagerBase.c.

175 {
176 return m_SecondaryAction;
177 }
ActionBase m_SecondaryAction

References m_SecondaryAction.

◆ Interrupt()

void Interrupt ( )
protected

Referenced by OnUpdateServer().

◆ IsSelectableActionsChanged()

bool IsSelectableActionsChanged ( )
protected

Definition at line 198 of file ActionManagerBase.c.

199 {
201 }

References m_SelectableActionsHasChanged.

◆ LocalInterrupt()

void LocalInterrupt ( )
protected

Definition at line 238 of file ActionManagerBase.c.

239 {
241 m_CurrentActionData.m_Action.Interrupt(m_CurrentActionData);
242 else
243 m_Interrupted = false;
244 }

References m_CurrentActionData, and m_Interrupted.

Referenced by Update().

◆ OnActionEnd()

void OnActionEnd ( )
protected

Definition at line 249 of file ActionManagerBase.c.

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 }
proto string ToString()
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

References Debug::ActionLog(), LogManager::IsActionLogEnable(), m_CurrentActionData, m_Player, and ToString().

◆ OnContinuousCancel()

void OnContinuousCancel ( )
protected

◆ OnContinuousStart()

void OnContinuousStart ( )
protected

◆ OnInputUserDataProcess()

bool OnInputUserDataProcess ( int userDataType,
ParamsReadContext ctx )
protected

Definition at line 266 of file ActionManagerBase.c.

267 {
268 return false;
269 }

◆ OnInstantAction()

void OnInstantAction ( typename user_action_type ,
Param data = null )
protected

◆ OnInteractAction()

void OnInteractAction ( )
protected

◆ OnJumpStart()

void OnJumpStart ( )
protected

◆ OnSingleUse()

void OnSingleUse ( )
protected

◆ OnSyncJuncture()

void OnSyncJuncture ( int pJunctureID,
ParamsReadContext pCtx )
protected

◆ RequestEndAction()

void RequestEndAction ( )
protected

◆ SelectFirstActionCategory()

void SelectFirstActionCategory ( )
protected

◆ SelectNextAction()

void SelectNextAction ( )
protected

Definition at line 481 of file ActionInput.c.

482 {
483 if (m_SelectActions.Count())
484 {
488 }
489 }
int m_selectedActionIndex
ActionInput m_SelectActions

References m_SelectActions, and m_selectedActionIndex.

◆ SelectNextActionCategory()

void SelectNextActionCategory ( )
protected

◆ SelectPrevAction()

void SelectPrevAction ( )
protected

Definition at line 491 of file ActionInput.c.

492 {
493 if (m_SelectActions.Count())
494 {
496 if (0 > m_selectedActionIndex)
498 }
499 }

References m_SelectActions, and m_selectedActionIndex.

◆ SelectPrevActionCategory()

void SelectPrevActionCategory ( )
protected

◆ SetActionContext()

void SetActionContext ( ActionTarget target,
ItemBase item )
protected

Definition at line 215 of file ActionManagerBase.c.

216 {
219 }
ActionTarget m_TestedActionTarget
ItemBase m_TestedActionItem

References m_TestedActionItem, and m_TestedActionTarget.

Referenced by ActionManagerClient::FindContextualUserActions().

◆ StartDeliveredAction()

void StartDeliveredAction ( )
protected

◆ Update()

void Update ( int pCurrentCommandID)
protected

Definition at line 103 of file ActionManagerBase.c.

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 }
void LocalInterrupt()
const int UA_AM_PENDING
Definition constants.c:446

References LocalInterrupt(), m_CurrentActionData, m_Interrupted, UA_AM_ACCEPTED, UA_AM_PENDING, and UA_AM_REJECTED.

Variable Documentation

◆ m_ActionInputWantEnd

◆ m_ActionNameActionMap

ref map<typename, ActionBase> m_ActionNameActionMap
staticprotected

Definition at line 45 of file ActionManagerBase.c.

Referenced by ActionManagerBase(), GetAction(), and GetActionVariant().

◆ m_ActionsArray

ref array<ref ActionBase> m_ActionsArray
staticprotected

◆ m_ActionsAvaibale

◆ m_ActionsEnabled

bool m_ActionsEnabled
protected

Definition at line 48 of file ActionManagerBase.c.

Referenced by ActionManagerBase(), ActionPossibilityCheck(), and EnableActions().

◆ m_ActionWantEndRequest

◆ m_CurrentActionData

◆ m_Interrupted

◆ m_PendingActionAcknowledgmentID

◆ m_Player

◆ m_PrimaryAction

ActionBase m_PrimaryAction
protected

Definition at line 31 of file ActionManagerBase.c.

Referenced by GetContinuousAction().

◆ m_PrimaryActionEnabled

bool m_PrimaryActionEnabled
protected

Definition at line 37 of file ActionManagerBase.c.

◆ m_PrimaryActionItem

ItemBase m_PrimaryActionItem
protected

Definition at line 33 of file ActionManagerBase.c.

◆ m_PrimaryActionTarget

ActionTarget m_PrimaryActionTarget
protected

Definition at line 32 of file ActionManagerBase.c.

◆ m_SecondaryAction

ActionBase m_SecondaryAction
protected

Definition at line 34 of file ActionManagerBase.c.

Referenced by GetSingleUseAction().

◆ m_SecondaryActionEnabled

bool m_SecondaryActionEnabled
protected

Definition at line 38 of file ActionManagerBase.c.

◆ m_SecondaryActionItem

ItemBase m_SecondaryActionItem
protected

Definition at line 36 of file ActionManagerBase.c.

◆ m_SecondaryActionTarget

ActionTarget m_SecondaryActionTarget
protected

Definition at line 35 of file ActionManagerBase.c.

◆ m_SelectableActions

ref TSelectableActionInfoArray m_SelectableActions
protected

Definition at line 40 of file ActionManagerBase.c.

Referenced by ActionManagerBase(), and GetSelectableActions().

◆ m_SelectableActionsHasChanged

bool m_SelectableActionsHasChanged
protected

Definition at line 42 of file ActionManagerBase.c.

Referenced by ActionManagerBase(), and IsSelectableActionsChanged().

◆ m_SelectedActionIndex

int m_SelectedActionIndex
protected

Definition at line 41 of file ActionManagerBase.c.

Referenced by ActionManagerBase(), and GetSelectedActionIndex().

◆ m_TertiaryActionEnabled

bool m_TertiaryActionEnabled
protected

Definition at line 39 of file ActionManagerBase.c.

◆ m_TestedActionItem

ItemBase m_TestedActionItem
protected

Definition at line 29 of file ActionManagerBase.c.

Referenced by SetActionContext().

◆ m_TestedActionTarget

ActionTarget m_TestedActionTarget
protected

Definition at line 28 of file ActionManagerBase.c.

Referenced by SetActionContext().