DayZ 1.24
Loading...
Searching...
No Matches
LayoutHolder Class Reference
Inheritance diagram for LayoutHolder:
[legend]
Collaboration diagram for LayoutHolder:
[legend]

Protected Member Functions

void OnDropReceivedFromHeader (Widget w, int x, int y, Widget receiver)
 
void DraggingOver (Widget w, int x, int y, Widget receiver)
 
void DraggingOverHeader (Widget w, int x, int y, Widget receiver)
 
void UpdateSpacer ()
 
Header GetHeader ()
 
void SetHeader (Header header)
 
void CheckHeaderDragability ()
 
void Container (LayoutHolder parent)
 
Container GetFocusedContainer ()
 
Container GetContainer (int index)
 
void SetFocusedContainer (Container cont)
 
SlotsIcon GetFocusedSlotsIcon ()
 
int GetActiveIndex ()
 
void SetActiveIndex (int index)
 
ScrollWidget GetScrollWidget ()
 
void UpdateRadialIcon ()
 
void SetSlotIcon (SlotsIcon icon)
 
void SetDefaultFocus (bool while_micromanagment_mode=false)
 
void SetLastFocus ()
 
void Unfocus ()
 
void MoveGridCursor (int direction)
 
void ScrollToActiveContainer ()
 
void CheckScrollbarVisibility ()
 
void Open ()
 
void Close ()
 
bool IsOpened ()
 
void SetOpenForSlotIcon (bool open, SlotsIcon icon=null)
 
void Toggle ()
 
float GetFocusedContainerHeight (bool contents=false)
 
float GetFocusedContainerYPos (bool contents=false)
 
float GetFocusedContainerYScreenPos (bool contents=false)
 
int Count ()
 
bool SelectItem ()
 
bool Select ()
 
bool OnSelectButton ()
 
bool Combine ()
 
bool TransferItemToVicinity ()
 
bool TransferItem ()
 
bool InspectItem ()
 
bool SplitItem ()
 
bool EquipItem ()
 
bool CanOpenCloseContainer ()
 
bool CanOpenCloseContainerEx (EntityAI focusedEntity)
 
bool CanSplit ()
 
bool CanSplitEx (EntityAI focusedEntity)
 
bool CanDrop ()
 
bool CanDropEx (EntityAI focusedEntity)
 
bool CanSwapOrTakeToHands ()
 
bool CanSwapOrTakeToHandsEx (EntityAI focusedEntity)
 
bool CanEquip ()
 
bool CanEquipEx (EntityAI focusedEntity)
 
bool CanTakeToInventory ()
 
bool CanTakeToInventoryEx (EntityAI focusedEntity)
 
bool CanCombine ()
 
bool CanCombineEx (EntityAI focusedEntity)
 
bool CanCombineAmmo ()
 
bool CanAddToQuickbarEx (EntityAI focusedEntity)
 
bool AddItemToQuickbarRadial (EntityAI itemToAssign)
 
bool IsEmpty ()
 
bool IsItemActive ()
 
bool IsItemWithQuantityActive ()
 
EntityAI GetFocusedItem ()
 
EntityAI GetFocusedContainerEntity ()
 
int GetColumnCount ()
 
void SetColumnCount (int count)
 
int GetFocusedColumn ()
 
void SetFocusedColumn (int column)
 
override void UpdateInterval ()
 
override void SetLastActive ()
 
override void SetFirstActive ()
 
override void SetActive (bool active)
 
void UnfocusAll ()
 
void UnfocusGrid ()
 
bool IsLastIndex ()
 
bool IsFirstIndex ()
 
bool IsFirstContainerFocused ()
 
bool IsLastContainerFocused ()
 
void ResetFocusedContainer ()
 
void SetNextActive ()
 
void SetPreviousActive (bool force=false)
 
void SetNextRightActive ()
 
void SetNextLeftActive ()
 
void SetSameLevelNextActive ()
 
void SetSameLevelPreviousActive ()
 
void RecomputeOpenedContainers ()
 
override void SetLayoutName ()
 
void Insert (LayoutHolder container, int pos=-1, bool immedUpdate=true)
 
void Remove (LayoutHolder container)
 
LayoutHolder Get (int x)
 
override void Refresh ()
 
void UpdateBodySpacers ()
 
void HideContent (bool force_hide=false)
 
void ShowContent (bool force_show=false)
 
void SetForceShow (bool value)
 
override void UpdateSelectionIcons ()
 
void ExpandCollapseContainer ()
 

Protected Attributes

ref array< ref LayoutHolderm_Body
 
ref array< LayoutHolderm_OpenedContainers
 
int m_ActiveIndex = 0
 
bool m_LastIndex
 
bool m_Closed
 
Container m_FocusedContainer
 
float m_PrevAlpha
 
const int ITEMS_IN_ROW = 8
 
int m_ColumnCount
 
int m_FocusedColumn = 0
 
bool m_ForcedHide
 
bool m_ForcedShow
 
SlotsIcon m_SlotIcon
 
EntityAI m_Entity
 
const int SORT_ATTACHMENTS_OWN = 1
 
const int SORT_CARGO_OWN = 2
 
const int SORT_ATTACHMENTS_NEXT_OFFSET = 2
 
const int SORT_CARGO_NEXT_OFFSET = 3
 

Detailed Description

Definition at line 1 of file Container.c.

Member Function Documentation

◆ AddItemToQuickbarRadial()

bool LayoutHolder::AddItemToQuickbarRadial ( EntityAI itemToAssign)
inlineprotected

Definition at line 577 of file Container.c.

578 {
580 {
583 dpi = player.GetDayZPlayerInventory();
584
585 if (itemToAssign && dpi && !dpi.IsProcessing())
586 {
587 RadialQuickbarMenu.SetItemToAssign(itemToAssign);
588
589 //open radial quickbar menu
590 if (!GetGame().GetUIManager().IsMenuOpen(MENU_RADIAL_QUICKBAR))
591 RadialQuickbarMenu.OpenMenu(GetGame().GetUIManager().FindMenu(MENU_INVENTORY));
592 }
593 return true;
594 }
595 return false;
596 }
PlayerBase GetPlayer()
bool CanAddToQuickbarEx(EntityAI focusedEntity)
Definition Container.c:562
proto native CGame GetGame()
const int MENU_INVENTORY
Definition constants.c:170
const int MENU_RADIAL_QUICKBAR
Definition constants.c:188

References GetGame(), GetPlayer(), MENU_INVENTORY, and MENU_RADIAL_QUICKBAR.

◆ CanAddToQuickbarEx()

bool LayoutHolder::CanAddToQuickbarEx ( EntityAI focusedEntity)
inlineprotected

Definition at line 562 of file Container.c.

563 {
564 if (ItemManager.GetInstance().IsMicromanagmentMode())
565 return false;
566
567 if (focusedEntity)
568 {
570 if (focusedEntity.GetHierarchyRootPlayer() == player)
571 return true;
572 }
573
574 return false;
575 }
static ItemManager GetInstance()

References GetGame(), ItemManager::GetInstance(), and GetPlayer().

◆ CanCombine()

bool LayoutHolder::CanCombine ( )
inlineprotected

Definition at line 527 of file Container.c.

528 {
530 if (focusedEntity)
531 {
533 return GetFocusedContainer().CanCombineEx(focusedEntity);
534
536 }
537
538 return false;
539 }
bool CanCombineEx(EntityAI focusedEntity)
Definition Container.c:541
EntityAI GetFocusedItem()
Definition Container.c:617
Container GetFocusedContainer()
Definition Container.c:48

References Container::GetFocusedItem().

◆ CanCombineAmmo()

bool LayoutHolder::CanCombineAmmo ( )
inlineprotected

Definition at line 555 of file Container.c.

556 {
559 return false;
560 }
override bool CanCombineAmmo()

◆ CanCombineEx()

bool LayoutHolder::CanCombineEx ( EntityAI focusedEntity)
inlineprotected

Definition at line 541 of file Container.c.

542 {
543 if (ItemManager.GetInstance().IsMicromanagmentMode())
544 return false;
545
546 if (focusedEntity)
547 {
548 EntityAI entityInHands = PlayerBase.Cast(GetGame().GetPlayer()).GetItemInHands();
551 }
552 return false;
553 }
static int GetCombinationFlags(EntityAI entity1, EntityAI entity2)

References ItemManager::GetCombinationFlags(), GetGame(), ItemManager::GetInstance(), and GetPlayer().

◆ CanDrop()

bool LayoutHolder::CanDrop ( )
inlineprotected

Definition at line 388 of file Container.c.

389 {
391 if (focusedEntity)
392 {
394 return GetFocusedContainer().CanDropEx(focusedEntity);
395
396 return CanDropEx(focusedEntity);
397
398 }
399
400 return false;
401 }
bool CanDropEx(EntityAI focusedEntity)
Definition Container.c:403

References Container::GetFocusedItem().

◆ CanDropEx()

bool LayoutHolder::CanDropEx ( EntityAI focusedEntity)
inlineprotected

Definition at line 403 of file Container.c.

404 {
405 if (ItemManager.GetInstance().IsMicromanagmentMode())
406 return false;
407
408 if (focusedEntity)
409 {
411
412 if (player)
413 return player.CanDropEntity(focusedEntity);
414 }
415 return false;
416 }

References GetGame(), ItemManager::GetInstance(), and GetPlayer().

◆ CanEquip()

bool LayoutHolder::CanEquip ( )
inlineprotected

Definition at line 456 of file Container.c.

457 {
459 if (focusedEntity)
460 {
462 return GetFocusedContainer().CanEquipEx(focusedEntity);
463
465 }
466
467 return false;
468 }
bool CanEquipEx(EntityAI focusedEntity)
Definition Container.c:470

References Container::GetFocusedItem().

◆ CanEquipEx()

bool LayoutHolder::CanEquipEx ( EntityAI focusedEntity)
inlineprotected

Definition at line 470 of file Container.c.

471 {
472 if (ItemManager.GetInstance().IsMicromanagmentMode())
473 return false;
474
475 bool found = false;
476 if (focusedEntity)
477 {
480 found = player.GetInventory().FindFreeLocationFor(focusedEntity, FindInventoryLocationType.ATTACHMENT, il);
481
482 if (!found)
483 {
484 for (int i = 0; i < focusedEntity.GetInventory().GetSlotIdCount(); i++)
485 {
486 int slot_id = focusedEntity.GetInventory().GetSlotId(i);
487 EntityAI slot_item = player.GetInventory().FindAttachment(slot_id);
488 if (slot_item && player.GetInventory().CanSwapEntitiesEx(focusedEntity, slot_item))
489 {
490 found = true;
491 break;
492 }
493
494 }
495 }
496 }
497 return found;
498 }
FindInventoryLocationType
flags for searching locations in inventory
InventoryLocation.

References GetGame(), ItemManager::GetInstance(), and GetPlayer().

◆ CanOpenCloseContainer()

bool LayoutHolder::CanOpenCloseContainer ( )
inlineprotected

Definition at line 342 of file Container.c.

343 {
344 if (ItemManager.GetInstance().IsMicromanagmentMode())
345 return false;
346
348 if (focusedEntity)
349 {
351 return GetFocusedContainer().CanOpenCloseContainerEx(focusedEntity);
352
354 }
355
356 return false;
357 }
bool CanOpenCloseContainerEx(EntityAI focusedEntity)
Definition Container.c:359

References Container::GetFocusedItem(), and ItemManager::GetInstance().

◆ CanOpenCloseContainerEx()

bool LayoutHolder::CanOpenCloseContainerEx ( EntityAI focusedEntity)
inlineprotected

Definition at line 359 of file Container.c.

360 {
361 return false;
362 }

◆ CanSplit()

bool LayoutHolder::CanSplit ( )
inlineprotected

Definition at line 364 of file Container.c.

365 {
367 if (focusedEntity)
368 {
370 return GetFocusedContainer().CanSplitEx(focusedEntity);
371
373 }
374
375 return false;
376 }
bool CanSplitEx(EntityAI focusedEntity)
Definition Container.c:378

References Container::GetFocusedItem().

◆ CanSplitEx()

bool LayoutHolder::CanSplitEx ( EntityAI focusedEntity)
inlineprotected

Definition at line 378 of file Container.c.

379 {
380 if (ItemManager.GetInstance().IsMicromanagmentMode())
381 return false;
382
383 if (focusedEntity)
384 return focusedEntity.CanBeSplit();
385 return false;
386 }

References ItemManager::GetInstance().

◆ CanSwapOrTakeToHands()

bool LayoutHolder::CanSwapOrTakeToHands ( )
inlineprotected

Definition at line 418 of file Container.c.

419 {
421 if (focusedEntity)
422 {
424 return GetFocusedContainer().CanSwapOrTakeToHandsEx(focusedEntity);
425
427 }
428
429 return false;
430 }
bool CanSwapOrTakeToHandsEx(EntityAI focusedEntity)
Definition Container.c:432

References Container::GetFocusedItem().

◆ CanSwapOrTakeToHandsEx()

bool LayoutHolder::CanSwapOrTakeToHandsEx ( EntityAI focusedEntity)
inlineprotected

Definition at line 432 of file Container.c.

433 {
434 if (ItemManager.GetInstance().IsMicromanagmentMode())
435 return false;
436
437 if (focusedEntity)
438 {
440 EntityAI entityInHands = player.GetItemInHands();
441 if (entityInHands)
442 {
444
447 else
448 return true;
449 }
450 else
451 return player.GetInventory().CanAddEntityIntoHands(focusedEntity);
452 }
453 return false;
454 }
script counterpart to engine's class Inventory
Definition Inventory.c:79
static bool CanSwapEntitiesEx(notnull EntityAI item1, notnull EntityAI item2)
Definition Inventory.c:610
static bool CanForceSwapEntitiesEx(notnull EntityAI item1, InventoryLocation item1_dst, notnull EntityAI item2, out InventoryLocation item2_dst)
Definition Inventory.c:645

References GameInventory::CanForceSwapEntitiesEx(), GameInventory::CanSwapEntitiesEx(), GetGame(), ItemManager::GetInstance(), and GetPlayer().

◆ CanTakeToInventory()

bool LayoutHolder::CanTakeToInventory ( )
inlineprotected

Definition at line 500 of file Container.c.

501 {
503 if (focusedEntity)
504 {
506 return GetFocusedContainer().CanTakeToInventoryEx(focusedEntity);
507
509 }
510
511 return false;
512 }
bool CanTakeToInventoryEx(EntityAI focusedEntity)
Definition Container.c:514

References Container::GetFocusedItem().

◆ CanTakeToInventoryEx()

bool LayoutHolder::CanTakeToInventoryEx ( EntityAI focusedEntity)
inlineprotected

Definition at line 514 of file Container.c.

515 {
516 if (ItemManager.GetInstance().IsMicromanagmentMode())
517 return false;
518
519 if (focusedEntity)
520 {
522 return player.GetInventory().CanAddEntityToInventory(focusedEntity, FindInventoryLocationType.CARGO);
523 }
524 return false;
525 }

References GetGame(), ItemManager::GetInstance(), and GetPlayer().

◆ CheckHeaderDragability()

void LayoutHolder::CheckHeaderDragability ( )
protected

◆ CheckScrollbarVisibility()

void LayoutHolder::CheckScrollbarVisibility ( )
inlineprotected

Definition at line 166 of file Container.c.

167 {
169 if (sw)
170 {
171 if (!sw.IsScrollbarVisible())
172 sw.VScrollToPos01(0.0);
173 else if (sw.GetVScrollPos01() > 1.0)
174 sw.VScrollToPos01(1.0);
175 }
176 }
ScrollWidget GetScrollWidget()
Definition Container.c:86

◆ Close()

void LayoutHolder::Close ( )
inlineprotected

Definition at line 184 of file Container.c.

185 {
186 m_Closed = true;
188 }
bool m_Closed
Definition Container.c:7
override void UpdateSelectionIcons()
Definition Container.c:1071

◆ Combine()

bool LayoutHolder::Combine ( )
inlineprotected

Definition at line 300 of file Container.c.

301 {
303 return GetFocusedContainer().Combine();
304 return true;
305 }
override bool Combine()

◆ Container()

void LayoutHolder::Container ( LayoutHolder parent)
inlineprotected

Definition at line 35 of file Container.c.

36 {
39 m_PrevAlpha = m_RootWidget.GetAlpha();
41 m_ForcedHide = false;
42 m_ForcedShow = false;
43
44 m_ActiveIndex = 0;
45 m_IsActive = false;
46 }
bool m_IsActive
ref Widget m_RootWidget[MAX_SIMULTANIOUS_PLAYERS]
ref array< ref LayoutHolder > m_Body
Definition Container.c:3
ref array< LayoutHolder > m_OpenedContainers
Definition Container.c:4
int m_ActiveIndex
Definition Container.c:5
bool m_ForcedHide
Definition Container.c:16
float m_PrevAlpha
Definition Container.c:9
bool m_ForcedShow
Definition Container.c:17
SlotsIcon m_SlotIcon
Definition Container.c:19

References m_IsActive, and m_RootWidget.

◆ Count()

int LayoutHolder::Count ( )
inlineprotected

◆ DraggingOver()

void LayoutHolder::DraggingOver ( Widget w,
int x,
int y,
Widget receiver )
protected

◆ DraggingOverHeader()

void LayoutHolder::DraggingOverHeader ( Widget w,
int x,
int y,
Widget receiver )
protected

◆ EquipItem()

bool LayoutHolder::EquipItem ( )
inlineprotected

Definition at line 335 of file Container.c.

336 {
339 return false;
340 }
override bool EquipItem()

◆ ExpandCollapseContainer()

void LayoutHolder::ExpandCollapseContainer ( )
inlineprotected

Definition at line 1076 of file Container.c.

1076{}

◆ Get()

LayoutHolder LayoutHolder::Get ( int x)
inlineprotected

Definition at line 1014 of file Container.c.

1015 {
1016 return m_Body.Get(x);
1017 }
Icon x

References x.

Referenced by PluginBase::Broadcast(), PluginBase::BroadcastFloat(), PluginBase::BroadcastInt(), PluginBase::BroadcastParam(), and PluginBase::BroadcastString().

◆ GetActiveIndex()

int LayoutHolder::GetActiveIndex ( )
inlineprotected

Definition at line 76 of file Container.c.

77 {
78 return m_ActiveIndex;
79 }

◆ GetColumnCount()

int LayoutHolder::GetColumnCount ( )
inlineprotected

Definition at line 634 of file Container.c.

635 {
636 return m_ColumnCount;
637 }
int m_ColumnCount
Definition Container.c:13

◆ GetContainer()

Container LayoutHolder::GetContainer ( int index)
inlineprotected

Definition at line 55 of file Container.c.

56 {
57 if (index < m_Body.Count())
58 return Container.Cast(m_Body[index]);
59 return null;
60 }

◆ GetFocusedColumn()

int LayoutHolder::GetFocusedColumn ( )
inlineprotected

Definition at line 644 of file Container.c.

645 {
646 return m_FocusedColumn;
647 }
int m_FocusedColumn
Definition Container.c:15

◆ GetFocusedContainer()

Container LayoutHolder::GetFocusedContainer ( )
inlineprotected

Definition at line 48 of file Container.c.

49 {
52 return null;
53 }

◆ GetFocusedContainerEntity()

EntityAI LayoutHolder::GetFocusedContainerEntity ( )
inlineprotected

Definition at line 626 of file Container.c.

627 {
630 item = GetFocusedContainer().GetFocusedContainerEntity();
631 return item;
632 }

◆ GetFocusedContainerHeight()

float LayoutHolder::GetFocusedContainerHeight ( bool contents = false)
inlineprotected

Definition at line 220 of file Container.c.

221 {
222 float x, y, result;
225 else if (GetRootWidget())
226 GetRootWidget().GetScreenSize(x, y);
227
228 result = y;
229
230 if (m_ActiveIndex == 0)
231 {
232 if (GetHeader())
233 {
234 GetHeader().GetRootWidget().GetScreenSize(x, y);
235 result += y;
236 }
237 }
238 return result;
239 }
Icon y
override float GetFocusedContainerHeight(bool contents=false)
Header GetHeader()

References GetFocusedContainerHeight(), Container::GetHeader(), x, and y.

Referenced by Container::GetFocusedContainerHeight(), and GetFocusedContainerHeight().

◆ GetFocusedContainerYPos()

float LayoutHolder::GetFocusedContainerYPos ( bool contents = false)
inlineprotected

Definition at line 241 of file Container.c.

242 {
243 float x, y;
246 else if (GetRootWidget())
247 GetRootWidget().GetPos(x, y);
248
249 return y;
250 }
override float GetFocusedContainerYPos(bool contents=false)

References GetFocusedContainerYPos(), x, and y.

Referenced by Container::GetFocusedContainerYPos(), and GetFocusedContainerYPos().

◆ GetFocusedContainerYScreenPos()

float LayoutHolder::GetFocusedContainerYScreenPos ( bool contents = false)
inlineprotected

Definition at line 252 of file Container.c.

253 {
254 float x, y, result;
257 else if (GetRootWidget())
258 GetRootWidget().GetScreenPos(x, y);
259
260
261 result = y;
262
263 if (m_ActiveIndex == 0)
264 {
265 if (GetHeader())
266 {
267 GetHeader().GetRootWidget().GetScreenPos(x, y);
268 result = y;
269 }
270 }
271 return result;
272 }
override float GetFocusedContainerYScreenPos(bool contents=false)

References GetFocusedContainerYScreenPos(), Container::GetHeader(), x, and y.

Referenced by Container::GetFocusedContainerYScreenPos(), and GetFocusedContainerYScreenPos().

◆ GetFocusedItem()

EntityAI LayoutHolder::GetFocusedItem ( )
inlineprotected

Definition at line 617 of file Container.c.

618 {
622
623 return item;
624 }
override EntityAI GetFocusedItem()

◆ GetFocusedSlotsIcon()

SlotsIcon LayoutHolder::GetFocusedSlotsIcon ( )
inlineprotected

Definition at line 68 of file Container.c.

69 {
71 if (c)
72 return c.GetFocusedSlotsIcon();
73 return null;
74 }

◆ GetHeader()

Header LayoutHolder::GetHeader ( )
protected

◆ GetScrollWidget()

ScrollWidget LayoutHolder::GetScrollWidget ( )
inlineprotected

Definition at line 86 of file Container.c.

87 {
88 return null;
89 }

◆ HideContent()

void LayoutHolder::HideContent ( bool force_hide = false)
inlineprotected

Definition at line 1040 of file Container.c.

1041 {
1042 if (!m_ForcedHide)
1044 for (int i = 0; i < m_Body.Count(); i++)
1045 {
1046 if (m_Body.Get(i))
1047 m_Body.Get(i).OnHide();
1048 }
1049 }

◆ Insert()

void LayoutHolder::Insert ( LayoutHolder container,
int pos = -1,
bool immedUpdate = true )
inlineprotected

Definition at line 973 of file Container.c.

974 {
975 if (pos > -1 && pos < m_Body.Count())
976 {
977 if (pos <= m_ActiveIndex)
979 m_Body.InsertAt(container, pos);
980 }
981 else
982 m_Body.Insert(container);
983
984 if (immedUpdate)
985 Refresh();
986 }
override void Refresh()
Definition Container.c:1019

References Container::Refresh().

◆ InspectItem()

bool LayoutHolder::InspectItem ( )
inlineprotected

Definition at line 321 of file Container.c.

322 {
324 return GetFocusedContainer().InspectItem();
325 return false;
326 }

Referenced by Icon::MouseClick().

◆ IsEmpty()

bool LayoutHolder::IsEmpty ( )
inlineprotected

Definition at line 598 of file Container.c.

599 {
600 return m_OpenedContainers.Count() == 0;
601 }

◆ IsFirstContainerFocused()

bool LayoutHolder::IsFirstContainerFocused ( )
inlineprotected

Definition at line 798 of file Container.c.

799 {
800 return m_ActiveIndex == 0;
801 }

◆ IsFirstIndex()

bool LayoutHolder::IsFirstIndex ( )
inlineprotected

Definition at line 793 of file Container.c.

794 {
795 return m_ActiveIndex == 0;
796 }

◆ IsItemActive()

bool LayoutHolder::IsItemActive ( )
inlineprotected

Definition at line 603 of file Container.c.

604 {
607 return false;
608 }
override bool IsItemActive()

◆ IsItemWithQuantityActive()

bool LayoutHolder::IsItemWithQuantityActive ( )
inlineprotected

Definition at line 610 of file Container.c.

611 {
614 return false;
615 }
override bool IsItemWithQuantityActive()

◆ IsLastContainerFocused()

bool LayoutHolder::IsLastContainerFocused ( )
inlineprotected

Definition at line 803 of file Container.c.

804 {
805 return m_ActiveIndex >= (m_OpenedContainers.Count() - 1);
806 }

◆ IsLastIndex()

bool LayoutHolder::IsLastIndex ( )
inlineprotected

Definition at line 788 of file Container.c.

789 {
790 return m_ActiveIndex == (m_OpenedContainers.Count() - 1);
791 }

◆ IsOpened()

bool LayoutHolder::IsOpened ( )
inlineprotected

Definition at line 190 of file Container.c.

191 {
192 return !m_Closed;
193 }

◆ MoveGridCursor()

void LayoutHolder::MoveGridCursor ( int direction)
inlineprotected

Definition at line 119 of file Container.c.

120 {
121 if (direction == Direction.UP)
123 else if (direction == Direction.DOWN)
125 else if (direction == Direction.RIGHT)
127 else if (direction == Direction.LEFT)
129
131
132 Inventory.GetInstance().UpdateConsoleToolbar();
133 }
Direction
Definition Inventory.c:19
void Inventory(LayoutHolder parent)
Definition Inventory.c:76
void SetNextLeftActive()
Definition Container.c:886
void SetPreviousActive(bool force=false)
Definition Container.c:846
void SetNextActive()
Definition Container.c:816
void SetNextRightActive()
Definition Container.c:876

References Inventory(), Container::SetNextActive(), Container::SetNextLeftActive(), Container::SetNextRightActive(), and Container::SetPreviousActive().

◆ OnDropReceivedFromHeader()

void LayoutHolder::OnDropReceivedFromHeader ( Widget w,
int x,
int y,
Widget receiver )
protected

◆ OnSelectButton()

bool LayoutHolder::OnSelectButton ( )
inlineprotected

Definition at line 293 of file Container.c.

294 {
296 return GetFocusedContainer().OnSelectButton();
297 return false;
298 }

◆ Open()

void LayoutHolder::Open ( )
inlineprotected

Definition at line 178 of file Container.c.

179 {
180 m_Closed = false;
182 }

◆ RecomputeOpenedContainers()

void LayoutHolder::RecomputeOpenedContainers ( )
inlineprotected

Definition at line 924 of file Container.c.

925 {
926 m_OpenedContainers.Clear();
927 int i;
928 bool need_reset_focus = false;
929 Container c;
930 for (i = 0; i < m_Body.Count(); i++)
931 {
932 c = Container.Cast(m_Body.Get(i));
933 if (c)
934 {
935 c.RecomputeOpenedContainers();
936 if (c.IsDisplayable() && c.IsVisible())
937 m_OpenedContainers.Insert(c);
938 else if (c.IsActive())
939 {
940 c.SetActive(false);
941 need_reset_focus = true;
942 }
943
944 }
945 }
946
947 //In case of removing focused container or change order of containers
948 if (IsActive())
949 {
951 {
952 need_reset_focus = true;
953 for (i = 0; i < m_OpenedContainers.Count(); i++)
954 {
956 {
957 need_reset_focus = false;
959 }
960 }
961 }
962
965 }
966 }
bool IsActive()
override void SetFirstActive()
Definition Container.c:701

References IsActive().

◆ Refresh()

override void LayoutHolder::Refresh ( )
inlineprotected

Definition at line 1019 of file Container.c.

1020 {
1021 for (int i = 0; i < m_Body.Count(); i++)
1022 {
1023 if (m_Body.Get(i))
1024 m_Body.Get(i).Refresh();
1025 }
1026 }

◆ Remove()

void LayoutHolder::Remove ( LayoutHolder container)
inlineprotected

Definition at line 988 of file Container.c.

989 {
990 if (m_Body)
991 {
992 int index = m_Body.Find(container);
993 if (index > -1)
994 {
996 if (index > -1)
997 {
998 if (index <= m_ActiveIndex)
999 {
1001 SetPreviousActive(true);
1002 else
1003 m_ActiveIndex--;
1004 }
1005 m_OpenedContainers.RemoveItem(container);
1006 }
1007 m_Body.RemoveItem(container);
1008 }
1009 }
1010
1011 Refresh();
1012 }

References Container::Refresh(), and Container::SetPreviousActive().

◆ ResetFocusedContainer()

void LayoutHolder::ResetFocusedContainer ( )
inlineprotected

Definition at line 808 of file Container.c.

809 {
811 GetFocusedContainer().ResetFocusedContainer();
812
813 m_ActiveIndex == 0;
814 }

◆ ScrollToActiveContainer()

void LayoutHolder::ScrollToActiveContainer ( )
inlineprotected

Definition at line 135 of file Container.c.

136 {
138 if (sw)
139 {
140 float x, y, y_s;
141
142 sw.GetScreenPos(x, y);
143 sw.GetScreenSize(x, y_s);
144 float f_y, f_h;
145 float amount;
148
149 float next_pos = f_y + f_h;
150
151 if (next_pos > (y + y_s))
152 {
153 amount = sw.GetVScrollPos() + next_pos - (y + y_s) + 2;
154 sw.VScrollToPos(amount);
155 }
156 else if (f_y < y)
157 {
158 amount = sw.GetVScrollPos() + f_y - y - 2;
159 sw.VScrollToPos(amount);
160 }
161
162 //CheckScrollbarVisibility();
163 }
164 }
float GetFocusedContainerYScreenPos(bool contents=false)
Definition Container.c:252
float GetFocusedContainerHeight(bool contents=false)
Definition Container.c:220

References Container::GetFocusedContainerHeight(), Container::GetFocusedContainerYScreenPos(), x, and y.

◆ Select()

bool LayoutHolder::Select ( )
inlineprotected

Definition at line 286 of file Container.c.

287 {
289 return GetFocusedContainer().Select();
290 return false;
291 }
override bool Select()

◆ SelectItem()

bool LayoutHolder::SelectItem ( )
inlineprotected

Definition at line 279 of file Container.c.

280 {
283 return false;
284 }
override bool SelectItem()

◆ SetActive()

override void LayoutHolder::SetActive ( bool active)
inlineprotected

Definition at line 725 of file Container.c.

726 {
727 if (!active)
728 HideOwnedTooltip();
729
730 if (!active && !m_IsActive)
731 return;
732
733 super.SetActive(active);
734 if (GetHeader())
736
737 if (m_MainWidget.FindAnyWidget("SelectedContainer"))
738 m_MainWidget.FindAnyWidget("SelectedContainer").Show(active);
739
740 Container c;
741 if (active)
742 {
743
745 if (m_OpenedContainers.Count())
746 {
748 if (c)
749 c.SetActive(active);
750 }
751 }
752 else
753 {
755 if (c)
757 Unfocus();
758 m_ActiveIndex = 0;
759 m_FocusedColumn = 0;
760 }
761 }
override void SetActive(bool active)
override void SetActive(bool active)
Definition Header.c:64
void Unfocus()
Definition Container.c:115
void SetDefaultFocus(bool while_micromanagment_mode=false)
Definition Container.c:102

References Container::GetHeader(), m_IsActive, Container::SetDefaultFocus(), and Container::Unfocus().

◆ SetActiveIndex()

void LayoutHolder::SetActiveIndex ( int index)
inlineprotected

Definition at line 81 of file Container.c.

82 {
84 }

◆ SetColumnCount()

void LayoutHolder::SetColumnCount ( int count)
inlineprotected

Definition at line 639 of file Container.c.

640 {
642 }

◆ SetDefaultFocus()

void LayoutHolder::SetDefaultFocus ( bool while_micromanagment_mode = false)
inlineprotected

Definition at line 102 of file Container.c.

103 {
104 m_ActiveIndex = 0;
105 }

◆ SetFirstActive()

override void LayoutHolder::SetFirstActive ( )
inlineprotected

Definition at line 701 of file Container.c.

702 {
703 if (!m_IsActive)
704 SetActive(true);
705 else
706 {
707 if (m_OpenedContainers.Count())
708 {
711 {
712 for (int i = 1; i < m_OpenedContainers.Count(); i++)
713 {
715 m_OpenedContainers[i].SetActive(false);
716 }
717 m_OpenedContainers[m_ActiveIndex].SetActive(true);
718 }
719 else
720 m_OpenedContainers[m_ActiveIndex].SetFirstActive();
721 }
722 }
723 }
void SetActive()
Definition TrapBase.c:409

References IsActive(), m_IsActive, SetActive(), and Container::SetDefaultFocus().

◆ SetFocusedColumn()

void LayoutHolder::SetFocusedColumn ( int column)
inlineprotected

Definition at line 649 of file Container.c.

650 {
652 }

◆ SetFocusedContainer()

void LayoutHolder::SetFocusedContainer ( Container cont)
inlineprotected

Definition at line 63 of file Container.c.

64 {
66 }
Container m_FocusedContainer
Definition Container.c:8

◆ SetForceShow()

void LayoutHolder::SetForceShow ( bool value)
inlineprotected

Definition at line 1066 of file Container.c.

1067 {
1069 }

◆ SetHeader()

void LayoutHolder::SetHeader ( Header header)
protected

◆ SetLastActive()

override void LayoutHolder::SetLastActive ( )
inlineprotected

Definition at line 665 of file Container.c.

666 {
667 if (m_IsActive)
668 {
669 m_IsActive = true;
670 if (m_OpenedContainers.Count())
671 {
672 SetLastFocus();
674 {
675 for (int i = 0; i < m_OpenedContainers.Count() - 1; i++)
676 {
678 m_OpenedContainers[i].SetActive(false);
679 }
680 m_OpenedContainers[m_ActiveIndex].SetLastActive();
681 }
682 else
683 m_OpenedContainers[m_ActiveIndex].SetLastActive();
684 }
685 }
686 else
687 {
688 m_IsActive = true;
689 if (GetHeader())
691 SetLastFocus();
692 if (m_OpenedContainers.Count())
693 {
695 if (c)
696 c.SetLastActive();
697 }
698 }
699 }
void SetLastFocus()
Definition Container.c:107

References Container::GetHeader(), IsActive(), m_IsActive, and Container::SetLastFocus().

◆ SetLastFocus()

void LayoutHolder::SetLastFocus ( )
inlineprotected

Definition at line 107 of file Container.c.

108 {
109 m_ActiveIndex = 0;
110 m_FocusedColumn = 0;
111 if (m_OpenedContainers.Count() > 0)
112 m_ActiveIndex = m_OpenedContainers.Count() - 1;
113 }

◆ SetLayoutName()

override void LayoutHolder::SetLayoutName ( )
inlineprotected

Definition at line 968 of file Container.c.

969 {
970 m_LayoutName = WidgetLayoutName.Container;
971 }
const string Container

References WidgetLayoutName::Container.

Referenced by ScriptedWidgetEventHandler::LayoutHolder().

◆ SetNextActive()

void LayoutHolder::SetNextActive ( )
inlineprotected

Definition at line 816 of file Container.c.

817 {
818 HideOwnedTooltip();
819
821 if (m_OpenedContainers.Count())
823
824 if (active && active.IsActive())
825 active.SetNextActive();
826 if (!active || !active.IsActive())
827 {
830 {
832
834 next.SetActive(true);
835 }
836 else if (Container.Cast(GetParent()))
837 SetActive(false);
838 else
839 {
840 SetActive(false);
842 }
843 }
844 }
bool IsLastContainerFocused()
Definition Container.c:803
proto native Widget GetParent()
Get parent of the Effect.
Definition Effect.c:389

References GetParent(), and SetActive().

◆ SetNextLeftActive()

void LayoutHolder::SetNextLeftActive ( )
inlineprotected

Definition at line 886 of file Container.c.

887 {
889 if (m_OpenedContainers.Count())
891
892 if (active)
893 active.SetNextLeftActive();
894 }

◆ SetNextRightActive()

void LayoutHolder::SetNextRightActive ( )
inlineprotected

Definition at line 876 of file Container.c.

877 {
879 if (m_OpenedContainers.Count())
881
882 if (active)
883 active.SetNextRightActive();
884 }

◆ SetOpenForSlotIcon()

void LayoutHolder::SetOpenForSlotIcon ( bool open,
SlotsIcon icon = null )
inlineprotected

Definition at line 195 of file Container.c.

196 {
197 if (!icon)
199
200 if (icon)
201 {
202 icon.GetRadialIcon().Show(open);
203 icon.GetRadialIconClosed().Show(!open);
204 }
205 /*else
206 {
207 ErrorEx("Dbg No Icon");
208 }*/
209 }

◆ SetPreviousActive()

void LayoutHolder::SetPreviousActive ( bool force = false)
inlineprotected

Definition at line 846 of file Container.c.

847 {
848 HideOwnedTooltip();
850 if (m_OpenedContainers.Count())
852
853 if (active && active.IsActive())
854 active.SetPreviousActive();
855
856 if (!active || !active.IsActive())
857 {
860 {
862
864 prev.SetLastActive();
865 }
866 else if (Container.Cast(GetParent()))
867 SetActive(false);
868 else
869 {
870 SetActive(false);
872 }
873 }
874 }
override void SetLastActive()
Definition Container.c:665
bool IsFirstContainerFocused()
Definition Container.c:798

References GetParent(), SetActive(), and Container::SetLastActive().

◆ SetSameLevelNextActive()

void LayoutHolder::SetSameLevelNextActive ( )
inlineprotected

Definition at line 896 of file Container.c.

897 {
900 active.SetActive(false);
901
903 if (m_ActiveIndex > m_OpenedContainers.Count() - 1)
904 m_ActiveIndex = 0;
905
907 active.SetActive(true);
908 }

◆ SetSameLevelPreviousActive()

void LayoutHolder::SetSameLevelPreviousActive ( )
inlineprotected

Definition at line 910 of file Container.c.

911 {
914 active.SetActive(false);
915
917 if (m_ActiveIndex < 0)
918 m_ActiveIndex = m_OpenedContainers.Count() - 1;
919
921 active.SetActive(true);
922 }

◆ SetSlotIcon()

void LayoutHolder::SetSlotIcon ( SlotsIcon icon)
inlineprotected

Definition at line 97 of file Container.c.

98 {
100 }

◆ ShowContent()

void LayoutHolder::ShowContent ( bool force_show = false)
inlineprotected

Definition at line 1051 of file Container.c.

1052 {
1053 if (force_show)
1054 m_ForcedHide = false;
1055
1056 if (!m_ForcedHide)
1057 {
1058 for (int i = 0; i < m_Body.Count(); i++)
1059 {
1060 if (m_Body.Get(i))
1061 m_Body.Get(i).OnShow();
1062 }
1063 }
1064 }

◆ SplitItem()

bool LayoutHolder::SplitItem ( )
inlineprotected

Definition at line 328 of file Container.c.

329 {
332 return false;
333 }
override bool SplitItem()

◆ Toggle()

void LayoutHolder::Toggle ( )
inlineprotected

Definition at line 211 of file Container.c.

212 {
213 if (IsOpened())
214 Close();
215 else
216 Open();
218 }
void Close()
Definition Container.c:184
void SetOpenForSlotIcon(bool open, SlotsIcon icon=null)
Definition Container.c:195
void Open()
Definition Container.c:178
bool IsOpened()
Definition Container.c:190

References Container::Close(), IsOpened(), and Container::Open().

◆ TransferItem()

bool LayoutHolder::TransferItem ( )
inlineprotected

Definition at line 314 of file Container.c.

315 {
318 return false;
319 }
override bool TransferItem()

◆ TransferItemToVicinity()

bool LayoutHolder::TransferItemToVicinity ( )
inlineprotected

Definition at line 307 of file Container.c.

308 {
311 return false;
312 }
override bool TransferItemToVicinity()

◆ Unfocus()

void LayoutHolder::Unfocus ( )
inlineprotected

Definition at line 115 of file Container.c.

116 {
117 }

◆ UnfocusAll()

void LayoutHolder::UnfocusAll ( )
inlineprotected

Definition at line 763 of file Container.c.

764 {
765 for (int i = 0; i < Count(); i++)
766 {
767 for (int j = 0; j < ITEMS_IN_ROW; j++)
768 {
770 if (Get(i) && Get(i).GetMainWidget())
771 Get(i).GetMainWidget().GetUserData(icon);
772
773 if (icon)
774 icon.GetCursorWidget().Show(false);
775 }
776 }
777 }
array< ref PlayerStatBase > Get()
const int ITEMS_IN_ROW
Definition Container.c:10

References Count, Get(), and ITEMS_IN_ROW.

◆ UnfocusGrid()

void LayoutHolder::UnfocusGrid ( )
inlineprotected

Definition at line 779 of file Container.c.

780 {
782 {
783 m_FocusedColumn = 0;
785 }
786 }
override void UnfocusAll()

◆ UpdateBodySpacers()

void LayoutHolder::UpdateBodySpacers ( )
inlineprotected

Definition at line 1028 of file Container.c.

1029 {
1030 for (int i = 0; i < m_Body.Count(); i++)
1031 {
1032 Container c = Container.Cast(m_Body.Get(i));
1033 if (c && c.IsInherited(Container))
1034 c.UpdateSpacer();
1035 }
1036
1037 UpdateSpacer();
1038 }
void UpdateSpacer()

◆ UpdateInterval()

override void LayoutHolder::UpdateInterval ( )
inlineprotected

Definition at line 654 of file Container.c.

655 {
656 for (int i = 0; i < m_Body.Count(); i++)
657 {
658 if (m_Body.Get(i))
659 m_Body.Get(i).UpdateInterval();
660 }
661
663 }
void CheckHeaderDragability()

References Container::CheckHeaderDragability().

◆ UpdateRadialIcon()

void LayoutHolder::UpdateRadialIcon ( )
inlineprotected

Definition at line 91 of file Container.c.

92 {
93 if (m_SlotIcon)
94 m_SlotIcon.GetRadialIconPanel().Show(false);
95 }
Widget GetRadialIconPanel()
Definition SlotsIcon.c:302

References SlotsIcon::GetRadialIconPanel().

◆ UpdateSelectionIcons()

override void LayoutHolder::UpdateSelectionIcons ( )
inlineprotected

Definition at line 1071 of file Container.c.

1072 {
1073 m_Parent.UpdateSelectionIcons();
1074 }
Widget m_Parent
Definition SizeToChild.c:86

References m_Parent.

◆ UpdateSpacer()

void LayoutHolder::UpdateSpacer ( )
protected

Member Data Documentation

◆ ITEMS_IN_ROW

const int LayoutHolder::ITEMS_IN_ROW = 8
protected

Definition at line 10 of file Container.c.

◆ m_ActiveIndex

int LayoutHolder::m_ActiveIndex = 0
protected

Definition at line 5 of file Container.c.

◆ m_Body

ref array<ref LayoutHolder> LayoutHolder::m_Body
protected

Definition at line 3 of file Container.c.

◆ m_Closed

bool LayoutHolder::m_Closed
protected

Definition at line 7 of file Container.c.

◆ m_ColumnCount

int LayoutHolder::m_ColumnCount
protected

Definition at line 13 of file Container.c.

◆ m_Entity

EntityAI LayoutHolder::m_Entity
protected

Definition at line 20 of file Container.c.

◆ m_FocusedColumn

int LayoutHolder::m_FocusedColumn = 0
protected

Definition at line 15 of file Container.c.

◆ m_FocusedContainer

Container LayoutHolder::m_FocusedContainer
protected

Definition at line 8 of file Container.c.

◆ m_ForcedHide

bool LayoutHolder::m_ForcedHide
protected

Definition at line 16 of file Container.c.

◆ m_ForcedShow

bool LayoutHolder::m_ForcedShow
protected

Definition at line 17 of file Container.c.

◆ m_LastIndex

bool LayoutHolder::m_LastIndex
protected

Definition at line 6 of file Container.c.

◆ m_OpenedContainers

ref array<LayoutHolder> LayoutHolder::m_OpenedContainers
protected

Definition at line 4 of file Container.c.

◆ m_PrevAlpha

float LayoutHolder::m_PrevAlpha
protected

Definition at line 9 of file Container.c.

◆ m_SlotIcon

SlotsIcon LayoutHolder::m_SlotIcon
protected

Definition at line 19 of file Container.c.

◆ SORT_ATTACHMENTS_NEXT_OFFSET

const int LayoutHolder::SORT_ATTACHMENTS_NEXT_OFFSET = 2
protected

Definition at line 24 of file Container.c.

◆ SORT_ATTACHMENTS_OWN

const int LayoutHolder::SORT_ATTACHMENTS_OWN = 1
protected

Definition at line 22 of file Container.c.

◆ SORT_CARGO_NEXT_OFFSET

const int LayoutHolder::SORT_CARGO_NEXT_OFFSET = 3
protected

Definition at line 25 of file Container.c.

◆ SORT_CARGO_OWN

const int LayoutHolder::SORT_CARGO_OWN = 2
protected

Definition at line 23 of file Container.c.


The documentation for this class was generated from the following file: