3 protected ref MainMenuVideo m_Video;
11 protected Widget m_ChangeAccount;
12 protected Widget m_CustomizeCharacter;
13 protected Widget m_PlayVideo;
14 protected Widget m_Tutorials;
15 protected Widget m_Options;
18 protected Widget m_MessageButton;
20 protected ref
Widget m_LastFocusedButton;
23 protected Widget m_DlcFrame;
27 protected ref MainMenuDlcHandlerBase m_DisplayedDlcHandler;
31 layoutRoot =
GetGame().GetWorkspace().CreateWidgets(
"gui/layouts/new_ui/main_menu_console.layout");
33 m_PlayerName =
TextWidget.Cast(layoutRoot.FindAnyWidget(
"character_name_xbox"));
35 m_ChangeAccount = layoutRoot.FindAnyWidget(
"choose_account");
36 m_CustomizeCharacter = layoutRoot.FindAnyWidget(
"customize_character");
37 m_PlayVideo = layoutRoot.FindAnyWidget(
"play_video");
38 m_Tutorials = layoutRoot.FindAnyWidget(
"tutorials");
39 m_Options = layoutRoot.FindAnyWidget(
"options");
40 m_Controls = layoutRoot.FindAnyWidget(
"controls");
41 m_Play = layoutRoot.FindAnyWidget(
"play");
42 m_MessageButton = layoutRoot.FindAnyWidget(
"message_button");
44 m_DlcFrame = layoutRoot.FindAnyWidget(
"dlc_Frame");
45 m_Version =
TextWidget.Cast(layoutRoot.FindAnyWidget(
"version"));
47 m_LastFocusedButton = m_Play;
49 GetGame().GetUIManager().ScreenFadeOut(1);
52 if (!
GetGame().GetProfileString(
"FirstLaunchDone", launch_done) || launch_done !=
"true")
54 GetGame().SetProfileString(
"FirstLaunchDone",
"true");
55 GetGame().GetUIManager().ShowDialog(
"#main_menu_tutorial",
"#main_menu_tutorial_desc", 555, DBT_YESNO, DBB_YES, DMT_QUESTION,
this);
76 void ~MainMenuConsole()
84 if (
GetGame().GetContentDLCService())
96 if (m_AllDLCs !=
null)
101 GetGame().GetModInfos(m_AllDLCs);
102 if (m_AllDLCs.Count() > 0)
104 m_AllDLCs.Remove(m_AllDLCs.Count() - 1);
108 FilterDLCs(m_AllDLCs);
120 m_AllDlcsMap.Clear();
122 int count = modArray.Count();
123 for (
int i = count - 1; i >= 0; i--)
126 if (!info.GetIsDLC())
129 m_AllDlcsMap.Set(info.GetName(), info);
133 void PopulateDlcFrame()
141 m_DlcHandlers.Clear();
145 int count = m_DlcData.DLCs.Count();
149 for (
int i = 0; i < count; i++)
151 data = m_DlcData.DLCs[i];
152 info = m_AllDlcsMap.Get(data.Name);
153 MainMenuDlcHandlerBase handler =
new MainMenuDlcHandlerBase(info, m_DlcFrame, data);
155 handler.ShowInfoPanel(
true);
156 m_DisplayedDlcHandler = handler;
158 m_DlcHandlers.Insert(handler);
164 #ifdef PLATFORM_CONSOLE
179 m_LastFocusedButton = m_Play;
180 OpenMenuServerBrowser();
183 else if (w == m_Options)
185 m_LastFocusedButton = m_Options;
189 else if (w == m_PlayVideo)
192 m_LastFocusedButton = m_PlayVideo;
196 else if (w == m_Tutorials)
198 m_LastFocusedButton = m_Tutorials;
208 else if (w == m_CustomizeCharacter)
210 m_LastFocusedButton = m_CustomizeCharacter;
211 OpenMenuCustomizeCharacter();
214 else if (w == m_ChangeAccount)
216 m_LastFocusedButton = m_ChangeAccount;
220 else if (w == m_MessageButton)
244 if (
GetGame().GetUserManager() &&
GetGame().GetUserManager().GetSelectedUser())
246 name =
GetGame().GetUserManager().GetSelectedUser().GetName();
247 if (
name.LengthUtf8() > 18)
253 m_PlayerName.SetText(
name);
257 m_Version.SetText(
"#main_menu_version" +
" " + version +
" (" +
g_Game.GetDatabaseID() +
")");
259 if (
GetGame().GetMission() !=
null)
277 if (m_ScenePC && m_ScenePC.GetIntroCamera())
279 m_ScenePC.GetIntroCamera().LookAt(m_ScenePC.GetIntroCharacter().GetPosition() +
Vector(0, 1, 0));
281 if (m_DisplayedDlcHandler)
282 m_DisplayedDlcHandler.ShowInfoPanel(
true);
285 #ifdef PLATFORM_CONSOLE
287 layoutRoot.FindAnyWidget(
"choose_account").Show(
GetGame().
GetInput().IsEnabledMouseAndKeyboard());
289 layoutRoot.FindAnyWidget(
"ButtonHolderCredits").Show(
GetGame().
GetInput().IsEnabledMouseAndKeyboard());
297 if (m_DisplayedDlcHandler)
298 m_DisplayedDlcHandler.ShowInfoPanel(
false);
302 override void Update(
float timeslice)
304 super.Update(timeslice);
306 if (
g_Game.GetLoadState() != DayZGameState.CONNECTING && !
GetGame().GetUIManager().IsDialogVisible())
308 #ifndef PLATFORM_CONSOLE
309 if (
GetUApi().GetInputByID(UAUIBack).LocalPress())
314 if (
GetUApi().GetInputByID(UAUICredits).LocalPress())
322 if (
GetUApi().GetInputByID(UAUICtrlY).LocalPress())
327 if (
GetUApi().GetInputByID(UAUICtrlX).LocalPress())
329 if (CanStoreBeOpened())
331 m_DisplayedDlcHandler.GetModInfo().GoToStore();
336 bool CanStoreBeOpened()
338 return m_DisplayedDlcHandler !=
null;
341 void OpenMenuServerBrowser()
346 void OpenMenuControls()
351 void OpenMenuOptions()
356 void OpenMenuPlayVideo()
361 void OpenMenuTutorials()
366 void OpenMenuCustomizeCharacter()
382 g_Game.SetLoadState(DayZLoadState.MAIN_MENU_START);
383 #ifndef PLATFORM_WINDOWS
384 user_manager.SelectUserEx(
null);
386 GetGame().GetUIManager().Back();
392 GetGame().GetUIManager().ShowDialog(
"#main_menu_exit",
"#main_menu_exit_desc",
IDC_MAIN_QUIT, DBT_YESNO, DBB_YES, DMT_QUESTION,
this);
401 int color_pnl =
ARGB(255, 200, 0, 0);
402 int color_lbl =
ARGB(255, 255, 255, 255);
404 ButtonSetColor(w, color_pnl);
405 ButtonSetAlphaAnim(w);
406 ButtonSetTextColor(w, color_lbl);
414 int color_pnl =
ARGB(0, 0, 0, 0);
415 int color_lbl =
ARGB(255, 255, 255, 255);
417 ButtonSetColor(w, color_pnl);
418 ButtonSetAlphaAnim(
null);
419 ButtonSetTextColor(w, color_lbl);
422 override bool OnModalResult(
Widget w,
int x,
int y,
int code,
int result)
433 else if (code == 555)
443 void ButtonSetText(
Widget w,
string text)
457 void ButtonSetColor(
Widget w,
int color)
462 Widget panel = w.FindWidget(w.GetName() +
"_panel");
466 panel.SetColor(color);
470 void ButtonSetAlphaAnim(
Widget w)
475 Widget panel = w.FindWidget(w.GetName() +
"_panel");
479 SetWidgetAnimAlpha(panel);
483 void ButtonSetTextColor(
Widget w,
int color)
494 label.SetColor(color);
499 text.SetColor(color);
504 text2.SetColor(color);
511 string context =
InputUtils.GetRichtextButtonIconFromInputAction(
"UAUICredits",
"#menu_credits", EUAINPUT_DEVICE_CONTROLLER,
InputUtils.ICON_SCALE_TOOLBAR);
514 context +=
string.Format(
" %1",
InputUtils.GetRichtextButtonIconFromInputAction(
"UAUICtrlY",
"#layout_xbox_main_menu_toolbar_account", EUAINPUT_DEVICE_CONTROLLER,
InputUtils.ICON_SCALE_TOOLBAR));
516 context +=
string.Format(
" %1",
InputUtils.GetRichtextButtonIconFromInputAction(
"UAUISelect",
"#layout_xbox_main_menu_toolbar_select", EUAINPUT_DEVICE_CONTROLLER,
InputUtils.ICON_SCALE_TOOLBAR));
518 toolbar_text.SetText(context);
523 bool toolbarShow =
false;
524 #ifdef PLATFORM_CONSOLE
528 layoutRoot.FindAnyWidget(
"toolbar_bg").Show(toolbarShow);