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

◆ UpdateItemInfoWeight()

static void UIScriptedMenu::UpdateItemInfoWeight ( Widget root_widget,
EntityAI item )
inlinestaticprivate

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

488 {
489 if (!item.CanDisplayWeight())
490 {
491 WidgetTrySetText(root_widget, "ItemWeightWidget", "", Colors.COLOR_DEFAULT);
492 return;
493 }
494
495 ItemBase item_IB = ItemBase.Cast( item );
496 if( item_IB )
497 {
498 int weight = item_IB.GetWeightEx();
499
500 if (root_widget.GetName() != "BackPanelWidget")
501 {
502 weight = item_IB.GetSingleInventoryItemWeightEx();
503 }
504
505 if (weight >= 1000)
506 {
507 int kilos = Math.Round(weight / 1000.0);
508 WidgetTrySetText(root_widget, "ItemWeightWidget", "#inv_inspect_about" + " " + kilos.ToString() + " " + "#inv_inspect_kg", Colors.COLOR_DEFAULT);
509 }
510 else if (weight >= 500)
511 {
512 WidgetTrySetText(root_widget, "ItemWeightWidget", "#inv_inspect_under_1", Colors.COLOR_DEFAULT);
513 }
514 else if (weight >= 250)
515 {
516 WidgetTrySetText(root_widget, "ItemWeightWidget", "#inv_inspect_under_05", Colors.COLOR_DEFAULT);
517 }
518 else
519 {
520 WidgetTrySetText(root_widget, "ItemWeightWidget", "#inv_inspect_under_025", Colors.COLOR_DEFAULT);
521 }
522 }
523 }
class GP5GasMask extends MaskBase ItemBase
static void WidgetTrySetText(Widget root_widget, string widget_name, string text, int color=0)
Определения InspectMenuNew.c:592
@ Colors
Определения EnWorld.c:88

Перекрестные ссылки Colors::COLOR_DEFAULT, Math::Round() и WidgetTrySetText().