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

◆ OnChange()

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

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

215 {
216 if (m_StatValuesInput.Contains(EditBoxWidget.Cast(w)) && finished)
217 {
218 EditBoxWidget ebw = EditBoxWidget.Cast(w);
219 RPCChangeStat(m_StatValuesInput.Get(EditBoxWidget.Cast(w)), ebw.GetText().ToFloat());
220 return true;
221 }
222 if (m_SliderWidgets.Contains(SliderWidget.Cast(w)))
223 {
224 m_ChangingSlider = true;
225 string stat_name = m_SliderWidgets.Get(SliderWidget.Cast(w));
226 SliderWidget sw = SliderWidget.Cast(w);
227 PlayerBase player = PlayerBase.Cast(g_Game.GetPlayer());
228 for (int i = 0; i < player.m_PlayerStats.GetPCO().Get().Count(); i++)
229 {
230 string label = player.m_PlayerStats.GetPCO().Get().Get(i).GetLabel();
231 if(label == stat_name)
232 {
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;
237
238 RPCChangeStat(label, current_value_abs);
239 }
240 }
241
242 if(finished)
243 m_ChangingSlider = false;
244 }
245
246 return false;
247 }
DayZGame g_Game
Определения DayZGame.c:4074
override float Get()
Определения PlayerStatBase.c:134
@ Count
Определения RandomGeneratorSyncManager.c:8
void RPCChangeStat(string stat, float value)
Определения HudDebugWinCharStats.c:262
ref map< EditBoxWidget, string > m_StatValuesInput
Определения HudDebugWinCharStats.c:9
bool m_ChangingSlider
Определения HudDebugWinCharStats.c:11
ref map< SliderWidget, string > m_SliderWidgets
Определения HudDebugWinCharStats.c:7

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