DayZ 1.27
DayZ Explorer by KGB
 
Загрузка...
Поиск...
Не найдено
TitleScreenMenu.c
См. документацию.
1
2class TitleScreenMenu extends UIScriptedMenu
3{
5
7 {
8 g_Game.SetGameState(DayZGameState.MAIN_MENU);
9 g_Game.SetLoadState(DayZLoadState.MAIN_MENU_START);
10 }
11
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}
DayZGame g_Game
Определения DayZGame.c:3868
Mission mission
Определения DisplayStatus.c:28
proto native UAInputAPI GetUApi()
proto native BiosUser GetSelectedUser()
Returns the currently selected user.
proto native BiosUserManager GetUserManager()
proto native WorkspaceWidget GetWorkspace()
proto void GetPlayerName(out string name)
Gets current player name.
Определения gameplay.c:317
override void OnShow()
Определения TitleScreenMenu.c:52
override void Update(float timeslice)
Определения TitleScreenMenu.c:77
void ~TitleScreenMenu()
Определения TitleScreenMenu.c:12
override void OnHide()
Определения TitleScreenMenu.c:72
RichTextWidget m_TextPress
Определения TitleScreenMenu.c:4
void TitleScreenMenu()
Определения TitleScreenMenu.c:6
override Widget Init()
Определения TitleScreenMenu.c:16
Определения DayZGame.c:64
Определения EnWidgets.c:190
proto native CGame GetGame()
GamepadButton
Определения EnSystem.c:341
const int MENU_MAIN
Определения constants.c:182
proto native external Widget CreateWidgets(string layout, Widget parentWidget=NULL, bool immedUpdate=true)
Create widgets from *.layout file.