71 PluginDeveloperSync developer_sync = PluginDeveloperSync.Cast(
GetPlugin( PluginDeveloperSync ) );
76 ref Param1<bool> params =
new Param1<bool>( state );
79 player.RPCSingleParam(
ERPCs.DEV_STATS_UPDATE, params,
true );
88 developer_sync.EnableUpdate( state,
ERPCs.DEV_STATS_UPDATE, player );
111 PluginDeveloperSync developer_sync = PluginDeveloperSync.Cast(
GetPlugin( PluginDeveloperSync ) );
116 if ( developer_sync.m_PlayerStatsSynced.Count() > 0 )
119 for (
int i = 0; i < developer_sync.m_PlayerStatsSynced.Count(); i++ )
121 AddValue( developer_sync.m_PlayerStatsSynced.Get( i ).GetName(), developer_sync.m_PlayerStatsSynced.Get( i ).GetValue().ToString() );
132 PluginDeveloperSync developer_sync = PluginDeveloperSync.Cast(
GetPlugin( PluginDeveloperSync ) );
133 if ( developer_sync.m_PlayerStatsSynced.Count() > 0 )
135 for (
int i = 0; i < developer_sync.m_PlayerStatsSynced.Count(); i++ )
137 string stat_name = developer_sync.m_PlayerStatsSynced.Get( i ).GetName();
138 float val_norm = developer_sync.m_PlayerStatsSynced.Get( i ).GetValueNorm();
139 float value = developer_sync.m_PlayerStatsSynced.Get( i ).GetValue();
141 if( stat_name ==
"BloodType" )
148 m_StatValues.
Get(i).SetText(
name);
155 if(!m_ChangingSlider)
156 m_SliderWidgets.GetKeyByValue(stat_name).SetCurrent(val_norm * 100);
182 m_StatWidgets.Insert(widget);
185 m_StatValues.Insert(tw_output);
187 EditBoxWidget ebw_input = EditBoxWidget.Cast(widget.FindAnyWidget(
"InputValue"));
188 m_StatValuesInput.Insert(ebw_input, title );
190 SliderWidget sw = SliderWidget.Cast(widget.FindAnyWidget(
"StatSlider"));
191 m_SliderWidgets.Insert(sw,title );
198 m_WgtPanel.GetScript( WgtModifiersContent_panel_script );
199 WgtModifiersContent_panel_script.
Update();
204 m_StatWidgets.Clear();
210 TextListboxWidget wgt = TextListboxWidget.Cast(m_WgtPanel);
217 if ( w.GetName() ==
"ResetStats" )
227 if ( m_StatValuesInput.Contains(EditBoxWidget.Cast(w)) && finished )
229 EditBoxWidget ebw = EditBoxWidget.Cast(w);
230 RPCChangeStat(m_StatValuesInput.Get(EditBoxWidget.Cast(w)), ebw.GetText().ToFloat());
233 if (m_SliderWidgets.Contains(SliderWidget.Cast(w)))
235 m_ChangingSlider =
true;
236 string stat_name = m_SliderWidgets.Get(SliderWidget.Cast(w));
237 SliderWidget sw = SliderWidget.Cast(w);
239 for (
int i = 0; i < player.m_PlayerStats.GetPCO().
Get().
Count(); i++ )
241 string label = player.m_PlayerStats.GetPCO().Get().Get( i ).GetLabel();
242 if(label == stat_name)
244 float stat_min = player.m_PlayerStats.GetPCO().Get().Get( i ).GetMin();
245 float stat_max = player.m_PlayerStats.GetPCO().Get().Get( i ).GetMax();
246 float current_value_norm = sw.GetCurrent() / 100;
247 float current_value_abs = stat_min + (stat_max - stat_min) * current_value_norm;
254 m_ChangingSlider =
false;
267 ref Param1<bool> params =
new Param1<bool>(
false );
270 player.RPCSingleParam(
ERPCs.DEV_RPC_STATS_RESET, params,
true );
283 player.RPCSingleParam(
ERPCs.DEV_RPC_STAT_SET, params,
true );
array< ref PlayerStatBase > Get()
PluginBase GetPlugin(typename plugin_type)
static string GetBloodTypeName(int bloodtype, out string type, out bool positive)
proto native WorkspaceWidget GetWorkspace()
override void SetUpdate(bool state)
void HudDebugWinCharStats(Widget widget_root)
TextListboxWidget m_WgtValues
void AddValue(string title, string value)
void AddValue(string title, string value, string value2)
void SetUpdate(bool state)
void ~HudDebugWinCharStats()
bool OnClick(Widget w, int x, int y, int button)
void RPCChangeStat(string stat, float value)
bool OnChange(Widget w, int x, int y, bool finished)
void FitWindowByContent(TextListboxWidget wgt)
Result for an object found in CGame.IsBoxCollidingGeometryProxy.
proto native CGame GetGame()
static proto float Round(float f)
Returns mathematical round of value.
string Get(int index)
Gets n-th character from string.