4 protected Widget m_ContentParent;
6 protected ScrollWidget m_ScrollWidget;
8 protected Widget m_DownIcon;
10 protected ref SizeToChild m_ContentResize;
11 protected bool m_ShouldChangeSize =
true;
12 protected bool m_ProcessGridMovement;
16 m_MainWidget.Show(
true);
17 m_ScrollWidget = ScrollWidget.Cast( m_MainWidget.FindAnyWidget(
"Scroller" ) );
18 m_MainWidget = m_MainWidget.FindAnyWidget(
"Content");
22 m_Body.Insert(m_PlayerContainer);
24 m_ProcessGridMovement =
false;
31 RecomputeOpenedContainers();
36 return m_PlayerContainer;
39 override void DraggingOverHeader(
Widget w,
int x,
int y,
Widget receiver)
41 m_PlayerContainer.DraggingOverHeader(w,
x,
y, receiver);
44 override bool Select()
46 return m_PlayerContainer.Select();
49 override bool SelectItem()
51 return m_PlayerContainer.SelectItem();
54 override bool Combine()
56 return m_PlayerContainer.Combine();
59 override bool SplitItem()
61 return m_PlayerContainer.SplitItem();
64 override bool EquipItem()
66 return m_PlayerContainer.EquipItem();
69 override bool TransferItem()
71 return m_PlayerContainer.TransferItem();
74 override bool InspectItem()
76 return m_PlayerContainer.InspectItem();
79 override bool TransferItemToVicinity()
81 return m_PlayerContainer.TransferItemToVicinity();
84 override void UnfocusGrid()
86 m_PlayerContainer.UnfocusGrid();
89 override bool CanTakeToInventory()
94 override bool CanTakeToInventoryEx(
EntityAI focusedEntity)
99 bool HasEntityContainerVisible(
EntityAI entity)
101 return m_PlayerContainer.HasEntityContainerVisible(entity);
104 void SwapItemsInOrder(
int slot1,
int slot2)
106 m_PlayerContainer.SwapItemsInOrder(slot1, slot2);
109 bool IsPlayerEquipmentActive()
111 return m_PlayerContainer.IsPlayerEquipmentActive();
114 override void SetSameLevelNextActive()
116 m_PlayerContainer.SetSameLevelNextActive();
119 override void SetSameLevelPreviousActive()
121 m_PlayerContainer.SetSameLevelPreviousActive();
125 override void ExpandCollapseContainer()
127 m_PlayerContainer.ExpandCollapseContainer();
130 override void Refresh()
132 m_ScrollWidget.Update();
133 m_PlayerContainer.Refresh();
134 m_ShouldChangeSize =
true;
137 override void SetLayoutName()
139 #ifdef PLATFORM_CONSOLE
158 override void SetParentWidget()
163 override void OnShow()
169 override void UpdateInterval()
171 super.UpdateInterval();
172 m_PlayerContainer.UpdateInterval();
174 CheckScrollbarVisibility();
177 void MoveUpDownIcons()
179 if (m_UpIcon && m_DownIcon)
186 m_UpIcon.GetScreenSize(
x,
y );
188 float top_y = GetCurrentContainerTopY();
189 m_UpIcon.SetPos( 0,
Math.Clamp( top_y, 0, 99999 ) );
191 #ifndef PLATFORM_CONSOLE
193 m_DownIcon.GetScreenSize( x2, y2 );
194 float bottom_y = GetCurrentContainerBottomY() - y2;
196 float diff = bottom_y - ( top_y +
y );
200 bottom_y -= diff / 2;
202 m_DownIcon.SetPos( 0, bottom_y );
216 override ScrollWidget GetScrollWidget()
218 return m_ScrollWidget;
221 override void UpdateSelectionIcons()
223 #ifdef PLATFORM_CONSOLE
224 ScrollToActiveContainer();
229 float GetCurrentContainerTopY()
232 GetMainWidget().Update();
233 GetMainWidget().GetScreenPos(
x,
y );
234 float cont_screen_pos = GetFocusedContainerYScreenPos();
236 return cont_screen_pos -
y;
239 float GetCurrentContainerBottomY()
242 GetMainWidget().Update();
243 GetMainWidget().GetScreenPos(
x,
y );
245 float cont_screen_pos = GetFocusedContainerYScreenPos();
246 float cont_screen_height = GetFocusedContainerHeight();
247 return cont_screen_pos -
y + cont_screen_height;