DayZ 1.24
Loading...
Searching...
No Matches
CAContinuousTime.c
Go to the documentation of this file.
2{
3 protected float m_LocalTimeElpased;
4 protected float m_TimeElpased;
5 protected float m_AdjustedTimeToComplete;
6 protected float m_DefaultTimeToComplete;
8
13
15 {
16 m_TimeElpased = 0;
17 if (!m_SpentUnits)
19 else
20 m_SpentUnits.param1 = 0;
21
22 m_AdjustedTimeToComplete = action_data.m_Player.GetSoftSkillsManager().SubtractSpecialtyBonus(m_DefaultTimeToComplete, m_Action.GetSpecialtyWeight(), true);
23 }
24
26 {
27 if (m_DefaultTimeToComplete < 0) //for infinite actions
28 return UA_PROCESSING;
29
30 if (!action_data.m_Player)
31 return UA_ERROR;
32
34 {
35 m_TimeElpased += action_data.m_Player.GetDeltaT();
36 return UA_PROCESSING;
37 }
38 else
39 {
40 if (m_SpentUnits)
41 {
44 }
46 return UA_FINISHED;
47 }
48 }
49
51 {
52 if (m_SpentUnits)
53 {
56 }
57 if (m_DefaultTimeToComplete < 0) //for infinite actions
58 return UA_FINISHED;
59
60 return UA_CANCEL;
61 }
62
63 override float GetProgress()
64 {
66 {
67 //progress = m_TimeElpased/m_AdjustedTimeToComplete;
69 }
70 else
71 Print("USER ACTION COMPONENT CONTINUOUS TIME - WRONG TIME TO COMPLETE CALCULATION - Incorrect data for progress bar!");
72 return 1;
73 }
74
75};
void SetACData(Param units)
Definition CABase.c:38
ActionBase m_Action
Definition CABase.c:3
void OnCompletePogress(ActionData action_data)
override int Execute(ActionData action_data)
ref Param1< float > m_SpentUnits
override void Setup(ActionData action_data)
void CAContinuousTime(float time_to_complete_action)
override float GetProgress()
override int Cancel(ActionData action_data)
proto void Print(void var)
Prints content of variable to console/log.
const int UA_FINISHED
Definition constants.c:436
const int UA_ERROR
Definition constants.c:455
const int UA_PROCESSING
Definition constants.c:434
const int UA_CANCEL
Definition constants.c:437