14 m_Root =
GetGame().GetWorkspace().CreateWidgets(
"gui/layouts/debug/day_z_hud_debug_agent.layout", parent);
22 countWidget.SetText(value);
24 if (temporaryResistance > 0.0)
25 tempResistanceWidget.SetText(
string.Format(
"(R-%1s)",
Math.
Round(temporaryResistance).
ToString()));
27 tempResistanceWidget.SetText(
"");
45 Param1<int> p1 =
new Param1<int>(agentId);
46 Man man =
GetGame().GetPlayer();
47 man.RPCSingleParam(
ERPCs.DEV_AGENT_GROW, p1,
true, man.GetIdentity());
52 super.OnClick(w,
x,
y, button);
110 return HudDebug.HUD_WIN_CHAR_AGENTS;
117 PluginDeveloperSync developer_sync = PluginDeveloperSync.Cast(
GetPlugin(PluginDeveloperSync));
122 Param1<bool> params =
new Param1<bool>(state);
125 player.RPCSingleParam(
ERPCs.DEV_AGENTS_UPDATE, params,
true);
134 developer_sync.EnableUpdate(state,
ERPCs.DEV_AGENTS_UPDATE, player);
141 super.Update(timeslice);
176 PluginDeveloperSync developerSync = PluginDeveloperSync.Cast(
GetPlugin(PluginDeveloperSync));
182 int agentsCount = developerSync.m_PlayerAgentsSynced.Count();
187 AddAgent(agent.GetName(), agent.GetValue(), agent.GetID(), agent.GetTemporaryResistanceTime());
196 if (w.GetName() ==
"ResetAgents")
207 Param1<bool> p1 =
new Param1<bool>(
false);
208 Man man =
g_Game.GetPlayer();
209 man.RPCSingleParam(
ERPCs.DEV_RPC_AGENT_RESET, p1,
true, man.GetIdentity());
212 void AddAgent(
string title,
string value,
int id,
float temporaryResistance)
214 HudDebugWinCharAgentsEntry agentEntry =
new HudDebugWinCharAgentsEntry(
this,
m_WgtAgents, title, value,
id, temporaryResistance);
223 entry.DestroyEntry();
void HudDebugWinCharAgents(Widget widget_root)
void ~HudDebugWinCharAgents()
class HudDebugWinCharAgentsEntry extends ScriptedWidgetEventHandler AGENTS_UPDATE_TIME
float m_UpdateAgentsTimer
GridSpacerWidget m_WgtAgents
void AddAgent(string title, string value, int id, float temporaryResistance)
ref array< ref HudDebugWinCharAgentsEntry > m_AgentEntries
void DebugRemoveAgentsRequest()
PluginConfigDebugProfile m_ConfigDebugProfile
PluginBase GetPlugin(typename plugin_type)
void SyncedValueAgent(string name, string value, int id, float temporaryResistance)
bool OnMouseButtonUp(Widget w, int x, int y, int button)
void SetDragging(bool enable)
bool OnClick(Widget w, int x, int y, int button)
void SetUpdate(bool state)
bool OnMouseButtonDown(Widget w, int x, int y, int button)
Result for an object found in CGame.IsBoxCollidingGeometryProxy.
proto string ToString(bool simple=true)
proto native vector Vector(float x, float y, float z)
Vector constructor from components.
static proto float Round(float f)
Returns mathematical round of value.
proto void GetMousePos(out int x, out int y)