Arma Reforger Explorer
1.7.0.54
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
Toggle main menu visibility
Loading...
Searching...
No Matches
SCR_AnalyticsDelayedSend.c
Go to the documentation of this file.
1
[
EnumLinear
()]
2
enum
SCR_EAnalyticsDelayedState
3
{
4
INACTIVE
,
// outside this menu
5
IN_MENU
,
// inside this menu
6
OUT_MENU_WAITING
,
// we just closed the menu
7
OUT_MENU_SENDING
// it was a while since we closed the menu
8
}
9
10
class
SCR_AnalyticsDelayedSend
11
{
12
protected
static
const
int
ANALYTICS_DELAY_SECONDS
= 10;
13
protected
SCR_EAnalyticsDelayedState
m_eState
=
SCR_EAnalyticsDelayedState
.INACTIVE;
14
protected
bool
m_bIsAdditive
=
false
;
15
protected
float
m_fTimeSpentSeconds
= 0;
16
protected
float
m_fDelayLeftSeconds
= 0;
17
18
//------------------------------------------------------------------------------------------------
20
void
Start
()
21
{
22
m_bIsAdditive
=
m_eState
==
SCR_EAnalyticsDelayedState
.OUT_MENU_WAITING;
23
m_eState
=
SCR_EAnalyticsDelayedState
.IN_MENU;
24
if
(!
m_bIsAdditive
)
25
m_fTimeSpentSeconds
= 0;
26
}
27
28
//------------------------------------------------------------------------------------------------
30
void
Stop
()
31
{
32
m_eState
=
SCR_EAnalyticsDelayedState
.OUT_MENU_WAITING;
33
m_fDelayLeftSeconds
=
ANALYTICS_DELAY_SECONDS
;
34
}
35
36
//------------------------------------------------------------------------------------------------
39
bool
IsAdditive
()
40
{
41
return
m_bIsAdditive
;
42
}
43
44
//------------------------------------------------------------------------------------------------
47
void
Update
(
float
deltaSeconds)
48
{
49
switch
(
m_eState
)
50
{
51
case
SCR_EAnalyticsDelayedState
.INACTIVE:
52
break
;
53
54
case
SCR_EAnalyticsDelayedState
.IN_MENU:
55
m_fTimeSpentSeconds
+= deltaSeconds;
56
break
;
57
58
case
SCR_EAnalyticsDelayedState
.OUT_MENU_WAITING:
59
m_fDelayLeftSeconds
-= deltaSeconds;
60
if
(
m_fDelayLeftSeconds
<= 0)
61
m_eState
=
SCR_EAnalyticsDelayedState
.OUT_MENU_SENDING;
62
break
;
63
64
case
SCR_EAnalyticsDelayedState
.OUT_MENU_SENDING:
65
break
;
66
}
67
}
68
69
//------------------------------------------------------------------------------------------------
71
bool
IsReadyToSend
()
72
{
73
return
m_eState
==
SCR_EAnalyticsDelayedState
.OUT_MENU_SENDING;
74
}
75
76
//------------------------------------------------------------------------------------------------
78
void
ResetReadyToSend
()
79
{
80
m_eState
=
SCR_EAnalyticsDelayedState
.INACTIVE;
81
}
82
83
//------------------------------------------------------------------------------------------------
86
int
GetTimeSpent
()
87
{
88
return
Math
.Round(
m_fTimeSpentSeconds
);
89
}
90
}
m_eState
EAITargetClusterState m_eState
Definition
SCR_AITargetClusterState.c:24
Start
void Start()
Start this tracking time in this menu, adds it to previous time if we have not yet sended previous da...
Definition
SCR_AnalyticsDelayedSend.c:20
GetTimeSpent
int GetTimeSpent()
Definition
SCR_AnalyticsDelayedSend.c:86
IsAdditive
bool IsAdditive()
Definition
SCR_AnalyticsDelayedSend.c:39
ANALYTICS_DELAY_SECONDS
enum SCR_EAnalyticsDelayedState ANALYTICS_DELAY_SECONDS
IsReadyToSend
bool IsReadyToSend()
Should we send our data already?
Definition
SCR_AnalyticsDelayedSend.c:71
SCR_EAnalyticsDelayedState
SCR_EAnalyticsDelayedState
Definition
SCR_AnalyticsDelayedSend.c:3
IN_MENU
@ IN_MENU
Definition
SCR_AnalyticsDelayedSend.c:5
OUT_MENU_SENDING
@ OUT_MENU_SENDING
Definition
SCR_AnalyticsDelayedSend.c:7
OUT_MENU_WAITING
@ OUT_MENU_WAITING
Definition
SCR_AnalyticsDelayedSend.c:6
ResetReadyToSend
void ResetReadyToSend()
We have sended our data, reset.
Definition
SCR_AnalyticsDelayedSend.c:78
m_bIsAdditive
bool m_bIsAdditive
Definition
SCR_AnalyticsDelayedSend.c:14
m_fTimeSpentSeconds
float m_fTimeSpentSeconds
Definition
SCR_AnalyticsDelayedSend.c:15
m_fDelayLeftSeconds
float m_fDelayLeftSeconds
Definition
SCR_AnalyticsDelayedSend.c:16
EnumLinear
SCR_CampaignSeizingComponent SCR_SeizingComponent EnumLinear()] enum SCR_EBaseCaptureState
Definition
SCR_CampaignSeizingComponent.c:333
Math
Definition
Math.c:13
Stop
void Stop()
Stop tracking time in this menu, prepare for sending data.
Definition
SCR_AnalyticsDelayedSend.c:30
INACTIVE
@ INACTIVE
body is not simulated (sleeps)
Definition
ActiveState.c:18
Update
@ Update
Definition
SndComponentCallbacks.c:14
scripts
Game
DataCollection
ApplicationData
SCR_AnalyticsDelayedSend.c
Generated by
1.17.0