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

◆ GetItemQuantityText()

string VicinitySlotsContainer::GetItemQuantityText ( EntityAI item)
inlineprotected

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

399 {
400 string quantity_text = "";
401 if ( item.IsInherited( InventoryItem ) )
402 {
403 ItemBase item_base = ItemBase.Cast( item );
404 float quantity = item_base.GetQuantity();
405 int ammo;
406 if ( item.IsInherited( Magazine ) )
407 {
408 Magazine magazine_item = Magazine.Cast( item );
409 ammo = magazine_item.GetAmmoCount();
410 quantity_text = ammo.ToString();
411 return quantity_text;
412 }
413 else if ( item.IsInherited( ItemBook ) )
414 {
415 return "";
416 }
417 int max = item.GetQuantityMax();
418 //string unit = item.ConfigGetString( "stackedUnit" );
419
420 if ( max > 0 )
421 {
422 if ( max == 1 )
423 {
424 float tmp = Math.Round( ( quantity / max ) * 100 );
425 quantity_text = tmp.ToString() + "%";
426 }
427 else
428 {
429 quantity_text = quantity.ToString();
430 }
431 }
432 }
433 return quantity_text;
434 }
class GP5GasMask extends MaskBase ItemBase
proto string ToString(bool simple=true)

Перекрестные ссылки Math::Round() и float::ToString().