11 private bool m_builtIn =
false;
12 const int ITEMS_COUNT = 27;
31 if (!m_context_menu_root_widget)
33 m_context_menu_root_widget =
GetGame().GetWorkspace().CreateWidgets(
"gui/layouts/day_z_inventory_context_menu.layout", layoutRoot);
34 m_context_menu_panel_widget = m_context_menu_root_widget.FindAnyWidget(
"PanelWidget");
35 m_context_menu_root_widget.Show(
false);
36 m_context_menu_root_widget.SetHandler(
this);
43 if (m_count == 0)
return;
68 m_context_menu_panel_widget.GetScript(
spacer);
72 m_context_menu_root_widget.GetSize(
w,
h);
73 m_context_menu_panel_widget.GetSize(
sx,
sy);
74 m_context_menu_root_widget.SetSize(
w,
sy);
77 m_context_menu_root_widget.GetScreenSize(
w,
h);
93 m_context_menu_root_widget.SetPos(
x,
y);
94 m_context_menu_root_widget.Show(
true);
99 m_context_menu_root_widget.SetSize(
x,
y);
106 m_context_menu_root_widget.FindAnyWidget(
"BackdropImageWidget").Show(
true);
108 m_context_menu_root_widget.FindAnyWidget(
"BackdropImageWidget").Show(
false);
114 m_context_menu_root_widget.Show(
false);
122 return m_context_menu_root_widget.IsVisible();
130 if (!m_builtIn &&
enterW && m_context_menu_panel_widget &&
enterW != m_context_menu_panel_widget &&
enterW.GetParent() != m_context_menu_panel_widget)
143 if (
button ==
MouseState.LEFT &&
w.GetUserID() > -1 &&
w.GetUserID() < m_commands.Count())
182 int itemWidth =
label.Length();
183 if (m_max_item_width < itemWidth)
184 m_max_item_width = itemWidth;
194 if (
index < m_commands.Count())
196 m_commands.RemoveOrdered(
index);
207 return m_commands.Count();
217 if (!m_context_menu_panel_widget)
219 Widget child = m_context_menu_panel_widget.GetChildren();
230 m_max_item_width = 0;
262 if (m_ContextMenuInstance)
267 m_ContextMenuInstance.SetSize(1, 1);
268 m_ContextMenuInstance.Show(
x,
y);
Super root of all classes in Enforce script.
Base Param Class with no parameters. Used as general purpose parameter overloaded with Param1 to Para...
proto native CGame GetGame()
string String(string s)
Helper for passing string expression to functions with void parameter. Example: Print(String("Hello "...
proto void GetScreenSize(out int x, out int y)