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
represents base for cargo storage for entities
proto native int GetWidth()
proto native int GetItemCount()
proto native int GetHeight()
override void UnfocusAll()
override void DraggingOver(Widget w, int x, int y, Widget receiver)
void DropReceived(Widget w, int x, int y)
override bool IsItemActive()
override EntityAI GetFocusedContainerEntity()
override bool InspectItem()
void SetEntity(EntityAI entity, int cargo_index=0, bool immedUpdate=true)
CargoContainer GetCargo()
override void UpdateInterval()
override bool IsLastContainerFocused()
override bool TransferItem()
override bool TransferItemToVicinity()
override void OnDropReceivedFromHeader(Widget w, int x, int y, Widget receiver)
override bool CanCombine()
EntityAI GetItemPreviewItem(Widget w)
override void DraggingOverHeader(Widget w, int x, int y, Widget receiver)
override bool CanCombineAmmo()
override bool EquipItem()
override bool IsFirstContainerFocused()
ref CargoContainer m_CargoGrid
override bool IsItemWithQuantityActive()
void LockCargo(bool value)
override void SetDefaultFocus(bool while_micromanagment_mode=false)
bool DraggingOverGrid(Widget w, int x, int y, Widget reciever)
void TakeIntoHands(notnull PlayerBase player, notnull EntityAI item)
override bool IsDisplayable()
override bool SplitItem()
void ContainerWithCargo(LayoutHolder parent, int sort=-1)
static ColorManager GetInstance()
void SetColor(Widget w, int color)
proto native bool GetFlip()
returns flip status of cargo
proto native bool IsValid()
verify current set inventory location
proto native void SetCargoAuto(notnull CargoBase cargo, EntityAI e, int row, int col, bool flip)
proto native bool CompareLocationOnly(notnull InventoryLocation other)
void ShowSourceDropzone(EntityAI item)
void SetDefaultOpenState(string type, bool is_opened)
Widget GetRightDropzone()
void SetIsDragging(bool is_dragging)
static ItemManager GetInstance()
EntityAI GetDraggedItem()
static void TakeOrSplitToInventory(notnull PlayerBase player, notnull EntityAI target, notnull EntityAI item)
static void TakeOrSplitToInventoryLocation(notnull PlayerBase player, notnull InventoryLocation dst)
FindInventoryLocationType
flags for searching locations in inventory