DayZ
1.24
Loading...
Searching...
No Matches
TitleScreenMenu.c
Go to the documentation of this file.
1
2
class
TitleScreenMenu
extends
UIScriptedMenu
3
{
4
RichTextWidget
m_TextPress
;
5
6
void
TitleScreenMenu
()
7
{
8
g_Game
.SetGameState(
DayZGameState
.MAIN_MENU);
9
g_Game
.SetLoadState(
DayZLoadState
.MAIN_MENU_START);
10
}
11
12
void
~TitleScreenMenu
()
13
{
14
}
15
16
override
Widget
Init
()
17
{
18
layoutRoot =
GetGame
().GetWorkspace().CreateWidgets(
"gui/layouts/xbox/day_z_title_screen.layout"
);
19
20
MissionMainMenu
mission
=
MissionMainMenu
.Cast(
g_Game
.GetMission());
21
22
m_TextPress =
RichTextWidget
.Cast(layoutRoot.FindAnyWidget(
"InputPromptText"
));
23
if
(m_TextPress)
24
{
25
string
gamertag
;
26
string
text
=
Widget
.TranslateString(
"#console_start_game"
);
27
GetGame
().GetPlayerName(
gamertag
);
28
#ifdef PLATFORM_XBOX
29
BiosUserManager
user_manager
=
GetGame
().GetUserManager();
30
if
(
user_manager
&&
user_manager
.GetSelectedUser())
31
m_TextPress.SetText(
string
.Format(
text
,
"<image set=\"xbox_buttons\" name=\"A\" />"
));
32
else
33
m_TextPress.SetText(
string
.Format(
text
,
"<image set=\"xbox_buttons\" name=\"A\" />"
));
34
#endif
35
36
#ifdef PLATFORM_PS4
37
string
confirm
=
"cross"
;
38
if
(
GetGame
().
GetInput
().GetEnterButton() ==
GamepadButton
.A)
39
confirm
=
"cross"
;
40
else
41
confirm
=
"circle"
;
42
m_TextPress.SetText(
string
.Format(
text
,
"<image set=\"playstation_buttons\" name=\""
+
confirm
+
"\" />"
));
43
#endif
44
}
45
return
layoutRoot;
46
}
47
48
override
void
OnShow
()
49
{
50
if
(
g_Game
.GetGameState() !=
DayZGameState
.CONNECTING)
51
{
52
#ifdef PLATFORM_CONSOLE
53
g_Game
.GamepadCheck();
54
#endif
55
}
56
layoutRoot.FindAnyWidget(
"notification_root"
).Show(
false
);
57
58
#ifdef PLATFORM_CONSOLE
59
#ifdef PLATFORM_XBOX
60
#ifdef BUILD_EXPERIMENTAL
61
layoutRoot.FindAnyWidget(
"notification_root"
).Show(
true
);
62
#endif
63
#endif
64
#endif
65
SetWidgetAnimAlpha(m_TextPress);
66
}
67
68
override
void
OnHide
()
69
{
70
layoutRoot.FindAnyWidget(
"notification_root"
).Show(
false
);
71
}
72
73
override
void
Update
(
float
timeslice
)
74
{
75
super
.Update(
timeslice
);
76
77
if
(
GetUApi
().GetInputByID(
UAUISelect
).LocalPress())
78
{
79
#ifdef PLATFORM_WINDOWS
80
EnterScriptedMenu(
MENU_MAIN
);
81
#endif
82
#ifdef PLATFORM_XBOX
83
g_Game
.GamepadCheck();
84
#endif
85
}
86
}
87
}
GetInput
ActionInput GetInput()
Definition
ActionBase.c:989
g_Game
DayZGame g_Game
Definition
DayZGame.c:3528
mission
Mission mission
Definition
DisplayStatus.c:28
GetUApi
proto native UAInputAPI GetUApi()
BiosUserManager
Definition
BiosUserManager.c:17
Param3
Definition
EntityAI.c:95
RichTextWidget
Definition
gameplay.c:314
UIScriptedMenu
Definition
DayZGame.c:64
UIScriptedMenu::OnShow
override void OnShow()
Definition
TitleScreenMenu.c:48
UIScriptedMenu::Update
override void Update(float timeslice)
Definition
TitleScreenMenu.c:73
UIScriptedMenu::~TitleScreenMenu
void ~TitleScreenMenu()
Definition
TitleScreenMenu.c:12
UIScriptedMenu::OnHide
override void OnHide()
Definition
TitleScreenMenu.c:68
UIScriptedMenu::m_TextPress
RichTextWidget m_TextPress
Definition
TitleScreenMenu.c:4
UIScriptedMenu::TitleScreenMenu
void TitleScreenMenu()
Definition
TitleScreenMenu.c:6
UIScriptedMenu::Init
override Widget Init()
Definition
TitleScreenMenu.c:16
Widget
Definition
EnWidgets.c:190
GetGame
proto native CGame GetGame()
GamepadButton
GamepadButton
Definition
EnSystem.c:341
MENU_MAIN
const int MENU_MAIN
Definition
constants.c:172
scripts
5_Mission
GUI
TitleScreenMenu.c
Generated by
1.10.0