DayZ 1.24
Loading...
Searching...
No Matches
ConsoleToolbarHandler.c
Go to the documentation of this file.
3{
4 Widget m_ToolbarWidget; //'toolbar_bg'
6
8 {
10 m_ToolbarWidget.SetHandler(this);
11
12 m_ToolbarText = RichTextWidget.Cast(m_ToolbarWidget.FindAnyWidget("ContextToolbarText"));
13#ifdef PLATFORM_CONSOLE
14 if (GetGame().GetMission())
15 GetGame().GetMission().GetOnInputDeviceChanged().Insert(OnInputDeviceChanged);
16#endif
18 }
19
21 {
22#ifdef PLATFORM_CONSOLE
24#endif
25 }
26
28 {
29#ifndef PLATFORM_CONSOLE
30 m_ToolbarWidget.Show(false);
31#endif
32 }
33}
34
36{
38 {
39#ifdef PLATFORM_CONSOLE
40 string text = "";
41 text += string.Format(" %1", InputUtils.GetRichtextButtonIconFromInputAction("UAUICtrlY", "#server_browser_show / #server_browser_hide", EUAINPUT_DEVICE_CONTROLLER, InputUtils.ICON_SCALE_TOOLBAR));
42 text += string.Format(" %1", InputUtils.GetRichtextButtonIconFromInputAction("UAUICtrlX", "#server_browser_menu_connect", EUAINPUT_DEVICE_CONTROLLER, InputUtils.ICON_SCALE_TOOLBAR));
43 text += string.Format(" %1", InputUtils.GetRichtextButtonIconFromInputAction("UAUIBack", "#STR_settings_menu_root_toolbar_bg_ConsoleToolbar_Back_BackText0", EUAINPUT_DEVICE_CONTROLLER, InputUtils.ICON_SCALE_TOOLBAR));
44 m_ToolbarText.SetText(text);
45
46 bool toolbarShow = false;
48 toolbarShow = !GetGame().GetInput().IsEnabledMouseAndKeyboardEvenOnServer() || GetGame().GetInput().GetCurrentInputDevice() == EInputDeviceType.CONTROLLER;
49 else
52#endif
53 }
54};
RichTextWidget m_ToolbarText
Widget m_ToolbarWidget
void UpdateControlsElements()
void UpdateControlsElements(EInputDeviceType pInputDeviceType=EInputDeviceType.UNKNOWN)
void OnInputDeviceChanged(EInputDeviceType pInputDeviceType)
static string GetRichtextButtonIconFromInputAction(notnull UAInput pInput, string pLocalizedDescription, int pInputDeviceType=EUAINPUT_DEVICE_CONTROLLER, float pScale=ICON_SCALE_NORMAL, bool pVertical=false)
Definition InputUtils.c:151
static const float ICON_SCALE_TOOLBAR
Definition InputUtils.c:15
map: item x vector(index, width, height)
Definition EnWidgets.c:651
proto native CGame GetGame()
EInputDeviceType
Definition input.c:3