DayZ 1.27
DayZ Explorer by KGB
 
Загрузка...
Поиск...
Не найдено
ActionManagerBase.c
См. документацию.
1class TSelectableActionInfoArray extends array<ref TSelectableActionInfo>
2{
3 bool IsSameAs(TSelectableActionInfoArray other)
4 {
5 if (this.Count() != other.Count())
6 {
7 return false;
8 }
9
10 for (int i = 0; i < Count(); ++i)
11 {
12 TSelectableActionInfo ai1 = this.Get(i);
13 TSelectableActionInfo ai2 = other.Get(i);
14
15 if (ai1.param2 != ai2.param2)
16 {
17 return false;
18 }
19
20 if (ai1.param3 != ai2.param3)
21 {
22 return false;
23 }
24 }
25
26 return true;
27 }
28}
29
31{
33
36
46 ref TSelectableActionInfoArray m_SelectableActions;
52 protected bool m_ActionWantEndRequest;
53 protected bool m_ActionInputWantEnd;
54 protected bool m_ActionsEnabled;
55 protected bool m_ActionsAvaibale;
56 protected bool m_IsRestrictedLookLimits; // restricts head look/aim limits while performing an action
57
58 //Pending actions waiting for acknowledgment
60
62
64 {
65 m_Player = player;
66 if (m_Player)
67 {
68 m_SelectableActions = new TSelectableActionInfoArray();
71
73
75 m_Interrupted = false;
76
78 if (!m_ActionsArray)
79 {
81 }
82
85 }
86
87 m_ActionsEnabled = true;
88 m_ActionsAvaibale = true;
89 }
90
92 {
94 return m_CurrentActionData.m_Action;
95
96 return null;
97 }
98
100 {
102 return m_CurrentActionData.m_MainItem;
103
104 return null;
105 }
106
107 void EnableActions(bool enable)
108 {
109 m_ActionsEnabled = enable;
110 }
111
112 void Update(int pCurrentCommandID)
113 {
115 {
116 if (m_Interrupted)
117 {
119 }
121 {
122 m_CurrentActionData.m_Action.OnUpdate(m_CurrentActionData);
123 }
124 }
125 else if (m_Interrupted)
126 {
127 m_Interrupted = false;
128 }
129
130 if (m_CurrentActionData) // again, can be nulled meanwhile
131 {
133 if (action && action.IsFullBody(m_Player) && action.IsCameraLockOnPerform())
134 {
136 {
137 Vector2 angleUD = action.GetCameraUDAngle();
138
140 m_Player.SetLookLimits(angleUD.x, angleUD.y, -160, 160);
141 m_Player.SetAimLimits(angleUD.x, angleUD.y, -180, 180);
142 }
143
144 return;
145 }
146 }
147
149 {
151 m_Player.SetLookLimits(-85, 85, -160, 160);
152 m_Player.SetAimLimits(-85, 85, -180, 180);
153 }
154 }
155
156 void OnSyncJuncture(int pJunctureID, ParamsReadContext pCtx)
157 {
158 int AcknowledgmentID;
159 switch (pJunctureID)
160 {
162 pCtx.Read(AcknowledgmentID);
163 if (m_CurrentActionData && AcknowledgmentID == m_PendingActionAcknowledgmentID)
165 break;
167 pCtx.Read(AcknowledgmentID);
168 if (m_CurrentActionData && AcknowledgmentID == m_PendingActionAcknowledgmentID)
170 break;
172 m_Interrupted = true;
173 break;
174 }
175 }
176
179
180 static ActionBase GetActionVariant(typename actionName)
181 {
183 {
184 ActionBase base_action = m_ActionNameActionMap.Get(actionName);
185 ActionBase new_action = ActionBase.Cast(actionName.Spawn());
186
187 new_action.CreateConditionComponents();
188 new_action.SetID(base_action.GetID());
189 new_action.SetInput(base_action.GetInput());
190
191 return new_action;
192 }
193 return null;
194 }
195
196 static ActionBase GetAction(typename actionName)
197 {
199 return m_ActionNameActionMap.Get(actionName);
200
201 return null;
202 }
203
204 static ActionBase GetAction(int actionID)
205 {
206 return m_ActionsArray.Get(actionID);
207 }
208
213
218
219 TSelectableActionInfoArray GetSelectableActions()
220 {
221 return m_SelectableActions;
222 }
223
225 {
227 }
228
233 void SelectNextAction();
234 void SelectPrevAction();
237
242
243 //------------------------------------------------------
244 bool ActionPossibilityCheck(int pCurrentCommandID)
245 {
246 if (!m_ActionsEnabled || m_Player.IsSprinting() || m_Player.IsUnconscious() || m_Player.GetCommandModifier_Action() || m_Player.GetCommand_Action() || m_Player.IsEmotePlaying())
247 return false;
248
249 if (m_Player.GetWeaponManager().IsRunning() || m_Player.GetThrowing().IsThrowingAnimationPlaying() || m_Player.GetDayZPlayerInventory().IsProcessing() || m_Player.IsItemsToDelete() || m_Player.IsRolling())
250 return false;
251
252 return (pCurrentCommandID == DayZPlayerConstants.COMMANDID_ACTION || pCurrentCommandID == DayZPlayerConstants.COMMANDID_MOVE || pCurrentCommandID == DayZPlayerConstants.COMMANDID_SWIM || pCurrentCommandID == DayZPlayerConstants.COMMANDID_LADDER || pCurrentCommandID == DayZPlayerConstants.COMMANDID_VEHICLE);
253 }
254 //------------------------------------------------------
255 protected void SetActionContext(ActionTarget target, ItemBase item)
256 {
257 m_TestedActionTarget = target;
258 m_TestedActionItem = item;
259 }
260
261 //------------------------------------------------------
262
264 {
266 {
267 return m_CurrentActionData.m_State;
268 }
269 return UA_NONE;
270 }
271
272 //---------------------------------
273 // EVENTS
274 //---------------------------------
278
280 {
281 m_Interrupted = true;
282 }
283
285 {
287 {
288 if(GetGame().IsMultiplayer())
289 {
291 }
292 else
293 {
295 }
296 }
297 }
299
300 protected void LocalInterrupt()
301 {
303 m_CurrentActionData.m_Action.Interrupt(m_CurrentActionData);
304 else
305 m_Interrupted = false;
306 }
307
308 void OnInteractAction(); //Interact
309 void OnInstantAction(typename user_action_type, Param data = null);
310
312 {
314 {
316 Debug.ActionLog("Time stamp: " + m_CurrentActionData.m_Player.GetSimulationTimeStamp(), m_CurrentActionData.m_Action.ToString() , "n/a", "OnActionEnd", m_CurrentActionData.m_Player.ToString());
317 Debug.ActionLog("Action data cleared ", this.ToString() , "n/a", "ActionEnd", m_CurrentActionData.m_Player.ToString());
318 }
320 m_CurrentActionData.m_Action.ActionCleanup(m_CurrentActionData);
321 m_CurrentActionData = NULL;
322
323 m_Player.ResetActionEndInput();
324 }
325
328
329 bool OnInputUserDataProcess(int userDataType, ParamsReadContext ctx)
330 {
331 return false;
332 }
333
335 {
337 return m_CurrentActionData.m_Action.GetProgress(m_CurrentActionData);
338
339 return 0.0;
340 }
341
343 {
345 return m_CurrentActionData.m_Action.GetProgressWidgetMultiplier(m_CurrentActionData);
346
347 return 1;
348 }
349
351 {
353 return m_CurrentActionData.m_Action.GetState(m_CurrentActionData);
354
355 return UA_NONE;
356 }
357
358 ActionReciveData GetReciveData()
359 {
360 return null;
361 }
362}
Param3 TSelectableActionInfo
ActionBase ActionData
Определения ActionBase.c:30
override ActionBase GetAction()
Определения ActionInput.c:483
override void SelectNextAction()
Определения ActionInput.c:496
override void SelectPrevAction()
Определения ActionInput.c:508
bool m_Interrupted
Определения ActionManagerBase.c:49
void RequestInterruptAction()
ItemBase m_SecondaryActionItem
Определения ActionManagerBase.c:42
ref ActionData m_CurrentActionData
Определения ActionManagerBase.c:61
ActionBase m_SecondaryAction
Определения ActionManagerBase.c:40
ActionTarget m_PrimaryActionTarget
Определения ActionManagerBase.c:38
bool m_TertiaryActionEnabled
Определения ActionManagerBase.c:45
void SelectFirstActionCategory()
void SetActionContext(ActionTarget target, ItemBase item)
Определения ActionManagerBase.c:255
bool IsSelectableActionsChanged()
Определения ActionManagerBase.c:238
bool m_ActionsEnabled
Определения ActionManagerBase.c:54
ItemBase GetRunningActionMainitem()
Определения ActionManagerBase.c:99
GetSelectedActionCategory()
int GetActionState()
Определения ActionManagerBase.c:350
ActionTarget m_TestedActionTarget
Определения ActionManagerBase.c:34
ActionBase GetContinuousAction()
Определения ActionManagerBase.c:209
void LocalInterrupt()
Определения ActionManagerBase.c:300
bool m_SelectableActionsHasChanged
Определения ActionManagerBase.c:48
void OnActionEnd()
Определения ActionManagerBase.c:311
void SelectNextActionCategory()
int GetSelectedActionIndex()
Определения ActionManagerBase.c:224
ActionTarget m_SecondaryActionTarget
Определения ActionManagerBase.c:41
bool m_ActionsAvaibale
Определения ActionManagerBase.c:55
void OnInstantAction(typename user_action_type, Param data=null)
static ActionBase GetActionVariant(typename actionName)
Определения ActionManagerBase.c:180
void OnContinuousCancel()
void EnableActions(bool enable)
Определения ActionManagerBase.c:107
ActionTarget FindActionTarget()
float GetACProgressWidgetMultiplier()
Определения ActionManagerBase.c:342
int m_SelectedActionIndex
Определения ActionManagerBase.c:47
void SelectPrevActionCategory()
void InterruptNoSync()
Определения ActionManagerBase.c:279
ActionBase GetSingleUseAction()
Определения ActionManagerBase.c:214
void OnSingleUse()
void OnContinuousStart()
bool m_IsRestrictedLookLimits
Определения ActionManagerBase.c:56
bool m_SecondaryActionEnabled
Определения ActionManagerBase.c:44
bool m_ActionInputWantEnd
Определения ActionManagerBase.c:53
TSelectableActionInfoArray GetSelectableActions()
Определения ActionManagerBase.c:219
void RequestEndAction()
bool ActionPossibilityCheck(int pCurrentCommandID)
Определения ActionManagerBase.c:244
void OnInteractAction()
ref TSelectableActionInfoArray m_SelectableActions
Определения ActionManagerBase.c:46
void EndOrInterruptCurrentAction()
void EndActionInput()
static ref array< ref ActionBase > m_ActionsArray
Определения ActionManagerBase.c:50
float GetActionComponentProgress()
Определения ActionManagerBase.c:334
ActionReciveData GetReciveData()
Определения ActionManagerBase.c:358
void ActionManagerBase(PlayerBase player)
Определения ActionManagerBase.c:63
ItemBase m_TestedActionItem
Определения ActionManagerBase.c:35
void Interrupt()
Определения ActionManagerBase.c:284
void StartDeliveredAction()
int m_PendingActionAcknowledgmentID
Определения ActionManagerBase.c:59
bool m_PrimaryActionEnabled
Определения ActionManagerBase.c:43
bool m_ActionWantEndRequest
Определения ActionManagerBase.c:52
void OnJumpStart()
ItemBase m_PrimaryActionItem
Определения ActionManagerBase.c:39
static ref map< typename, ActionBase > m_ActionNameActionMap
Определения ActionManagerBase.c:51
ActionBase m_PrimaryAction
Определения ActionManagerBase.c:37
class ActionTargets ActionTarget
map
Определения ControlsXboxNew.c:4
bool OnInputUserDataProcess(int userDataType, ParamsReadContext ctx)
Определения EmoteManager.c:500
void OnSyncJuncture(int pJunctureID, ParamsReadContext pCtx)
Определения EmoteManager.c:532
proto string ToString()
DayZPlayer m_Player
Определения Hand_Events.c:42
override float Get()
Определения PlayerStatBase.c:134
@ Count
Определения RandomGeneratorSyncManager.c:8
int GetID()
Определения ActionBase.c:1321
void SetID(int actionId)
Определения ActionBase.c:1316
ActionInput GetInput()
Определения ActionBase.c:1311
void SetInput(ActionInput ai)
Определения ActionBase.c:220
void CreateConditionComponents()
Определения ActionBase.c:230
bool IsFullBody(PlayerBase player)
Определения ActionBase.c:708
Определения ActionBase.c:53
bool ConstructActions(out array< ref ActionBase > actionsArray, out map< typename, ActionBase > actionNameActionMap)
Определения ActionConstructor.c:3
Vector2 GetCameraUDAngle()
Определения ActionContinuousBase.c:165
bool IsCameraLockOnPerform()
Определения ActionContinuousBase.c:158
static const int SJ_ACTION_INTERRUPT
Определения DayZPlayerSyncJunctures.c:8
static const int SJ_ACTION_ACK_REJECT
Определения DayZPlayerSyncJunctures.c:13
static const int SJ_ACTION_ACK_ACCEPT
Определения DayZPlayerSyncJunctures.c:12
static void ActionLog(string message=LOG_DEFAULT, string plugin=LOG_DEFAULT, string author=LOG_DEFAULT, string label=LOG_DEFAULT, string entity=LOG_DEFAULT)
Определения Debug.c:127
Определения Debug.c:2
Определения InventoryItem.c:731
static bool IsActionLogEnable()
Определения Debug.c:638
Определения Debug.c:594
Base Param Class with no parameters. Used as general purpose parameter overloaded with Param1 to Para...
Определения param.c:12
Определения PlayerBaseClient.c:2
proto bool Read(void value_in)
float x
Определения Vector2.c:9
float y
Определения Vector2.c:10
Определения Vector2.c:2
bool IsSameAs(TSelectableActionInfoArray other)
Определения ActionManagerBase.c:3
Result for an object found in CGame.IsBoxCollidingGeometryProxy.
DayZPlayerConstants
defined in C++
Определения dayzplayer.c:602
Serializer ParamsReadContext
Определения gameplay.c:15
proto native CGame GetGame()
static proto string ToString(void var, bool type=false, bool name=false, bool quotes=true)
Return string representation of variable.
const int UA_AM_ACCEPTED
Определения constants.c:475
const int UA_AM_REJECTED
Определения constants.c:476
const int UA_NONE
Определения constants.c:460
const int UA_AM_PENDING
Определения constants.c:474
proto native volatile void Update()
Определения PlayerSoundManager.c:125
proto native int GetRunningAction()
returns -1 when no action is running or RELOAD,MECHANISM, ....
Определения ActionManagerBase.c:91