415 {
416 Widget item_card_widget = quickbar_item.GetRadialItemCard();
417
418
419 Widget item_details = item_card_widget.FindAnyWidget(
"ItemDetails" );
420 TextWidget item_title = TextWidget.Cast( item_card_widget.FindAnyWidget( "ItemTitle" ) );
421
422
423 TextWidget text_widget = TextWidget.Cast( item_card_widget.FindAnyWidget(
TEXT_ITEM_NAME ) );
424 EntityAI item = quickbar_item.GetItem();
425
426 Widget quantity_panel = item_card_widget.FindAnyWidget(
"QuantityPanel" );
427 if ( item )
428 {
429
430 text_widget.SetText( quickbar_item.GetItem().GetDisplayName() );
431
432
433 ItemPreviewWidget item_preview = ItemPreviewWidget.Cast( item_card_widget.FindAnyWidget( "ItemPreview" ) );
435 item_preview.
SetView( item.GetViewIndex() );
437
438
439 Widget quantity_stack = quantity_panel.FindAnyWidget(
"QuantityStackPanel" );
440 ProgressBarWidget quantity_bar = ProgressBarWidget.Cast( quantity_panel.FindAnyWidget( "QuantityBar" ) );
441 int has_quantity = QuantityConversions.HasItemQuantity( item );
442
444 {
445 quantity_panel.Show( false );
446 }
448 {
449
450 quantity_bar.Show( false );
451
452
453 TextWidget quantity_text = TextWidget.Cast( quantity_stack.FindAnyWidget( "Quantity" ) );
454 quantity_text.SetText( QuantityConversions.GetItemQuantityText( item ) );
455 quantity_stack.Show( true );
456 }
458 {
459
460 quantity_stack.Show( false );
461
462
463 float progress_max = quantity_bar.GetMax();
464 int max = item.ConfigGetInt( "varQuantityMax" );
465 int count = item.ConfigGetInt( "count" );
466 float quantity = QuantityConversions.GetItemQuantity(
ItemBase.Cast( item ) );
467
468 if ( count > 0 )
469 {
470 max = count;
471 }
472 if ( max > 0 )
473 {
474
475 float value = Math.Round( ( quantity / max ) * 100 );
476 quantity_bar.SetCurrent( value );
477 }
478
479 quantity_bar.Show( true );
480 }
481
482
483 item_details.Show( true );
484 item_title.Show( false );
485 }
486 else if ( quickbar_item.GetCategorySwitchID() != -1 )
487 {
488 item_title.SetText( quickbar_item.GetItemName() );
489
490 item_details.Show( false );
491 item_title.Show( true );
492 }
493 else
494 {
495 item_title.SetText( "#container_empty" );
496
497
498 item_details.Show( false );
499 item_title.Show( true );
500 }
501 }
class GP5GasMask extends MaskBase ItemBase
const int QUANTITY_PROGRESS
const int QUANTITY_HIDDEN
proto native vector Vector(float x, float y, float z)
Vector constructor from components.