16 RecomputeOpenedContainers();
53 if( value != m_LockCargo )
63 SetOpenState(!m_Closed);
74 SetOpenForSlotIcon(
true);
81 m_SlotIcon.GetRadialIconPanel().Show( !m_LockCargo );
91 SetOpenForSlotIcon(
false);
98 m_SlotIcon.GetRadialIconPanel().Show( !m_LockCargo );
104 return !m_Closed && !m_LockCargo;
111 if (
m_Entity.GetInventory().IsInventoryLockedForLockType( HIDE_INV_FROM_SCRIPT ) || !
m_Entity.CanDisplayCargo() )
116 RecomputeOpenedContainers();
124 RecomputeOpenedContainers();
128 super.UpdateInterval();
139 m_SlotIcon.GetRadialIconPanel().Show( !hide );
156 m_CargoGrid.SetDefaultFocus( while_micromanagment_mode );
194 SetOpenState(
true );
198 m_ClosableHeader.SetItemPreview( entity );
199 CheckHeaderDragability();
202 if (
m_Entity.GetInventory().IsInventoryLockedForLockType( HIDE_INV_FROM_SCRIPT ) || !
m_Entity.CanDisplayCargo() )
210 GetMainWidget().Update();
229 string name = w.GetName();
230 name.Replace(
"PanelWidget",
"Render" );
252 if( !player.CanManipulateInventory() )
264 if( !item.GetInventory().CanRemoveEntity() )
271 #ifdef PLATFORM_CONSOLE
285 #ifdef PLATFORM_CONSOLE
290 dst.
SetCargoAuto(cargo, item,
x,
y, item.GetInventory().GetFlipCargo());
293 #ifdef PLATFORM_CONSOLE
294 if( dst.
IsValid() &&
m_Entity.GetInventory().LocationCanAddEntityEx(dst))
296 if(
m_Entity && c_x >
x && c_y >
y &&
m_Entity.GetInventory().LocationCanAddEntityEx(dst))
316 if( w.FindAnyWidget(
"Cursor") )
318 w.FindAnyWidget(
"Cursor").SetColor( color );
322 string name = w.GetName();
323 name.Replace(
"PanelWidget",
"Cursor" );
324 if( w.FindAnyWidget(
name ) )
326 w.FindAnyWidget(
name ).SetColor( color );
336 GetMainWidget().Update();
337 GetMainWidget().GetScreenSize( xx, yy );
340 GetMainWidget().FindAnyWidget(
"Background").Show(
true );
341 GetMainWidget().FindAnyWidget(
"Background").SetSize( xx, yy );
349 #ifdef PLATFORM_CONSOLE
356 #ifdef PLATFORM_CONSOLE
372 #ifdef PLATFORM_CONSOLE
377 dst.
SetCargoAuto(cargo, item,
x,
y, item.GetInventory().GetFlipCargo());
381 item.GetInventory().GetCurrentInventoryLocation(src);
386 #ifdef PLATFORM_CONSOLE
387 if(dst.
IsValid() &&
m_Entity.GetInventory().LocationCanAddEntityEx(dst))
389 if( c_x >
x && c_y >
y &&
m_Entity.GetInventory().LocationCanAddEntityEx(dst))
398 if( icon && w && w.FindAnyWidget(
"Cursor") )
414 if( !item.GetInventory().CanRemoveEntity() || !player.CanManipulateInventory() )
417 float stackable = item_base.GetTargetQuantityMax();
419 if( stackable == 0 || stackable >= item_base.GetQuantity() )
421 player.PredictiveTakeEntityToHands( item );
423 else if( stackable != 0 && stackable < item_base.GetQuantity() )
425 item_base.SplitIntoStackMaxHandsClient( player );
443 if( item.GetInventory().CanRemoveEntity() && player.CanManipulateInventory() &&
m_Entity.GetInventory().CanAddEntityInCargo( item, item.GetInventory().GetFlipCargo() ) && !
m_Entity.GetInventory().HasEntityInCargo( item ) )
473 if(
GetEntity() && item.GetInventory().GetCurrentInventoryLocation(src))
478 player.PredictiveTakeToDst(src, dst);
481 bool can_add =
m_Entity.GetInventory().CanAddEntityInCargo( item, item.GetInventory().GetFlipCargo() );
482 bool in_cargo = !player.GetInventory().HasEntityInInventory( item ) || !
m_Entity.GetInventory().HasEntityInCargo( item );
483 if( can_add && in_cargo )
PlayerSpawnPresetDiscreteItemSetSlotData name
one set for cargo
FindInventoryLocationType
flags for searching locations in inventory
proto native int GetItemCount()
proto native int GetWidth()
proto native int GetHeight()
represents base for cargo storage for entities
override bool IsFirstContainerFocused()
override void SetDefaultFocus(bool while_micromanagment_mode=false)
override void DraggingOverHeader(Widget w, int x, int y, Widget receiver)
override bool IsLastContainerFocused()
void DropReceived(Widget w, int x, int y)
override bool EquipItem()
override void DraggingOver(Widget w, int x, int y, Widget receiver)
override bool CanCombineAmmo()
override bool CanCombine()
void SetEntity(EntityAI entity, int cargo_index=0, bool immedUpdate=true)
override bool InspectItem()
override bool TransferItemToVicinity()
ref CargoContainer m_CargoGrid
override bool IsItemActive()
override bool IsItemWithQuantityActive()
override void UpdateInterval()
override bool TransferItem()
CargoContainer GetCargo()
EntityAI GetItemPreviewItem(Widget w)
void LockCargo(bool value)
override EntityAI GetFocusedContainerEntity()
override void OnDropReceivedFromHeader(Widget w, int x, int y, Widget receiver)
override bool SplitItem()
override void UnfocusAll()
void ContainerWithCargo(LayoutHolder parent, int sort=-1)
void TakeIntoHands(notnull PlayerBase player, notnull EntityAI item)
bool DraggingOverGrid(Widget w, int x, int y, Widget reciever)
override bool IsDisplayable()
void SetColor(Widget w, int color)
static ColorManager GetInstance()
proto native bool IsValid()
verify current set inventory location
proto native void SetCargoAuto(notnull CargoBase cargo, EntityAI e, int row, int col, bool flip)
based on Cargo.IsProxyCargo uses SetProxyCargo or SetCargo respectively
proto native bool CompareLocationOnly(notnull InventoryLocation other)
proto native bool GetFlip()
returns flip status of cargo
EntityAI GetDraggedItem()
void ShowSourceDropzone(EntityAI item)
Widget GetRightDropzone()
void SetIsDragging(bool is_dragging)
static ItemManager GetInstance()
void SetDefaultOpenState(string type, bool is_opened)
static void TakeOrSplitToInventoryLocation(notnull PlayerBase player, notnull InventoryLocation dst)
static void TakeOrSplitToInventory(notnull PlayerBase player, notnull EntityAI target, notnull EntityAI item)
proto native CGame GetGame()