387 {
388 if ( item.IsInherited( ZombieBase ) || item.IsInherited( Car ) ) return;
389
391 if( item_base )
392 {
393 float item_quantity = item_base.GetQuantity();
394 int max_quantity = item.GetQuantityMax();
395
396 float quantity_ratio;
397
398 if( max_quantity > 0 && !item.IsInherited(
ClothingBase ))
399 {
400 string quantity_str;
401 if( item.ConfigGetString("stackedUnit") == "pc." )
402 {
403 if( item_quantity == 1 )
404 {
406 }
407 else
408 {
410 }
411 }
412 else if( item.ConfigGetString("stackedUnit") == "percentage" )
413 {
414 quantity_ratio = Math.Round( ( item_quantity / max_quantity ) * 100 );
415
416 quantity_str =
"#inv_inspect_remaining " + quantity_ratio.
ToString() +
"#inv_inspect_percent";
418 }
419 else if( item.ConfigGetString("stackedUnit") == "g" )
420 {
421 quantity_ratio = Math.Round( ( item_quantity / max_quantity ) * 100 );
422
423 quantity_str =
"#inv_inspect_remaining " + quantity_ratio.
ToString() +
"#inv_inspect_percent";
425 }
426 else if( item.ConfigGetString("stackedUnit") == "ml" )
427 {
428 quantity_ratio = Math.Round( ( item_quantity / max_quantity ) * 100 );
429
430 quantity_str =
"#inv_inspect_remaining " + quantity_ratio.
ToString() +
"#inv_inspect_percent";
432 }
433 else if( item.IsInherited( Magazine ) )
434 {
435 Magazine magazine_item;
436 Class.CastTo(magazine_item, item);
437
438 if( magazine_item.GetAmmoCount() == 1 )
439 {
440 WidgetTrySetText( root_widget,
"ItemQuantityWidget", magazine_item.GetAmmoCount().ToString() +
" " +
"#inv_inspect_piece",
Colors.COLOR_DEFAULT );
441 }
442 else
443 {
444 WidgetTrySetText( root_widget,
"ItemQuantityWidget", magazine_item.GetAmmoCount().ToString() +
" " +
"#inv_inspect_pieces",
Colors.COLOR_DEFAULT );
445 }
446 }
447 else
448 {
450 }
451 }
452 else
453 {
455 {
456 float heatIsolation = MiscGameplayFunctions.GetCurrentItemHeatIsolation( item_base );
457 if ( heatIsolation <= GameConstants.HEATISO_THRESHOLD_BAD )
458 {
460 }
461 else if ( ( heatIsolation > GameConstants.HEATISO_THRESHOLD_BAD ) && ( heatIsolation <= GameConstants.HEATISO_THRESHOLD_LOW ) )
462 {
464 }
465 else if ( ( heatIsolation > GameConstants.HEATISO_THRESHOLD_LOW ) && ( heatIsolation <= GameConstants.HEATISO_THRESHOLD_MEDIUM ) )
466 {
468 }
469 else if ( ( heatIsolation > GameConstants.HEATISO_THRESHOLD_MEDIUM ) && ( heatIsolation <= GameConstants.HEATISO_THRESHOLD_HIGH ) )
470 {
472 }
473 else
474 {
476 }
477 }
478 else
479 {
481 }
482 }
483 }
484 }
class GP5GasMask extends MaskBase ItemBase
proto string ToString(bool simple=true)