Arma Reforger Explorer 1.7.0.54
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
Loading...
Searching...
No Matches
SCR_AnalyticsDataCollectionVoNDataModule.c
Go to the documentation of this file.
3{
5
6 //------------------------------------------------------------------------------------------------
7 protected override void Enable()
8 {
9 super.Enable();
10
11 SCR_VoNComponent.GetOnVoNUsed().Insert(OnVoNUsed);
12 }
13
14 //------------------------------------------------------------------------------------------------
15 protected override void Disable()
16 {
17 super.Enable();
18
19 SCR_VoNComponent.GetOnVoNUsed().Remove(OnVoNUsed);
20 }
21
22 //------------------------------------------------------------------------------------------------
23 override void OnPlayerConnected(int playerId)
24 {
25 if (m_mPlayerVoNActivation.Contains(playerId))
26 return;
27
28 m_mPlayerVoNActivation.Insert(playerId, false);
29 }
30
31 //------------------------------------------------------------------------------------------------
32 override void OnPlayerDisconnected(int playerId, KickCauseCode cause, IEntity controlledEntity = null)
33 {
34 super.OnPlayerDisconnected(playerId, cause, controlledEntity);
35
36 m_mPlayerVoNActivation.Remove(playerId);
37 }
38
39 //------------------------------------------------------------------------------------------------
40 protected void OnVoNUsed(int playerId)
41 {
42 if (m_mPlayerVoNActivation.Get(playerId))
43 return;
44
45 m_mPlayerVoNActivation.Set(playerId, true);
46
47 SCR_PlayerData playerData = SCR_PlayerData.GetPlayerData(playerId);
48 if (!playerData)
49 return;
50
51 playerData.dataEvent.is_verbal_comm = true;
52 }
53
54 #ifdef ENABLE_DIAG
55 //------------------------------------------------------------------------------------------------
56 override void DrawContent()
57 {
58 if (!m_bIsEnabled)
59 {
60 DbgUI.Text("Module disabled!");
61 return;
62 }
63
64 foreach (int playerID, bool usedVoN : m_mPlayerVoNActivation)
65 {
66 string playerName = GetGame().GetPlayerManager().GetPlayerName(playerID);
67 DbgUI.Text(string.Format("Player %1 - %2 used VoN communication = %3", playerID, playerName, usedVoN));
68 }
69 }
70 #endif
71
72 //------------------------------------------------------------------------------------------------
74 {
75 Disable();
76 }
77}
ArmaReforgerScripted GetGame()
Definition game.c:1398
SCR_AIAnimation_Loitering BaseContainerProps
Commanding menu commanding element class.
Definition DbgUI.c:66
override void OnPlayerDisconnected(int playerId, KickCauseCode cause, IEntity controlledEntity=null)
ref SCR_PlayerDataEvent dataEvent
static SCR_PlayerData GetPlayerData(int playerID)
Definition Types.c:486