Dayz Explorer 1.28.160049
Loading...
Searching...
No Matches
titlescreenmenu.c
Go to the documentation of this file.
1
2class 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 {
40 confirm = "cross";
41 }
42 else
43 {
44 confirm = "circle";
45 }
46 m_TextPress.SetText(string.Format(text, "<image set=\"playstation_buttons\" name=\"" + confirm + "\" />"));
47 #endif
48 }
49 return layoutRoot;
50 }
51
52 override void OnShow()
53 {
54 if (g_Game.GetGameState() != DayZGameState.CONNECTING)
55 {
56 #ifdef PLATFORM_CONSOLE
57 g_Game.GamepadCheck();
58 #endif
59 }
60 layoutRoot.FindAnyWidget("notification_root").Show(false);
61
62 #ifdef PLATFORM_CONSOLE
63 #ifdef PLATFORM_XBOX
64 #ifdef BUILD_EXPERIMENTAL
65 layoutRoot.FindAnyWidget("notification_root").Show(true);
66 #endif
67 #endif
68 #endif
69 SetWidgetAnimAlpha(m_TextPress);
70 }
71
72 override void OnHide()
73 {
74 layoutRoot.FindAnyWidget("notification_root").Show(false);
75 }
76
77 override void Update(float timeslice)
78 {
79 super.Update(timeslice);
80
81 if (GetUApi().GetInputByID(UAUISelect).LocalPress())
82 {
83 #ifdef PLATFORM_WINDOWS
84 EnterScriptedMenu(MENU_MAIN);
85 #endif
86 #ifdef PLATFORM_XBOX
87 g_Game.GamepadCheck();
88 #endif
89 }
90 }
91}
proto native BiosUserManager GetUserManager()
override void OnShow()
override void OnHide()
override Widget Init()
Definition bookmenu.c:11
DayZGame g_Game
Definition dayzgame.c:3868
Mission mission
proto native CGame GetGame()
GamepadButton
Definition ensystem.c:341
const int MENU_MAIN
Definition constants.c:182
proto native UAInputAPI GetUApi()