Dayz Explorer  1.24.157551 (v105080)
Dayz Code Explorer by Zeroy
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  {
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 }
GetGame
proto native CGame GetGame()
UIScriptedMenu
Definition: dayzgame.c:63
mission
Mission mission
Definition: displaystatus.c:28
OnHide
override void OnHide()
Definition: inventorymenu.c:141
RichTextWidget
Definition: gameplay.c:315
Init
class InventoryGridController extends ScriptedWidgetEventHandler Init
Definition: uihintpanel.c:46
g_Game
DayZGame g_Game
Definition: dayzgame.c:3727
BiosUserManager
Definition: biosusermanager.c:16
Update
proto native volatile void Update()
Definition: playersoundmanager.c:125
OnShow
override void OnShow()
Definition: controlsxbox.c:349
Widget
Definition: enwidgets.c:189
GamepadButton
GamepadButton
Definition: ensystem.c:340
GetUApi
proto native UAInputAPI GetUApi()
GetInput
ActionInput GetInput()
Definition: actionbase.c:1066
MENU_MAIN
const int MENU_MAIN
Definition: constants.c:172