585 {
586 int index = Math.Round(data[0]);
589
590 if ( bck )
591 {
592 item_w = bck.FindAnyWidget("GridItem");
593 if ( item_w )
594 {
595 int has_quantity =
m_Controller.HasItemQuantity( item );
596 Widget quantity_panel = bck.FindAnyWidget(
"QuantityPanel");
597 TextWidget item_quantity = TextWidget.Cast( bck.FindAnyWidget("Quantity") );
598 ProgressBarWidget quantity_progress = ProgressBarWidget.Cast( bck.FindAnyWidget("QuantityBar") );
599 Widget quantity_stack = bck.FindAnyWidget(
"QuantityStackPanel");
601 {
602 quantity_panel.Show( false );
603 }
604 else
605 {
606 quantity_panel.Show( true );
608 {
609 item_quantity.SetText(
m_Controller.GetItemQuantityText( item ) );
610 quantity_stack.Show( true );
611 quantity_progress.Show( false );
612 }
614 {
615 float progress_max = quantity_progress.GetMax();
619 if ( count > 0 )
620 {
621 max = count;
622 }
623 if ( max > 0 )
624 {
625
626 float value = Math.Round( ( quantity / max ) * 100 );
627 quantity_progress.SetCurrent( value );
628 }
629 quantity_stack.Show( false );
630 quantity_progress.Show( true );
631 }
632 }
633
634 if ( show_temperature )
635 {
636 if ( item && item.IsInherited( InventoryItem ) )
637 {
639 if ( color )
640 {
641 item_w.SetColor( color );
642 }
643 }
644 }
645 }
646 }
647 }
const int QUANTITY_PROGRESS
const int QUANTITY_HIDDEN