4 protected bool m_LockCargo;
9 m_ClosableHeader =
new ClosableHeader(
this,
"CloseButtonOnMouseButtonDown" );
14 m_MainWidget = m_MainWidget.FindWidget(
"body" );
17 override bool IsDisplayable()
19 for(
int i = 0; i < m_Body.Count(); i++)
22 if( c && c.IsDisplayable())
28 override void UpdateRadialIcon()
32 bool show_radial_icon;
33 show_radial_icon = IsOpened();
34 show_radial_icon = show_radial_icon && ( (
m_Entity.GetInventory().GetCargo() &&
m_Entity.CanDisplayCargo()) ||
m_Entity.GetSlotsCountCorrect() > 0 );
35 show_radial_icon = show_radial_icon && !
m_Entity.GetInventory().IsInventoryLockedForLockType( HIDE_INV_FROM_SCRIPT );
36 if ( IsDisplayable() )
38 m_SlotIcon.GetRadialIconPanel().Show(
true );
39 SetOpenForSlotIcon(show_radial_icon);
43 m_SlotIcon.GetRadialIconPanel().Show(
false );
48 void SetOpenState(
bool state )
64 return m_ClosableHeader;
73 SetOpenForSlotIcon(
true);
83 SetOpenForSlotIcon(
false);
103 if( m_Body &&
x < m_Body.Count() &&
x >= 0 )
104 return m_Body.Get(
x );
116 void CloseButtonOnMouseButtonDown()
121 override float GetFocusedContainerHeight(
bool contents =
false )
124 if( contents && GetFocusedContainer() )
125 y = GetFocusedContainer().GetFocusedContainerHeight( contents );
126 else if( GetRootWidget() )
127 GetRootWidget().GetScreenSize(
x,
y );
131 override float GetFocusedContainerYPos(
bool contents =
false )
134 if( contents && GetFocusedContainer() )
135 y = GetFocusedContainer().GetFocusedContainerYPos( contents );
136 else if( GetRootWidget() )
137 GetRootWidget().GetPos(
x,
y );
141 override float GetFocusedContainerYScreenPos(
bool contents =
false )
144 if( contents && GetFocusedContainer() )
145 y = GetFocusedContainer().GetFocusedContainerYScreenPos( contents );
146 else if( GetRootWidget() )
147 GetRootWidget().GetScreenPos(
x,
y );
151 void MoveContainerUp(
Widget cont )
156 m_Entity.GetInventory().GetCurrentInventoryLocation( loc );
159 int slot = loc.GetSlot();
161 UpdateSelectionIcons();
166 void MoveContainerDown(
Widget cont )
171 m_Entity.GetInventory().GetCurrentInventoryLocation( loc );
174 int slot = loc.GetSlot();
176 UpdateSelectionIcons();
181 override void CheckHeaderDragability()
183 super.CheckHeaderDragability();
187 int flag = m_ClosableHeader.GetMainWidget().GetFlags();
193 m_ClosableHeader.GetMainWidget().ClearFlags(
WidgetFlags.DRAGGABLE );
195 if (drag && drag == m_ClosableHeader.GetMainWidget())
198 m_ClosableHeader.OnDropHeader(
null);
203 else if (!old && current)
205 m_ClosableHeader.GetMainWidget().SetFlags(
WidgetFlags.DRAGGABLE );