Dayz Explorer  1.24.157551 (v105080)
Dayz Code Explorer by Zeroy
helpscreen.c
Go to the documentation of this file.
1 class HelpScreen extends UIScriptedMenu
2 {
3  TextListboxWidget m_KeyBindingsTextListboxWidget;
4  TextListboxWidget m_MouseBindingsTextListboxWidget;
5 
6  ButtonWidget m_CloseConsoleButton;
7 
8  void HelpScreen()
9  {
10 
11  }
12 
13  void ~HelpScreen()
14  {
15  }
16 
17  override Widget Init()
18  {
19  PluginKeyBinding module_keybinding = PluginKeyBinding.Cast( GetPlugin(PluginKeyBinding) );
20 
21  layoutRoot = GetGame().GetWorkspace().CreateWidgets("gui/layouts/help_screen.layout");
22  m_KeyBindingsTextListboxWidget = TextListboxWidget.Cast( layoutRoot.FindAnyWidget("KeyBindingsTextListboxWidget") );
23  m_MouseBindingsTextListboxWidget = TextListboxWidget.Cast( layoutRoot.FindAnyWidget("MouseBindingsTextListboxWidget") );
24 
25  array<ref KeyBinding> keybindings = module_keybinding.GetKeyBindings();
26  for ( int i = 0; i < keybindings.Count(); i++ )
27  {
28  m_KeyBindingsTextListboxWidget.AddItem( keybindings.Get(i).GetInfoBind(), NULL, 0 );
29  m_KeyBindingsTextListboxWidget.SetItem( i, keybindings.Get(i).GetInfoDescription(), NULL, 1 );
30  }
31 
32  array<ref MouseBinding> mousebindings = module_keybinding.GetMouseBindings();
33  for ( i = 0; i < mousebindings.Count(); i++ )
34  {
35  m_MouseBindingsTextListboxWidget.AddItem( mousebindings.Get(i).GetInfoBind(), NULL, 0 );
36  m_MouseBindingsTextListboxWidget.SetItem( i, mousebindings.Get(i).GetInfoDescription(), NULL, 1 );
37  }
38 
39  m_CloseConsoleButton = ButtonWidget.Cast( layoutRoot.FindAnyWidget("CloseButtonWidget") );
40 
41  return layoutRoot;
42  }
43 
44  override bool OnClick(Widget w, int x, int y, int button)
45  {
46  super.OnClick(w, x, y, button);
47 
48  if ( w == m_CloseConsoleButton )
49  {
50  Close();
51  return true;
52  }
53 
54  return false;
55  }
56 }
GetGame
proto native CGame GetGame()
UIScriptedMenu
Definition: dayzgame.c:63
Close
void Close()
y
Icon y
GetPlugin
PluginBase GetPlugin(typename plugin_type)
Definition: pluginmanager.c:316
Init
class InventoryGridController extends ScriptedWidgetEventHandler Init
Definition: uihintpanel.c:46
array< ref KeyBinding >
x
Icon x
Widget
Definition: enwidgets.c:189
OnClick
override bool OnClick(Widget w, int x, int y, int button)
buttons clicks
Definition: dayzgame.c:146