Dayz Explorer  1.24.157551 (v105080)
Dayz Code Explorer by Zeroy
handsheader.c
Go to the documentation of this file.
2 {
3  protected bool m_ForceHideCollapseButtons;
4  protected Widget m_ItemHeader;
5 
6  void HandsHeader( LayoutHolder parent, string function_name )
7  {
8  m_DefaultFontSize = 24;
9  m_ItemHeader = m_MainWidget.FindAnyWidget( "hands_item_header" );
10 
11  m_MainWidget = GetMainWidget().FindAnyWidget( "height_wrapper" );
12  m_DefaultColor = GetMainWidget().GetColor();
13  #ifdef PLATFORM_CONSOLE
14  ShowCollapseButtons( false, true );
15  #endif
16  }
17 
18  override void SetLayoutName()
19  {
20  m_LayoutName = WidgetLayoutName.HandsHeader;
21  }
22 
23  override void UpdateInterval()
24  {
25  PlayerBase p = PlayerBase.Cast( GetGame().GetPlayer() );
26  if (!p)
27  return;
28 
29  EntityAI item = p.GetHumanInventory().GetEntityInHands();
30  /*if ( !m_ForceHideCollapseButtons )
31  {
32  if ( item && !item.GetInventory().IsInventoryLockedForLockType( HIDE_INV_FROM_SCRIPT ) && item.HasCargo() )
33  {
34  ShowCollapseButtons( true );
35  }
36  else
37  {
38  ShowCollapseButtons( false );
39  }
40  }*/
41 
42  m_ItemHeader.Show( item != null );
43  }
44 
45  void ShowCollapseButtons( bool show, bool force = false )
46  {
47  m_ForceHideCollapseButtons = force;
48  #ifdef PLATFORM_CONSOLE
49  m_CollapseButton.Show( false );
50  #else
51  m_CollapseButton.Show( show );
52  #endif
53  }
54 }
GetGame
proto native CGame GetGame()
LayoutHolder
Definition: container.c:1
HandsHeader
Definition: handsheader.c:1
WidgetLayoutName
Definition: widgetlayoutname.c:1
PlayerBase
Definition: playerbaseclient.c:1
Header
Definition: header.c:1
GetPlayer
protected void GetPlayer()
Definition: crosshairselector.c:127
Widget
Definition: enwidgets.c:189
EntityAI
Definition: building.c:5