35 const int BUTTON_XBOX_CONTROLS = 201;
55 hud.ShowQuickbarUI(
true);
61 PPERequesterBank.GetRequester(PPERequester_MenuEffects).Stop();
66 #ifdef PLATFORM_CONSOLE
81 m_OnlineMenu.Show(
false);
83 m_ContinueButton = ButtonWidget.Cast(layoutRoot.FindAnyWidget(
"continuebtn"));
84 m_RestartDeadButton = ButtonWidget.Cast(layoutRoot.FindAnyWidget(
"restartbtn_dead"));
85 m_ExitButton = ButtonWidget.Cast(layoutRoot.FindAnyWidget(
"exitbtn"));
86 m_RestartButton = ButtonWidget.Cast(layoutRoot.FindAnyWidget(
"restartbtn"));
87 m_OptionsButton = ButtonWidget.Cast(layoutRoot.FindAnyWidget(
"optionsbtn"));
88 m_ControlsButton = ButtonWidget.Cast(layoutRoot.FindAnyWidget(
"controlsbtn"));
89 m_OnlineButton = ButtonWidget.Cast(layoutRoot.FindAnyWidget(
"onlinebtn"));
90 m_TutorialsButton = ButtonWidget.Cast(layoutRoot.FindAnyWidget(
"tutorialsbtn"));
91 m_Version =
TextWidget.Cast(layoutRoot.FindAnyWidget(
"version"));
93 m_SelectAvailable =
true;
94 m_MuteAvailable =
false;
95 m_GamercardAvailable =
false;
96 m_BackAvailable =
true;
101 int life_state = player.GetPlayerState();
105 m_PlayerAlive =
true;
113 #ifdef PLATFORM_CONSOLE
114 version =
"#main_menu_version" +
" " + version +
" (" +
g_Game.GetDatabaseID() +
")";
116 version =
"#main_menu_version" +
" " + version;
118 m_Version.SetText(version);
122 m_OnlineButton.Show(
true);
125 w_text.SetText(
g_Game.GetHostName());
127 m_ServerInfoPanel =
new PlayerListScriptedWidget(m_OnlineMenu.FindAnyWidget(
"ServerInfoPanel"));
135 string uid = m_ServerInfoPanel.FindPlayerByWidget(
GetFocus());
140 m_MuteAvailable =
false;
141 m_GamercardAvailable =
false;
147 m_GamercardAvailable =
true;
152 if (m_ServerInfoPanel.IsGloballyMuted(uid))
154 m_MuteAvailable =
false;
160 layoutRoot.FindAnyWidget(
"onlinebtn").Show(
false);
161 layoutRoot.FindAnyWidget(
"invitebtn").Show(
false);
165 ButtonWidget restart_btn = ButtonWidget.Cast(layoutRoot.FindAnyWidgetById(
IDC_INT_RETRY));
168 restart_btn.SetText(
"#main_menu_respawn");
172 restart_btn.SetText(
"#main_menu_restart");
175 if (
GetGame().IsMultiplayer() && !(
GetGame().CanRespawnPlayer() || (player && player.IsUnconscious())))
177 restart_btn.Enable(
false);
178 restart_btn.Show(
false);
192 hud.ShowHudUI(
false);
193 hud.ShowQuickbarUI(
false);
199 PPERequester_MenuEffects requester;
200 Class.
CastTo(requester,PPERequesterBank.GetRequester(PPERequester_MenuEffects));
201 requester.SetVignetteIntensity(0.6);
214 super.OnClick(w,
x,
y, button);
216 switch (w.GetUserID())
240 if (!
GetGame().IsMultiplayer())
252 m_OnlineMenu.Show(
true);
253 m_SelectAvailable =
false;
256 m_ServerInfoPanel.FocusFirst();
271 if (w == layoutRoot.FindAnyWidget(
"backbtn"))
275 else if (w == m_RestartDeadButton)
293 super.OnModalResult(w,
x,
y, code, result);
307 g_Game.CancelLoginTimeCountdown();
314 g_Game.CancelLoginTimeCountdown();
318 if (result == DBB_YES)
350 player.SimulateDeath(
true);
354 MissionGameplay missionGP = MissionGameplay.Cast(
GetGame().GetMission());
355 missionGP.DestroyAllMenus();
356 missionGP.SetPlayerRespawning(
true);
357 missionGP.Continue();
367 if (RespawnDialogue.Cast(menu))
375 if (
GetGame().GetUserManager())
377 return (uid == local_uid);
384 for (
int i = 0; i < player_count; i++)
387 sync_player.
m_UID =
"uid" + i;
398 if (
GetGame().IsMultiplayer() && layoutRoot.FindAnyWidget(
"OnlineInfo").IsVisible())
400 PlayerListEntryScriptedWidget selected;
401 if (m_ServerInfoPanel)
402 selected = m_ServerInfoPanel.GetSelectedPlayer();
403 if (
GetUApi().GetInputByID(UAUICtrlX).LocalPress())
406 m_ServerInfoPanel.ToggleMute(selected.GetUID());
411 if (
GetUApi().GetInputByID(UAUICtrlY).LocalPress())
425 int life_state = player.GetPlayerState();
431 m_RestartButton.Show(player.IsUnconscious());
435 m_RestartButton.Show(
false);
438 m_ContinueButton.Show(m_PlayerAlive);
439 m_RestartDeadButton.Show(!m_PlayerAlive);
444 return m_OnlineMenu.IsVisible();
449 m_OnlineMenu.Show(
false);
450 m_SelectAvailable =
true;
451 m_MuteAvailable =
false;
452 m_GamercardAvailable =
false;
460 if (m_ServerInfoPanel)
462 m_ServerInfoPanel.FocusFirst();
475 m_ServerInfoPanel.Reload(player_list);
482 m_ServerInfoPanel.Reload(result_list);
493 int life_state = player.GetPlayerState();
497 m_PlayerAlive =
true;
503 m_RestartButton.Show(player.IsUnconscious());
507 m_RestartButton.Show(
false);
509 m_ContinueButton.Show(m_PlayerAlive);
510 m_RestartDeadButton.Show(!m_PlayerAlive);
514 #ifdef PLATFORM_CONSOLE
522 warning.SetText(
"#str_mouse_and_keyboard_server_warning");
526 warning.SetText(
"#str_controller_server_warning");
579 if (w == m_ContinueButton || w == m_ExitButton || w == m_RestartButton || w == m_OptionsButton || w == m_ControlsButton || w == m_OnlineButton || w == m_TutorialsButton);
589 #ifdef PLATFORM_CONSOLE
590 version =
"#main_menu_version" +
" " + version +
" (" +
g_Game.GetDatabaseID() +
")";
592 version =
"#main_menu_version" +
" " + version;
594 m_Version.SetText(version);
596 m_MuteAvailable =
false;
597 m_GamercardAvailable =
false;
599 if (
GetGame().IsMultiplayer() && layoutRoot.FindAnyWidget(
"OnlineInfo").IsVisible() && m_ServerInfoPanel)
601 PlayerListEntryScriptedWidget selected = m_ServerInfoPanel.GetSelectedPlayer();
602 if (selected && !selected.IsLocalPlayer())
606 m_GamercardAvailable =
true;
617 #ifdef PLATFORM_WINDOWS
621 ButtonWidget button = ButtonWidget.Cast(w);
622 if (button && button != m_ContinueButton)
624 button.SetTextColor(
ARGB(255, 255, 255, 255));
635 int color_pnl =
ARGB(255, 0, 0, 0);
636 int color_lbl =
ARGB(255, 255, 0, 0);
638 #ifdef PLATFORM_CONSOLE
639 color_pnl =
ARGB(255, 200, 0, 0);
640 color_lbl =
ARGB(255, 255, 255, 255);
652 int color_pnl =
ARGB(0, 0, 0, 0);
653 int color_lbl =
ARGB(255, 255, 255, 255);
678 Widget panel = w.FindWidget(w.GetName() +
"_panel");
682 panel.SetColor(color);
697 label.SetColor(color);
702 text.SetColor(color);
707 text2.SetColor(color);
728 m_MuteButtonTextID =
"#ps4_ingame_menu_mute";
729 m_UnmuteButtonTextID =
"#ps4_ingame_menu_unmute";
731 m_SelectButtonTextID =
"#ps4_ingame_menu_select";
732 m_OpenGameCardButtonTextID =
"#ps4_ingame_menu_opencard";
734 m_MuteButtonTextID =
"#xbox_ingame_menu_mute";
735 m_UnmuteButtonTextID =
"#xbox_ingame_menu_unmute";
737 m_SelectButtonTextID =
"#layout_xbox_ingame_menu_select";
738 m_OpenGameCardButtonTextID =
"#layout_xbox_ingame_menu_gamecard";
751 uiGamecardText.SetText(m_OpenGameCardButtonTextID);
759 uiSelectText.SetText(m_SelectButtonTextID);
768 if (player.IsUnconscious())
785 bool toolbarShow =
false;
786 #ifdef PLATFORM_CONSOLE
794 if (m_SelectAvailable)
800 if (m_GamercardAvailable)
803 toolbar_text.SetText(text);
810 layoutRoot.FindAnyWidget(
"toolbar_bg").Show(toolbarShow);
811 layoutRoot.FindAnyWidget(
"play_panel_root").Show(!onlineOpen);
812 layoutRoot.FindAnyWidget(
"play_panel_root2").Show(onlineOpen && !toolbarShow);
813 layoutRoot.FindAnyWidget(
"dayz_logo").Show(!onlineOpen);
protected void OnInputDeviceChanged(EInputDeviceType pInputDeviceType)
protected void OnInputPresetChanged()
class JsonControlMappingInfo m_BackButtonTextID
proto native owned string GetUid()
proto native BiosUser GetSelectedUser()
Returns the currently selected user.
proto native void RespawnPlayer()
proto void GetVersion(out string version)
proto native Mission GetMission()
MenuDefaultCharacterData GetMenuDefaultCharacterData(bool fill_data=true)
proto native Input GetInput()
proto native DayZPlayer GetPlayer()
override ScriptCallQueue GetCallQueue(int call_category)
proto native World GetWorld()
proto native void RestartMission()
proto native BiosUserManager GetUserManager()
proto native UIManager GetUIManager()
proto native void LogoutRequestTime()
Logout methods.
proto native WorkspaceWidget GetWorkspace()
Super root of all classes in Enforce script.
static ref SyncPlayerList m_PlayerList
static ref ScriptInvoker SyncEvent_OnPlayerListUpdate
ScriptInvoker GetOnInputPresetChanged()
ScriptInvoker GetOnInputDeviceChanged()
static void ShowUserProfile(string uid)
static ref ScriptInvoker m_PermissionsAsyncInvoker
static map< string, bool > GetMuteList()
static void ShowInviteScreen()
static bool IsPlayerMuted(string id)
proto void Call(func fn, 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)
adds call into the queue with given parameters and arguments (arguments are held in memory until the ...
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
ref array< ref SyncPlayer > m_PlayerList
proto native void ShowDialog(string caption, string text, int id, int butts, int def, int type, UIScriptedMenu handler)
Shows message dialog.
bool CloseAll()
Close all opened menus.
proto native bool IsDisabledReceivingVoN()
Result for an object found in CGame.IsBoxCollidingGeometryProxy.
proto native CGame GetGame()
const int RESPAWN_MODE_CUSTOM
static proto bool CastTo(out Class to, Class from)
Try to safely down-cast base class to child class.
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.
const int IDC_MAIN_OPTIONS
const int IDC_MULTI_INVITE
const int IDC_MAIN_CONTINUE
const int IDC_INT_RETRY
ingame menu
const int IDC_MAIN_ONLINE
int ARGB(int a, int r, int g, int b)