3 protected ScrollWidget m_Scroller;
5 protected ref SizeToChild m_HandsResizer;
7 protected bool m_ShouldChangeSize =
true;
12 m_Body.Insert(m_HandsContainer);
15 m_MainWidget.Update();
19 RecomputeOpenedContainers();
24 Widget swap_cursor = m_MainWidget.FindAnyWidget(
"SwapCursor");
27 return swap_cursor.IsVisible();
32 bool IsCombineActive()
34 Widget combine_cursor = m_MainWidget.FindAnyWidget(
"CombineCursor");
37 return combine_cursor.IsVisible();
42 override ScrollWidget GetScrollWidget()
47 override void UpdateSelectionIcons()
49 #ifdef PLATFORM_CONSOLE
50 ScrollToActiveContainer();
54 override void UpdateInterval()
56 if (!m_Scroller.IsScrollbarVisible())
58 m_Scroller.VScrollToPos01(0.0);
60 else if (m_Scroller.GetVScrollPos01() > 1.0)
62 m_Scroller.VScrollToPos01(1.0);
64 m_HandsContainer.UpdateInterval();
68 m_Scroller.GetScreenSize(
x,
y );
69 m_MainWidget.GetScreenSize( x2, y2 );
71 m_ShouldChangeSize =
true;
74 if ( m_ShouldChangeSize && m_HandsResizer.ResizeParentToChild( changed_size,
InventoryMenu.GetHeight() * 0.5 ) )
75 m_Scroller.SetAlpha( 0.3921 );
77 m_Scroller.SetAlpha( 0 );
80 m_ShouldChangeSize =
false;
83 override void SetLayoutName()
88 override void SetParentWidget()
93 override void OnShow()
96 m_HandsContainer.OnShow();
99 override void Refresh()
101 UpdateSelectionIcons();
102 m_ShouldChangeSize =
true;
105 override void SetSameLevelNextActive()
107 super.SetSameLevelNextActive();
111 override void SetSameLevelPreviousActive()
113 super.SetSameLevelPreviousActive();
118 void DraggingOverHandsPanel(
Widget w,
int x,
int y,
Widget receiver )
129 string name = w.GetName();
130 name.Replace(
"PanelWidget",
"Render" );
144 if( ipw.GetItem() &&
GetGame().
GetPlayer().GetHumanInventory().CanAddEntityIntoHands( ipw.GetItem() ) )
148 ItemManager.GetInstance().GetCenterDropzone().SetAlpha( 1 );
154 ItemManager.GetInstance().GetCenterDropzone().SetAlpha( 1 );
158 void OnHandsPanelDropReceived(
Widget w,
int x,
int y,
Widget receiver )
163 string name = w.GetName();
164 name.Replace(
"PanelWidget",
"Render" );
178 if( !ipw.GetItem().GetInventory().CanRemoveEntity() )
181 if(
GetGame().
GetPlayer().GetHumanInventory().CanAddEntityIntoHands( ipw.GetItem() ) )
184 float stackable = item_base.GetTargetQuantityMax(-1);
186 if( stackable == 0 || item_base.GetQuantity() <= stackable )
188 GetGame().GetPlayer().PredictiveTakeEntityToHands( item_base );
190 else if( stackable != 0 && stackable <= item_base.GetQuantity() )