DayZ 1.27
DayZ Explorer by KGB
 
Загрузка...
Поиск...
Не найдено
InventoryMenu.c
См. документацию.
7
9{
11 private ref ContextMenu m_context_menu;
12 protected bool m_IsOpened;
13 protected bool m_OnlyFirstTime;
14 protected int m_LastDisplayLanguage;
15
16 protected static ScreenWidthType m_WidthType;
17 protected static int m_Width;
18 protected static int m_Height;
19
21 {
22 CheckWidth();
23 m_Inventory = new Inventory(null);
24 m_Inventory.Reset();
25 m_Inventory.UpdateInterval();
26 m_context_menu = new ContextMenu();
27 m_LastDisplayLanguage = g_Game.GetCurrentDisplayLanguageIdx();
28 }
29
30 override Widget Init()
31 {
32 m_Inventory.Init();
33 m_context_menu.Init(layoutRoot);
34 layoutRoot = m_Inventory.GetMainWidget();
35 return layoutRoot;
36 }
37
39 {
41
42 if( m_Height > 0 )
43 {
44 float ratio = m_Width / m_Height;
45 if( ratio > 1.75 )
47 else if( ratio > 1.5 )
49 else
51 }
52 }
53
55 {
56 return m_WidthType;
57 }
58
59 static int GetWidth()
60 {
61 return m_Width;
62 }
63
64 static int GetHeight()
65 {
66 return m_Height;
67 }
68
69 static float GetHeightMultiplied( float value )
70 {
71 float height = m_Height;
72 return height / 1080 * value;
73 }
74
76 {
77 m_Inventory.RefreshQuickbar();
78 }
79
80 override ContextMenu GetContextMenu()
81 {
82 return m_context_menu;
83 }
84
86 {
87
88 }
89
90 override void Update( float timeslice )
91 {
92 if( m_Inventory )
93 {
94 m_Inventory.Update(timeslice);
95 }
96 }
97
98 override void Refresh()
99 {
100 super.Refresh();
101
102 m_Inventory.UpdateConsoleToolbar();
103 }
104
105 override void OnShow()
106 {
107 super.OnShow();
108 m_IsOpened = true;
109 PPERequesterBank.GetRequester(PPERequesterBank.REQ_INVENTORYBLUR).Start();
111
112 if(m_Inventory)
113 m_Inventory.OnShow();
114
115 SetFocus( layoutRoot );
116
117 MissionGameplay mission = MissionGameplay.Cast( GetGame().GetMission() );
118 if( mission )
119 {
120 mission.MoveHudForInventory( true );
121 }
122
124 ItemManager.GetInstance().SetSelectedItemEx(null, null, null);
125
126 m_Inventory.Refresh();
127 }
128
129 override bool OnController( Widget w, int control, int value )
130 {
131 if( m_IsOpened )
132 return m_Inventory.Controller( w, control, value );
133 return false;
134 }
135
136 bool IsOpened()
137 {
138 return m_IsOpened;
139 }
140
141 override void OnHide()
142 {
143 super.OnHide();
144 m_context_menu.Hide();
145 m_IsOpened = false;
146 PPERequesterBank.GetRequester(PPERequesterBank.REQ_INVENTORYBLUR).Stop();
147 if(m_Inventory)
148 m_Inventory.OnHide();
149 MissionGameplay mission = MissionGameplay.Cast(GetGame().GetMission());
150 if(mission)
151 {
152 mission.MoveHudForInventory( false );
153 }
154
156 ItemManager.GetInstance().SetSelectedItemEx(null, null, null);
158 }
159
161 {
163 }
164
166 {
167 return g_Game.GetCurrentDisplayLanguageIdx() != m_LastDisplayLanguage;
168 }
169
170 override void OnPlayerDeath()
171 {
172 super.OnPlayerDeath();
173 MissionGameplay mission = MissionGameplay.Cast(GetGame().GetMission());
174 if (mission)
175 {
176 mission.HideInventory();
177 }
178 }
179}
void Inventory(LayoutHolder parent)
Определения Inventory.c:74
const float NARROW
Определения ActionConstants.c:127
const float WIDE
Определения ActionConstants.c:129
bool IsOpened()
Определения BaseBuildingBase.c:1635
DayZGame g_Game
Определения DayZGame.c:3868
float GetHeight()
Определения DayZPlayerImplementFallDamage.c:83
Mission mission
Определения DisplayStatus.c:28
@ MEDIUM
Определения EStatLevels.c:5
static ScreenWidthType m_WidthType
Определения InventoryMenu.c:16
override ContextMenu GetContextMenu()
Определения InventoryMenu.c:80
bool m_OnlyFirstTime
Определения InventoryMenu.c:13
int m_LastDisplayLanguage
Определения InventoryMenu.c:14
void InitContainers(EntityAI target)
Определения InventoryMenu.c:85
bool m_IsOpened
Определения InventoryMenu.c:12
void CheckWidth()
Определения InventoryMenu.c:38
static int m_Width
Определения InventoryMenu.c:17
int GetLastDisplayLanguage()
Определения InventoryMenu.c:160
ScreenWidthType
Определения InventoryMenu.c:2
bool LanguageChanged()
Определения InventoryMenu.c:165
void RefreshQuickbar()
Определения InventoryMenu.c:75
ref ContextMenu m_context_menu
Определения InventoryMenu.c:11
static ScreenWidthType GetWidthType()
Определения InventoryMenu.c:54
static int m_Height
Определения InventoryMenu.c:18
static float GetHeightMultiplied(float value)
Определения InventoryMenu.c:69
void InventoryMenu()
Определения InventoryMenu.c:20
static int GetWidth()
Определения InventoryMenu.c:59
enum ScreenWidthType m_Inventory
Определения Building.c:6
void SetItemMicromanagmentMode(bool item_micromanagment_mode)
Определения ItemManager.c:64
void SetSelectedItemEx(EntityAI selected_item, Container selected_container, LayoutHolder selected_icon)
Определения ItemManager.c:113
void HideTooltip()
Определения ItemManager.c:398
static ItemManager GetInstance()
Определения ItemManager.c:282
Определения ItemManager.c:2
override void OnShow()
Определения CameraToolsMenu.c:99
override void Refresh()
Определения ChatInputMenu.c:70
override void OnHide()
Определения CameraToolsMenu.c:109
override Widget Init()
Определения BookMenu.c:11
override bool OnController(Widget w, int control, int value)
Определения GesturesMenu.c:256
override void OnPlayerDeath()
Определения InspectMenuNew.c:619
Определения DayZGame.c:64
void RefreshVicinityItems()
Определения VicinityItemManager.c:209
static VicinityItemManager GetInstance()
Определения VicinityItemManager.c:22
Определения EnWidgets.c:190
proto native CGame GetGame()
proto void GetScreenSize(out int x, out int y)
proto native void SetFocus(Widget w)
proto native volatile void Update()
Определения PlayerSoundManager.c:125