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

◆ SetItemHealth()

void ScriptedWidgetEventHandler::SetItemHealth ( int health,
string itemWidget,
string healthWidget,
bool enabled )
inlineprotected

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

362 {
363 Widget widget;
364
365 widget = m_Root.FindAnyWidget(itemWidget);
366
367 if (enabled)
368 {
369 ImageWidget healthMark;
370 Class.CastTo(healthMark, widget.FindAnyWidget(healthWidget));
371
372 if (m_ItemFrozen && health != GameConstants.STATE_RUINED)
373 {
374 healthMark.SetColor(Colors.COLOR_FROZEN);
375 healthMark.SetAlpha(0.5);
376 healthMark.GetParent().Show(true);
377 }
378 else
379 {
380 switch (health)
381 {
382 case -1 :
383 healthMark.GetParent().Show(false);
384 break;
385 case GameConstants.STATE_PRISTINE :
386 healthMark.SetColor(Colors.COLOR_PRISTINE);
387 healthMark.SetAlpha(0.5);
388 healthMark.GetParent().Show(true);
389 break;
390 case GameConstants.STATE_WORN :
391 healthMark.SetColor(Colors.COLOR_WORN);
392 healthMark.SetAlpha(0.5);
393 healthMark.GetParent().Show(true);
394 break;
395 case GameConstants.STATE_DAMAGED :
396 healthMark.SetColor(Colors.COLOR_DAMAGED);
397 healthMark.SetAlpha(0.5);
398 healthMark.GetParent().Show(true);
399 break;
400 case GameConstants.STATE_BADLY_DAMAGED:
401 healthMark.SetColor(Colors.COLOR_BADLY_DAMAGED);
402 healthMark.SetAlpha(0.5);
403 healthMark.GetParent().Show(true);
404 break;
405 case GameConstants.STATE_RUINED :
406 healthMark.SetColor(Colors.COLOR_RUINED);
407 healthMark.SetAlpha(0.5);
408 healthMark.GetParent().Show(true);
409 break;
410 default :
411 healthMark.SetColor(0x00FFFFFF);
412 healthMark.SetAlpha(0.5);
413 healthMark.GetParent().Show(true);
414 break;
415 }
416 }
417
418 widget.Show(true);
419 }
420 else
421 widget.Show(false);
422 }
Widget m_Root
Определения SizeToChild.c:9
@ Colors
Определения EnWorld.c:88
WorkspaceWidget Widget
Defined in code.

Перекрестные ссылки Class::CastTo(), Colors::COLOR_BADLY_DAMAGED, Colors::COLOR_DAMAGED, Colors::COLOR_FROZEN, Colors::COLOR_PRISTINE, Colors::COLOR_RUINED, Colors::COLOR_WORN, m_ItemFrozen, m_Root, GameConstants::STATE_BADLY_DAMAGED, GameConstants::STATE_DAMAGED, GameConstants::STATE_PRISTINE, GameConstants::STATE_RUINED и GameConstants::STATE_WORN.

Используется в BuildCursor().