3 TextListboxWidget m_WgtValues;
82 PluginDeveloperSync developerSync = PluginDeveloperSync.Cast(
GetPlugin(PluginDeveloperSync));
87 Param1<bool> params =
new Param1<bool>(state);
90 player.RPCSingleParam(
ERPCs.DEV_STATS_UPDATE, params,
true);
99 developerSync.EnableUpdate(state,
ERPCs.DEV_STATS_UPDATE, player);
106 super.Update(timeslice);
125 PluginDeveloperSync developerSync = PluginDeveloperSync.Cast(
GetPlugin(PluginDeveloperSync));
127 int valuesCount = developerSync.m_PlayerStatsSynced.Count();
130 foreach (
SyncedValue syncedValue : developerSync.m_PlayerStatsSynced)
141 PluginDeveloperSync developerSync = PluginDeveloperSync.Cast(
GetPlugin(PluginDeveloperSync));
142 int valuesCount = developerSync.m_PlayerStatsSynced.Count();
145 foreach (
int i,
SyncedValue syncedValue : developerSync.m_PlayerStatsSynced)
147 string statName = syncedValue.
GetName();
149 float value = syncedValue.
GetValue();
151 if ( statName ==
"BloodType" )
162 if (statName ==
"HeatBuffer")
164 float heatBufferNormalized =
Math.
Round(
Math.
Lerp(-1, 1, valueNormalized) * 1000) * 0.001;
173 m_SliderWidgets.GetKeyByValue(statName).SetCurrent(valueNormalized * 100);
180 Widget widget =
g_Game.GetWorkspace().CreateWidgets(
"gui/layouts/debug/day_z_hud_debug_stat.layout",
m_WgtPanel );
192 SliderWidget sw = SliderWidget.Cast(widget.FindAnyWidget(
"StatSlider"));
205 if (w.GetName() ==
"ResetStats")
226 SliderWidget sw = SliderWidget.Cast(w);
228 for (
int i = 0; i < player.m_PlayerStats.GetPCO().
Get().
Count(); i++)
230 string label = player.m_PlayerStats.GetPCO().Get().Get(i).GetLabel();
231 if(label == stat_name)
233 float statMin = player.m_PlayerStats.GetPCO().Get().Get(i).GetMin();
234 float statMax = player.m_PlayerStats.GetPCO().Get().Get(i).GetMax();
235 float current_value_norm = sw.GetCurrent() / 100;
236 float current_value_abs = statMin + (statMax - statMin) * current_value_norm;
255 Param1<bool> params =
new Param1<bool>(
false);
258 player.RPCSingleParam(
ERPCs.DEV_RPC_STATS_RESET, params,
true);
270 player.RPCSingleParam(
ERPCs.DEV_RPC_STAT_SET, params,
true);
PlayerSpawnPresetDiscreteItemSetSlotData name
one set for cargo
PluginBase GetPlugin(typename plugin_type)
static string GetBloodTypeName(int bloodtype, out string type, out bool positive)
void RPCChangeStat(string stat, float value)
bool OnMouseButtonUp(Widget w, int x, int y, int button)
void SetDragging(bool enable)
ref array< Widget > m_StatWidgets
bool OnChange(Widget w, int x, int y, bool finished)
ref map< EditBoxWidget, string > m_StatValuesInput
override void Update(float timeslice)
bool OnClick(Widget w, int x, int y, int button)
GridSpacerWidget m_WgtPanel
void ~HudDebugWinCharStats()
ref array< TextWidget > m_StatValues
void AddValue(string title, string value, string value2)
void SetUpdate(bool state)
override void OnDraggingEnd()
PluginConfigDebugProfile m_ConfigDebugProfile
ref map< SliderWidget, string > m_SliderWidgets
bool OnMouseButtonDown(Widget w, int x, int y, int button)
void AddValue(string title, string value)
override void SetUpdate(bool state)
void HudDebugWinCharStats(Widget widget_root)
Result for an object found in CGame.IsBoxCollidingGeometryProxy.
proto string ToString(bool simple=true)
void Obsolete(string msg="")
proto native vector Vector(float x, float y, float z)
Vector constructor from components.
static proto float Lerp(float a, float b, float time)
Linearly interpolates between 'a' and 'b' given 'time'.
static proto float Round(float f)
Returns mathematical round of value.
proto void GetMousePos(out int x, out int y)