DayZ 1.28
DayZ Explorer by KGB
 
Загрузка...
Поиск...
Не найдено
InGameMenuXbox.c
См. документацию.
1class InGameMenuXbox extends UIScriptedMenu
2{
3 // Widgets texts id
4 protected string m_MuteButtonTextID;
5 protected string m_UnmuteButtonTextID;
6 protected string m_BackButtonTextID;
7 protected string m_SelectButtonTextID;
8 protected string m_OpenGameCardButtonTextID;
9 protected string m_CurrentMuteButtonText;
10
11 protected bool m_SelectAvailable;
12 protected bool m_MuteAvailable;
13 protected bool m_BackAvailable;
14 protected bool m_GamercardAvailable;
15
16 protected bool m_PlayerAlive;
17
18 protected ref PlayerListScriptedWidget m_ServerInfoPanel;
19
21
24 protected ButtonWidget m_ContinueButton;
25 protected ButtonWidget m_ExitButton;
26 protected ButtonWidget m_RestartDeadButton;
27 protected ButtonWidget m_RestartButton;
28 protected ButtonWidget m_OptionsButton;
29 protected ButtonWidget m_InviteButton;
30 protected ButtonWidget m_ControlsButton;
31 protected ButtonWidget m_OnlineButton;
32 protected ButtonWidget m_TutorialsButton;
34
35 protected ButtonWidget m_ShowFeedback;
36 protected ImageWidget m_FeedbackQRCode;
37 protected ImageWidget m_FeedbackPlatformIcon;
38 protected ButtonWidget m_FeedbackClose;
40
41 const int BUTTON_XBOX_CONTROLS = 201;
42
48
50 {
53
55 if (mission)
56 {
57 IngameHud hud = IngameHud.Cast(mission.GetHud());
58 if (hud)
59 {
60 hud.ShowHudUI(true);
61 hud.ShowQuickbarUI(true);
62 }
63
64 mission.Continue();
65 }
66
67 PPERequesterBank.GetRequester(PPERequester_MenuEffects).Stop();
68 }
69
70 protected void OnInputPresetChanged()
71 {
72 #ifdef PLATFORM_CONSOLE
74 #endif
75 }
76
77 protected void OnInputDeviceChanged(EInputDeviceType pInputDeviceType)
78 {
81
82 switch (pInputDeviceType)
83 {
84 case EInputDeviceType.CONTROLLER:
85 {
86 if (mk && mkServer)
87 {
89 if (!GetFocus() || GetFocus() == m_FeedbackClose)
90 {
92 }
93
94 m_FeedbackClose.Show(false);
95 m_ShowFeedback.Show(false);
96 }
97 break;
98 }
99 default:
100 {
101 if (mk && mkServer)
102 {
104 m_ShowFeedback.Show(true);
105 m_FeedbackClose.Show(true);
106 m_FeedbackCloseLabel.SetText(string.Format("%1",InputUtils.GetRichtextButtonIconFromInputAction("UAUIBack", "#close", EUAINPUT_DEVICE_CONTROLLER, InputUtils.ICON_SCALE_NORMAL)));
107 }
108 break;
109 }
110 }
111
113 }
114
115 override Widget Init()
116 {
117 layoutRoot = GetGame().GetWorkspace().CreateWidgets("gui/layouts/xbox/day_z_ingamemenu_xbox.layout");
118
119 m_OnlineMenu = GetGame().GetWorkspace().CreateWidgets("gui/layouts/xbox/ingamemenu_xbox/online_info_menu.layout", layoutRoot);
120 m_OnlineMenu.Show(false);
121
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");
138
139 m_SelectAvailable = true;
140 m_MuteAvailable = false;
141 m_GamercardAvailable = false;
142 m_BackAvailable = true;
143
144 PlayerBase player = PlayerBase.Cast(GetGame().GetPlayer());
145 if (player)
146 {
147 m_PlayerAlive = player.GetPlayerState() == EPlayerStates.ALIVE;
148 if (!m_PlayerAlive)
149 m_BackAvailable = false;
150
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);
157 }
158
159 string version;
160 GetGame().GetVersion(version);
161 #ifdef PLATFORM_CONSOLE
162 version = "#main_menu_version" + " " + version + " (" + g_Game.GetDatabaseID() + ")";
163 #else
164 version = "#main_menu_version" + " " + version;
165 #endif
166 m_Version.SetText(version);
167
168 if (GetGame().IsMultiplayer())
169 {
170 m_OnlineButton.Show(true);
171
172 TextWidget w_text = TextWidget.Cast(m_OnlineMenu.FindAnyWidget("OnlineTextWidget"));
173 w_text.SetText(g_Game.GetHostName());
174
175 m_ServerInfoPanel = new PlayerListScriptedWidget(m_OnlineMenu.FindAnyWidget("ServerInfoPanel"));
176
179
182
183 string uid = m_ServerInfoPanel.FindPlayerByWidget(GetFocus());
184 if (uid != "")
185 {
186 if (IsLocalPlayer(uid) || m_ServerInfoPanel.IsEmpty())
187 {
188 m_MuteAvailable = false;
189 m_GamercardAvailable = false;
190 }
191 else
192 {
194 #ifndef PLATFORM_PS4
196 #endif
198 }
199
200 if (m_ServerInfoPanel.IsGloballyMuted(uid))
201 {
202 m_MuteAvailable = false;
203 }
204 }
205 }
206 else
207 {
208 layoutRoot.FindAnyWidget("onlinebtn").Show(false);
209 layoutRoot.FindAnyWidget("invitebtn").Show(false);
210 }
211
212 //RESPAWN & RESTART
213 if (GetGame().IsMultiplayer())
214 {
215 m_RestartButton.SetText("#main_menu_respawn");
216 }
217 else
218 {
219 m_RestartButton.SetText("#main_menu_restart");
220 }
221
222 if (!ShouldRestartBeVisible(player))
223 {
224 m_RestartButton.Show(false);
225 }
226
228 if (mission)
229 {
230 IngameHud hud = IngameHud.Cast(mission.GetHud());
231 if (hud)
232 {
233 hud.ShowHudUI(false);
234 hud.ShowQuickbarUI(false);
235 }
236
237 mission.Pause();
238 }
239
240 PPERequester_MenuEffects requester;
241 Class.CastTo(requester,PPERequesterBank.GetRequester(PPERequester_MenuEffects));
242 requester.SetVignetteIntensity(0.6);
243
246
247 #ifdef PLATFORM_PS4
248 m_FeedbackQRCode.LoadImageFile(0, "gui/textures/feedback_qr_ps.edds");
249 #else
250 m_FeedbackQRCode.LoadImageFile(0, "gui/textures/feedback_qr_xbox.edds");
251 #endif
252
253 return layoutRoot;
254 }
255
256 override bool OnClick(Widget w, int x, int y, int button)
257 {
258 super.OnClick(w, x, y, button);
259
261 {
262 switch (w.GetUserID())
263 {
265 {
266 if (!IsOnlineOpen())
267 {
269 }
270 else
271 {
272 CloseOnline();
273 }
274 return true;
275 }
276 case IDC_MAIN_OPTIONS:
277 {
278 EnterScriptedMenu(MENU_OPTIONS);
279 return true;
280 }
282 {
283 EnterScriptedMenu(MENU_XBOX_CONTROLS);
284 return true;
285 }
286 case IDC_MAIN_QUIT:
287 {
288 GetGame().GetUIManager().ShowDialog("#main_menu_exit", "#main_menu_exit_desc", IDC_INT_EXIT, DBT_YESNO, DBB_YES, DMT_QUESTION, NULL);
289 return true;
290 }
291 case IDC_INT_RETRY:
292 {
293 if (!GetGame().IsMultiplayer())
294 {
295 GetGame().GetUIManager().ShowDialog("#main_menu_restart", "Are you sure you want to restart?", IDC_INT_RETRY, DBT_YESNO, DBB_YES, DMT_QUESTION, this);
296 }
297 else
298 {
299 GetGame().GetUIManager().ShowDialog("#main_menu_respawn", "#main_menu_respawn_question", IDC_INT_RETRY, DBT_YESNO, DBB_YES, DMT_QUESTION, this);
300 }
301 return true;
302 }
303 case IDC_MAIN_ONLINE:
304 {
305 m_OnlineMenu.Show(true);
306 m_SelectAvailable = false;
307
309 m_ServerInfoPanel.FocusFirst();
310 return true;
311 }
313 {
314 EnterScriptedMenu(MENU_TUTORIAL);
315 return true;
316 }
317 case IDC_MULTI_INVITE:
318 {
320 return true;
321 }
322 }
323
324 if (w == m_RestartDeadButton)
325 {
326 if (GetGame().GetMission().GetRespawnModeClient() == GameConstants.RESPAWN_MODE_CUSTOM)
327 {
328 GetGame().GetCallQueue(CALL_CATEGORY_GUI).Call(GetGame().GetUIManager().EnterScriptedMenu,MENU_RESPAWN_DIALOGUE,this);
329 }
330 else
331 {
332 GameRetry(true);
333 }
334 return true;
335 }
336 }
337 else
338 {
339 if (w == m_FeedbackClose)
340 {
342 return true;
343 }
344 }
345
346 if (w.GetUserID() == IDC_MAIN_FEEDBACK && !IsOnlineOpen())
347 {
349 return true;
350 }
351
352 return false;
353 }
354
355 protected void ToggleFeedbackDialog()
356 {
357 bool dialogVisible = FeedbackDialogVisible();
358 m_DialogPanel.Show(!dialogVisible);
359 m_IngameMenuPanel.Show(dialogVisible);
360
361 if (!dialogVisible)
362 {
363 PPERequesterBank.GetRequester(PPERequester_FeedbackBlur).Start();
364 }
365 else
366 {
367 PPERequesterBank.GetRequester(PPERequester_FeedbackBlur).Stop();
368 }
369
372 }
373
375 {
376 return m_DialogPanel.IsVisible();
377 }
378
379 override bool OnModalResult(Widget w, int x, int y, int code, int result)
380 {
381 super.OnModalResult(w, x, y, code, result);
382
383 if (code == IDC_INT_EXIT && result == DBB_YES)
384 {
385 if (GetGame().IsMultiplayer())
386 {
388 GetGame().GetCallQueue(CALL_CATEGORY_GUI).Call(GetGame().GetMission().CreateLogoutMenu, this);
389 }
390 else
391 {
392 // skip logout screen in singleplayer
394 }
395 g_Game.CancelLoginTimeCountdown();
396
397 return true;
398
399 }
400 else if (code == IDC_INT_EXIT && result == DBB_NO)
401 {
402 g_Game.CancelLoginTimeCountdown();
403 }
404 else if (code == IDC_INT_RETRY)
405 {
406 if (result == DBB_YES)
407 {
408 if (GetGame().GetMission().GetRespawnModeClient() == GameConstants.RESPAWN_MODE_CUSTOM)
409 {
410 GetGame().GetCallQueue(CALL_CATEGORY_GUI).Call(GetGame().GetUIManager().EnterScriptedMenu,MENU_RESPAWN_DIALOGUE,this);
411 }
412 else
413 {
414 GameRetry(true);
415 return true;
416 }
417 }
418 else
419 {
421 }
422 }
423
424 return false;
425 }
426
427 void GameRetry(bool random)
428 {
429 if (GetGame().IsMultiplayer())
430 {
433
434 PlayerBase player = PlayerBase.Cast(GetGame().GetPlayer());
435 if (player)
436 {
437 player.SimulateDeath(true);
438 GetGame().GetCallQueue(CALL_CATEGORY_GUI).Call(player.ShowDeadScreen, true, 0);
439 }
440
441 MissionGameplay missionGP = MissionGameplay.Cast(GetGame().GetMission());
442 missionGP.DestroyAllMenus();
443 missionGP.SetPlayerRespawning(true);
444 missionGP.Continue();
445
446 Close();
447 }
448 else
449 {
451 }
452 }
453
454 void MenuRequestRespawn(UIScriptedMenu menu, bool random)
455 {
456 if (RespawnDialogue.Cast(menu))
457 {
458 GameRetry(random);
459 }
460 }
461
462 bool IsLocalPlayer(string uid)
463 {
464 PlayerBase player = PlayerBase.Cast(GetGame().GetPlayer());
465 string local_uid;
466 if (GetGame().GetUserManager())
467 {
468 local_uid = GetGame().GetUserManager().GetSelectedUser().GetUid();
469 }
470
471 return (uid == local_uid);
472 }
473
475 {
476 SyncPlayerList player_list = new SyncPlayerList;
477 player_list.m_PlayerList = new array<ref SyncPlayer>;
478
479 for (int i = 0; i < player_count; i++)
480 {
481 SyncPlayer sync_player = new SyncPlayer;
482 sync_player.m_UID = "uid" + i;
483 sync_player.m_PlayerName = "Player " + i;
484 player_list.m_PlayerList.Insert(sync_player);
485 }
486
487 return player_list;
488 }
489
490 override void Update(float timeslice)
491 {
492 super.Update(timeslice);
493
494 if (GetUApi().GetInputByID(UAUIThumbRight).LocalPress() && !IsOnlineOpen() || FeedbackDialogVisible() && GetUApi().GetInputByID(UAUIBack).LocalPress())
495 {
497 }
498
499 if (GetGame().IsMultiplayer() && layoutRoot.FindAnyWidget("OnlineInfo").IsVisible())
500 {
501 PlayerListEntryScriptedWidget selected;
503 {
504 selected = m_ServerInfoPanel.GetSelectedPlayer();
505 }
506
507 if (GetUApi().GetInputByID(UAUICtrlX).LocalPress())
508 {
509 if (selected)
510 {
511 m_ServerInfoPanel.ToggleMute(selected.GetUID());
512 }
513
514 Refresh();
515 }
516
517 #ifndef PLATFORM_PS4
518 if (GetUApi().GetInputByID(UAUICtrlY).LocalPress())
519 {
520 if (selected)
521 {
522 OnlineServices.ShowUserProfile(selected.GetUID());
523 }
524 }
525 #endif
526 }
527 }
528
529 bool ShouldRestartBeVisible(Man player)
530 {
531 PlayerBase p = PlayerBase.Cast(player);
532 return p && p.IsUnconsciousStateOnly() && !CfgGameplayHandler.GetDisableRespawnInUnconsciousness();
533 }
534
536 {
537 bool shouldUpdateMenuFocus = false;
538 Man player = GetGame().GetPlayer();
539 if (player)
540 {
541 m_PlayerAlive = player.GetPlayerState() == EPlayerStates.ALIVE;
542 }
543
544 if (m_PlayerAlive)
545 {
546 bool showRestartBtn = ShouldRestartBeVisible(player);
547 m_RestartButton.Show(showRestartBtn);
548 }
549 else
550 {
551 m_RestartButton.Show(false);
552 m_BackAvailable = false;
553 }
554
557
559 }
560
562 {
563 return m_OnlineMenu.IsVisible();
564 }
565
567 {
568 m_OnlineMenu.Show(false);
569 m_SelectAvailable = true;
570 m_MuteAvailable = false;
571 m_GamercardAvailable = false;
572
575 }
576
578 {
580 {
581 m_ServerInfoPanel.FocusFirst();
582
583 Refresh();
584 }
585 }
586
587 override bool OnItemSelected(Widget w, int x, int y, int row, int column, int oldRow, int oldColumn)
588 {
589 return false;
590 }
591
593 {
594 m_ServerInfoPanel.Reload(player_list);
595
596 Refresh();
597 }
598
600 {
601 m_ServerInfoPanel.Reload(result_list);
602
603 Refresh();
604 }
605
606 override void OnShow()
607 {
608 super.OnShow();
609
610 #ifdef PLATFORM_CONSOLE
613 TextWidget warning = TextWidget.Cast(layoutRoot.FindAnyWidget("MouseAndKeyboardWarning"));
614 if (mk)
615 {
616 if (mk_server)
617 {
618 warning.SetText("#str_mouse_and_keyboard_server_warning");
619 }
620 else
621 {
622 warning.SetText("#str_controller_server_warning");
623 }
624 }
625
626 warning.Show(mk);
627 #endif
628
629 UpdateGUI();
630
632 OnInputDeviceChanged(GetGame().GetInput().GetCurrentInputDevice());
633 }
634
635 override bool OnMouseEnter(Widget w, int x, int y)
636 {
637 if (IsFocusable(w))
638 {
640 return true;
641 }
642 return false;
643 }
644
645 override bool OnMouseLeave(Widget w, Widget enterW, int x, int y)
646 {
647 if (IsFocusable(w))
648 {
649 ColorNormal(w);
650 return true;
651 }
652 return false;
653 }
654
655 override bool OnFocus(Widget w, int x, int y)
656 {
657 if (IsFocusable(w))
658 {
660 return true;
661 }
662 return false;
663 }
664
665 override bool OnFocusLost(Widget w, int x, int y)
666 {
667 if (IsFocusable(w))
668 {
669 ColorNormal(w);
670 return true;
671 }
672 return false;
673 }
674
676 {
677 if (w)
678 {
680 {
681 return true;
682 }
683 }
684 return false;
685 }
686
687 override void Refresh()
688 {
689 string version;
690 GetGame().GetVersion(version);
691 #ifdef PLATFORM_CONSOLE
692 version = "#main_menu_version" + " " + version + " (" + g_Game.GetDatabaseID() + ")";
693 #else
694 version = "#main_menu_version" + " " + version;
695 #endif
696 m_Version.SetText(version);
697
698 m_MuteAvailable = false;
699 m_GamercardAvailable = false;
700
701 if (GetGame().IsMultiplayer() && layoutRoot.FindAnyWidget("OnlineInfo").IsVisible() && m_ServerInfoPanel)
702 {
703 PlayerListEntryScriptedWidget selected = m_ServerInfoPanel.GetSelectedPlayer();
704 if (selected && !selected.IsLocalPlayer())
705 {
706 m_MuteAvailable = !GetGame().GetWorld().IsDisabledReceivingVoN() && !selected.IsGloballyMuted();
707 #ifndef PLATFORM_PS4
709 #endif
710 SetMuteButtonText(selected.IsMuted());
711 }
712 }
713
715 }
716
718 {
719 #ifdef PLATFORM_WINDOWS
720 SetFocus(null);
721 #endif
722
723 ButtonWidget button = ButtonWidget.Cast(w);
724 if (button && button != m_ContinueButton)
725 {
726 button.SetTextColor(ARGB(255, 255, 255, 255));
727 }
728 ButtonSetColor(w, ARGB(0, 0, 0, 0));
729 ButtonSetTextColor(w, ARGB(60, 0, 0, 0));
730 }
731
733 {
734 if (!w)
735 {
736 return;
737 }
738
739 int color_pnl = ARGB(255, 0, 0, 0);
740 int color_lbl = ARGB(255, 255, 0, 0);
741
742 #ifdef PLATFORM_CONSOLE
743 color_pnl = ARGB(255, 200, 0, 0);
744 color_lbl = ARGB(255, 255, 255, 255);
745 #endif
746
747 ButtonSetColor(w, color_pnl);
748 ButtonSetTextColor(w, color_lbl);
749 }
750
752 {
753 if (!w) return;
754
755 int color_pnl = ARGB(0, 0, 0, 0);
756 int color_lbl = ARGB(255, 255, 255, 255);
757
758 ButtonSetColor(w, color_pnl);
759 ButtonSetTextColor(w, color_lbl);
760 }
761
762 void ButtonSetText(Widget w, string text)
763 {
764 if (!w)
765 {
766 return;
767 }
768
769 TextWidget label = TextWidget.Cast(w.FindWidget(w.GetName() + "_label"));
770 if (label)
771 {
772 label.SetText(text);
773 }
774
775 }
776
777 void ButtonSetColor(Widget w, int color)
778 {
779 if (!w)
780 {
781 return;
782 }
783
784 Widget panel = w.FindWidget(w.GetName() + "_panel");
785 if (panel)
786 {
787 panel.SetColor(color);
788 }
789 }
790
791 void ButtonSetTextColor(Widget w, int color)
792 {
793 if (!w)
794 {
795 return;
796 }
797
798 TextWidget label = TextWidget.Cast(w.FindAnyWidget(w.GetName() + "_label"));
799 TextWidget text = TextWidget.Cast(w.FindAnyWidget(w.GetName() + "_text"));
800 TextWidget text2 = TextWidget.Cast(w.FindAnyWidget(w.GetName() + "_text_1"));
801
802 if (label)
803 {
804 label.SetColor(color);
805 }
806
807 if (text)
808 {
809 text.SetColor(color);
810 }
811
812 if (text2)
813 {
814 text2.SetColor(color);
815 }
816 }
817
819 protected void SetMuteButtonText(bool isMuted)
820 {
821 if (isMuted)
822 {
824 }
825 else
826 {
828 }
829 }
830
832 protected void LoadTextStrings()
833 {
834 #ifdef PLATFORM_PS4
835 m_MuteButtonTextID = "#ps4_ingame_menu_mute";
836 m_UnmuteButtonTextID = "#ps4_ingame_menu_unmute";
837 m_BackButtonTextID = "#ps4_ingame_menu_back";
838 m_SelectButtonTextID = "#ps4_ingame_menu_select";
839 m_OpenGameCardButtonTextID = "#ps4_ingame_menu_opencard";
840 #else
841 m_MuteButtonTextID = "#xbox_ingame_menu_mute";
842 m_UnmuteButtonTextID = "#xbox_ingame_menu_unmute";
843 m_BackButtonTextID = "#STR_rootFrame_toolbar_bg_ConsoleToolbar_Back_BackText0";
844 m_SelectButtonTextID = "#layout_xbox_ingame_menu_select";
845 m_OpenGameCardButtonTextID = "#layout_xbox_ingame_menu_gamecard";
846 #endif
847 }
848
850 protected void LoadFooterButtonTexts()
851 {
852 TextWidget uiGamecardText = TextWidget.Cast(layoutRoot.FindAnyWidget("GamercardText"));
853 TextWidget uiBackText = TextWidget.Cast(layoutRoot.FindAnyWidget("BackText"));
854 TextWidget uiSelectText = TextWidget.Cast(layoutRoot.FindAnyWidget("SelectText"));
855
856 if (uiGamecardText)
857 {
858 uiGamecardText.SetText(m_OpenGameCardButtonTextID);
859 }
860
861 if (uiBackText)
862 {
863 uiBackText.SetText(m_BackButtonTextID);
864 }
865
866 if (uiSelectText)
867 {
868 uiSelectText.SetText(m_SelectButtonTextID);
869 }
870 }
871
873 {
874 Man player = GetGame().GetPlayer();
875 if (m_PlayerAlive)
876 {
877 if (ShouldRestartBeVisible(player))
878 {
880 }
881 else
882 {
884 }
885 }
886 else
887 {
889 }
890 }
891
892 protected void UpdateControlsElements()
893 {
895 bool onlineOpen = IsOnlineOpen();
896 layoutRoot.FindAnyWidget("toolbar_bg").Show(toolbarShow);
897 layoutRoot.FindAnyWidget("top").Show(!onlineOpen);
898
900 if (onlineOpen)
901 {
902 layoutRoot.FindAnyWidget("bottom").Show(!toolbarShow);
903 }
904 else
905 {
906 layoutRoot.FindAnyWidget("bottom").Show(true);
907 }
908
909 RichTextWidget continueBtnIcon = RichTextWidget.Cast(layoutRoot.FindAnyWidget("continuebtn_icon"));
910 string contineBtnText = "";
911 continueBtnIcon.Show(!toolbarShow);
912
913 RichTextWidget toolbarTextWidget = RichTextWidget.Cast(layoutRoot.FindAnyWidget("ContextToolbarText"));
914 string toolbarText = "";
915
917 if (toolbarShow)
918 {
920 {
922 {
923 toolbarText += string.Format(" %1",InputUtils.GetRichtextButtonIconFromInputAction("UAUISelect", m_SelectButtonTextID, EUAINPUT_DEVICE_CONTROLLER, InputUtils.ICON_SCALE_TOOLBAR));
924 }
925
926 if (m_MuteAvailable)
927 {
928 toolbarText += string.Format(" %1",InputUtils.GetRichtextButtonIconFromInputAction("UAUICtrlX", m_CurrentMuteButtonText, EUAINPUT_DEVICE_CONTROLLER, InputUtils.ICON_SCALE_TOOLBAR));
929 }
930
931 if (m_BackAvailable)
932 {
933 toolbarText += string.Format(" %1",InputUtils.GetRichtextButtonIconFromInputAction("UAUIBack", m_BackButtonTextID, EUAINPUT_DEVICE_CONTROLLER, InputUtils.ICON_SCALE_TOOLBAR));
934 }
935
937 {
938 toolbarText += string.Format(" %1",InputUtils.GetRichtextButtonIconFromInputAction("UAUICtrlY", m_OpenGameCardButtonTextID, EUAINPUT_DEVICE_CONTROLLER, InputUtils.ICON_SCALE_TOOLBAR));
939 }
940
941 if (!IsOnlineOpen())
942 {
943 toolbarText += string.Format(" %1",InputUtils.GetRichtextButtonIconFromInputAction("UAUIThumbRight", "#layout_main_menu_feedback", EUAINPUT_DEVICE_CONTROLLER, InputUtils.ICON_SCALE_TOOLBAR));
944 }
945 }
946 else
947 {
948 toolbarText = InputUtils.GetRichtextButtonIconFromInputAction("UAUIBack", "#close", EUAINPUT_DEVICE_CONTROLLER, InputUtils.ICON_SCALE_TOOLBAR);
949 }
950 }
951 else
952 {
954 contineBtnText = InputUtils.GetRichtextButtonIconFromInputAction("UAUIBack", "", EUAINPUT_DEVICE_CONTROLLER);
955 }
956
957 toolbarTextWidget.SetText(toolbarText);
958 continueBtnIcon.SetText(contineBtnText);
959
961 string continueBtnLabel = "#main_menu_continue";
962 if (onlineOpen)
963 continueBtnLabel = "#layout_character_creation_back";
964
965 TextWidget continueBtnTextWidget = TextWidget.Cast(layoutRoot.FindAnyWidget("continuebtn_label"));
966 continueBtnTextWidget.SetText(continueBtnLabel);
967 layoutRoot.FindAnyWidget("dayz_logo").Show(!onlineOpen);
968 }
969
970 override void OnHide()
971 {
972 super.OnHide();
974 {
976 }
977 }
978}
array< ref BiosPrivacyUidResult > BiosPrivacyUidResultArray
Определения BiosPrivacyService.c:49
DayZGame g_Game
Определения DayZGame.c:3868
Mission mission
Определения DisplayStatus.c:28
EPlayerStates
Определения EPlayerStates.c:2
Icon x
Icon y
void Close()
PlayerBase GetPlayer()
Определения ModifierBase.c:51
proto native UAInputAPI GetUApi()
proto native owned string GetUid()
proto native BiosUser GetSelectedUser()
Returns the currently selected user.
proto native UIManager GetUIManager()
proto native void RestartMission()
proto native World GetWorld()
override ScriptCallQueue GetCallQueue(int call_category)
Определения DayZGame.c:1187
proto native BiosUserManager GetUserManager()
proto native void LogoutRequestTime()
Logout methods.
proto native DayZPlayer GetPlayer()
proto native WorkspaceWidget GetWorkspace()
proto native void RespawnPlayer()
proto void GetVersion(out string version)
proto native Input GetInput()
proto native Mission GetMission()
MenuDefaultCharacterData GetMenuDefaultCharacterData(bool fill_data=true)
Определения Global/game.c:1548
static bool GetDisableRespawnInUnconsciousness()
Определения CfgGameplayHandler.c:178
Super root of all classes in Enforce script.
Определения EnScript.c:11
static ref ScriptInvoker SyncEvent_OnPlayerListUpdate
Определения ClientData.c:3
static ref SyncPlayerList m_PlayerList
Определения ClientData.c:8
Определения ClientData.c:2
proto native EInputDeviceType GetCurrentInputDevice()
proto native bool IsEnabledMouseAndKeyboard()
proto native bool IsEnabledMouseAndKeyboardEvenOnServer()
static const float ICON_SCALE_NORMAL
Определения InputUtils.c:14
static string GetRichtextButtonIconFromInputAction(notnull UAInput pInput, string pLocalizedDescription, int pInputDeviceType=EUAINPUT_DEVICE_CONTROLLER, float pScale=ICON_SCALE_NORMAL, bool pVertical=false)
Определения InputUtils.c:167
static const float ICON_SCALE_TOOLBAR
Определения InputUtils.c:15
Определения InputUtils.c:2
void SetRandomCharacterForced(bool state)
Определения gameplay.c:1115
ScriptInvoker GetOnInputDeviceChanged()
Определения gameplay.c:851
void AbortMission()
Определения gameplay.c:776
ScriptInvoker GetOnInputPresetChanged()
Определения gameplay.c:859
Mission class.
Определения gameplay.c:687
static ref ScriptInvoker m_PermissionsAsyncInvoker
Определения OnlineServices.c:4
static bool IsPlayerMuted(string id)
Определения OnlineServices.c:357
static void ShowInviteScreen()
Определения OnlineServices.c:392
static void ShowUserProfile(string uid)
Определения OnlineServices.c:247
static map< string, bool > GetMuteList()
Определения OnlineServices.c:387
Определения OnlineServices.c:2
Определения PlayerBaseClient.c:2
Определения gameplay.c:317
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
string m_PlayerName
Определения SyncPlayer.c:11
string m_UID
Keeping for backwards compatability with mods.
Определения SyncPlayer.c:8
Определения SyncPlayer.c:2
ref array< ref SyncPlayer > m_PlayerList
Определения SyncPlayerList.c:3
Определения SyncPlayerList.c:2
Определения EnWidgets.c:220
proto native void ShowDialog(string caption, string text, int id, int butts, int def, int type, UIScriptedMenu handler)
Shows message dialog.
void ShowUICursor(bool visible)
Определения UIManager.c:244
void LoadFooterButtonTexts()
Initial texts load for the footer buttons.
Определения InGameMenuXbox.c:850
void MenuRequestRespawn(UIScriptedMenu menu, bool random)
Определения InGameMenuXbox.c:454
void SyncEvent_OnRecievedPlayerList(SyncPlayerList player_list)
Определения InGameMenuXbox.c:592
override bool OnMouseEnter(Widget w, int x, int y)
Определения InGameMenuXbox.c:635
Widget m_ExitButton
Определения InGameMenu.c:7
override void OnShow()
Определения InGameMenuXbox.c:606
bool FeedbackDialogVisible()
Определения InGameMenuXbox.c:374
void OnPermissionsUpdate(BiosPrivacyUidResultArray result_list)
Определения InGameMenuXbox.c:599
void ColorDisable(Widget w)
Определения InGameMenuXbox.c:717
ImageWidget m_FeedbackPlatformIcon
Определения InGameMenuXbox.c:37
ImageWidget m_FeedbackQRCode
Определения InGameMenuXbox.c:36
Widget m_DialogPanel
Определения InGameMenuXbox.c:23
override bool OnFocus(Widget w, int x, int y)
Определения InGameMenuXbox.c:655
void SetMuteButtonText(bool isMuted)
Set mute text button text (mute / unmute)
Определения InGameMenuXbox.c:819
override void Update(float timeslice)
Определения InGameMenuXbox.c:490
bool m_SelectAvailable
Определения InGameMenuXbox.c:11
override void Refresh()
Определения ChatInputMenu.c:70
RichTextWidget m_FeedbackCloseLabel
Определения InGameMenuXbox.c:39
TextWidget m_Version
Определения InGameMenuXbox.c:33
string m_BackButtonTextID
Определения ControlsXboxNew.c:30
void UpdateMenuFocus()
Определения InGameMenuXbox.c:872
Widget m_ContinueButton
Определения InGameMenu.c:5
bool m_PlayerAlive
Определения InGameMenuXbox.c:16
void ColorHighlight(Widget w)
Определения ControlsXboxNew.c:446
bool IsFocusable(Widget w)
Определения CameraToolsMenu.c:960
ButtonWidget m_ShowFeedback
Определения InGameMenuXbox.c:35
void LoadTextStrings()
Set correct bottom button texts based on platform (ps4 vs xbox texts)
Определения InGameMenuXbox.c:832
ButtonWidget m_OnlineButton
Определения InGameMenuXbox.c:31
void OnInputDeviceChanged(EInputDeviceType pInputDeviceType)
Определения ControlsXboxNew.c:71
Widget m_RestartButton
Определения InGameMenu.c:8
void ButtonSetText(Widget w, string text)
Определения InGameMenuXbox.c:762
string m_OpenGameCardButtonTextID
Определения InGameMenuXbox.c:8
bool m_GamercardAvailable
Определения InGameMenuXbox.c:14
const int BUTTON_XBOX_CONTROLS
Определения InGameMenuXbox.c:41
SyncPlayerList CreateFakePlayerList(int player_count)
Определения InGameMenuXbox.c:474
Widget m_OptionsButton
Определения InGameMenu.c:12
override void OnHide()
Определения InGameMenuXbox.c:970
override bool OnFocusLost(Widget w, int x, int y)
Определения InGameMenuXbox.c:665
override bool OnItemSelected(Widget w, int x, int y, int row, int column, int oldRow, int oldColumn)
Определения InGameMenuXbox.c:587
override bool OnMouseLeave(Widget w, Widget enterW, int x, int y)
Определения InGameMenuXbox.c:645
ButtonWidget m_ControlsButton
Определения InGameMenuXbox.c:30
ButtonWidget m_InviteButton
Определения InGameMenuXbox.c:29
Widget m_ServerInfoPanel
Определения InGameMenu.c:13
void UpdateGUI()
Определения InGameMenu.c:314
ButtonWidget m_RestartDeadButton
Определения InGameMenuXbox.c:26
string m_SelectButtonTextID
Определения InGameMenuXbox.c:7
Widget m_IngameMenuPanel
Определения InGameMenuXbox.c:22
bool IsLocalPlayer(string uid)
Определения InGameMenuXbox.c:462
string m_MuteButtonTextID
Определения InGameMenuXbox.c:4
void InGameMenuXbox()
Определения InGameMenuXbox.c:43
Widget m_OnlineMenu
Определения InGameMenuXbox.c:20
void GameRetry(bool random)
Определения InGameMenuXbox.c:427
string m_UnmuteButtonTextID
Определения InGameMenuXbox.c:5
void UpdateControlsElements()
Определения ControlsXboxNew.c:527
void ~InGameMenuXbox()
Определения InGameMenuXbox.c:49
void RespawnDialogue()
void ButtonSetTextColor(Widget w, int color)
Определения ControlsXboxNew.c:502
ButtonWidget m_FeedbackClose
Определения InGameMenuXbox.c:38
bool m_MuteAvailable
Определения InGameMenuXbox.c:12
override Widget Init()
Определения InGameMenuXbox.c:115
void SelectServer()
Определения InGameMenuXbox.c:577
void CloseOnline()
Определения InGameMenuXbox.c:566
override bool OnClick(Widget w, int x, int y, int button)
Определения InGameMenuXbox.c:256
ButtonWidget m_TutorialsButton
Определения InGameMenuXbox.c:32
void ButtonSetColor(Widget w, int color)
Определения ControlsXboxNew.c:489
override bool OnModalResult(Widget w, int x, int y, int code, int result)
Определения InGameMenuXbox.c:379
void ColorNormal(Widget w)
Определения ControlsXboxNew.c:463
string m_CurrentMuteButtonText
Определения InGameMenuXbox.c:9
void ToggleFeedbackDialog()
Определения InGameMenuXbox.c:355
bool IsOnlineOpen()
Определения InGameMenuXbox.c:561
bool m_BackAvailable
Определения InGameMenuXbox.c:13
bool ShouldRestartBeVisible(Man player)
Определения InGameMenuXbox.c:529
void OnInputPresetChanged()
Определения ControlsXboxNew.c:63
Определения DayZGame.c:64
Определения EnWidgets.c:190
proto native bool IsDisabledReceivingVoN()
Result for an object found in CGame.IsBoxCollidingGeometryProxy.
proto native CGame GetGame()
const int RESPAWN_MODE_CUSTOM
Определения 3_Game/constants.c:1047
static proto bool CastTo(out Class to, Class from)
Try to safely down-cast base class to child class.
const int MENU_TUTORIAL
Определения 3_Game/constants.c:204
const int MENU_XBOX_CONTROLS
Определения 3_Game/constants.c:197
const int MENU_RESPAWN_DIALOGUE
Определения 3_Game/constants.c:209
const int MENU_OPTIONS
Определения 3_Game/constants.c:183
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.
void Continue()
Timer continue when it was paused.
Определения 3_Game/tools/tools.c:247
const int CALL_CATEGORY_GUI
Определения 3_Game/tools/tools.c:9
const int IDC_INT_EXIT
Определения 3_Game/constants.c:160
const int IDC_MAIN_OPTIONS
Определения 3_Game/constants.c:142
const int IDC_MULTI_INVITE
Определения 3_Game/constants.c:152
const int IDC_MAIN_QUIT
Определения 3_Game/constants.c:144
const int IDC_MAIN_CONTINUE
Определения 3_Game/constants.c:145
const int IDC_INT_RETRY
ingame menu
Определения 3_Game/constants.c:158
const int IDC_MAIN_FEEDBACK
Определения 3_Game/constants.c:150
const int IDC_MAIN_TUTORIAL
Определения 3_Game/constants.c:146
const int IDC_MAIN_ONLINE
Определения 3_Game/constants.c:149
proto native external Widget CreateWidgets(string layout, Widget parentWidget=NULL, bool immedUpdate=true)
Create widgets from *.layout file.
proto native Widget GetFocus()
proto native void SetFocus(Widget w)
EInputDeviceType
Определения input.c:3
int ARGB(int a, int r, int g, int b)
Определения proto.c:322