4 protected int m_CargoIndex = -1;
11 m_CargoGrid =
new CargoContainer(
this);
14 m_CargoGrid.GetRootWidget().SetSort(1);
17 RecomputeOpenedContainers();
29 return m_CargoGrid.IsEmpty();
34 return m_CargoGrid.IsItemActive();
39 return m_CargoGrid.CanCombine();
44 return m_CargoGrid.CanCombineAmmo();
49 return m_CargoGrid.IsItemWithQuantityActive();
54 if (
value != m_LockCargo)
64 SetOpenState(!m_Closed);
75 SetOpenForSlotIcon(
true);
81 m_SlotIcon.GetRadialIconPanel().Show(!m_LockCargo);
90 SetOpenForSlotIcon(
false);
96 m_SlotIcon.GetRadialIconPanel().Show(!m_LockCargo);
101 return !m_Closed && !m_LockCargo;
111 if (m_CargoGrid.IsVisible())
112 RecomputeOpenedContainers();
117 if (!m_CargoGrid.IsVisible())
118 RecomputeOpenedContainers();
121 super.UpdateInterval();
122 m_CargoGrid.UpdateInterval();
129 m_SlotIcon.GetRadialIconPanel().Show(!
hide);
135 return m_CargoGrid.IsFirstContainerFocused();
140 return m_CargoGrid.IsLastContainerFocused();
150 m_CargoGrid.Unfocus();
155 return m_CargoGrid.SplitItem();
160 return m_CargoGrid.EquipItem();
165 return m_CargoGrid.TransferItem();
170 return m_CargoGrid.TransferItemToVicinity();
175 return m_CargoGrid.InspectItem();
186 m_CargoGrid.UpdateHeaderText();
187 m_ClosableHeader.SetItemPreview(
entity);
188 CheckHeaderDragability();
199 GetMainWidget().Update();
218 string name =
w.GetName();
219 name.Replace(
"PanelWidget",
"Render");
226 return ipw.GetItem();
235 if (!
player.CanManipulateInventory())
243 if (!
item.GetInventory().CanRemoveEntity())
248#ifdef PLATFORM_CONSOLE
262#ifdef PLATFORM_CONSOLE
270#ifdef PLATFORM_CONSOLE
271 if (
dst.IsValid() &&
m_Entity.GetInventory().LocationCanAddEntityEx(
dst))
289 if (
w.FindAnyWidget(
"Cursor"))
290 w.FindAnyWidget(
"Cursor").SetColor(
color);
293 string name =
w.GetName();
294 name.Replace(
"PanelWidget",
"Cursor");
295 if (
w.FindAnyWidget(
name))
305 GetMainWidget().Update();
306 GetMainWidget().GetScreenSize(
xx,
yy);
309 GetMainWidget().FindAnyWidget(
"Background").Show(
true);
310 GetMainWidget().FindAnyWidget(
"Background").SetSize(
xx,
yy);
316#ifdef PLATFORM_CONSOLE
317 if (m_CargoGrid.HasItem(
item))
321#ifdef PLATFORM_CONSOLE
337#ifdef PLATFORM_CONSOLE
346 item.GetInventory().GetCurrentInventoryLocation(
src);
348 if (
src.CompareLocationOnly(
dst) &&
src.GetFlip() ==
dst.GetFlip())
351#ifdef PLATFORM_CONSOLE
352 if (
dst.IsValid() &&
m_Entity.GetInventory().LocationCanAddEntityEx(
dst))
363 if (
icon &&
w &&
w.FindAnyWidget(
"Cursor"))
379 if (!
item.GetInventory().CanRemoveEntity() || !
player.CanManipulateInventory())
404 if (
item.GetInventory().CanRemoveEntity() &&
player.CanManipulateInventory() &&
m_Entity.GetInventory().CanAddEntityInCargo(
item,
item.GetInventory().GetFlipCargo()) && !
m_Entity.GetInventory().HasEntityInCargo(
item))
PlayerSpawnPresetDiscreteItemSetSlotData name
one set for cargo
FindInventoryLocationType
flags for searching locations in inventory
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()
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()
void ContainerWithCargo(Container parent, int sort=-1)
override void UnfocusAll()
void TakeIntoHands(notnull PlayerBase player, notnull EntityAI item)
bool DraggingOverGrid(Widget w, int x, int y, Widget reciever)
override bool IsDisplayable()
static ColorManager GetInstance()
static ItemManager GetInstance()
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()