DayZ 1.27
DayZ Explorer by KGB
 
Загрузка...
Поиск...
Не найдено

◆ OnChange()

bool HudDebugWinBase::OnChange ( Widget w,
int x,
int y,
bool finished )
inlineprivate

См. определение в файле HudDebugWinCharStats.c строка 211

212 {
213 if ( m_StatValuesInput.Contains(EditBoxWidget.Cast(w)) && finished )
214 {
215 EditBoxWidget ebw = EditBoxWidget.Cast(w);
216 RPCChangeStat(m_StatValuesInput.Get(EditBoxWidget.Cast(w)), ebw.GetText().ToFloat());
217 return true;
218 }
219 if (m_SliderWidgets.Contains(SliderWidget.Cast(w)))
220 {
221 m_ChangingSlider = true;
222 string stat_name = m_SliderWidgets.Get(SliderWidget.Cast(w));
223 SliderWidget sw = SliderWidget.Cast(w);
224 PlayerBase player = PlayerBase.Cast(GetGame().GetPlayer());
225 for ( int i = 0; i < player.m_PlayerStats.GetPCO().Get().Count(); i++ )
226 {
227 string label = player.m_PlayerStats.GetPCO().Get().Get( i ).GetLabel();
228 if(label == stat_name)
229 {
230 float stat_min = player.m_PlayerStats.GetPCO().Get().Get( i ).GetMin();
231 float stat_max = player.m_PlayerStats.GetPCO().Get().Get( i ).GetMax();
232 float current_value_norm = sw.GetCurrent() / 100;
233 float current_value_abs = stat_min + (stat_max - stat_min) * current_value_norm;
234
235 RPCChangeStat(label, current_value_abs);
236 }
237 }
238 //Print("OnChange " + finished);
239 if(finished)
240 m_ChangingSlider = false;
241 }
242
243 return false;
244 }
PlayerBase GetPlayer()
Определения ModifierBase.c:51
override float Get()
Определения PlayerStatBase.c:134
@ Count
Определения RandomGeneratorSyncManager.c:8
void RPCChangeStat(string stat, float value)
Определения HudDebugWinCharStats.c:260
ref map< ref EditBoxWidget, string > m_StatValuesInput
Определения HudDebugWinCharStats.c:8
bool m_ChangingSlider
Определения HudDebugWinCharStats.c:10
ref map< ref SliderWidget, string > m_SliderWidgets
Определения HudDebugWinCharStats.c:6
proto native CGame GetGame()

Перекрестные ссылки Count, Get(), GetGame(), GetPlayer(), m_ChangingSlider, m_SliderWidgets, m_StatValuesInput, RPCChangeStat(), x и y.