3 protected ref
Icon m_Icon;
4 protected EntityAI m_AttachmentsInitialized;
6 protected float m_IconSize;
12 GetGame().GetPlayer().GetOnItemAddedToHands().Insert( CreateNewIcon );
13 GetGame().GetPlayer().GetOnItemRemovedFromHands().Insert( DeleteIcon );
18 GetGame().GetPlayer().GetOnItemAddedToHands().Remove( CreateNewIcon );
19 GetGame().GetPlayer().GetOnItemRemovedFromHands().Remove( DeleteIcon );
22 void RefreshQuantity(
EntityAI m_Item_to_refresh )
40 override void SetDefaultFocus(
bool while_micromanagment_mode =
false)
42 super.SetDefaultFocus(while_micromanagment_mode);
44 m_Icon.SetActive(
true);
47 override void SetLastFocus()
51 m_Icon.SetActive(
true);
54 override void Unfocus()
58 m_Icon.SetActive(
false);
66 override void SetLayoutName()
77 override void UpdateInterval()
79 bool show_combine_swap =
ItemManager.GetInstance().IsDragging();
81 #ifdef PLATFORM_CONSOLE
82 if ( m_Icon && !m_Icon.IsDragged() &&
GetGame().
GetInput().IsEnabledMouseAndKeyboardEvenOnServer() )
84 if ( m_Icon && !m_Icon.IsDragged() )
87 m_Icon.GetMainWidget().FindAnyWidget(
"Combine" ).Show( show_combine_swap );
88 m_Icon.GetMainWidget().FindAnyWidget(
"Swap" ).Show( show_combine_swap );
93 m_Icon.UpdateInterval();
100 GetRootWidget().GetParent().GetParent().GetParent().GetParent().GetScreenSize( m_IconSize,
y );
101 m_IconSize = m_IconSize / 10;
103 m_Icon =
new Icon(
this,
true );
116 Inventory.GetInstance().UpdateConsoleToolbar();
123 string display_name =
m_Item.GetDisplayName();
124 display_name.ToUpper();
125 header.SetName( display_name );
135 m_AttachmentsInitialized =
null;
138 Inventory.GetInstance().UpdateConsoleToolbar();
141 override bool SelectItem()
151 override bool Select()
153 Man player =
GetGame().GetPlayer();
155 if(
ItemManager.GetInstance().IsMicromanagmentMode() )
158 if( selected_item && selected_item.GetInventory().CanRemoveEntity() )
160 if(item_in_hands && item_in_hands.GetInventory().CanRemoveEntity())
162 if(
GameInventory.CanSwapEntitiesEx( item_in_hands, selected_item ) )
164 player.PredictiveSwapEntities( item_in_hands, selected_item );
170 if ( player.GetHumanInventory().CanAddEntityInHands( selected_item ) && selected_item.GetInventory().CanRemoveEntity())
173 float stackable = item_base.GetTargetQuantityMax();
174 if (stackable == 0 || item_base.GetQuantity() <= stackable)
176 GetGame().GetPlayer().PredictiveTakeEntityToHands( item_base );
179 else if( stackable != 0 && stackable <= item_base.GetQuantity() )