79 bool mk =
GetGame().GetInput().IsEnabledMouseAndKeyboard();
80 bool mkServer =
GetGame().GetInput().IsEnabledMouseAndKeyboardEvenOnServer();
82 switch (pInputDeviceType)
88 GetGame().GetUIManager().ShowUICursor(
false);
89 if (!GetFocus() || GetFocus() == m_FeedbackClose)
94 m_FeedbackClose.Show(
false);
95 m_ShowFeedback.Show(
false);
103 GetGame().GetUIManager().ShowUICursor(
true);
104 m_ShowFeedback.Show(
true);
105 m_FeedbackClose.Show(
true);
117 layoutRoot =
GetGame().GetWorkspace().CreateWidgets(
"gui/layouts/xbox/day_z_ingamemenu_xbox.layout");
119 m_OnlineMenu =
GetGame().GetWorkspace().CreateWidgets(
"gui/layouts/xbox/ingamemenu_xbox/online_info_menu.layout", layoutRoot);
120 m_OnlineMenu.Show(
false);
122 m_IngameMenuPanel = layoutRoot.FindAnyWidget(
"ingame_menu_panel");
123 m_ContinueButton = ButtonWidget.Cast(layoutRoot.FindAnyWidget(
"continuebtn"));
124 m_RestartDeadButton = ButtonWidget.Cast(layoutRoot.FindAnyWidget(
"restartbtn_dead"));
125 m_ExitButton = ButtonWidget.Cast(layoutRoot.FindAnyWidget(
"exitbtn"));
126 m_RestartButton = ButtonWidget.Cast(layoutRoot.FindAnyWidget(
"restartbtn"));
127 m_OptionsButton = ButtonWidget.Cast(layoutRoot.FindAnyWidget(
"optionsbtn"));
128 m_InviteButton = ButtonWidget.Cast(layoutRoot.FindAnyWidget(
"invitebtn"));
129 m_ControlsButton = ButtonWidget.Cast(layoutRoot.FindAnyWidget(
"controlsbtn"));
130 m_OnlineButton = ButtonWidget.Cast(layoutRoot.FindAnyWidget(
"onlinebtn"));
131 m_TutorialsButton = ButtonWidget.Cast(layoutRoot.FindAnyWidget(
"tutorialsbtn"));
132 m_Version = TextWidget.Cast(layoutRoot.FindAnyWidget(
"version"));
133 m_ShowFeedback = ButtonWidget.Cast(layoutRoot.FindAnyWidget(
"feedbackbtn"));
134 m_FeedbackQRCode = ImageWidget.Cast(layoutRoot.FindAnyWidget(
"qr_image"));
135 m_FeedbackClose = ButtonWidget.Cast(layoutRoot.FindAnyWidget(
"close_button"));
136 m_FeedbackCloseLabel =
RichTextWidget.Cast(layoutRoot.FindAnyWidget(
"close_button_label"));
137 m_DialogPanel = layoutRoot.FindAnyWidget(
"ingame_menu_dialog");
139 m_SelectAvailable =
true;
140 m_MuteAvailable =
false;
141 m_GamercardAvailable =
false;
142 m_BackAvailable =
true;
147 m_PlayerAlive = player.GetPlayerState() ==
EPlayerStates.ALIVE;
149 m_BackAvailable =
false;
151 player.GetOnUnconsciousStart().Insert(UpdateGUI);
152 player.GetOnUnconsciousStart().Insert(UpdateMenuFocus);
153 player.GetOnUnconsciousStop().Insert(UpdateGUI);
154 player.GetOnUnconsciousStop().Insert(UpdateMenuFocus);
155 player.GetOnDeathStart().Insert(UpdateGUI);
156 player.GetOnDeathStart().Insert(UpdateMenuFocus);
161 #ifdef PLATFORM_CONSOLE
162 version =
"#main_menu_version" +
" " + version +
" (" +
g_Game.GetDatabaseID() +
")";
164 version =
"#main_menu_version" +
" " + version;
166 m_Version.SetText(version);
170 m_OnlineButton.Show(
true);
172 TextWidget w_text = TextWidget.Cast(m_OnlineMenu.FindAnyWidget(
"OnlineTextWidget"));
173 w_text.SetText(
g_Game.GetHostName());
175 m_ServerInfoPanel =
new PlayerListScriptedWidget(m_OnlineMenu.FindAnyWidget(
"ServerInfoPanel"));
177 OnlineServices.m_PermissionsAsyncInvoker.Insert(OnPermissionsUpdate);
178 ClientData.SyncEvent_OnPlayerListUpdate.Insert(SyncEvent_OnRecievedPlayerList);
180 m_ServerInfoPanel.Reload(
ClientData.m_PlayerList);
183 string uid = m_ServerInfoPanel.FindPlayerByWidget(GetFocus());
188 m_MuteAvailable =
false;
189 m_GamercardAvailable =
false;
193 m_MuteAvailable = !
GetGame().GetWorld().IsDisabledReceivingVoN();
195 m_GamercardAvailable =
true;
200 if (m_ServerInfoPanel.IsGloballyMuted(uid))
202 m_MuteAvailable =
false;
208 layoutRoot.FindAnyWidget(
"onlinebtn").Show(
false);
209 layoutRoot.FindAnyWidget(
"invitebtn").Show(
false);
215 m_RestartButton.SetText(
"#main_menu_respawn");
219 m_RestartButton.SetText(
"#main_menu_restart");
224 m_RestartButton.Show(
false);
230 IngameHud hud = IngameHud.Cast(
mission.GetHud());
233 hud.ShowHudUI(
false);
234 hud.ShowQuickbarUI(
false);
240 PPERequester_MenuEffects requester;
241 Class.CastTo(requester,PPERequesterBank.GetRequester(PPERequester_MenuEffects));
242 requester.SetVignetteIntensity(0.6);
248 m_FeedbackQRCode.LoadImageFile(0,
"gui/textures/feedback_qr_ps.edds");
250 m_FeedbackQRCode.LoadImageFile(0,
"gui/textures/feedback_qr_xbox.edds");
256 override bool OnClick(Widget w,
int x,
int y,
int button)
258 super.OnClick(w,
x,
y, button);
262 switch (w.GetUserID())
288 GetGame().GetUIManager().ShowDialog(
"#main_menu_exit",
"#main_menu_exit_desc",
IDC_INT_EXIT, DBT_YESNO, DBB_YES, DMT_QUESTION, NULL);
293 if (!
GetGame().IsMultiplayer())
295 GetGame().GetUIManager().ShowDialog(
"#main_menu_restart",
"Are you sure you want to restart?",
IDC_INT_RETRY, DBT_YESNO, DBB_YES, DMT_QUESTION,
this);
299 GetGame().GetUIManager().ShowDialog(
"#main_menu_respawn",
"#main_menu_respawn_question",
IDC_INT_RETRY, DBT_YESNO, DBB_YES, DMT_QUESTION,
this);
305 m_OnlineMenu.Show(
true);
306 m_SelectAvailable =
false;
309 m_ServerInfoPanel.FocusFirst();
324 if (w == m_RestartDeadButton)
339 if (w == m_FeedbackClose)
492 super.Update(timeslice);
499 if (
GetGame().IsMultiplayer() && layoutRoot.FindAnyWidget(
"OnlineInfo").IsVisible())
501 PlayerListEntryScriptedWidget selected;
502 if (m_ServerInfoPanel)
504 selected = m_ServerInfoPanel.GetSelectedPlayer();
507 if (
GetUApi().GetInputByID(UAUICtrlX).LocalPress())
511 m_ServerInfoPanel.ToggleMute(selected.GetUID());
518 if (
GetUApi().GetInputByID(UAUICtrlY).LocalPress())
691 #ifdef PLATFORM_CONSOLE
692 version =
"#main_menu_version" +
" " + version +
" (" +
g_Game.GetDatabaseID() +
")";
694 version =
"#main_menu_version" +
" " + version;
696 m_Version.SetText(version);
698 m_MuteAvailable =
false;
699 m_GamercardAvailable =
false;
701 if (
GetGame().IsMultiplayer() && layoutRoot.FindAnyWidget(
"OnlineInfo").IsVisible() && m_ServerInfoPanel)
703 PlayerListEntryScriptedWidget selected = m_ServerInfoPanel.GetSelectedPlayer();
704 if (selected && !selected.IsLocalPlayer())
706 m_MuteAvailable = !
GetGame().GetWorld().IsDisabledReceivingVoN() && !selected.IsGloballyMuted();
708 m_GamercardAvailable =
true;
894 bool toolbarShow = !
GetGame().GetInput().IsEnabledMouseAndKeyboardEvenOnServer() ||
GetGame().GetInput().GetCurrentInputDevice() ==
EInputDeviceType.CONTROLLER;
896 layoutRoot.FindAnyWidget(
"toolbar_bg").Show(toolbarShow);
897 layoutRoot.FindAnyWidget(
"top").Show(!onlineOpen);
902 layoutRoot.FindAnyWidget(
"bottom").Show(!toolbarShow);
906 layoutRoot.FindAnyWidget(
"bottom").Show(
true);
910 string contineBtnText =
"";
911 continueBtnIcon.Show(!toolbarShow);
914 string toolbarText =
"";
921 if (m_SelectAvailable)
936 if (m_GamercardAvailable)
957 toolbarTextWidget.SetText(toolbarText);
958 continueBtnIcon.SetText(contineBtnText);
961 string continueBtnLabel =
"#main_menu_continue";
963 continueBtnLabel =
"#layout_character_creation_back";
965 TextWidget continueBtnTextWidget = TextWidget.Cast(layoutRoot.FindAnyWidget(
"continuebtn_label"));
966 continueBtnTextWidget.SetText(continueBtnLabel);
967 layoutRoot.FindAnyWidget(
"dayz_logo").Show(!onlineOpen);