DayZ
1.24
Loading...
Searching...
No Matches
ConsoleToolbarHandler.c
Go to the documentation of this file.
1
2
class
ConsoleToolbarWidgetHandlerBase
:
ScriptedWidgetEventHandler
3
{
4
Widget
m_ToolbarWidget
;
//'toolbar_bg'
5
RichTextWidget
m_ToolbarText
;
6
7
void
OnWidgetScriptInit
(
Widget
w
)
8
{
9
m_ToolbarWidget
=
w
;
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
17
UpdateControlsElements
();
18
}
19
20
protected
void
OnInputDeviceChanged
(
EInputDeviceType
pInputDeviceType
)
21
{
22
#ifdef PLATFORM_CONSOLE
23
UpdateControlsElements
(
pInputDeviceType
);
24
#endif
25
}
26
27
protected
void
UpdateControlsElements
(
EInputDeviceType
pInputDeviceType
=
EInputDeviceType
.UNKNOWN)
28
{
29
#ifndef PLATFORM_CONSOLE
30
m_ToolbarWidget
.Show(
false
);
31
#endif
32
}
33
}
34
35
class
PasswordMenuToolbarHandler
:
ConsoleToolbarWidgetHandlerBase
36
{
37
override
protected
void
UpdateControlsElements
(
EInputDeviceType
pInputDeviceType
=
EInputDeviceType
.UNKNOWN)
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
;
47
if
(
pInputDeviceType
==
EInputDeviceType
.UNKNOWN)
48
toolbarShow
= !
GetGame
().GetInput().IsEnabledMouseAndKeyboardEvenOnServer() ||
GetGame
().GetInput().GetCurrentInputDevice() ==
EInputDeviceType
.CONTROLLER;
49
else
50
toolbarShow
=
pInputDeviceType
==
EInputDeviceType
.CONTROLLER;
51
m_ToolbarWidget
.Show(
toolbarShow
);
52
#endif
53
}
54
};
m_ToolbarText
RichTextWidget m_ToolbarText
Definition
ConsoleToolbarHandler.c:39
m_ToolbarWidget
Widget m_ToolbarWidget
Definition
ConsoleToolbarHandler.c:38
UpdateControlsElements
void UpdateControlsElements()
Definition
ItemDropWarningMenu.c:206
ConsoleToolbarWidgetHandlerBase
Definition
ConsoleToolbarHandler.c:3
ConsoleToolbarWidgetHandlerBase::UpdateControlsElements
void UpdateControlsElements(EInputDeviceType pInputDeviceType=EInputDeviceType.UNKNOWN)
Definition
ConsoleToolbarHandler.c:27
ConsoleToolbarWidgetHandlerBase::OnInputDeviceChanged
void OnInputDeviceChanged(EInputDeviceType pInputDeviceType)
Definition
ConsoleToolbarHandler.c:20
ConsoleToolbarWidgetHandlerBase::m_ToolbarText
RichTextWidget m_ToolbarText
Definition
ConsoleToolbarHandler.c:5
ConsoleToolbarWidgetHandlerBase::OnWidgetScriptInit
void OnWidgetScriptInit(Widget w)
Definition
ConsoleToolbarHandler.c:7
ConsoleToolbarWidgetHandlerBase::m_ToolbarWidget
Widget m_ToolbarWidget
Definition
ConsoleToolbarHandler.c:4
InputUtils
Definition
InputUtils.c:2
InputUtils::GetRichtextButtonIconFromInputAction
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
InputUtils::ICON_SCALE_TOOLBAR
static const float ICON_SCALE_TOOLBAR
Definition
InputUtils.c:15
Param3
Definition
EntityAI.c:95
RichTextWidget
Definition
gameplay.c:314
ScriptedWidgetEventHandler
map: item x vector(index, width, height)
Definition
EnWidgets.c:651
ScriptedWidgetEventHandler::UpdateControlsElements
void UpdateControlsElements()
Definition
TabberUI.c:434
Widget
Definition
EnWidgets.c:190
GetGame
proto native CGame GetGame()
EInputDeviceType
EInputDeviceType
Definition
input.c:3
scripts
5_Mission
GUI
NewUI
ConsoleToolbarHandler.c
Generated by
1.10.0