Dayz
Build 1.29.163047, Scripts Rev. 123548
Dayz Code Explorer by Zeroy
Toggle main menu visibility
Loading...
Searching...
No Matches
inventorymenu.c
Go to the documentation of this file.
1
enum
ScreenWidthType
2
{
3
NARROW
,
4
MEDIUM
,
5
WIDE
6
}
7
8
class
InventoryMenu
extends
UIScriptedMenu
9
{
10
ref
Inventory
m_Inventory
;
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
20
void
InventoryMenu
()
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
38
void
CheckWidth
()
39
{
40
GetScreenSize
(
m_Width
,
m_Height
);
41
42
if
(
m_Height
> 0 )
43
{
44
float
ratio =
m_Width
/
m_Height
;
45
if
( ratio > 1.75 )
46
m_WidthType
=
ScreenWidthType
.WIDE;
47
else
if
( ratio > 1.5 )
48
m_WidthType
=
ScreenWidthType
.MEDIUM;
49
else
50
m_WidthType
=
ScreenWidthType
.NARROW;
51
}
52
}
53
54
static
ScreenWidthType
GetWidthType
()
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
75
void
RefreshQuickbar
()
76
{
77
m_Inventory
.RefreshQuickbar();
78
}
79
80
override
ContextMenu
GetContextMenu
()
81
{
82
return
m_context_menu
;
83
}
84
85
void
InitContainers
(
EntityAI
target)
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();
110
VicinityItemManager
.
GetInstance
().
RefreshVicinityItems
();
111
112
if
(
m_Inventory
)
113
m_Inventory
.OnShow();
114
115
SetFocus
( layoutRoot );
116
117
MissionGameplay
mission
= MissionGameplay.Cast(
g_Game
.GetMission() );
118
if
(
mission
)
119
{
120
mission
.MoveHudForInventory(
true
);
121
}
122
123
ItemManager
.
GetInstance
().
SetItemMicromanagmentMode
(
false
);
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(
g_Game
.GetMission());
150
if
(
mission
)
151
{
152
mission
.MoveHudForInventory(
false
);
153
}
154
155
ItemManager
.
GetInstance
().
SetItemMicromanagmentMode
(
false
);
156
ItemManager
.
GetInstance
().
SetSelectedItemEx
(null, null, null);
157
ItemManager
.
GetInstance
().
HideTooltip
();
158
}
159
160
int
GetLastDisplayLanguage
()
161
{
162
return
m_LastDisplayLanguage
;
163
}
164
165
bool
LanguageChanged
()
166
{
167
return
g_Game
.GetCurrentDisplayLanguageIdx() !=
m_LastDisplayLanguage
;
168
}
169
170
override
void
OnPlayerDeath
()
171
{
172
super.OnPlayerDeath();
173
MissionGameplay
mission
= MissionGameplay.Cast(
g_Game
.GetMission());
174
if
(
mission
)
175
{
176
mission
.HideInventory();
177
}
178
}
179
}
Inventory
void Inventory(LayoutHolder parent)
Definition
inventory.c:74
NARROW
const float NARROW
Definition
actionconstants.c:127
WIDE
const float WIDE
Definition
actionconstants.c:129
IsOpened
bool IsOpened()
Definition
basebuildingbase.c:1679
EntityAI
Definition
inventoryitem.c:2
ItemManager
Definition
itemmanager.c:2
ItemManager::SetItemMicromanagmentMode
void SetItemMicromanagmentMode(bool item_micromanagment_mode)
Definition
itemmanager.c:64
ItemManager::SetSelectedItemEx
void SetSelectedItemEx(EntityAI selected_item, Container selected_container, LayoutHolder selected_icon)
Definition
itemmanager.c:113
ItemManager::HideTooltip
void HideTooltip()
Definition
itemmanager.c:398
ItemManager::GetInstance
static ItemManager GetInstance()
Definition
itemmanager.c:282
UIScriptedMenu
Xbox menu.
Definition
dayzgame.c:64
UIScriptedMenu::Refresh
override void Refresh()
Definition
chatinputmenu.c:70
UIScriptedMenu::CheckWidth
void CheckWidth()
Definition
mainmenu.c:704
UIScriptedMenu::OnShow
override void OnShow()
Definition
cameratoolsmenu.c:99
UIScriptedMenu::OnHide
override void OnHide()
Definition
cameratoolsmenu.c:109
UIScriptedMenu::Init
override Widget Init()
Definition
bookmenu.c:11
UIScriptedMenu::OnController
override bool OnController(Widget w, int control, int value)
Definition
gesturesmenu.c:256
UIScriptedMenu::OnPlayerDeath
override void OnPlayerDeath()
Definition
inspectmenunew.c:619
VicinityItemManager
Definition
vicinityitemmanager.c:2
VicinityItemManager::RefreshVicinityItems
void RefreshVicinityItems()
Definition
vicinityitemmanager.c:209
VicinityItemManager::GetInstance
static VicinityItemManager GetInstance()
Definition
vicinityitemmanager.c:22
Widget
Definition
enwidgets.c:190
g_Game
DayZGame g_Game
Definition
dayzgame.c:3942
GetHeight
float GetHeight()
Definition
dayzplayerimplementfalldamage.c:83
mission
Mission mission
Definition
displaystatus.c:28
MEDIUM
@ MEDIUM
Definition
estatlevels.c:5
GetScreenSize
proto void GetScreenSize(out int x, out int y)
SetFocus
proto native void SetFocus(Widget w)
Update
proto native volatile void Update()
Definition
playersoundmanager.c:125
m_WidthType
static ScreenWidthType m_WidthType
Definition
inventorymenu.c:16
GetContextMenu
override ContextMenu GetContextMenu()
Definition
inventorymenu.c:80
m_OnlyFirstTime
bool m_OnlyFirstTime
Definition
inventorymenu.c:13
m_LastDisplayLanguage
int m_LastDisplayLanguage
Definition
inventorymenu.c:14
InitContainers
void InitContainers(EntityAI target)
Definition
inventorymenu.c:85
m_IsOpened
bool m_IsOpened
Definition
inventorymenu.c:12
m_Width
static int m_Width
Definition
inventorymenu.c:17
GetLastDisplayLanguage
int GetLastDisplayLanguage()
Definition
inventorymenu.c:160
ScreenWidthType
ScreenWidthType
Definition
inventorymenu.c:2
LanguageChanged
bool LanguageChanged()
Definition
inventorymenu.c:165
RefreshQuickbar
void RefreshQuickbar()
Definition
inventorymenu.c:75
m_context_menu
ref ContextMenu m_context_menu
Definition
inventorymenu.c:11
GetWidthType
static ScreenWidthType GetWidthType()
Definition
inventorymenu.c:54
m_Height
static int m_Height
Definition
inventorymenu.c:18
GetHeightMultiplied
static float GetHeightMultiplied(float value)
Definition
inventorymenu.c:69
InventoryMenu
void InventoryMenu()
Definition
inventorymenu.c:20
GetWidth
static int GetWidth()
Definition
inventorymenu.c:59
m_Inventory
enum ScreenWidthType m_Inventory
Games
Dayz
scripts
5_mission
gui
inventorymenu.c
Generated by
1.17.0