Arma Reforger Explorer 1.7.0.54
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
Loading...
Searching...
No Matches
SCR_DataCollectorModule.c
Go to the documentation of this file.
3{
5
6 protected float m_fTimeSinceUpdate = 0;
7 [Attribute("1", UIWidgets.Slider, desc: "Seconds between updates of the module")]
9
10 //***************************//
11 /* OVERRIDDEN BY ALL MODULES */
12 //***************************//
13
14 //------------------------------------------------------------------------------------------------
15 void Update(float timeTick);
16
17 //***********************************************************//
18 /* OVERRIDDEN BY SOME MODULES BUT CALLING THEIR SUPER METHOD */
19 //***********************************************************//
20
21 //------------------------------------------------------------------------------------------------
22 void OnPlayerDisconnected(int playerID, IEntity controlledEntity = null)
23 {
24 if (!controlledEntity)
25 controlledEntity = GetGame().GetPlayerManager().GetPlayerControlledEntity(playerID);
26
27 if (controlledEntity)
28 RemoveInvokers(controlledEntity);
29 }
30
31 //------------------------------------------------------------------------------------------------
32 protected void AddInvokers(IEntity player);
33
34 //------------------------------------------------------------------------------------------------
35 protected void RemoveInvokers(IEntity player);
36
37 //------------------------------------------------------------------------------------------------
38 void OnPlayerSpawned(int playerID, IEntity controlledEntity)
39 {
40 AddInvokers(controlledEntity);
41 }
42
43 //***********************************************************//
44 /* OVERRIDDEN BY SOME MODULES BUT CALLING THEIR SUPER METHOD */
45 /************ (unless the call is very specific) *************/
46 //***********************************************************//
47
48 //------------------------------------------------------------------------------------------------
49 void OnPlayerAuditSuccess(int playerID);
50
51 //------------------------------------------------------------------------------------------------
52 void OnPlayerKilled(int playerId, IEntity playerEntity, IEntity killerEntity, notnull Instigator instigator, notnull SCR_InstigatorContextData instigatorContextData);
53
54 //------------------------------------------------------------------------------------------------
55 void OnAIKilled(IEntity AIEntity, IEntity killerEntity, notnull Instigator instigator, notnull SCR_InstigatorContextData instigatorContextData);
56
57 //------------------------------------------------------------------------------------------------
59
60 //------------------------------------------------------------------------------------------------
61 void InitModule();
62
63 //*****************//
64 /* NEVER OVERRIDDEN*/
65 //*****************//
66
67 //------------------------------------------------------------------------------------------------
69 {
70 //If the previous entity exists, remove the invokers from it
71 if (from)
72 RemoveInvokers(from);
73
74 //If there's no entity yet we can assume the player disconnected or it hasn't spawned.
75 //In this case we do nothing and keep listening to the spawn invoker.
76 //Otherwise, we add the invokers to the 'to' entity
77 if (to)
78 AddInvokers(to);
79 }
80
81 //************************************************************************//
82 /*********************** CREATED ONLY FOR PROTOTYPE ***********************/
83 /* These create a textwidget on screen with the stats updated dynamically */
84 //************************************************************************//
85 //************************************************************************//
86
87#ifdef ENABLE_DIAG
88 //------------------------------------------------------------------------------------------------
89 void CreateVisualization()
90 {
92 }
93
94 //------------------------------------------------------------------------------------------------
95 protected void CreateEntry(string text, float value, int id)
96 {
97 if (!m_StatsVisualization || !GetGame().GetDataCollector() || !GetGame().GetDataCollector().GetUIHandler())
98 return;
99
100 Widget entry = GetGame().GetDataCollector().GetUIHandler().CreateEntry();
101
102 if (!entry)
103 {
104 Print("UI handler from DataCollector couldn't create a visual widget", LogLevel.ERROR);
105 return;
106 }
107
108 TextWidget StatName = TextWidget.Cast(entry.FindAnyWidget("StatName"));
109 TextWidget StatValue = TextWidget.Cast(entry.FindAnyWidget("StatValue"));
110 if (!StatName || !StatValue)
111 {
112 Print("StatName or StatValue textwidgets could not be found in data collector ui handler's layout", LogLevel.ERROR);
113 return;
114 }
115
116 StatName.SetText(text); StatValue.SetText(value.ToString());
117 m_StatsVisualization.Insert(id, StatValue);
118 }
119#endif
120};
ArmaReforgerScripted GetGame()
Definition game.c:1398
SCR_DataCollectorComponent GetDataCollector()
Definition game.c:110
SCR_AIAnimation_Loitering BaseContainerProps
Commanding menu commanding element class.
UI Textures DeployMenu Briefing conflict_HintBanner_1_UI desc
void OnAIKilled(IEntity AIEntity, IEntity killerEntity, notnull Instigator instigator, notnull SCR_InstigatorContextData instigatorContextData)
void OnPlayerKilled(int playerId, IEntity playerEntity, IEntity killerEntity, notnull Instigator instigator, notnull SCR_InstigatorContextData instigatorContextData)
void OnPlayerSpawned(int playerID, IEntity controlledEntity)
void RemoveInvokers(IEntity player)
void AddInvokers(IEntity player)
void Update(float timeTick)
void OnControlledEntityChanged(IEntity from, IEntity to)
void OnPlayerDisconnected(int playerID, IEntity controlledEntity=null)
void OnPlayerAuditSuccess(int playerID)
ref map< int, TextWidget > m_StatsVisualization
Definition Types.c:486
proto void Print(void var, LogLevel level=LogLevel.NORMAL)
Prints content of variable to console/log.
LogLevel
Enum with severity of the logging message.
Definition LogLevel.c:14
SCR_FieldOfViewSettings Attribute