DayZ 1.24
Loading...
Searching...
No Matches
ActionInput Class Reference
Inheritance diagram for ActionInput:
[legend]
Collaboration diagram for ActionInput:
[legend]

Protected Member Functions

void SetInput (string input_name)
 
int GetInputType ()
 
UAInput GetUAInput ()
 
bool JustActivate ()
 
bool IsActive ()
 
bool WasEnded ()
 
void Update ()
 
void Reset ()
 
void UpdatePossibleActions (PlayerBase player, ActionTarget target, ItemBase item, int action_condition_mask)
 
ActionBase GetAction ()
 
ActionTarget GetUsedActionTarget ()
 
ItemBase GetUsedMainItem ()
 
array< ActionBaseGetPossibleActions ()
 
ActionBase GetPossibleAction ()
 
int GetPossibleActionIndex ()
 
bool HasTarget ()
 
void OnActionStart ()
 
void OnActionEnd ()
 
void ActionsSelectReset ()
 
void ForceAction (ActionBase action, ActionTarget target, ItemBase item)
 
void ForceActionTarget (ActionTarget target)
 
void ClearForcedAction ()
 
void ClearForcedTarget ()
 
bool ForceActionCheck (PlayerBase player)
 
void SelectNextAction ()
 
void SelectPrevAction ()
 
int GetPossibleActionsCount ()
 
bool HasInput ()
 
int GetPriority ()
 

Private Member Functions

void ActionInput ()
 
void Init (PlayerBase player, ActionManagerClient am)
 
void SetEnablity (bool value)
 

Private Attributes

UAIDWrapper m_input
 
int m_InputType
 
int m_Priority
 
bool m_DetectFromItem
 
bool m_DetectFromTarget
 
bool m_DetectFromPlayer
 
bool m_Enabled
 
bool m_JustActivate
 
bool m_HasTarget
 
PlayerBase m_Player
 
ref ActionTarget m_ForcedTarget
 
ref ForcedActionData m_ForcedActionData
 
ref ActionTarget m_Target
 
ItemBase m_MainItem
 
int m_ConditionMask
 
bool m_Active
 

Detailed Description

Definition at line 19 of file ActionInput.c.

Constructor & Destructor Documentation

◆ ActionInput()

void ActionInput::ActionInput ( )
inlineprivate

Definition at line 43 of file ActionInput.c.

44 {
45 m_Active = false;
46 m_Enabled = true;
49
50 m_HasTarget = false;
51
52 m_JustActivate = false;
53 m_DetectFromTarget = false;
54 m_DetectFromItem = true;
55 m_DetectFromPlayer = true;
56
57 m_Priority = 100;
58 }
bool m_DetectFromItem
Definition ActionInput.c:24
bool m_DetectFromPlayer
Definition ActionInput.c:26
ref ActionTarget m_ForcedTarget
Definition ActionInput.c:33
bool m_JustActivate
Definition ActionInput.c:28
ref ForcedActionData m_ForcedActionData
Definition ActionInput.c:35
bool m_DetectFromTarget
Definition ActionInput.c:25
bool m_HasTarget
Definition ActionInput.c:29

References m_Active, m_DetectFromItem, m_DetectFromPlayer, m_DetectFromTarget, m_Enabled, m_ForcedActionData, m_ForcedTarget, m_HasTarget, m_JustActivate, and m_Priority.

Member Function Documentation

◆ ActionsSelectReset()

void ActionInput::ActionsSelectReset ( )
inlineprotected

Definition at line 221 of file ActionInput.c.

222 {}

Referenced by OnActionStart(), and Reset().

◆ ClearForcedAction()

void ActionInput::ClearForcedAction ( )
inlineprotected

Definition at line 237 of file ActionInput.c.

238 {
240 }

References m_ForcedActionData.

◆ ClearForcedTarget()

void ActionInput::ClearForcedTarget ( )
inlineprotected

Definition at line 242 of file ActionInput.c.

243 {
245 }

References m_ForcedTarget.

◆ ForceAction()

void ActionInput::ForceAction ( ActionBase action,
ActionTarget target,
ItemBase item )
inlineprotected

Definition at line 224 of file ActionInput.c.

225 {
227 m_ForcedActionData.m_Action = action;
228 m_ForcedActionData.m_Target = target;
229 m_ForcedActionData.m_Item = item;
230 }

References m_ForcedActionData.

◆ ForceActionCheck()

bool ActionInput::ForceActionCheck ( PlayerBase player)
inlineprotected

Definition at line 247 of file ActionInput.c.

248 {
250 {
251 if (m_ForcedActionData.m_Action.Can(player, m_ForcedActionData.m_Target, m_ForcedActionData.m_Item))
252 {
254 m_Target = m_ForcedActionData.m_Target;
255 return true;
256 }
257 }
258 return false;
259 }
ItemBase m_MainItem
Definition ActionInput.c:38
ref ActionTarget m_Target
Definition ActionInput.c:37

References m_ForcedActionData, m_MainItem, and m_Target.

Referenced by NoIndicationActionInputBase::GetAction().

◆ ForceActionTarget()

void ActionInput::ForceActionTarget ( ActionTarget target)
inlineprotected

Definition at line 232 of file ActionInput.c.

233 {
235 }

References m_ForcedTarget.

◆ GetAction()

ActionBase ActionInput::GetAction ( )
inlineprotected

Definition at line 176 of file ActionInput.c.

177 {
178 return NULL;
179 }

◆ GetInputType()

int ActionInput::GetInputType ( )
inlineprotected

Definition at line 87 of file ActionInput.c.

88 {
89 return m_InputType;
90 }

References m_InputType.

◆ GetPossibleAction()

ActionBase ActionInput::GetPossibleAction ( )
inlineprotected

Definition at line 196 of file ActionInput.c.

197 {
198 return NULL;
199 }

◆ GetPossibleActionIndex()

int ActionInput::GetPossibleActionIndex ( )
inlineprotected

Definition at line 201 of file ActionInput.c.

202 {
203 return -1;
204 }

◆ GetPossibleActions()

array< ActionBase > ActionInput::GetPossibleActions ( )
inlineprotected

Definition at line 191 of file ActionInput.c.

192 {
193 return NULL;
194 }

◆ GetPossibleActionsCount()

int ActionInput::GetPossibleActionsCount ( )
inlineprotected

Definition at line 268 of file ActionInput.c.

269 {
270 return -1;
271 }

◆ GetPriority()

int ActionInput::GetPriority ( )
inlineprotected

Definition at line 278 of file ActionInput.c.

279 {
280 return m_Priority;
281 }

References m_Priority.

◆ GetUAInput()

UAInput ActionInput::GetUAInput ( )
inlineprotected

Definition at line 92 of file ActionInput.c.

93 {
94 return m_input.InputP();
95 }
UAIDWrapper m_input
Definition ActionInput.c:21
proto native UAInput InputP()

References UAIDWrapper::InputP(), and m_input.

◆ GetUsedActionTarget()

ActionTarget ActionInput::GetUsedActionTarget ( )
inlineprotected

Definition at line 181 of file ActionInput.c.

182 {
183 return m_Target;
184 }

References m_Target.

◆ GetUsedMainItem()

ItemBase ActionInput::GetUsedMainItem ( )
inlineprotected

Definition at line 186 of file ActionInput.c.

187 {
188 return m_MainItem;
189 }

References m_MainItem.

◆ HasInput()

bool ActionInput::HasInput ( )
inlineprotected

Definition at line 273 of file ActionInput.c.

274 {
275 return m_input != NULL;
276 }

References m_input.

◆ HasTarget()

bool ActionInput::HasTarget ( )
inlineprotected

Definition at line 206 of file ActionInput.c.

207 {
208 return false;
209 }

◆ Init()

void ActionInput::Init ( PlayerBase player,
ActionManagerClient am )
inlineprivate

Definition at line 60 of file ActionInput.c.

61 {
63
65 Debug.ActionLog("n/a", this.ToString(), "n/a", "Init()", player.ToString());
66
67 }
proto string ToString()
PlayerBase m_Player
Definition ActionInput.c:31
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_Player, and ToString().

◆ IsActive()

bool ActionInput::IsActive ( )
inlineprotected

Definition at line 102 of file ActionInput.c.

103 {
104 return m_Active;
105 }

References m_Active.

◆ JustActivate()

bool ActionInput::JustActivate ( )
inlineprotected

Definition at line 97 of file ActionInput.c.

98 {
99 return m_JustActivate;
100 }

References m_JustActivate.

◆ OnActionEnd()

void ActionInput::OnActionEnd ( )
inlineprotected

Definition at line 216 of file ActionInput.c.

217 {
218 Reset();
219 }

References Reset().

◆ OnActionStart()

void ActionInput::OnActionStart ( )
inlineprotected

Definition at line 211 of file ActionInput.c.

212 {
214 }
void ActionsSelectReset()

References ActionsSelectReset().

◆ Reset()

void ActionInput::Reset ( )
inlineprotected

Definition at line 166 of file ActionInput.c.

167 {
168 m_Active = false;
170 }

References ActionsSelectReset(), and m_Active.

Referenced by OnActionEnd().

◆ SelectNextAction()

void ActionInput::SelectNextAction ( )
inlineprotected

Definition at line 261 of file ActionInput.c.

262 {
263 }

◆ SelectPrevAction()

void ActionInput::SelectPrevAction ( )
inlineprotected

Definition at line 265 of file ActionInput.c.

266 {}

◆ SetEnablity()

void ActionInput::SetEnablity ( bool value)
inlineprivate

Definition at line 69 of file ActionInput.c.

70 {
72 }

References m_Enabled.

◆ SetInput()

void ActionInput::SetInput ( string input_name)
inlineprotected

Definition at line 74 of file ActionInput.c.

75 {
76 m_input = GetUApi().GetInputByName(input_name).GetPersistentWrapper();
77
79 {
80 if (m_input && m_input.InputP())
81 Debug.ActionLog("(+) input set to " + input_name, this.ToString(), "n/a", "SetInput()", "n/a");
82 else
83 Debug.ActionLog("(-) input is not set to " + input_name, this.ToString(), "n/a", "SetInput()", "n/a");
84 }
85 }
proto native UAInputAPI GetUApi()

References Debug::ActionLog(), GetUApi(), UAIDWrapper::InputP(), LogManager::IsActionLogEnable(), m_input, and ToString().

Referenced by ContinuousWeaponManipulationActionInput::ContinuousWeaponManipulationActionInput(), DropActionInput::DropActionInput(), and WeaponManipulationActionInput::WeaponManipulationActionInput().

◆ Update()

void ActionInput::Update ( )
inlineprotected

Definition at line 112 of file ActionInput.c.

113 {
114 if (!m_Enabled)
115 {
116 m_Active = false;
117 m_JustActivate = false;
118 return;
119 }
120
121 switch (m_InputType)
122 {
123 case ActionInputType.AIT_CONTINUOUS:
124 m_JustActivate = false;
125 if (m_Active)
126 m_Active = m_input.InputP().LocalHold();
127 else
128 {
129 m_Active = m_input.InputP().LocalHoldBegin();
131 }
132 break;
133 case ActionInputType.AIT_SINGLE:
134 m_Active = m_input.InputP().LocalClick();
136 break;
137 case ActionInputType.AIT_DOUBLECLICK:
138 m_Active = m_input.InputP().LocalDoubleClick();
140 break;
141 break;
142 case ActionInputType.AIT_HOLDSINGLE:
143 m_Active = m_input.InputP().LocalHoldBegin();
145 break;
146 break;
147 case ActionInputType.AIT_CLICKCONTINUOUS:
148 m_JustActivate = false;
149 if (m_Active)
150 {
151 if (m_input.InputP().LocalClick())
152 m_Active = false;
153 }
154 else
155 {
156 m_Active = m_input.InputP().LocalClick();
158 }
159 break;
160 break;
161 default:
162 break;
163 }
164 }
ActionInputType
Definition ActionInput.c:2

References UAIDWrapper::InputP(), m_Active, m_Enabled, m_input, m_InputType, and m_JustActivate.

◆ UpdatePossibleActions()

void ActionInput::UpdatePossibleActions ( PlayerBase player,
ActionTarget target,
ItemBase item,
int action_condition_mask )
inlineprotected

Definition at line 172 of file ActionInput.c.

173 {
174 }

◆ WasEnded()

bool ActionInput::WasEnded ( )
inlineprotected

Definition at line 107 of file ActionInput.c.

108 {
109 return !m_Active;
110 }

References m_Active.

Member Data Documentation

◆ m_Active

bool ActionInput::m_Active
private

Definition at line 41 of file ActionInput.c.

Referenced by ActionInput(), IsActive(), Reset(), Update(), and WasEnded().

◆ m_ConditionMask

int ActionInput::m_ConditionMask
private

◆ m_DetectFromItem

bool ActionInput::m_DetectFromItem
private

Definition at line 24 of file ActionInput.c.

Referenced by ActionInput().

◆ m_DetectFromPlayer

bool ActionInput::m_DetectFromPlayer
private

Definition at line 26 of file ActionInput.c.

Referenced by ActionInput().

◆ m_DetectFromTarget

bool ActionInput::m_DetectFromTarget
private

◆ m_Enabled

bool ActionInput::m_Enabled
private

Definition at line 27 of file ActionInput.c.

Referenced by ActionInput(), SetEnablity(), and Update().

◆ m_ForcedActionData

ref ForcedActionData ActionInput::m_ForcedActionData
private

◆ m_ForcedTarget

ref ActionTarget ActionInput::m_ForcedTarget
private

Definition at line 33 of file ActionInput.c.

Referenced by ActionInput(), ClearForcedTarget(), and ForceActionTarget().

◆ m_HasTarget

bool ActionInput::m_HasTarget
private

Definition at line 29 of file ActionInput.c.

Referenced by ActionInput().

◆ m_input

UAIDWrapper ActionInput::m_input
private

Definition at line 21 of file ActionInput.c.

Referenced by GetUAInput(), HasInput(), SetInput(), and Update().

◆ m_InputType

◆ m_JustActivate

bool ActionInput::m_JustActivate
private

Definition at line 28 of file ActionInput.c.

Referenced by ActionInput(), JustActivate(), and Update().

◆ m_MainItem

◆ m_Player

PlayerBase ActionInput::m_Player
private

Definition at line 31 of file ActionInput.c.

Referenced by NoIndicationActionInputBase::GetAction(), and Init().

◆ m_Priority

int ActionInput::m_Priority
private

Definition at line 23 of file ActionInput.c.

Referenced by ActionInput(), and GetPriority().

◆ m_Target


The documentation for this class was generated from the following file: