1#ifndef BUILD_EXPERIMENTAL
2 #define ENABLE_CAROUSEL
7 protected ref MainMenuVideo m_Video;
46 #ifdef PLATFORM_MSSTORE
47 layoutRoot =
g_Game.GetWorkspace().CreateWidgets(
"gui/layouts/new_ui/main_menu_msstore.layout");
49 layoutRoot =
g_Game.GetWorkspace().CreateWidgets(
"gui/layouts/new_ui/main_menu_console.layout");
56 m_PlayVideo = layoutRoot.FindAnyWidget(
"play_video");
57 m_Tutorials = layoutRoot.FindAnyWidget(
"tutorials");
58 m_Options = layoutRoot.FindAnyWidget(
"options");
59 m_Exit = layoutRoot.FindAnyWidget(
"exit");
60 m_Controls = layoutRoot.FindAnyWidget(
"controls");
61 m_Play = layoutRoot.FindAnyWidget(
"play");
64 m_DlcFrame = layoutRoot.FindAnyWidget(
"dlc_Frame");
69 m_FeedbackClose = ButtonWidget.Cast(layoutRoot.FindAnyWidget(
"close_button"));
76 g_Game.GetUIManager().ScreenFadeOut(1);
79 if (!
g_Game.GetProfileString(
"FirstLaunchDone", launch_done) || launch_done !=
"true")
81 g_Game.SetProfileString(
"FirstLaunchDone",
"true");
82 g_Game.GetUIManager().ShowDialog(
"#main_menu_tutorial",
"#main_menu_tutorial_desc", 555, DBT_YESNO, DBB_YES, DMT_QUESTION,
this);
92 #ifdef ENABLE_CAROUSEL
106 g_Game.SetLoadState(DayZLoadState.MAIN_MENU_CONTROLLER_SELECT);
110 #ifdef PLATFORM_MSSTORE
115 #ifdef PLATFORM_CONSOLE
118 #ifdef PLATFORM_MSSTORE
126 #ifdef PLATFORM_CONSOLE
133 #ifdef PLATFORM_MSSTORE
157 #ifdef ENABLE_CAROUSEL
168 #ifdef ENABLE_CAROUSEL
183 #ifdef PLATFORM_CONSOLE
190 #ifndef PLATFORM_MSSTORE
191 switch (pInputDeviceType)
194 if (
g_Game.GetInput().IsEnabledMouseAndKeyboard())
196 g_Game.GetUIManager().ShowUICursor(
false);
197 #ifdef PLATFORM_CONSOLE
206 #ifndef PLATFORM_XBOX
217 #ifdef PLATFORM_MSSTORE
224 if (
g_Game.GetInput().IsEnabledMouseAndKeyboard())
226 g_Game.GetUIManager().ShowUICursor(
true);
227 #ifdef PLATFORM_CONSOLE
232 #ifndef PLATFORM_MSSTORE
233 #ifndef PLATFORM_XBOX
240 #ifdef PLATFORM_MSSTORE
248 switch (pInputDeviceType)
306 #ifndef PLATFORM_MSSTORE
307 #ifndef PLATFORM_XBOX
335 if (ButtonWidget.Cast(w))
372 if (
g_Game.GetUserManager() &&
g_Game.GetUserManager().GetSelectedUser())
374 name =
g_Game.GetUserManager().GetSelectedUser().GetName();
375 if (
name.LengthUtf8() > 18)
384 g_Game.GetVersion(version);
385 m_Version.SetText(
"#main_menu_version" +
" " + version +
" (" +
g_Game.GetDatabaseID() +
")");
393 #ifdef PLATFORM_MSSTORE
394 #ifdef ENABLE_CAROUSEL
412 #ifdef ENABLE_CAROUSEL
424 #ifdef PLATFORM_CONSOLE
425 layoutRoot.FindAnyWidget(
"ButtonHolderCredits").Show(
g_Game.GetInput().IsEnabledMouseAndKeyboard());
439 super.Update(timeslice);
443 if (
g_Game.GetLoadState() != DayZGameState.CONNECTING && !
g_Game.GetUIManager().IsDialogVisible())
445 #ifndef PLATFORM_CONSOLE
446 if (
GetUApi().GetInputByID(UAUIBack).LocalPress())
448 if (!
g_Game.GetUIManager().IsDialogHiding())
452 if (
GetUApi().GetInputByID(UAUIBack).LocalPress())
464 if (
GetUApi().GetInputByID(UAUICredits).LocalPress())
469 if (
GetUApi().GetInputByID(UAUICtrlX).LocalPress())
475 if (
GetUApi().GetInputByID(UAUIThumbRight).LocalPress())
480 #ifdef ENABLE_CAROUSEL
484 if (
GetUApi().GetInputByID(UAUICtrlX).LocalHold())
489 if (articleCount > 1)
491 if (
GetUApi().GetInputByID(UAUIPadRight).LocalPress())
494 if (
GetUApi().GetInputByID(UAUIPadLeft).LocalPress())
512 PPERequesterBank.GetRequester(PPERequester_FeedbackBlur).Start();
516 PPERequesterBank.GetRequester(PPERequester_FeedbackBlur).Stop();
574 g_Game.SetLoadState(DayZLoadState.MAIN_MENU_START);
575 #ifndef PLATFORM_WINDOWS
578 g_Game.GetUIManager().Back();
584 g_Game.GetUIManager().ShowDialog(
"#main_menu_exit",
"#main_menu_exit_desc",
IDC_MAIN_QUIT, DBT_YESNO, DBB_YES, DMT_QUESTION,
this);
593 int color_pnl =
ARGB(255, 200, 0, 0);
594 int color_lbl =
ARGB(255, 255, 255, 255);
606 int color_pnl =
ARGB(0, 0, 0, 0);
607 int color_lbl =
ARGB(255, 255, 255, 255);
625 else if (code == 555)
654 Widget panel = w.FindWidget(w.GetName() +
"_panel");
658 panel.SetColor(color);
667 Widget panel = w.FindWidget(w.GetName() +
"_panel");
671 SetWidgetAnimAlpha(panel);
686 label.SetColor(color);
691 text.SetColor(color);
696 text2.SetColor(color);
707 #ifndef PLATFORM_MSSTORE
709 #ifndef PLATFORM_XBOX
722 toolbar_text.SetText(context);
727 bool toolbarShow =
false;
728 #ifdef PLATFORM_CONSOLE
729 toolbarShow = !
g_Game.GetInput().IsEnabledMouseAndKeyboard() ||
g_Game.GetInput().GetCurrentInputDevice() ==
EInputDeviceType.CONTROLLER;
732 layoutRoot.FindAnyWidget(
"toolbar_bg").Show(toolbarShow);
758 #ifdef ENABLE_CAROUSEL
767 protected ref MainMenuDlcHandlerBase m_DisplayedDlcHandler;
788 for (
int i = 0; i < count; i++)
792 MainMenuDlcHandlerBase handler =
new MainMenuDlcHandlerBase(info,
m_DlcFrame, data);
794 handler.ShowInfoPanel(
true);
809 int count = modArray.Count();
810 for (
int i = count - 1; i >= 0; i--)
PlayerSpawnPresetDiscreteItemSetSlotData name
one set for cargo
void NewsCarousel(Widget parent, UIScriptedMenu mainMenu)
bool SelectUserEx(BiosUser user)
static JsonDataDLCList GetData()
static void SubscribeDLCUpdate()
static void UnsubscribeDLCUpdate()
static ScriptInvoker GetOnDLCChangedSI()
proto owned string GetName()
proto bool Remove(func fn, int flags=EScriptInvokerRemoveFlags.ALL)
remove specific call from list
proto bool Insert(func fn, int flags=EScriptInvokerInsertFlags.IMMEDIATE)
insert method to list
Result for an object found in CGame.IsBoxCollidingGeometryProxy.
void Obsolete(string msg="")
proto native vector Vector(float x, float y, float z)
Vector constructor from components.
proto void GetScreenSize(out int x, out int y)
static proto string Format(string fmt, void param1=NULL, void param2=NULL, void param3=NULL, void param4=NULL, void param5=NULL, void param6=NULL, void param7=NULL, void param8=NULL, void param9=NULL)
Gets n-th character from string.
int ARGB(int a, int r, int g, int b)