DayZ 1.24
Loading...
Searching...
No Matches
PluginItemDiagnostic.c File Reference

Go to the source code of this file.

Classes

class  ScriptedWidgetEventHandler
 map: item x vector(index, width, height) More...
 

Functions

void PluginItemDiagnostic ()
 
void ~PluginItemDiagnostic ()
 
override void OnInit ()
 
bool OnMouseButtonDown (Widget w, int x, int y, int button)
 
bool OnMouseButtonUp (Widget w, int x, int y, int button)
 
void SetDragging (bool enable)
 
void OnDraggingStart ()
 
void OnDraggingEnd ()
 
bool OnClick (Widget w, int x, int y, int button)
 
void RegisterDebugItem (Object item, PlayerBase player)
 
Object GetWatchedItem (PlayerBase player)
 
bool IsActive ()
 
void OnScriptMenuOpened (bool opened)
 
void ShowWidgets (bool show)
 
void OnSelectAction (EntityAI ent, int actionId)
 
void ReleaseFocus ()
 
void ToggleDebugWindowEvent ()
 
void ClearWidgets ()
 
void Tick ()
 
void ClearProperties ()
 
void GeneratePropertiesObject (EntityAI item)
 
void SendRPC (Object item, PlayerBase player)
 
void StopWatchRequest (PlayerBase player)
 
void OnRPC (Object entity, ParamsReadContext ctx)
 
void FillServerFinalVars (int count, ParamsReadContext ctx, array< ref Param > params)
 
void InitializeWidgets ()
 
override void OnUpdate (float delta_time)
 
void DisplayAll (EntityAI item, array< ref Param > vars_server, array< ref Param > vars_client, string debug_text_server)
 
void FillAgentArray (ParamsReadContext ctx, int agents_count)
 
void UpdateAgentWidget ()
 
void UpdateNumericalVarsWidget (array< ref Param > vars_server, array< ref Param > vars_client)
 
void PrintOut ()
 
void GetLocalProperties (EntityAI entity, array< ref Param > properties, bool client=false)
 
int FillWithAgents (ItemBase item, array< ref Param > properties)
 

Variables

class PluginItemDiagnosticEventHandler extends ScriptedWidgetEventHandler m_Entity
 
ref Timer myTimer1
 
ref map< PlayerBase, Objectm_ObserversMap = new map<PlayerBase, Object>
 
ref array< stringm_Agents = new array<string>
 
ref map< string, floatm_Floats = new map<string, float>
 
ref map< string, floatm_VarsNumbersFinalServer = new map<string, float>
 
ref map< string, floatm_VarsFinalClient = new map<string, float>
 
ref array< ref Paramm_Properties = new array<ref Param>
 
bool m_IsActive = false
 
bool m_ScriptMenuOpened
 
string m_NoteClient
 
ref PluginItemDiagnosticEventHandler m_EventHandler
 
bool m_IsDragging
 
PluginConfigDebugProfile m_ConfigDebugProfile
 
Widget m_DebugRootWidget
 
Widget m_FrameWidget
 
TextListboxWidget m_DebugAgentListWidget
 
TextWidget m_DebugOutputServer
 
TextWidget m_DebugOutputClient
 
TextListboxWidget m_DebugFloatsProperListWidget
 
TextListboxWidget m_DebugClientVarsWidget
 
TextWidget m_ClassNameWidget
 
TextWidget m_DistanceWidget
 
ItemPreviewWidget m_ItemPreviewWidget
 
ButtonWidget m_DebugButtonWidget1
 
ButtonWidget m_DebugButtonWidget2
 
ButtonWidget m_DebugButtonWidget3
 
ButtonWidget m_DebugButtonWidget4
 
ButtonWidget m_CloseButton
 
Shape m_ItemLine
 
vector m_DraggingOffset
 

Function Documentation

◆ ClearProperties()

void ClearProperties ( )

Definition at line 296 of file PluginItemDiagnostic.c.

297 {
298 m_Properties.Clear();
299 }
ref array< ref Param > m_Properties

References m_Properties.

Referenced by GeneratePropertiesObject(), and ~PluginItemDiagnostic().

◆ ClearWidgets()

void ClearWidgets ( )

Definition at line 265 of file PluginItemDiagnostic.c.

266 {
267 m_DebugAgentListWidget.ClearItems();
268 m_DebugOutputServer.SetText("");
269 m_DebugOutputClient.SetText("");
272 m_ClassNameWidget.SetText("");
273 }
TextWidget m_ClassNameWidget
TextListboxWidget m_DebugFloatsProperListWidget
TextWidget m_DebugOutputClient
ItemPreviewWidget m_ItemPreviewWidget
TextListboxWidget m_DebugAgentListWidget
TextWidget m_DebugOutputServer
proto native void SetItem(EntityAI object)

References m_ClassNameWidget, m_DebugAgentListWidget, m_DebugFloatsProperListWidget, m_DebugOutputClient, m_DebugOutputServer, m_ItemPreviewWidget, and ItemPreviewWidget::SetItem().

Referenced by ToggleDebugWindowEvent().

◆ DisplayAll()

void DisplayAll ( EntityAI item,
array< ref Param > vars_server,
array< ref Param > vars_client,
string debug_text_server )

Definition at line 455 of file PluginItemDiagnostic.c.

456 {
457 m_ClassNameWidget.SetText(item.GetType());
460 //UpdateFloatWidget();
464 m_DebugOutputClient.SetText(item.GetDebugText());
465
466 /*
467 string button1, button2, button3, button4;
468 item.GetDebugButtonNames(button1, button2, button3, button4);
469 m_DebugButtonWidget1.SetText(button1);
470 m_DebugButtonWidget2.SetText(button2);
471 m_DebugButtonWidget3.SetText(button3);
472 m_DebugButtonWidget4.SetText(button4);
473 */
474
475
476 }
void UpdateNumericalVarsWidget(array< ref Param > vars_server, array< ref Param > vars_client)
void UpdateAgentWidget()

References m_ClassNameWidget, m_DebugOutputClient, m_DebugOutputServer, m_ItemPreviewWidget, ItemPreviewWidget::SetItem(), UpdateAgentWidget(), and UpdateNumericalVarsWidget().

Referenced by OnRPC().

◆ FillAgentArray()

void FillAgentArray ( ParamsReadContext ctx,
int agents_count )

Definition at line 478 of file PluginItemDiagnostic.c.

479 {
480 m_Agents.Clear();
481 for (int i = 0; i < agents_count; i++)
482 {
484 {
486 m_Agents.Insert(agent);
487 }
488 }
489 }
ref array< string > m_Agents
static ref Param1< string > PARAM1_STRING

References m_Agents, and CachedObjectsParams::PARAM1_STRING.

Referenced by OnRPC().

◆ FillServerFinalVars()

void FillServerFinalVars ( int count,
ParamsReadContext ctx,
array< ref Param > params )

Definition at line 374 of file PluginItemDiagnostic.c.

375 {
376 for (int i = 0; i < count; i++)
377 {
379
380 ctx.Read(p2);
381 /*
382 string name = CachedObjectsParams.PARAM2_STRING_FLOAT.param1;
383 float value = CachedObjectsParams.PARAM2_STRING_FLOAT.param2;
384 PrintString(name+","+value.ToString());
385 */
386 params.Insert(p2);
387 }
388 //PrintString("----------------------------------------------------");
389 }

Referenced by OnRPC().

◆ FillWithAgents()

int FillWithAgents ( ItemBase item,
array< ref Param > properties )

Definition at line 603 of file PluginItemDiagnostic.c.

604 {
605 if (!item)
606 return 0;
607 int agents = item.GetAgents();
608 if (agents == 0) return 0;
609 int num_of_agents = 0;
611 PluginTransmissionAgents.BuildAgentArray(agents, agents_aray);
612 int agents_count = agents_aray.Count();
613
614 for (int i = 0; i < agents_count; i++)
615 {
616 //PluginTransmissionAgents mta = PluginTransmissionAgents.Cast(GetPlugin(PluginTransmissionAgents));
617 string agent_name = PluginTransmissionAgents.GetNameByID(agents_aray.Get(i));
619 properties.Insert(param1);
621 }
622
623 return num_of_agents;
624 }

Referenced by GetLocalProperties().

◆ GeneratePropertiesObject()

void GeneratePropertiesObject ( EntityAI item)

Definition at line 302 of file PluginItemDiagnostic.c.

303 {
306
307 }
void GetLocalProperties(EntityAI entity, array< ref Param > properties, bool client=false)
void ClearProperties()

References ClearProperties(), GetLocalProperties(), and m_Properties.

Referenced by Tick().

◆ GetLocalProperties()

void GetLocalProperties ( EntityAI entity,
array< ref Param > properties,
bool client = false )

Definition at line 531 of file PluginItemDiagnostic.c.

532 {
533 if (!entity)
534 return;
536
537 if (!client)
538 {
539 // -------- DEBUG OUTPUT ------
540 Param1<string> debug_output = new Param1<string>(entity.GetDebugText());
541 properties.Insert(debug_output);
542 if (!item)
543 return;
544 // -------- AGENTS ------------
547 properties.InsertAt(agents_count, 1); // hard coded index 1 !!
548 }
549 if (!item)
550 return;
551 // ------ INDIVIDUAL VARS------
552 int number_of_items = 0;
553 Param2<string, float> quantity = new Param2<string, float>("quantity", item.GetQuantity());
554 properties.Insert(quantity);
556 //-----------------------------
557 Param2<string, float> liquid_type = new Param2<string, float>("liquid_type", item.GetLiquidType());
558 properties.Insert(liquid_type);
560 //-----------------------------
561 Param2<string, float> wetness = new Param2<string, float>("wetness", item.GetWet());
562 properties.Insert(wetness);
564 //-----------------------------
565 Param2<string, float> temperature = new Param2<string, float>("temperature", item.GetTemperature());
566 properties.Insert(temperature);
568 //-----------------------------
569 Param2<string, float> energy = new Param2<string, float>("energy", item.GetEnergy());
570 properties.Insert(energy);
572 //-----------------------------
574 if (!client)
575 health = new Param2<string, float>("health", item.GetHealth("", ""));
576 else
577 health = new Param2<string, float>("NO SYNC", 0);
578 properties.Insert(health);
580 //-----------------------------
581 int r, g, b, a;
582 item.GetColor(r, g, b, a);
584 properties.Insert(p2r);
587 properties.Insert(p2g);
590 properties.Insert(p2b);
593 properties.Insert(p2a);
595 //-----------------------------
596 if (!client)
597 {
599 properties.InsertAt(item_count, 2);
600 }
601 }
int FillWithAgents(ItemBase item, array< ref Param > properties)

References FillWithAgents().

Referenced by GeneratePropertiesObject(), and OnRPC().

◆ GetWatchedItem()

Object GetWatchedItem ( PlayerBase player)

Definition at line 198 of file PluginItemDiagnostic.c.

199 {
200 return m_ObserversMap.Get(player);
201 }
ref map< PlayerBase, Object > m_ObserversMap

References m_ObserversMap.

◆ InitializeWidgets()

void InitializeWidgets ( )

Definition at line 391 of file PluginItemDiagnostic.c.

392 {
394 m_EventHandler.m_Owner = this;
395
397 m_DebugRootWidget = GetGame().GetWorkspace().CreateWidgets("gui/layouts/debug/debug_item.layout");
398
400
401 m_FrameWidget = m_DebugRootWidget.FindAnyWidget("FrameWidget0");
402 m_DebugAgentListWidget = TextListboxWidget.Cast(m_DebugRootWidget.FindAnyWidget("w_Agents"));
403 m_DebugOutputServer = TextWidget.Cast(m_DebugRootWidget.FindAnyWidget("DebugOutputServer"));
404 m_DebugOutputClient = TextWidget.Cast(m_DebugRootWidget.FindAnyWidget("DebugOutputClient"));
405 m_DebugFloatsProperListWidget = TextListboxWidget.Cast(m_DebugRootWidget.FindAnyWidget("w_FloatsProper"));
406 m_ItemPreviewWidget = ItemPreviewWidget.Cast(m_DebugRootWidget.FindAnyWidget("w_ItemPreview"));
407 m_ClassNameWidget = TextWidget.Cast(m_DebugRootWidget.FindAnyWidget("w_ClassName"));
408 m_DistanceWidget = TextWidget.Cast(m_DebugRootWidget.FindAnyWidget("w_Distance"));
409
410 m_DebugButtonWidget1 = ButtonWidget.Cast(m_DebugRootWidget.FindAnyWidget("DebugButton1"));
411 m_DebugButtonWidget2 = ButtonWidget.Cast(m_DebugRootWidget.FindAnyWidget("DebugButton2"));
412 m_DebugButtonWidget3 = ButtonWidget.Cast(m_DebugRootWidget.FindAnyWidget("DebugButton3"));
413 m_DebugButtonWidget4 = ButtonWidget.Cast(m_DebugRootWidget.FindAnyWidget("DebugButton4"));
414
415 m_CloseButton = ButtonWidget.Cast(m_DebugRootWidget.FindAnyWidget("CloseButton"));
416 }
Widget m_DebugRootWidget
TextWidget m_DistanceWidget
ButtonWidget m_CloseButton
ButtonWidget m_DebugButtonWidget3
ButtonWidget m_DebugButtonWidget4
ButtonWidget m_DebugButtonWidget1
ref PluginItemDiagnosticEventHandler m_EventHandler
ButtonWidget m_DebugButtonWidget2
Widget m_FrameWidget
proto native CGame GetGame()

References GetGame(), m_ClassNameWidget, m_CloseButton, m_DebugAgentListWidget, m_DebugButtonWidget1, m_DebugButtonWidget2, m_DebugButtonWidget3, m_DebugButtonWidget4, m_DebugFloatsProperListWidget, m_DebugOutputClient, m_DebugOutputServer, m_DebugRootWidget, m_DistanceWidget, m_EventHandler, m_FrameWidget, and m_ItemPreviewWidget.

Referenced by PluginItemDiagnostic().

◆ IsActive()

bool IsActive ( )

Definition at line 204 of file PluginItemDiagnostic.c.

205 {
206 return m_IsActive;
207 }
bool m_IsActive

References m_IsActive.

◆ OnClick()

bool OnClick ( Widget w,
int x,
int y,
int button )

Definition at line 169 of file PluginItemDiagnostic.c.

170 {
171 SetDragging(false);
172
173 if (w == m_CloseButton)
174 {
176 return true;
177 }
178 return true;
179 }
void SetDragging(bool enable)
void ToggleDebugWindowEvent()

References m_CloseButton, SetDragging(), and ToggleDebugWindowEvent().

◆ OnDraggingEnd()

void OnDraggingEnd ( )

Definition at line 158 of file PluginItemDiagnostic.c.

159 {
161 {
162 float wx, wy;
163 m_DebugRootWidget.GetScreenPos(wx, wy);
164 m_ConfigDebugProfile.SetItemDebugPos(Vector(wx, wy, 0));
165 }
166 }
PluginConfigDebugProfile m_ConfigDebugProfile
proto native vector Vector(float x, float y, float z)
Vector constructor from components.

References m_ConfigDebugProfile, m_DebugRootWidget, and Vector().

Referenced by SetDragging().

◆ OnDraggingStart()

void OnDraggingStart ( )

Definition at line 148 of file PluginItemDiagnostic.c.

149 {
150 int mx, my;
151 float wx, wy;
152 GetMousePos(mx, my);
153 m_DebugRootWidget.GetScreenPos(wx, wy);
154 m_DraggingOffset[0] = wx - mx;
155 m_DraggingOffset[1] = wy - my;
156 }
vector m_DraggingOffset
proto void GetMousePos(out int x, out int y)

References GetMousePos(), m_DebugRootWidget, and m_DraggingOffset.

Referenced by SetDragging().

◆ OnInit()

override void OnInit ( )

Definition at line 101 of file PluginItemDiagnostic.c.

102 {
105 {
106 vector pos = m_ConfigDebugProfile.GetItemDebugPos();
107 if (m_DebugRootWidget && pos != vector.Zero)
108 {
109 float wx = pos[0];
110 float wy = pos[1];
111 m_DebugRootWidget.SetPos(wx, wy);
112 }
113 }
114 }
PluginBase GetPlugin(typename plugin_type)
static const vector Zero
Definition EnConvert.c:110

References GetPlugin(), m_ConfigDebugProfile, m_DebugRootWidget, and vector::Zero.

◆ OnMouseButtonDown()

bool OnMouseButtonDown ( Widget w,
int x,
int y,
int button )

Definition at line 116 of file PluginItemDiagnostic.c.

117 {
118 if (button == 0)
119 SetDragging(true);
120 if (button == 1)
121 {
122 if (m_Entity)
123 {
124 float xx, yy;
125 m_DebugRootWidget.GetPos(xx, yy);
126 ContextMenu.DisplayContextMenu(x - xx, y - yy, EntityAI.Cast(m_Entity), m_DebugRootWidget, this);
127 }
128 }
129 return true;
130 }
Icon x
Icon y
class PluginItemDiagnosticEventHandler extends ScriptedWidgetEventHandler m_Entity

References m_DebugRootWidget, m_Entity, SetDragging(), x, and y.

◆ OnMouseButtonUp()

bool OnMouseButtonUp ( Widget w,
int x,
int y,
int button )

Definition at line 132 of file PluginItemDiagnostic.c.

133 {
134 if (button == 0)
135 SetDragging(false);
136 return true;
137 }

References SetDragging().

◆ OnRPC()

void OnRPC ( Object entity,
ParamsReadContext ctx )

Definition at line 326 of file PluginItemDiagnostic.c.

327 {
328
329 if (!GetGame().IsMultiplayer())
331 else
333
335
336
337#ifdef DEVELOPER
339#endif
340 if (!IsActive())
341 ShowWidgets(true);
342
347 if (item)
348 {
349 ctx.Read(CachedObjectsParams.PARAM1_INT);//hardcoded to index 1
351
352 ctx.Read(CachedObjectsParams.PARAM1_INT);//hardcoded to index 2
354
356
359
362 }
363 if (EntityAI.Cast(entity))
365 if (GetDayZGame().IsInventoryOpen() || GetGame().GetUIManager().FindMenu(MENU_SCRIPTCONSOLE))
366 m_DebugRootWidget.SetSort(-1);
367 else
368 m_DebugRootWidget.SetSort(10);
369 m_DebugRootWidget.Show(true);
370
371
372 }
DayZGame GetDayZGame()
Definition DayZGame.c:3530
void ShowWidgets(bool show)
void FillServerFinalVars(int count, ParamsReadContext ctx, array< ref Param > params)
void FillAgentArray(ParamsReadContext ctx, int agents_count)
bool IsActive()
void DisplayAll(EntityAI item, array< ref Param > vars_server, array< ref Param > vars_client, string debug_text_server)
static ref Param1< int > PARAM1_INT
const int MENU_SCRIPTCONSOLE
Definition constants.c:175

References DisplayAll(), FillAgentArray(), FillServerFinalVars(), GetDayZGame(), GetGame(), GetLocalProperties(), IsActive(), m_DebugRootWidget, m_Entity, MENU_SCRIPTCONSOLE, CachedObjectsParams::PARAM1_INT, CachedObjectsParams::PARAM1_STRING, and ShowWidgets().

◆ OnScriptMenuOpened()

void OnScriptMenuOpened ( bool opened)

Definition at line 209 of file PluginItemDiagnostic.c.

210 {
212 }
bool m_ScriptMenuOpened

References m_ScriptMenuOpened.

◆ OnSelectAction()

void OnSelectAction ( EntityAI ent,
int actionId )

Definition at line 224 of file PluginItemDiagnostic.c.

225 {
226#ifdef DIAG_DEVELOPER
228 player.GetActionManager().OnInstantAction(ActionDebug, new Param2<EntityAI, int>(ent, actionId));
229#endif
230 }
PlayerBase GetPlayer()

References GetGame(), and GetPlayer().

◆ OnUpdate()

override void OnUpdate ( float delta_time)

Definition at line 418 of file PluginItemDiagnostic.c.

419 {
420 super.OnUpdate(delta_time);
421
422 if (!m_Entity || !m_IsActive)
423 {
424
425 if (m_ItemLine)
426 {
427 m_ItemLine.Destroy();
429 }
430 return;
431 }
432
434
435
436 if (m_IsDragging)
437 {
438 int x, y;
439 GetMousePos(x, y);
441 }
442 vector pts[2];
443 pts[0] = GetGame().GetPlayer().GetPosition();
444 pts[1] = m_Entity.GetPosition();
445 if (m_ItemLine)
446 {
447 m_ItemLine.Destroy();
449
450 }
451 m_ItemLine = Shape.CreateLines(COLOR_BLUE, ShapeFlags.TRANSP | ShapeFlags.NOOUTLINE | ShapeFlags.NOZBUFFER, pts, 2);
452 m_DistanceWidget.SetText(vector.Distance(pts[0], pts[1]).ToString() + "m.");
453 }
Shape m_ItemLine
bool m_IsDragging
static proto native float Distance(vector v1, vector v2)
Returns the distance between tips of two 3D vectors.
const int COLOR_BLUE
Definition constants.c:66
ShapeFlags
Definition EnDebug.c:126
class DiagMenu Shape
don't call destructor directly. Use Destroy() instead

References COLOR_BLUE, vector::Distance(), GetGame(), GetMousePos(), m_DebugRootWidget, m_DistanceWidget, m_DraggingOffset, m_Entity, m_IsActive, m_IsDragging, m_ItemLine, m_ItemPreviewWidget, m_ScriptMenuOpened, Shape, x, and y.

◆ PluginItemDiagnostic()

void PluginItemDiagnostic ( )

◆ PrintOut()

void PrintOut ( )

Definition at line 522 of file PluginItemDiagnostic.c.

523 {
524 Debug.LogArrayString(m_Agents, "ItemDebug");
525 Debug.Log("----------------------", "ItemDebug");
526 }
Definition Debug.c:14
static void Log(string message=LOG_DEFAULT, string plugin=LOG_DEFAULT, string author=LOG_DEFAULT, string label=LOG_DEFAULT, string entity=LOG_DEFAULT)
Prints debug message with normal prio.
Definition Debug.c:133
static void LogArrayString(array< string > arr=NULL, string plugin=LOG_DEFAULT, string author=LOG_DEFAULT, string label=LOG_DEFAULT, string entity=LOG_DEFAULT)
Definition Debug.c:367

References Debug::Log(), Debug::LogArrayString(), and m_Agents.

◆ RegisterDebugItem()

void RegisterDebugItem ( Object item,
PlayerBase player )

Definition at line 181 of file PluginItemDiagnostic.c.

182 {
183 if (!myTimer1)
184 {
185 myTimer1 = new Timer();
186 myTimer1.Run(1, this, "Tick", NULL, true);
187 }
188
189 if (m_ObserversMap.Contains(player))
191 else
192 m_ObserversMap.Insert(player, item);
193#ifdef DEVELOPER
195#endif
196 }
ref Timer myTimer1

References m_ObserversMap, and myTimer1.

◆ ReleaseFocus()

void ReleaseFocus ( )

Definition at line 232 of file PluginItemDiagnostic.c.

233 {
234 GetGame().GetInput().ResetGameFocus();
235 GetGame().GetUIManager().ShowUICursor(false);
236 if (GetGame().GetUIManager())
237 {
238 if (GetGame().GetUIManager().IsDialogVisible())
239 GetGame().GetUIManager().CloseDialog();
240
241 }
242 }

References GetGame().

◆ SendRPC()

void SendRPC ( Object item,
PlayerBase player )

Definition at line 309 of file PluginItemDiagnostic.c.

310 {
312 m_Properties.InsertAt(p1, 0);
313 GetGame().RPC(player, ERPCs.RPC_ITEM_DIAG, m_Properties, true, player.GetIdentity());
314
315 if (!GetGame().IsMultiplayer())
316 m_Entity = item;
317
318 }
ERPCs
Definition ERPCs.c:2

References GetGame(), m_Entity, and m_Properties.

◆ SetDragging()

void SetDragging ( bool enable)

Definition at line 139 of file PluginItemDiagnostic.c.

140 {
141 if (enable && !m_IsDragging)
143 else if (!enable && m_IsDragging)
146 }
void OnDraggingStart()
void OnDraggingEnd()

References m_IsDragging, OnDraggingEnd(), and OnDraggingStart().

Referenced by OnClick(), OnMouseButtonDown(), OnMouseButtonUp(), and ToggleDebugWindowEvent().

◆ ShowWidgets()

void ShowWidgets ( bool show)

Definition at line 215 of file PluginItemDiagnostic.c.

216 {
217
218 m_IsActive = show;
219
221 m_DebugRootWidget.Show(show);
222 }

References m_DebugRootWidget, and m_IsActive.

◆ StopWatchRequest()

void StopWatchRequest ( PlayerBase player)

Definition at line 320 of file PluginItemDiagnostic.c.

321 {
322 if (m_ObserversMap.Contains(player))
323 m_ObserversMap.Remove(player);
324 }

References m_ObserversMap.

◆ Tick()

void Tick ( )

Definition at line 275 of file PluginItemDiagnostic.c.

276 {
277 for (int i = 0; i < m_ObserversMap.Count(); i++)
278 {
279 Object item = m_ObserversMap.GetElement(i);
281
282 if (item && player)
283 {
286 }
287 else
288 {
289 Debug.LogError("PluginItemDiagnostic: dead debug record, removing record");
290 m_ObserversMap.RemoveElement(i);
291 }
292 }
293
294 }
void SendRPC()
void GeneratePropertiesObject(EntityAI item)
static void LogError(string message=LOG_DEFAULT, string plugin=LOG_DEFAULT, string author=LOG_DEFAULT, string label=LOG_DEFAULT, string entity=LOG_DEFAULT)
Prints debug message as error message.
Definition Debug.c:341

References GeneratePropertiesObject(), Debug::LogError(), m_ObserversMap, and SendRPC().

◆ ToggleDebugWindowEvent()

void ToggleDebugWindowEvent ( )

Definition at line 244 of file PluginItemDiagnostic.c.

245 {
246 if (m_IsActive)
247 {
249 GetGame().RPCSingleParam(player, ERPCs.RPC_ITEM_DIAG_CLOSE, null, true);
250 ShowWidgets(false);
251 ClearWidgets();
252
253 GetGame().GetCallQueue(CALL_CATEGORY_GUI).CallLater(ReleaseFocus, 100);
254 //m_IsActive = false;
255 SetDragging(false);
256 }
257 else
258 {
259 ShowWidgets(true);
260 //m_IsActive = true;
261 }
262
263 }
void ClearWidgets()
void ReleaseFocus()
const int CALL_CATEGORY_GUI
Definition tools.c:9

References CALL_CATEGORY_GUI, ClearWidgets(), GetGame(), GetPlayer(), m_IsActive, ReleaseFocus(), SetDragging(), and ShowWidgets().

◆ UpdateAgentWidget()

void UpdateAgentWidget ( )

Definition at line 492 of file PluginItemDiagnostic.c.

493 {
494 m_DebugAgentListWidget.ClearItems();
495 for (int i = 0; i < m_Agents.Count(); i++)
496 {
497 string agent = m_Agents.Get(i);
498 m_DebugAgentListWidget.AddItem(agent, NULL, 0);
499 }
500 }

References m_Agents, and m_DebugAgentListWidget.

Referenced by DisplayAll().

◆ UpdateNumericalVarsWidget()

void UpdateNumericalVarsWidget ( array< ref Param > vars_server,
array< ref Param > vars_client )

Definition at line 503 of file PluginItemDiagnostic.c.

504 {
506 for (int i = 0; i < vars_server.Count(); i++)
507 {
510
513
514 string name = p2_server.param1;
516 m_DebugFloatsProperListWidget.SetItem(i, p2_server.param2.ToString(), NULL, 1);
517 m_DebugFloatsProperListWidget.SetItem(i, p2_client.param2.ToString(), NULL, 2);
518 }
519 }
PlayerSpawnPresetDiscreteItemSetSlotData name
one set for cargo
Base Param Class with no parameters. Used as general purpose parameter overloaded with Param1 to Para...
Definition param.c:12

References m_DebugFloatsProperListWidget, and name.

Referenced by DisplayAll().

◆ ~PluginItemDiagnostic()

Definition at line 91 of file PluginItemDiagnostic.c.

92 {
94 if (m_ItemLine)
95 {
96 m_ItemLine.Destroy();
98 }
99 }

References ClearProperties(), and m_ItemLine.

Variable Documentation

◆ m_Agents

ref array<string> m_Agents = new array<string>

Definition at line 47 of file PluginItemDiagnostic.c.

◆ m_ClassNameWidget

TextWidget m_ClassNameWidget

Definition at line 67 of file PluginItemDiagnostic.c.

Referenced by ClearWidgets(), DisplayAll(), and InitializeWidgets().

◆ m_CloseButton

◆ m_ConfigDebugProfile

◆ m_DebugAgentListWidget

TextListboxWidget m_DebugAgentListWidget

Definition at line 62 of file PluginItemDiagnostic.c.

Referenced by ClearWidgets(), InitializeWidgets(), and UpdateAgentWidget().

◆ m_DebugButtonWidget1

ButtonWidget m_DebugButtonWidget1

Definition at line 71 of file PluginItemDiagnostic.c.

Referenced by InitializeWidgets().

◆ m_DebugButtonWidget2

ButtonWidget m_DebugButtonWidget2

Definition at line 72 of file PluginItemDiagnostic.c.

Referenced by InitializeWidgets().

◆ m_DebugButtonWidget3

ButtonWidget m_DebugButtonWidget3

Definition at line 73 of file PluginItemDiagnostic.c.

Referenced by InitializeWidgets().

◆ m_DebugButtonWidget4

ButtonWidget m_DebugButtonWidget4

Definition at line 74 of file PluginItemDiagnostic.c.

Referenced by InitializeWidgets().

◆ m_DebugClientVarsWidget

TextListboxWidget m_DebugClientVarsWidget

Definition at line 66 of file PluginItemDiagnostic.c.

◆ m_DebugFloatsProperListWidget

TextListboxWidget m_DebugFloatsProperListWidget

◆ m_DebugOutputClient

TextWidget m_DebugOutputClient

Definition at line 64 of file PluginItemDiagnostic.c.

Referenced by ClearWidgets(), DisplayAll(), and InitializeWidgets().

◆ m_DebugOutputServer

TextWidget m_DebugOutputServer

Definition at line 63 of file PluginItemDiagnostic.c.

Referenced by ClearWidgets(), DisplayAll(), and InitializeWidgets().

◆ m_DebugRootWidget

◆ m_DistanceWidget

TextWidget m_DistanceWidget

Definition at line 68 of file PluginItemDiagnostic.c.

◆ m_DraggingOffset

vector m_DraggingOffset

Definition at line 79 of file PluginItemDiagnostic.c.

Referenced by OnDraggingStart(), and OnUpdate().

◆ m_Entity

◆ m_EventHandler

Definition at line 55 of file PluginItemDiagnostic.c.

Referenced by InitializeWidgets().

◆ m_Floats

ref map<string, float> m_Floats = new map<string, float>

Definition at line 48 of file PluginItemDiagnostic.c.

◆ m_FrameWidget

Widget m_FrameWidget

Definition at line 60 of file PluginItemDiagnostic.c.

Referenced by InitializeWidgets().

◆ m_IsActive

bool m_IsActive = false

Definition at line 52 of file PluginItemDiagnostic.c.

◆ m_IsDragging

bool m_IsDragging

Definition at line 56 of file PluginItemDiagnostic.c.

Referenced by OnUpdate(), and SetDragging().

◆ m_ItemLine

Shape m_ItemLine

Definition at line 78 of file PluginItemDiagnostic.c.

Referenced by OnUpdate(), and ~PluginItemDiagnostic().

◆ m_ItemPreviewWidget

ItemPreviewWidget m_ItemPreviewWidget

Definition at line 69 of file PluginItemDiagnostic.c.

Referenced by ClearWidgets(), DisplayAll(), InitializeWidgets(), and OnUpdate().

◆ m_NoteClient

string m_NoteClient

Definition at line 54 of file PluginItemDiagnostic.c.

◆ m_ObserversMap

ref map<PlayerBase, Object> m_ObserversMap = new map<PlayerBase, Object>

Definition at line 46 of file PluginItemDiagnostic.c.

Referenced by GetWatchedItem(), RegisterDebugItem(), StopWatchRequest(), and Tick().

◆ m_Properties

ref array<ref Param> m_Properties = new array<ref Param>

Definition at line 51 of file PluginItemDiagnostic.c.

Referenced by ClearProperties(), GeneratePropertiesObject(), and SendRPC().

◆ m_ScriptMenuOpened

bool m_ScriptMenuOpened

Definition at line 53 of file PluginItemDiagnostic.c.

Referenced by OnScriptMenuOpened(), and OnUpdate().

◆ m_VarsFinalClient

ref map<string, float> m_VarsFinalClient = new map<string, float>

Definition at line 50 of file PluginItemDiagnostic.c.

◆ m_VarsNumbersFinalServer

ref map<string, float> m_VarsNumbersFinalServer = new map<string, float>

Definition at line 49 of file PluginItemDiagnostic.c.

◆ myTimer1