Arma Reforger Explorer  1.1.0.42
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
SCR_InventoryButtonPageUI.c
Go to the documentation of this file.
2 {
7 };
8 
9 
10 //------------------------------------------------------------------------------------------------
14 {
15 
16  protected SCR_InventoryMenuUI m_pMenuHandler;
17  protected SCR_InventoryStorageBaseUI m_pStorageUI = null;
18  protected EInventoryButton m_EButtonType;
19  protected Widget m_widget;
20  //------------------------------------------------------------------------ USER METHODS ------------------------------------------------------------------------
21 
22  //------------------------------------------------------------------------------------------------
23 
24  //------------------------------------------------------------------------ COMMON METHODS ----------------------------------------------------------------------
25 
26  //------------------------------------------------------------------------------------------------
27  override bool OnClick(Widget w, int x, int y, int button)
28  {
29  switch ( m_EButtonType )
30  {
31  case EInventoryButton.BUTTON_PAGE_PREV:
32  {
33  if ( m_pStorageUI )
34  m_pStorageUI.Action_PrevPage();
35  } break;
36  case EInventoryButton.BUTTON_PAGE_NEXT:
37  {
38  if ( m_pStorageUI )
39  m_pStorageUI.Action_NextPage();
40  } break;
41 
42  case EInventoryButton.BUTTON_TRAVERSE_BACK:
43  {
44  if ( !m_pStorageUI )
45  return false;
46  if ( !m_pMenuHandler )
47  return false;
48  // m_pMenuHandler.SetActiveStorage( m_pStorageUI );
49  m_pMenuHandler.Action_StepBack();
50  } break;
51 
52  case EInventoryButton.BUTTON_SHOW_DEFAULT:
53  {
54  if ( m_pMenuHandler )
55  m_pMenuHandler.ShowDefault( );
56  } break;
57 
58  }
59  return true;
60  }
61 
62  //------------------------------------------------------------------------------------------------
63  override bool OnFocus(Widget w, int x, int y)
64  {
65  return false;
66  }
67 
68  //------------------------------------------------------------------------------------------------
69  override bool OnFocusLost(Widget w, int x, int y)
70  {
71  return false;
72  }
73 
74  //------------------------------------------------------------------------------------------------
75  override bool OnChange(Widget w, int x, int y, bool finished)
76  {
77  }
78 
79  //------------------------------------------------------------------------------------------------
80  override void HandlerAttached( Widget w )
81  {
82  m_widget = w;
83  }
84 
85  //------------------------------------------------------------------------------------------------
86  void SCR_InventoryButton( EInventoryButton EButtonType, SCR_InventoryMenuUI pMenuHandler = null, SCR_InventoryStorageBaseUI pStorageUI = null )
87  {
88  m_pStorageUI = pStorageUI;
89  m_pMenuHandler = pMenuHandler;
90  //store the item into the slot
91  m_EButtonType = EButtonType;
92  }
93 
94 
95  //------------------------------------------------------------------------------------------------
96  void ~SCR_InventoryButton()
97  {
98  }
99 };
BUTTON_PAGE_NEXT
@ BUTTON_PAGE_NEXT
Definition: SCR_InventoryButtonPageUI.c:4
BUTTON_PAGE_PREV
@ BUTTON_PAGE_PREV
Definition: SCR_InventoryButtonPageUI.c:3
SCR_InventoryStorageBaseUI
Definition: SCR_InventoryStorageBaseUI.c:6
SCR_InventoryButton
Definition: SCR_InventoryButtonPageUI.c:13
BUTTON_SHOW_DEFAULT
@ BUTTON_SHOW_DEFAULT
Definition: SCR_InventoryButtonPageUI.c:6
SCR_InventoryMenuUI
Definition: SCR_InventoryMenuUI.c:247
BUTTON_TRAVERSE_BACK
@ BUTTON_TRAVERSE_BACK
Definition: SCR_InventoryButtonPageUI.c:5
EInventoryButton
EInventoryButton
Definition: SCR_InventoryButtonPageUI.c:1
BasicButtonComponent
Definition: BasicButtonComponent.c:1