22 float GetTemporaryResistance()
39 void HudDebugWinCharAgents( Widget widget_root )
47 m_WgtAgents.GetScript(WgtModifiersContentPanelScript);
50 void ~HudDebugWinCharAgents()
70 PluginDeveloperSync developer_sync = PluginDeveloperSync.Cast(
GetPlugin( PluginDeveloperSync ) );
75 ref Param1<bool> params =
new Param1<bool>( state );
78 player.RPCSingleParam(
ERPCs.DEV_AGENTS_UPDATE, params,
true );
87 developer_sync.EnableUpdate( state,
ERPCs.DEV_AGENTS_UPDATE, player );
125 PluginDeveloperSync developer_sync = PluginDeveloperSync.Cast(
GetPlugin( PluginDeveloperSync ) );
131 if ( developer_sync.m_PlayerAgentsSynced.Count() > 0 )
133 for (
int i = 0; i < developer_sync.m_PlayerAgentsSynced.Count(); i++ )
137 syncedValue.GetName(),
138 syncedValue.GetValue(),
140 syncedValue.GetTemporaryResistanceTime(),
146 bool OnClick( Widget w,
int x,
int y,
int button )
149 if (w.GetName() ==
"ButtonAgentActivate")
152 DebugGrowAgentsRequest(data.GetID(),
true);
155 else if (w.GetName() ==
"ButtonAgentDeactivate")
158 DebugGrowAgentsRequest(data.GetID(),
false);
161 else if (w.GetName() ==
"ResetAgents")
163 DebugRemoveAgentsRequest();
170 void DebugGrowAgentsRequest(
int agent_id,
bool should_grow)
177 ref Param1<int> p1 =
new Param1<int>( agent_id );
178 Man man =
GetGame().GetPlayer();
179 man.RPCSingleParam(
ERPCs.DEV_AGENT_GROW, p1,
true, man.GetIdentity());
182 void DebugRemoveAgentsRequest()
184 ref Param1<bool> p1 =
new Param1<bool>(
false );
185 Man man =
GetGame().GetPlayer();
186 man.RPCSingleParam(
ERPCs.DEV_RPC_AGENT_RESET, p1,
true, man.GetIdentity());
189 void AddAgent(
string title,
string value,
int id,
float temporaryResistance)
191 Widget widget =
GetGame().GetWorkspace().CreateWidgets(
"gui/layouts/debug/day_z_hud_debug_agent.layout",
m_WgtAgents);
192 ButtonWidget btn = ButtonWidget.Cast( widget.FindAnyWidget(
"TextAgentName" ) );
193 TextWidget countWidget = TextWidget.Cast(widget.FindAnyWidget(
"TextWidgetAgentCount"));
194 TextWidget tempResistanceWidget = TextWidget.Cast(widget.FindAnyWidget(
"TextWidgetAgentTempResistanceTime"));
195 Widget activateButton = widget.FindAnyWidget(
"ButtonAgentActivate");
196 Widget deactivateButton = widget.FindAnyWidget(
"ButtonAgentDeactivate");
198 countWidget.SetText(value);
200 if (temporaryResistance > 0.0)
201 tempResistanceWidget.SetText(
string.Format(
"(R-%1s)",
Math.Round(temporaryResistance).ToString()));
203 tempResistanceWidget.SetText(
"");
213 WgtModifiersContentPanelScript.
Update();
PlayerSpawnPresetDiscreteItemSetSlotData name
one set for cargo
void FitWindowByContent(TextListboxWidget wgt)
void SetUpdate(bool state)
Result for an object found in CGame.IsBoxCollidingGeometryProxy.
override bool OnClick(Widget w, int x, int y, int button)
buttons clicks
int m_ID
ID of effect, given by SEffectManager when registered (automatically done when playing through it)
proto native CGame GetGame()
ref map< Widget, ref DebugAgentData > m_AgentWidgetData
ref array< ref Widget > m_AgentWidgets
class DebugAgentData m_WgtAgents
PluginBase GetPlugin(typename plugin_type)
void SyncedValueAgent(string name, string value, int id, float temporaryResistance)