DayZ 1.24
Loading...
Searching...
No Matches
InventoryMenu.c File Reference

Go to the source code of this file.

Enumerations

enum  ScreenWidthType { NARROW , MEDIUM , WIDE }
 

Functions

void InventoryMenu ()
 
override Widget Init ()
 Launched from 'DayZGame.DeferredInit' to make earlier access, use, and updates impossible (downside of a non-static system)
 
void CheckWidth ()
 
static ScreenWidthType GetWidthType ()
 
static int GetWidth ()
 
static int GetHeight ()
 
static float GetHeightMultiplied (float value)
 
void RefreshQuickbar ()
 
override ContextMenu GetContextMenu ()
 
void InitContainers (EntityAI target)
 
override void Update (float timeslice)
 
override void Refresh ()
 
override void OnShow ()
 
override bool OnController (Widget w, int control, int value)
 
bool IsOpened ()
 
override void OnHide ()
 
int GetLastDisplayLanguage ()
 
bool LanguageChanged ()
 

Variables

enum ScreenWidthType m_Inventory
 
ref ContextMenu m_context_menu
 
bool m_IsOpened
 
bool m_OnlyFirstTime
 
int m_LastDisplayLanguage
 
static ScreenWidthType m_WidthType
 
static int m_Width
 
static int m_Height
 

Enumeration Type Documentation

◆ ScreenWidthType

Enumerator
NARROW 
MEDIUM 
WIDE 

Definition at line 1 of file InventoryMenu.c.

2{
3 NARROW,
4 MEDIUM,
5 WIDE
6}
@ MEDIUM
@ WIDE
@ NARROW

Function Documentation

◆ CheckWidth()

void CheckWidth ( )
protected

Definition at line 38 of file InventoryMenu.c.

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 }
static ScreenWidthType m_WidthType
static int m_Width
ScreenWidthType
static int m_Height
proto void GetScreenSize(out int x, out int y)

References GetScreenSize(), m_Height, m_Width, and m_WidthType.

Referenced by InventoryMenu().

◆ GetContextMenu()

override ContextMenu GetContextMenu ( )
protected

◆ GetHeight()

static int GetHeight ( )
staticprotected

Definition at line 64 of file InventoryMenu.c.

65 {
66 return m_Height;
67 }

References m_Height.

◆ GetHeightMultiplied()

static float GetHeightMultiplied ( float value)
staticprotected

Definition at line 69 of file InventoryMenu.c.

70 {
71 float height = m_Height;
72 return height / 1080 * value;
73 }

References m_Height.

◆ GetLastDisplayLanguage()

int GetLastDisplayLanguage ( )
protected

Definition at line 154 of file InventoryMenu.c.

155 {
157 }
int m_LastDisplayLanguage

References m_LastDisplayLanguage.

◆ GetWidth()

static int GetWidth ( )
staticprotected

Definition at line 59 of file InventoryMenu.c.

60 {
61 return m_Width;
62 }

References m_Width.

◆ GetWidthType()

static ScreenWidthType GetWidthType ( )
staticprotected

Definition at line 54 of file InventoryMenu.c.

55 {
56 return m_WidthType;
57 }

References m_WidthType.

◆ Init()

override Widget Init ( )
protected

Launched from 'DayZGame.DeferredInit' to make earlier access, use, and updates impossible (downside of a non-static system)

pre-init arrays

Definition at line 30 of file InventoryMenu.c.

31 {
32 m_Inventory.Init();
33 m_context_menu.Init(layoutRoot);
34 layoutRoot = m_Inventory.GetMainWidget();
35 return layoutRoot;
36 }
enum ScreenWidthType m_Inventory

References m_context_menu, and m_Inventory.

◆ InitContainers()

void InitContainers ( EntityAI target)
protected

Definition at line 85 of file InventoryMenu.c.

86 {
87
88 }

◆ InventoryMenu()

◆ IsOpened()

bool IsOpened ( )
protected

Definition at line 132 of file InventoryMenu.c.

133 {
134 return m_IsOpened;
135 }
bool m_IsOpened

References m_IsOpened.

◆ LanguageChanged()

bool LanguageChanged ( )
protected

Definition at line 159 of file InventoryMenu.c.

160 {
161 return g_Game.GetCurrentDisplayLanguageIdx() != m_LastDisplayLanguage;
162 }

References g_Game, and m_LastDisplayLanguage.

◆ OnController()

override bool OnController ( Widget w,
int control,
int value )
protected

Definition at line 125 of file InventoryMenu.c.

126 {
127 if (m_IsOpened)
128 return m_Inventory.Controller(w, control, value);
129 return false;
130 }

References m_Inventory, and m_IsOpened.

◆ OnHide()

override void OnHide ( )
protected

Definition at line 137 of file InventoryMenu.c.

138 {
139 super.OnHide();
140 m_context_menu.Hide();
141 m_IsOpened = false;
142 PPERequesterBank.GetRequester(PPERequesterBank.REQ_INVENTORYBLUR).Stop();
143 if (m_Inventory)
144 m_Inventory.OnHide();
145 MissionGameplay mission = MissionGameplay.Cast(GetGame().GetMission());
146 if (mission)
147 mission.MoveHudForInventory(false);
148
149 ItemManager.GetInstance().SetItemMicromanagmentMode(false);
150 ItemManager.GetInstance().SetSelectedItemEx(null, null, null);
151 ItemManager.GetInstance().HideTooltip();
152 }
Mission mission
static ItemManager GetInstance()
proto native CGame GetGame()

References GetGame(), ItemManager::GetInstance(), m_context_menu, m_Inventory, m_IsOpened, and mission.

Referenced by Container::Close(), ClosableContainer::Close(), ClosableContainer::LockCargo(), and Container::SetOpenState().

◆ OnShow()

override void OnShow ( )
protected

Definition at line 103 of file InventoryMenu.c.

104 {
105 super.OnShow();
106 m_IsOpened = true;
107 PPERequesterBank.GetRequester(PPERequesterBank.REQ_INVENTORYBLUR).Start();
108 VicinityItemManager.GetInstance().RefreshVicinityItems();
109
110 if (m_Inventory)
111 m_Inventory.OnShow();
112
113 SetFocus(layoutRoot);
114
115 MissionGameplay mission = MissionGameplay.Cast(GetGame().GetMission());
116 if (mission)
117 mission.MoveHudForInventory(true);
118
119 ItemManager.GetInstance().SetItemMicromanagmentMode(false);
120 ItemManager.GetInstance().SetSelectedItemEx(null, null, null);
121
122 m_Inventory.Refresh();
123 }
static VicinityItemManager GetInstance()
proto native void SetFocus(Widget w)

References GetGame(), ItemManager::GetInstance(), VicinityItemManager::GetInstance(), m_Inventory, m_IsOpened, mission, and SetFocus().

◆ Refresh()

override void Refresh ( )
protected

Definition at line 96 of file InventoryMenu.c.

97 {
98 super.Refresh();
99
100 m_Inventory.UpdateConsoleToolbar();
101 }

References m_Inventory.

◆ RefreshQuickbar()

void RefreshQuickbar ( )
protected

◆ Update()

override void Update ( float timeslice)
protected

Definition at line 90 of file InventoryMenu.c.

91 {
92 if (m_Inventory)
93 m_Inventory.Update(timeslice);
94 }

References m_Inventory.

Variable Documentation

◆ m_context_menu

ref ContextMenu m_context_menu
private

Definition at line 11 of file InventoryMenu.c.

Referenced by GetContextMenu(), Init(), InventoryMenu(), and OnHide().

◆ m_Height

int m_Height
staticprotected

Definition at line 18 of file InventoryMenu.c.

Referenced by CheckWidth(), GetHeight(), and GetHeightMultiplied().

◆ m_Inventory

◆ m_IsOpened

◆ m_LastDisplayLanguage

int m_LastDisplayLanguage
protected

Definition at line 14 of file InventoryMenu.c.

Referenced by GetLastDisplayLanguage(), InventoryMenu(), and LanguageChanged().

◆ m_OnlyFirstTime

bool m_OnlyFirstTime
protected

Definition at line 13 of file InventoryMenu.c.

◆ m_Width

int m_Width
staticprotected

Definition at line 17 of file InventoryMenu.c.

Referenced by CheckWidth(), and GetWidth().

◆ m_WidthType

ScreenWidthType m_WidthType
staticprotected

Definition at line 16 of file InventoryMenu.c.

Referenced by CheckWidth(), and GetWidthType().