DayZ 1.27
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 if (mk && mkServer)
86 {
88 if (!GetFocus() || GetFocus() == m_FeedbackClose)
89 {
91 }
92
93 m_FeedbackClose.Show(false);
94 m_ShowFeedback.Show(false);
95 }
96 break;
97
98 default:
99 if (mk && mkServer)
100 {
102 m_ShowFeedback.Show(true);
103 m_FeedbackClose.Show(true);
104 m_FeedbackCloseLabel.SetText(string.Format("%1",InputUtils.GetRichtextButtonIconFromInputAction("UAUIBack", "#close", EUAINPUT_DEVICE_CONTROLLER, InputUtils.ICON_SCALE_NORMAL)));
105 }
106 break;
107 }
108
110 }
111
112 override Widget Init()
113 {
114 layoutRoot = GetGame().GetWorkspace().CreateWidgets("gui/layouts/xbox/day_z_ingamemenu_xbox.layout");
115
116 m_OnlineMenu = GetGame().GetWorkspace().CreateWidgets("gui/layouts/xbox/ingamemenu_xbox/online_info_menu.layout", layoutRoot);
117 m_OnlineMenu.Show(false);
118
119 m_IngameMenuPanel = layoutRoot.FindAnyWidget("ingame_menu_panel");
120 m_ContinueButton = ButtonWidget.Cast(layoutRoot.FindAnyWidget("continuebtn"));
121 m_RestartDeadButton = ButtonWidget.Cast(layoutRoot.FindAnyWidget("restartbtn_dead"));
122 m_ExitButton = ButtonWidget.Cast(layoutRoot.FindAnyWidget("exitbtn"));
123 m_RestartButton = ButtonWidget.Cast(layoutRoot.FindAnyWidget("restartbtn"));
124 m_OptionsButton = ButtonWidget.Cast(layoutRoot.FindAnyWidget("optionsbtn"));
125 m_InviteButton = ButtonWidget.Cast(layoutRoot.FindAnyWidget("invitebtn"));
126 m_ControlsButton = ButtonWidget.Cast(layoutRoot.FindAnyWidget("controlsbtn"));
127 m_OnlineButton = ButtonWidget.Cast(layoutRoot.FindAnyWidget("onlinebtn"));
128 m_TutorialsButton = ButtonWidget.Cast(layoutRoot.FindAnyWidget("tutorialsbtn"));
129 m_Version = TextWidget.Cast(layoutRoot.FindAnyWidget("version"));
130 m_ShowFeedback = ButtonWidget.Cast(layoutRoot.FindAnyWidget("feedbackbtn"));
131 m_FeedbackQRCode = ImageWidget.Cast(layoutRoot.FindAnyWidget("qr_image"));
132 m_FeedbackClose = ButtonWidget.Cast(layoutRoot.FindAnyWidget("close_button"));
133 m_FeedbackCloseLabel = RichTextWidget.Cast(layoutRoot.FindAnyWidget("close_button_label"));
134 m_DialogPanel = layoutRoot.FindAnyWidget("ingame_menu_dialog");
135
136 m_SelectAvailable = true;
137 m_MuteAvailable = false;
138 m_GamercardAvailable = false;
139 m_BackAvailable = true;
140
141 PlayerBase player = PlayerBase.Cast(GetGame().GetPlayer());
142 if (player)
143 {
144 m_PlayerAlive = player.GetPlayerState() == EPlayerStates.ALIVE;
145 if (!m_PlayerAlive)
146 m_BackAvailable = false;
147
148 player.GetOnUnconsciousStart().Insert(UpdateGUI);
149 player.GetOnUnconsciousStart().Insert(UpdateMenuFocus);
150 player.GetOnUnconsciousStop().Insert(UpdateGUI);
151 player.GetOnUnconsciousStop().Insert(UpdateMenuFocus);
152 player.GetOnDeathStart().Insert(UpdateGUI);
153 player.GetOnDeathStart().Insert(UpdateMenuFocus);
154 }
155
156 string version;
157 GetGame().GetVersion(version);
158 #ifdef PLATFORM_CONSOLE
159 version = "#main_menu_version" + " " + version + " (" + g_Game.GetDatabaseID() + ")";
160 #else
161 version = "#main_menu_version" + " " + version;
162 #endif
163 m_Version.SetText(version);
164
165 if (GetGame().IsMultiplayer())
166 {
167 m_OnlineButton.Show(true);
168
169 TextWidget w_text = TextWidget.Cast(m_OnlineMenu.FindAnyWidget("OnlineTextWidget"));
170 w_text.SetText(g_Game.GetHostName());
171
172 m_ServerInfoPanel = new PlayerListScriptedWidget(m_OnlineMenu.FindAnyWidget("ServerInfoPanel"));
173
176
179
180 string uid = m_ServerInfoPanel.FindPlayerByWidget(GetFocus());
181 if (uid != "")
182 {
183 if (IsLocalPlayer(uid) || m_ServerInfoPanel.IsEmpty())
184 {
185 m_MuteAvailable = false;
186 m_GamercardAvailable = false;
187 }
188 else
189 {
191 #ifndef PLATFORM_PS4
193 #endif
195 }
196
197 if (m_ServerInfoPanel.IsGloballyMuted(uid))
198 {
199 m_MuteAvailable = false;
200 }
201 }
202 }
203 else
204 {
205 layoutRoot.FindAnyWidget("onlinebtn").Show(false);
206 layoutRoot.FindAnyWidget("invitebtn").Show(false);
207 }
208
209 //RESPAWN & RESTART
210 if (GetGame().IsMultiplayer())
211 {
212 m_RestartButton.SetText("#main_menu_respawn");
213 }
214 else
215 {
216 m_RestartButton.SetText("#main_menu_restart");
217 }
218
219 if (!ShouldRestartBeVisible(player))
220 {
221 //m_RestartButton.Enable(false);
222 m_RestartButton.Show(false);
223 }
224
226 if (mission)
227 {
228 IngameHud hud = IngameHud.Cast(mission.GetHud());
229 if (hud)
230 {
231 hud.ShowHudUI(false);
232 hud.ShowQuickbarUI(false);
233 }
234
235 mission.Pause();
236 }
237
238 PPERequester_MenuEffects requester;
239 Class.CastTo(requester,PPERequesterBank.GetRequester(PPERequester_MenuEffects));
240 requester.SetVignetteIntensity(0.6);
241
244
245 #ifdef PLATFORM_PS4
246 m_FeedbackQRCode.LoadImageFile(0, "gui/textures/feedback_qr_ps.edds");
247 #else
248 m_FeedbackQRCode.LoadImageFile(0, "gui/textures/feedback_qr_xbox.edds");
249 #endif
250
251 return layoutRoot;
252 }
253
254 override bool OnClick(Widget w, int x, int y, int button)
255 {
256 super.OnClick(w, x, y, button);
257
259 {
260 switch (w.GetUserID())
261 {
263 {
265 return true;
266 }
267 case IDC_MAIN_OPTIONS:
268 {
269 EnterScriptedMenu(MENU_OPTIONS);
270 return true;
271 }
273 {
274 EnterScriptedMenu(MENU_XBOX_CONTROLS);
275 return true;
276 }
277 case IDC_MAIN_QUIT:
278 {
279 GetGame().GetUIManager().ShowDialog("#main_menu_exit", "#main_menu_exit_desc", IDC_INT_EXIT, DBT_YESNO, DBB_YES, DMT_QUESTION, NULL);
280 return true;
281 }
282 case IDC_INT_RETRY:
283 {
284 if (!GetGame().IsMultiplayer())
285 {
286 GetGame().GetUIManager().ShowDialog("#main_menu_restart", "Are you sure you want to restart?", IDC_INT_RETRY, DBT_YESNO, DBB_YES, DMT_QUESTION, this);
287 }
288 else
289 {
290 GetGame().GetUIManager().ShowDialog("#main_menu_respawn", "#main_menu_respawn_question", IDC_INT_RETRY, DBT_YESNO, DBB_YES, DMT_QUESTION, this);
291 }
292 return true;
293 }
294 case IDC_MAIN_ONLINE:
295 {
296 m_OnlineMenu.Show(true);
297 m_SelectAvailable = false;
298
300 m_ServerInfoPanel.FocusFirst();
301 return true;
302 }
304 {
305 EnterScriptedMenu(MENU_TUTORIAL);
306 return true;
307 }
308 case IDC_MULTI_INVITE:
309 {
311 return true;
312 }
313 }
314
315 if (w == layoutRoot.FindAnyWidget("backbtn"))
316 {
317 CloseOnline();
318 }
319 else if (w == m_RestartDeadButton)
320 {
321 if (GetGame().GetMission().GetRespawnModeClient() == GameConstants.RESPAWN_MODE_CUSTOM)
322 {
323 GetGame().GetCallQueue(CALL_CATEGORY_GUI).Call(GetGame().GetUIManager().EnterScriptedMenu,MENU_RESPAWN_DIALOGUE,this);
324 }
325 else
326 {
327 GameRetry(true);
328 }
329 return true;
330 }
331 }
332 else
333 {
334 if (w == m_FeedbackClose)
335 {
337 return true;
338 }
339 }
340
341 if (w.GetUserID() == IDC_MAIN_FEEDBACK && !IsOnlineOpen())
342 {
344 return true;
345 }
346
347 return false;
348 }
349
350 protected void ToggleFeedbackDialog()
351 {
352 bool dialogVisible = FeedbackDialogVisible();
353 m_DialogPanel.Show(!dialogVisible);
354 m_IngameMenuPanel.Show(dialogVisible);
355
356 if (!dialogVisible)
357 {
358 PPERequesterBank.GetRequester(PPERequester_FeedbackBlur).Start();
359 }
360 else
361 {
362 PPERequesterBank.GetRequester(PPERequester_FeedbackBlur).Stop();
363 }
364
367 }
368
370 {
371 return m_DialogPanel.IsVisible();
372 }
373
374 override bool OnModalResult(Widget w, int x, int y, int code, int result)
375 {
376 super.OnModalResult(w, x, y, code, result);
377
378 if (code == IDC_INT_EXIT && result == DBB_YES)
379 {
380 if (GetGame().IsMultiplayer())
381 {
383 GetGame().GetCallQueue(CALL_CATEGORY_GUI).Call(GetGame().GetMission().CreateLogoutMenu, this);
384 }
385 else
386 {
387 // skip logout screen in singleplayer
389 }
390 g_Game.CancelLoginTimeCountdown();
391
392 return true;
393
394 }
395 else if (code == IDC_INT_EXIT && result == DBB_NO)
396 {
397 g_Game.CancelLoginTimeCountdown();
398 }
399 else if (code == IDC_INT_RETRY)
400 {
401 if (result == DBB_YES)
402 {
403 if (GetGame().GetMission().GetRespawnModeClient() == GameConstants.RESPAWN_MODE_CUSTOM)
404 {
405 GetGame().GetCallQueue(CALL_CATEGORY_GUI).Call(GetGame().GetUIManager().EnterScriptedMenu,MENU_RESPAWN_DIALOGUE,this);
406 }
407 else
408 {
409 GameRetry(true);
410 return true;
411 }
412 }
413 else
414 {
416 }
417 }
418
419 return false;
420 }
421
422 void GameRetry(bool random)
423 {
424 if (GetGame().IsMultiplayer())
425 {
426 //GetGame().GetUIManager().CloseAll();
429
430 PlayerBase player = PlayerBase.Cast(GetGame().GetPlayer());
431 if (player)
432 {
433 player.SimulateDeath(true);
434 GetGame().GetCallQueue(CALL_CATEGORY_GUI).Call(player.ShowDeadScreen, true, 0);
435 }
436
437 MissionGameplay missionGP = MissionGameplay.Cast(GetGame().GetMission());
438 missionGP.DestroyAllMenus();
439 missionGP.SetPlayerRespawning(true);
440 missionGP.Continue();
441
442 Close();
443 }
444 else
446 }
447
448 void MenuRequestRespawn(UIScriptedMenu menu, bool random)
449 {
450 if (RespawnDialogue.Cast(menu))
451 GameRetry(random);
452 }
453
454 bool IsLocalPlayer(string uid)
455 {
456 PlayerBase player = PlayerBase.Cast(GetGame().GetPlayer());
457 string local_uid;
458 if (GetGame().GetUserManager())
459 local_uid = GetGame().GetUserManager().GetSelectedUser().GetUid();
460 return (uid == local_uid);
461 }
462
464 {
465 SyncPlayerList player_list = new SyncPlayerList;
466 player_list.m_PlayerList = new array<ref SyncPlayer>;
467 for (int i = 0; i < player_count; i++)
468 {
469 SyncPlayer sync_player = new SyncPlayer;
470 sync_player.m_UID = "uid" + i;
471 sync_player.m_PlayerName = "Player " + i;
472 player_list.m_PlayerList.Insert(sync_player);
473 }
474 return player_list;
475 }
476
477 override void Update(float timeslice)
478 {
479 super.Update(timeslice);
480
481 if (GetUApi().GetInputByID(UAUIThumbRight).LocalPress() && !IsOnlineOpen() || FeedbackDialogVisible() && GetUApi().GetInputByID(UAUIBack).LocalPress())
482 {
484 }
485
486 if (GetGame().IsMultiplayer() && layoutRoot.FindAnyWidget("OnlineInfo").IsVisible())
487 {
488 PlayerListEntryScriptedWidget selected;
490 selected = m_ServerInfoPanel.GetSelectedPlayer();
491 if (GetUApi().GetInputByID(UAUICtrlX).LocalPress())
492 {
493 if (selected)
494 m_ServerInfoPanel.ToggleMute(selected.GetUID());
495 Refresh();
496 }
497
498 #ifndef PLATFORM_PS4
499 if (GetUApi().GetInputByID(UAUICtrlY).LocalPress())
500 {
501 if (selected)
502 OnlineServices.ShowUserProfile(selected.GetUID());
503 }
504 #endif
505 }
506 }
507
508 bool ShouldRestartBeVisible(Man player)
509 {
510 PlayerBase p = PlayerBase.Cast(player);
511 return p && p.IsUnconsciousStateOnly() && !CfgGameplayHandler.GetDisableRespawnInUnconsciousness();
512 }
513
515 {
516 bool shouldUpdateMenuFocus = false;
517 Man player = GetGame().GetPlayer();
518 if (player)
519 m_PlayerAlive = player.GetPlayerState() == EPlayerStates.ALIVE;
520
521 if (m_PlayerAlive)
522 {
523 bool showRestartBtn = ShouldRestartBeVisible(player);
524 m_RestartButton.Show(showRestartBtn);
525 }
526 else
527 {
528 m_RestartButton.Show(false);
529 m_BackAvailable = false;
530 }
531
534
536 }
537
539 {
540 return m_OnlineMenu.IsVisible();
541 }
542
544 {
545 m_OnlineMenu.Show(false);
546 m_SelectAvailable = true;
547 m_MuteAvailable = false;
548 m_GamercardAvailable = false;
550
552 }
553
555 {
557 {
558 m_ServerInfoPanel.FocusFirst();
559
560 Refresh();
561 }
562 }
563
564 override bool OnItemSelected(Widget w, int x, int y, int row, int column, int oldRow, int oldColumn)
565 {
566 return false;
567 }
568
570 {
571 m_ServerInfoPanel.Reload(player_list);
572
573 Refresh();
574 }
575
577 {
578 m_ServerInfoPanel.Reload(result_list);
579
580 Refresh();
581 }
582
583 override void OnShow()
584 {
585 super.OnShow();
586
587 #ifdef PLATFORM_CONSOLE
590 TextWidget warning = TextWidget.Cast(layoutRoot.FindAnyWidget("MouseAndKeyboardWarning"));
591 if (mk)
592 {
593 if (mk_server)
594 {
595 warning.SetText("#str_mouse_and_keyboard_server_warning");
596 }
597 else
598 {
599 warning.SetText("#str_controller_server_warning");
600 }
601 }
602
603 warning.Show(mk);
604 #endif
605
606 UpdateGUI();
607
609 OnInputDeviceChanged(GetGame().GetInput().GetCurrentInputDevice());
610 }
611
612 override bool OnMouseEnter(Widget w, int x, int y)
613 {
614 if (IsFocusable(w))
615 {
617 return true;
618 }
619 return false;
620 }
621
622 override bool OnMouseLeave(Widget w, Widget enterW, int x, int y)
623 {
624 if (IsFocusable(w))
625 {
626 ColorNormal(w);
627 return true;
628 }
629 return false;
630 }
631
632 override bool OnFocus(Widget w, int x, int y)
633 {
634 if (IsFocusable(w))
635 {
637 return true;
638 }
639 return false;
640 }
641
642 override bool OnFocusLost(Widget w, int x, int y)
643 {
644 if (IsFocusable(w))
645 {
646 ColorNormal(w);
647 return true;
648 }
649 return false;
650 }
651
653 {
654 if (w)
655 {
657 return true;
658 }
659 return false;
660 }
661
662 override void Refresh()
663 {
664 string version;
665 GetGame().GetVersion(version);
666 #ifdef PLATFORM_CONSOLE
667 version = "#main_menu_version" + " " + version + " (" + g_Game.GetDatabaseID() + ")";
668 #else
669 version = "#main_menu_version" + " " + version;
670 #endif
671 m_Version.SetText(version);
672
673 m_MuteAvailable = false;
674 m_GamercardAvailable = false;
675
676 if (GetGame().IsMultiplayer() && layoutRoot.FindAnyWidget("OnlineInfo").IsVisible() && m_ServerInfoPanel)
677 {
678 PlayerListEntryScriptedWidget selected = m_ServerInfoPanel.GetSelectedPlayer();
679 if (selected && !selected.IsLocalPlayer())
680 {
681 m_MuteAvailable = !GetGame().GetWorld().IsDisabledReceivingVoN() && !selected.IsGloballyMuted();
682 #ifndef PLATFORM_PS4
684 #endif
685 SetMuteButtonText(selected.IsMuted());
686 }
687 }
688
690 }
691
693 {
694 #ifdef PLATFORM_WINDOWS
695 SetFocus(null);
696 #endif
697
698 ButtonWidget button = ButtonWidget.Cast(w);
699 if (button && button != m_ContinueButton)
700 {
701 button.SetTextColor(ARGB(255, 255, 255, 255));
702 }
703 ButtonSetColor(w, ARGB(0, 0, 0, 0));
704 ButtonSetTextColor(w, ARGB(60, 0, 0, 0));
705 }
706
708 {
709 if (!w)
710 return;
711
712 int color_pnl = ARGB(255, 0, 0, 0);
713 int color_lbl = ARGB(255, 255, 0, 0);
714
715 #ifdef PLATFORM_CONSOLE
716 color_pnl = ARGB(255, 200, 0, 0);
717 color_lbl = ARGB(255, 255, 255, 255);
718 #endif
719
720 ButtonSetColor(w, color_pnl);
721 ButtonSetTextColor(w, color_lbl);
722 }
723
725 {
726 if (!w)
727 return;
728
729 int color_pnl = ARGB(0, 0, 0, 0);
730 int color_lbl = ARGB(255, 255, 255, 255);
731
732 ButtonSetColor(w, color_pnl);
733 ButtonSetTextColor(w, color_lbl);
734 }
735
736 void ButtonSetText(Widget w, string text)
737 {
738 if (!w)
739 return;
740
741 TextWidget label = TextWidget.Cast(w.FindWidget(w.GetName() + "_label"));
742
743 if (label)
744 {
745 label.SetText(text);
746 }
747
748 }
749
750 void ButtonSetColor(Widget w, int color)
751 {
752 if (!w)
753 return;
754
755 Widget panel = w.FindWidget(w.GetName() + "_panel");
756
757 if (panel)
758 {
759 panel.SetColor(color);
760 }
761 }
762
763 void ButtonSetTextColor(Widget w, int color)
764 {
765 if (!w)
766 return;
767
768 TextWidget label = TextWidget.Cast(w.FindAnyWidget(w.GetName() + "_label"));
769 TextWidget text = TextWidget.Cast(w.FindAnyWidget(w.GetName() + "_text"));
770 TextWidget text2 = TextWidget.Cast(w.FindAnyWidget(w.GetName() + "_text_1"));
771
772 if (label)
773 {
774 label.SetColor(color);
775 }
776
777 if (text)
778 {
779 text.SetColor(color);
780 }
781
782 if (text2)
783 {
784 text2.SetColor(color);
785 }
786 }
787
789 protected void SetMuteButtonText(bool isMuted)
790 {
791 if (isMuted)
792 {
794 }
795 else
796 {
798 }
799 }
800
802 protected void LoadTextStrings()
803 {
804 #ifdef PLATFORM_PS4
805 m_MuteButtonTextID = "#ps4_ingame_menu_mute";
806 m_UnmuteButtonTextID = "#ps4_ingame_menu_unmute";
807 m_BackButtonTextID = "#ps4_ingame_menu_back";
808 m_SelectButtonTextID = "#ps4_ingame_menu_select";
809 m_OpenGameCardButtonTextID = "#ps4_ingame_menu_opencard";
810 #else
811 m_MuteButtonTextID = "#xbox_ingame_menu_mute";
812 m_UnmuteButtonTextID = "#xbox_ingame_menu_unmute";
813 m_BackButtonTextID = "#STR_rootFrame_toolbar_bg_ConsoleToolbar_Back_BackText0";
814 m_SelectButtonTextID = "#layout_xbox_ingame_menu_select";
815 m_OpenGameCardButtonTextID = "#layout_xbox_ingame_menu_gamecard";
816 #endif
817 }
818
820 protected void LoadFooterButtonTexts()
821 {
822 TextWidget uiGamecardText = TextWidget.Cast(layoutRoot.FindAnyWidget("GamercardText"));
823 TextWidget uiBackText = TextWidget.Cast(layoutRoot.FindAnyWidget("BackText"));
824 TextWidget uiSelectText = TextWidget.Cast(layoutRoot.FindAnyWidget("SelectText"));
825
826 if (uiGamecardText)
827 {
828 uiGamecardText.SetText(m_OpenGameCardButtonTextID);
829 }
830 if (uiBackText)
831 {
832 uiBackText.SetText(m_BackButtonTextID);
833 }
834 if (uiSelectText)
835 {
836 uiSelectText.SetText(m_SelectButtonTextID);
837 }
838 }
839
841 {
842 Man player = GetGame().GetPlayer();
843 if (m_PlayerAlive)
844 {
845 if (ShouldRestartBeVisible(player))
847 else
849 }
850 else
851 {
853 }
854 }
855
856 protected void UpdateControlsElements()
857 {
858 bool toolbarShow = false;
859 #ifdef PLATFORM_CONSOLE
861 #endif
862
863 if (toolbarShow)
864 {
865 RichTextWidget toolbar_text = RichTextWidget.Cast(layoutRoot.FindAnyWidget("ContextToolbarText"));
866 string text = "";
868 {
870 text += string.Format(" %1",InputUtils.GetRichtextButtonIconFromInputAction("UAUISelect", m_SelectButtonTextID, EUAINPUT_DEVICE_CONTROLLER, InputUtils.ICON_SCALE_TOOLBAR));
871 if (m_MuteAvailable)
872 text += string.Format(" %1",InputUtils.GetRichtextButtonIconFromInputAction("UAUICtrlX", m_CurrentMuteButtonText, EUAINPUT_DEVICE_CONTROLLER, InputUtils.ICON_SCALE_TOOLBAR));
873 if (m_BackAvailable)
874 text += string.Format(" %1",InputUtils.GetRichtextButtonIconFromInputAction("UAUIBack", m_BackButtonTextID, EUAINPUT_DEVICE_CONTROLLER, InputUtils.ICON_SCALE_TOOLBAR));
876 text += string.Format(" %1",InputUtils.GetRichtextButtonIconFromInputAction("UAUICtrlY", m_OpenGameCardButtonTextID, EUAINPUT_DEVICE_CONTROLLER, InputUtils.ICON_SCALE_TOOLBAR));
877 if (!IsOnlineOpen())
878 text += string.Format(" %1",InputUtils.GetRichtextButtonIconFromInputAction("UAUIThumbRight", "#layout_main_menu_feedback", EUAINPUT_DEVICE_CONTROLLER, InputUtils.ICON_SCALE_TOOLBAR));
879 }
880 else
881 {
882 text = InputUtils.GetRichtextButtonIconFromInputAction("UAUIBack", "#close", EUAINPUT_DEVICE_CONTROLLER, InputUtils.ICON_SCALE_TOOLBAR);
883 }
884 toolbar_text.SetText(text);
885 }
886
887 RichTextWidget toolbar_b2 = RichTextWidget.Cast(layoutRoot.FindAnyWidget("BackIcon0"));
888 toolbar_b2.SetText(InputUtils.GetRichtextButtonIconFromInputAction("UAUIBack", "", EUAINPUT_DEVICE_CONTROLLER));
889
890 bool onlineOpen = IsOnlineOpen();
891 layoutRoot.FindAnyWidget("toolbar_bg").Show(toolbarShow);
892 layoutRoot.FindAnyWidget("play_panel_root").Show(!onlineOpen);
893 layoutRoot.FindAnyWidget("play_panel_root2").Show(onlineOpen && !toolbarShow);
894 layoutRoot.FindAnyWidget("dayz_logo").Show(!onlineOpen);
895 }
896
897 override void OnHide()
898 {
899 super.OnHide();
901 {
903 }
904 }
905}
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)
Определения Game.c:1493
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
Определения constants.c:659
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:820
void MenuRequestRespawn(UIScriptedMenu menu, bool random)
Определения InGameMenuXbox.c:448
void SyncEvent_OnRecievedPlayerList(SyncPlayerList player_list)
Определения InGameMenuXbox.c:569
override bool OnMouseEnter(Widget w, int x, int y)
Определения InGameMenuXbox.c:612
Widget m_ExitButton
Определения InGameMenu.c:7
override void OnShow()
Определения InGameMenuXbox.c:583
bool FeedbackDialogVisible()
Определения InGameMenuXbox.c:369
void OnPermissionsUpdate(BiosPrivacyUidResultArray result_list)
Определения InGameMenuXbox.c:576
void ColorDisable(Widget w)
Определения InGameMenuXbox.c:692
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:632
void SetMuteButtonText(bool isMuted)
Set mute text button text (mute / unmute)
Определения InGameMenuXbox.c:789
override void Update(float timeslice)
Определения InGameMenuXbox.c:477
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:840
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:802
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:736
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:463
Widget m_OptionsButton
Определения InGameMenu.c:12
override void OnHide()
Определения InGameMenuXbox.c:897
override bool OnFocusLost(Widget w, int x, int y)
Определения InGameMenuXbox.c:642
override bool OnItemSelected(Widget w, int x, int y, int row, int column, int oldRow, int oldColumn)
Определения InGameMenuXbox.c:564
override bool OnMouseLeave(Widget w, Widget enterW, int x, int y)
Определения InGameMenuXbox.c:622
ButtonWidget m_ControlsButton
Определения InGameMenuXbox.c:30
ButtonWidget m_InviteButton
Определения InGameMenuXbox.c:29
Widget m_ServerInfoPanel
Определения InGameMenu.c:13
void UpdateGUI()
Определения InGameMenu.c:307
ButtonWidget m_RestartDeadButton
Определения InGameMenuXbox.c:26
string m_SelectButtonTextID
Определения InGameMenuXbox.c:7
Widget m_IngameMenuPanel
Определения InGameMenuXbox.c:22
bool IsLocalPlayer(string uid)
Определения InGameMenuXbox.c:454
string m_MuteButtonTextID
Определения InGameMenuXbox.c:4
void InGameMenuXbox()
Определения InGameMenuXbox.c:43
Widget m_OnlineMenu
Определения InGameMenuXbox.c:20
void GameRetry(bool random)
Определения InGameMenuXbox.c:422
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:112
void SelectServer()
Определения InGameMenuXbox.c:554
void CloseOnline()
Определения InGameMenuXbox.c:543
override bool OnClick(Widget w, int x, int y, int button)
Определения InGameMenuXbox.c:254
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:374
void ColorNormal(Widget w)
Определения ControlsXboxNew.c:463
string m_CurrentMuteButtonText
Определения InGameMenuXbox.c:9
void ToggleFeedbackDialog()
Определения InGameMenuXbox.c:350
bool IsOnlineOpen()
Определения InGameMenuXbox.c:538
bool m_BackAvailable
Определения InGameMenuXbox.c:13
bool ShouldRestartBeVisible(Man player)
Определения InGameMenuXbox.c:508
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
Определения constants.c:1045
static proto bool CastTo(out Class to, Class from)
Try to safely down-cast base class to child class.
const int MENU_TUTORIAL
Определения constants.c:204
const int MENU_XBOX_CONTROLS
Определения constants.c:197
const int MENU_RESPAWN_DIALOGUE
Определения constants.c:209
const int MENU_OPTIONS
Определения 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.
Определения tools.c:247
const int CALL_CATEGORY_GUI
Определения tools.c:9
const int IDC_INT_EXIT
Определения constants.c:160
const int IDC_MAIN_OPTIONS
Определения constants.c:142
const int IDC_MULTI_INVITE
Определения constants.c:152
const int IDC_MAIN_QUIT
Определения constants.c:144
const int IDC_MAIN_CONTINUE
Определения constants.c:145
const int IDC_INT_RETRY
ingame menu
Определения constants.c:158
const int IDC_MAIN_FEEDBACK
Определения constants.c:150
const int IDC_MAIN_TUTORIAL
Определения constants.c:146
const int IDC_MAIN_ONLINE
Определения 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