DayZ 1.30
DayZ Explorer by KGB
 
Загрузка...
Поиск...
Не найдено
ServerBrowserMenuNew.c
См. документацию.
1const int MAX_FAVORITES = 25;
2
3#ifdef PLATFORM_CONSOLE
4const int SERVER_BROWSER_PAGE_SIZE = 22;
5#else
7#endif
8
9class ServerBrowserMenuNew extends UIScriptedMenu
10{
11 protected Widget m_Play;
14
15 protected Widget m_Back;
17 protected TextWidget m_PlayerName;
18
19 protected TabberUI m_Tabber;
24
25 protected TabType m_IsRefreshing = TabType.NONE;
27 protected ServerBrowserEntry m_SelectedServer;
28
29 override Widget Init()
30 {
31 #ifdef PLATFORM_CONSOLE
32 layoutRoot = g_Game.GetWorkspace().CreateWidgets("gui/layouts/new_ui/server_browser/xbox/server_browser.layout");
33 m_FavoritesTab = new ServerBrowserFavoritesTabConsolePages(layoutRoot.FindAnyWidget("Tab_0"), this, TabType.FAVORITE);
34 m_OfficialTab = new ServerBrowserTabConsolePages(layoutRoot.FindAnyWidget("Tab_1"), this, TabType.OFFICIAL);
35 m_CommunityTab = new ServerBrowserTabConsolePages(layoutRoot.FindAnyWidget("Tab_2"), this, TabType.COMMUNITY);
36 #else
37 layoutRoot = g_Game.GetWorkspace().CreateWidgets("gui/layouts/new_ui/server_browser/pc/server_browser.layout");
38 m_FavoritesTab = new ServerBrowserFavoritesTabPc(layoutRoot.FindAnyWidget("Tab_0"), this, TabType.FAVORITE);
39 m_OfficialTab = new ServerBrowserTabPc(layoutRoot.FindAnyWidget("Tab_1"), this, TabType.OFFICIAL);
40 m_CommunityTab = new ServerBrowserTabPc(layoutRoot.FindAnyWidget("Tab_2"), this, TabType.COMMUNITY);
41 m_LANTab = new ServerBrowserTabPc(layoutRoot.FindAnyWidget("Tab_3"), this, TabType.LAN);
42 #endif
43
44 layoutRoot.FindAnyWidget("Tabber").GetScript(m_Tabber);
45
46 m_Play = layoutRoot.FindAnyWidget("play");
47 m_PlayButtonLabel = TextWidget.Cast(m_Play.FindAnyWidget("play_label"));
48 m_OpenStoreButtonLabel = TextWidget.Cast(m_Play.FindAnyWidget("open_store_label"));
49 m_Back = layoutRoot.FindAnyWidget("back_button");
50 m_CustomizeCharacter = layoutRoot.FindAnyWidget("customize_character");
51 m_PlayerName = TextWidget.Cast(layoutRoot.FindAnyWidget("character_name_text"));
53
54 #ifndef PLATFORM_CONSOLE
55 layoutRoot.FindAnyWidget("customize_character").Show(false);
56 layoutRoot.FindAnyWidget("character").Show(false);
57 #endif
58
59 Refresh();
60
61 string version;
62 g_Game.GetVersion(version);
63
64 #ifdef PLATFORM_CONSOLE
65 version = "#main_menu_version" + " " + version + " (" + g_Game.GetDatabaseID() + ")";
66 if (g_Game.GetInput().IsEnabledMouseAndKeyboard())
67 {
68 layoutRoot.FindAnyWidget("toolbar_bg").Show(false);
69 }
70
71 RichTextWidget playPanelBack = RichTextWidget.Cast(layoutRoot.FindAnyWidget("BackIcon0"));
72 playPanelBack.SetText(InputUtils.GetRichtextButtonIconFromInputAction("UAUIBack", "", EUAINPUT_DEVICE_CONTROLLER, InputUtils.ICON_SCALE_NORMAL));
73
74 RichTextWidget playPanelPlay = RichTextWidget.Cast(layoutRoot.FindAnyWidget("PlayIcon0"));
75 playPanelPlay.SetText(InputUtils.GetRichtextButtonIconFromInputAction("UAUISelect", "", EUAINPUT_DEVICE_CONTROLLER, InputUtils.ICON_SCALE_NORMAL));
76 #else
77 version = "#main_menu_version" + " " + version;
78 #endif
79
83
84 m_Tabber.m_OnTabSwitch.Insert(OnTabSwitch);
85
86 m_FavoritesTab.RefreshList();
87
88 #ifdef PLATFORM_CONSOLE
90 //Sort init
91 TextWidget sort_text = TextWidget.Cast(layoutRoot.FindAnyWidget("SortText"));
92 sort_text.SetText("#str_serverbrowserroot_toolbar_bg_consoletoolbar_sort_sorttext0");
93 #endif
94
95 PPERequesterBank.GetRequester(PPERequester_ServerBrowserBlur).Start(new Param1<float>(0.5));
96
97 g_Game.GetMission().GetOnInputPresetChanged().Insert(OnInputPresetChanged);
98 g_Game.GetMission().GetOnInputDeviceChanged().Insert(OnInputDeviceChanged);
99
100 #ifdef PLATFORM_WINDOWS
101 g_Game.GetInput().EnableGamepad(false);
102 #endif
103
104 return layoutRoot;
105 }
106
108 {
109 #ifdef PLATFORM_CONSOLE
111 #endif
112
113 #ifdef PLATFORM_WINDOWS
114 g_Game.GetInput().EnableGamepad(true);
115 #endif
116
119 m_Tabber.m_OnTabSwitch.Remove(OnTabSwitch);
120 PPERequesterBank.GetRequester(PPERequester_ServerBrowserBlur).Stop();
121 }
122
127
128 protected void OnInputPresetChanged()
129 {
130 #ifdef PLATFORM_CONSOLE
132 #endif
133 }
134
135 protected void OnInputDeviceChanged(EInputDeviceType pInputDeviceType)
136 {
137 switch (pInputDeviceType)
138 {
139 case EInputDeviceType.CONTROLLER:
140 #ifdef PLATFORM_CONSOLE
142 layoutRoot.FindAnyWidget("toolbar_bg").Show(true);
143 layoutRoot.FindAnyWidget("ConsoleControls").Show(true);
144 #ifdef PLATFORM_MSSTORE
145 layoutRoot.FindAnyWidget("PlayIcon0").Show(true);
146 layoutRoot.FindAnyWidget("BackIcon0").Show(true);
147 #else
148 layoutRoot.FindAnyWidget("PlayIcon0").Show(false);
149 layoutRoot.FindAnyWidget("BackIcon0").Show(false);
150 #endif
151 if (g_Game.GetInput().IsEnabledMouseAndKeyboardEvenOnServer())
152 {
153 g_Game.GetUIManager().ShowUICursor(false);
154 }
155 #endif
156 break;
157
158 default:
159 #ifdef PLATFORM_CONSOLE
160 if (g_Game.GetInput().IsEnabledMouseAndKeyboardEvenOnServer())
161 {
162 layoutRoot.FindAnyWidget("toolbar_bg").Show(false);
163 layoutRoot.FindAnyWidget("ConsoleControls").Show(false);
164 #ifdef PLATFORM_MSSTORE
165 layoutRoot.FindAnyWidget("PlayIcon0").Show(false); // Not sure why these are inverted on consoles. Let's keep it safe per-platform.
166 layoutRoot.FindAnyWidget("BackIcon0").Show(false);
167 #else
168 layoutRoot.FindAnyWidget("PlayIcon0").Show(true);
169 layoutRoot.FindAnyWidget("BackIcon0").Show(true);
170 #endif
171 g_Game.GetUIManager().ShowUICursor(true);
172 }
173 #endif
174 break;
175 }
176 }
177
178 override bool OnClick(Widget w, int x, int y, int button)
179 {
180 if (button == MouseState.LEFT)
181 {
182 if (w == m_Play)
183 {
184 // The 'open store' label already tells the player the DLC is missing,
185 // in that case the store is opened without warning them again
186 Play(!m_OpenStoreButtonLabel.IsVisible());
187 return true;
188 }
189 else if (w == m_Back)
190 {
191 Back();
192 return true;
193 }
194 else if (w == m_CustomizeCharacter)
195 {
197 return true;
198 }
199 }
200 return false;
201 }
202
203 override bool OnMouseEnter(Widget w, int x, int y)
204 {
205 if (IsFocusable(w))
206 {
208 return true;
209 }
210 return false;
211 }
212
213 override bool OnMouseLeave(Widget w, Widget enterW, int x, int y)
214 {
215 if (IsFocusable(w))
216 {
217 ColorNormal(w);
218 return true;
219 }
220 return false;
221 }
222
230
232 {
233 return m_IsRefreshing;
234 }
235
237 {
238 foreach (string id : m_Favorites)
239 {
240 array<string> output = new array<string>;
241 id.Split(":", output);
242 if (output.Count() == 2)
243 {
244 string ip = output[0];
245 int port = output[1].ToInt();
246 input.AddFavourite(ip, port);
247 }
248 }
249 }
250
251 bool IsFavorited(string server_id)
252 {
253 int index = -1;
254 if (m_Favorites)
255 {
256 index = m_Favorites.Find(server_id);
257 }
258 return (index >= 0);
259 }
260
261 // Returns whether server was favorited or not
262 bool SetFavoriteConsoles(string ipAddress, int port, bool favorite)
263 {
264 if (favorite && m_Favorites.Count() >= MAX_FAVORITES)
265 {
266 g_Game.GetUIManager().ShowDialog("#layout_notification_info_warning", "#STR_MaxFavouriteReached", 0, DBT_OK, DBB_YES, DMT_EXCLAMATION, this);
267 return false;
268 }
269
270 AddFavorite(ipAddress, port, favorite);
272
273 return favorite;
274 }
275
276 void AddFavorite(string ipAddress, int port, bool favorite)
277 {
278 string serverId = ipAddress + ":" + port;
279 bool isFavorited = IsFavorited(serverId);
280
281 if (favorite && !isFavorited)
282 {
283 m_Favorites.Insert(serverId);
284 }
285 else if (isFavorited)
286 {
287 m_Favorites.RemoveItem(serverId);
288 m_OfficialTab.Unfavorite(serverId);
289 m_CommunityTab.Unfavorite(serverId);
290 m_FavoritesTab.Unfavorite(serverId);
291 #ifndef PLATFORM_CONSOLE
292 m_LANTab.Unfavorite(serverId);
293 #endif
294 }
295 }
296
297 void Back()
298 {
299 g_Game.GetUIManager().Back();
300 }
301
302 void ShowYButton(bool show)
303 {
304 RichTextWidget yIcon = RichTextWidget.Cast(layoutRoot.FindAnyWidget("ResetIcon"));
305 TextWidget yText = TextWidget.Cast(layoutRoot.FindAnyWidget("ResetText"));
306
307 if (yIcon)
308 {
309 yIcon.Show(show);
310 }
311
312 if (yText)
313 {
314 yText.Show(show);
315 }
316 }
317
318 void UpdateYButtonLabel(string text)
319 {
320 TextWidget yText = TextWidget.Cast(layoutRoot.FindAnyWidget("ResetText"));
321 if (yText)
322 {
323 yText.SetText(text);
324 yText.Update();
325 }
326 }
327
328 void ShowAButton(bool show)
329 {
330 RichTextWidget aIcon = RichTextWidget.Cast(layoutRoot.FindAnyWidget("ConnectIcon"));
331 TextWidget aText = TextWidget.Cast(layoutRoot.FindAnyWidget("ConnectText"));
332
333 if (aIcon)
334 {
335 aIcon.Show(show);
336 }
337
338 if (aText)
339 {
340 aText.Show(show);
341 }
342 }
343
344 void UpdateAButtonLabel(string text)
345 {
346 TextWidget aText = TextWidget.Cast(layoutRoot.FindAnyWidget("ConnectText"));
347 if (aText)
348 {
349 aText.SetText(text);
350 aText.Update();
351 }
352 }
353
354 void UpdateXButtonLabel(string text)
355 {
356 TextWidget xText = TextWidget.Cast(layoutRoot.FindAnyWidget("RefreshText"));
357 if (xText)
358 {
359 xText.SetText(text);
360 xText.Update();
361 }
362 }
363
364 void ShowThumbRButton(bool show)
365 {
366 RichTextWidget trIcon = RichTextWidget.Cast(layoutRoot.FindAnyWidget("SwitchIcon"));
367 TextWidget trText = TextWidget.Cast(layoutRoot.FindAnyWidget("SwitchText"));
368
369 if (trIcon)
370 {
371 trIcon.Show(show);
372 }
373
374 if (trText)
375 {
376 trText.Show(show);
377 }
378 }
379
380 void UpdateThumbRButtonLabel(string text)
381 {
382 TextWidget trText = TextWidget.Cast(layoutRoot.FindAnyWidget("SwitchText"));
383 if (trText)
384 {
385 trText.SetText(text);
386 trText.Update();
387 }
388 }
389
390 void FilterFocus(bool focus)
391 {
392 #ifdef PLATFORM_CONSOLE
393 if (focus)
394 {
395 ShowThumbRButton(false);
396 string aButtonLabel;
397 if (GetServersLoadingTab() == TabType.FAVORITE)
398 {
399 #ifdef PLATFORM_PS4
400 aButtonLabel = "#ps4_ingame_menu_select";
401 #else
402 aButtonLabel = "#layout_xbox_ingame_menu_select";
403 #endif
404 }
405 else
406 {
407 aButtonLabel = "#dialog_change";
408 }
409
410 UpdateAButtonLabel(aButtonLabel);
411 UpdateXButtonLabel("#server_browser_menu_refresh");
412 UpdateYButtonLabel("#server_details_header");
413 }
414 #endif
415 }
416
417 void DetailsFocus(bool focus)
418 {
419 #ifdef PLATFORM_CONSOLE
420 if (focus)
421 {
422 ShowThumbRButton(false);
423 UpdateYButtonLabel("#STR_server_browser_tab_root_details_show_server_filters");
424 string aButtonLabel;
425 #ifdef PLATFORM_PS4
426 aButtonLabel = "#ps4_ingame_menu_select";
427 #else
428 aButtonLabel = "#layout_xbox_ingame_menu_select";
429 #endif
430 UpdateAButtonLabel(aButtonLabel);
431 }
432 #endif
433 }
434
436 {
438 }
439
440 void ServerListFocus(bool focus, bool favorite)
441 {
442 #ifdef PLATFORM_CONSOLE
443 if (focus)
444 {
445 UpdateAButtonLabel("#server_browser_menu_connect");
446
447 string trText;
448 if (favorite)
449 {
450 trText = "#server_browser_menu_unfavorite";
451 }
452 else
453 {
454 trText = "#server_browser_menu_favorite";
455 }
456
458 }
459 #endif
460 }
461
462 override bool OnFocus(Widget w, int x, int y)
463 {
464 if (IsFocusable(w))
465 {
467 return true;
468 }
469 return false;
470 }
471
472 override bool OnFocusLost(Widget w, int x, int y)
473 {
474 if (IsFocusable(w))
475 {
476 ColorNormal(w);
477 return true;
478 }
479 return false;
480 }
481
482 override void Refresh()
483 {
484 string name;
485
486 #ifdef PLATFORM_CONSOLE
487 if (g_Game.GetUserManager() && g_Game.GetUserManager().GetSelectedUser())
488 {
489 name = g_Game.GetUserManager().GetSelectedUser().GetName();
490 if (name.LengthUtf8() > 18)
491 {
492 name = name.SubstringUtf8(0, 18);
493 name += "...";
494 }
495 }
496 #else
497 g_Game.GetPlayerNameShort(14, name);
498 #endif
499
500 if (m_PlayerName)
501 m_PlayerName.SetText(name);
502
503 string version;
504 g_Game.GetVersion(version);
505 #ifdef PLATFORM_CONSOLE
506 version = "#main_menu_version" + " " + version + " (" + g_Game.GetDatabaseID() + ")";
507 #else
508 version = "#main_menu_version" + " " + version;
509 #endif
510 }
511
512 override void Update(float timeslice)
513 {
514 if (!g_Game.GetUIManager().IsDialogVisible() && !GetDayZGame().IsConnecting())
515 {
516 if (GetUApi().GetInputByID(UAUIThumbRight).LocalPress())
517 {
519 }
520
521 if (GetUApi().GetInputByID(UAUITabLeft).LocalPress())
522 {
523 m_Tabber.PreviousTab();
524 }
525
526 if (GetUApi().GetInputByID(UAUITabRight).LocalPress())
527 {
528 m_Tabber.NextTab();
529 }
530
531 if (GetUApi().GetInputByID(UAUINextDown).LocalPress())
532 {
534 }
535
536 if (GetUApi().GetInputByID(UAUINextUp).LocalPress())
537 {
539 }
540
541 if (GetUApi().GetInputByID(UAUISelect).LocalPress())
542 {
544 }
545
546 if (GetUApi().GetInputByID(UAUICtrlX).LocalPress())
547 {
549 }
550
551 if (GetUApi().GetInputByID(UAUICtrlY).LocalPress())
552 {
554 }
555
556 if (GetUApi().GetInputByID(UAUILeft).LocalPress())
557 {
559 }
560
561 // LEFT HOLD
562 if (GetUApi().GetInputByID(UAUILeft).LocalHold())
563 {
565 }
566
567 // LEFT RELEASE
568 if (GetUApi().GetInputByID(UAUILeft).LocalRelease())
569 {
571 }
572
573 if (GetUApi().GetInputByID(UAUIRight).LocalPress())
574 {
576 }
577
578 // RIGHT HOLD
579 if (GetUApi().GetInputByID(UAUIRight).LocalHold())
580 {
582 }
583
584 // RIGHT RELEASE
585 if (GetUApi().GetInputByID(UAUIRight).LocalRelease())
586 {
588 }
589
590 if (GetUApi().GetInputByID(UAUIUp).LocalPress())
591 {
592 GetSelectedTab().Up();
593 }
594
595 if (GetUApi().GetInputByID(UAUIDown).LocalPress())
596 {
597 GetSelectedTab().Down();
598 }
599
600 if (GetUApi().GetInputByID(UAUIBack).LocalPress())
601 {
602 Back();
603 }
604 }
605
606 super.Update(timeslice);
607 }
608
610 {
611 if (w)
612 {
613 return (w == m_Play || w == m_CustomizeCharacter || w == m_Back);
614 }
615 return false;
616 }
617
619 {
621
622 #ifdef PLATFORM_WINDOWS
624 #else
625 g_Game.GetProfileStringList("SB_Favorites", m_Favorites);
626
627 // ignore any ids that do not follow correct IP:PORT format
628 for (int i = 0; i < m_Favorites.Count(); ++i)
629 {
630 string id = m_Favorites[i];
631 array<string> output = new array<string>;
632
633 id.Split(":", output);
634 if (output.Count() != 2)
635 {
636 m_Favorites.Remove(i);
637 --i;
638 }
639 }
640
641 // only handle MAX_FAVORITES on consoles
642 if (m_Favorites.Count() > MAX_FAVORITES)
643 {
644 // favorites are ordered by when they were favorited
645 // so keep most recent favorites and ignore oldest favorites
646 m_Favorites.Invert();
648 m_Favorites.Invert();
649 }
650 #endif
651 }
652
654 {
655 g_Game.SetProfileStringList("SB_Favorites", m_Favorites);
656 g_Game.SaveProfile();
657 }
658
659 void SelectServer(ServerBrowserEntry server)
660 {
662 {
663 m_SelectedServer.Deselect();
664 }
665
666 m_SelectedServer = server;
667
668 string mapNM = m_SelectedServer.GetMapToRun();
669 ContentDLC contentDLC = g_Game.GetContentDLCService();
670 EDLCId dlcId = contentDLC.GetDLCFromWorld(mapNM);
671 if (!ContentDLC.IsValidDLCID(dlcId) || contentDLC.IsDLCInstalled(dlcId))
672 {
673 m_PlayButtonLabel.Show(true);
674 m_OpenStoreButtonLabel.Show(false);
675 }
676 else
677 {
678 m_PlayButtonLabel.Show(false);
679 m_OpenStoreButtonLabel.Show(true);
680 }
681 }
682
684 {
686 m_SelectedServer.Deselect();
687
688 m_SelectedServer = null;
689 }
690
691 void Connect(ServerBrowserEntry server)
692 {
693 SelectServer(server);
694 #ifdef PLATFORM_CONSOLE
696 #endif
697 Play();
698 }
699
701 void Play(bool warnAboutMissingDLC = true)
702 {
704 {
705 string mapNM = m_SelectedServer.GetMapToRun();
706 ContentDLC contentDLC = g_Game.GetContentDLCService();
707 EDLCId dlcId = contentDLC.GetDLCFromWorld(mapNM);
708 if (ContentDLC.IsValidDLCID(dlcId))
709 {
710 if (!contentDLC.UseDLC(dlcId))
711 {
712 if (warnAboutMissingDLC)
714 else
715 contentDLC.BuyDLC(dlcId);
716
717 return;
718 }
719 }
720
721 string ip = m_SelectedServer.GetIP();
722 int port = m_SelectedServer.GetPort();
723 int steamQueryPort = m_SelectedServer.GetSteamQueryPort();
724 g_Game.ConnectFromServerBrowserEx(ip, port, steamQueryPort, "");
725 }
726 }
727
729 {
730 PPERequesterBank.GetRequester(PPERequester_ServerBrowserBlur).Stop();
731 EnterScriptedMenu(MENU_CHARACTER);
732 }
733
734 // Unused?!
736 {
737
738 }
739
740 // Unused?!
742 {
743
744 }
745
747 {
748 switch (m_Tabber.GetSelectedIndex())
749 {
750 case 0:
751 {
752 return m_FavoritesTab;
753 }
754 case 1:
755 {
756 return m_OfficialTab;
757 }
758 case 2:
759 {
760 return m_CommunityTab;
761 }
762 case 3:
763 {
764 return m_LANTab;
765 }
766 }
767 return null;
768 }
769
771 {
772 #ifdef PLATFORM_CONSOLE
773 ShowThumbRButton(false);
774 #endif
775
778
781
782 #ifdef PLATFORM_CONSOLE
784 if (GetSelectedTab().GetTabType() != TabType.FAVORITE)
785 {
786 ShowYButton(true);
787 }
788 else
789 {
790 ShowYButton(false);
791 }
792 #endif
793 }
794
795 void OnLoadServerModsAsync(GetServerModListResult result_list)
796 {
797 if (GetSelectedTab())
798 {
799 GetSelectedTab().OnLoadServerModsAsync(result_list.m_Id, result_list.m_Mods);
800 }
801 }
802
803 void OnLoadServersAsync(GetServersResult result_list, EBiosError error, string response)
804 {
805 #ifdef PLATFORM_WINDOWS
806 #ifdef PLATFORM_CONSOLE
807 GetSelectedTab().OnLoadServersAsyncConsole(result_list, error, response);
808 #else
809 GetSelectedTab().OnLoadServersAsyncPC(result_list, error, response);
810 #endif
811 #else
812 GetSelectedTab().OnLoadServersAsyncConsole(result_list, error, response);
813 #endif
814 }
815
816 //Coloring functions (Until WidgetStyles are useful)
818 {
819 if (!w)
820 return;
821
822 int color_pnl = ARGB(255, 0, 0, 0);
823 int color_lbl = ARGB(255, 255, 0, 0);
824
825 #ifdef PLATFORM_CONSOLE
826 color_pnl = ARGB(255, 200, 0, 0);
827 color_lbl = ARGB(255, 255, 255, 255);
828 #endif
829
830 ButtonSetColor(w, color_pnl);
831 ButtonSetTextColor(w, color_lbl);
832 }
833
835 {
836 if (!w)
837 return;
838
839 int color_pnl = ARGB(0, 0, 0, 0);
840 int color_lbl = ARGB(255, 255, 255, 255);
841
842 ButtonSetColor(w, color_pnl);
843 ButtonSetTextColor(w, color_lbl);
844 }
845
846 void ButtonSetText(Widget w, string text)
847 {
848 if (!w)
849 return;
850
851 TextWidget label = TextWidget.Cast(w.FindWidget(w.GetName() + "_label"));
852
853 if (label)
854 {
855 label.SetText(text);
856 }
857
858 }
859
860 void ButtonSetColor(Widget w, int color)
861 {
862 if (!w)
863 return;
864
865 Widget panel = w.FindWidget(w.GetName() + "_panel");
866
867 if (panel)
868 {
869 panel.SetColor(color);
870 }
871 }
872
873 void ButtonSetTextColor(Widget w, int color)
874 {
875 if (!w)
876 return;
877
878 TextWidget label = TextWidget.Cast(w.FindAnyWidget(w.GetName() + "_label"));
879 TextWidget text = TextWidget.Cast(w.FindAnyWidget(w.GetName() + "_text"));
880 TextWidget text2 = TextWidget.Cast(w.FindAnyWidget(w.GetName() + "_text_1"));
881
882 if (label)
883 {
884 label.SetColor(color);
885 }
886
887 if (text)
888 {
889 text.SetColor(color);
890 }
891
892 if (text2)
893 {
894 text2.SetColor(color);
895 }
896 }
897
898 protected void UpdateControlsElements()
899 {
900 RichTextWidget toolbar_a = RichTextWidget.Cast(layoutRoot.FindAnyWidget("ConnectIcon"));
901 RichTextWidget toolbar_b = RichTextWidget.Cast(layoutRoot.FindAnyWidget("BackIcon"));
902 RichTextWidget toolbar_x = RichTextWidget.Cast(layoutRoot.FindAnyWidget("RefreshIcon"));
903 RichTextWidget toolbar_y = RichTextWidget.Cast(layoutRoot.FindAnyWidget("ResetIcon"));
904 RichTextWidget toolbar_tr = RichTextWidget.Cast(layoutRoot.FindAnyWidget("SwitchIcon"));
905 toolbar_a.SetText(InputUtils.GetRichtextButtonIconFromInputAction("UAUISelect", "", EUAINPUT_DEVICE_CONTROLLER, InputUtils.ICON_SCALE_TOOLBAR));
906 toolbar_b.SetText(InputUtils.GetRichtextButtonIconFromInputAction("UAUIBack", "", EUAINPUT_DEVICE_CONTROLLER, InputUtils.ICON_SCALE_TOOLBAR));
907 toolbar_x.SetText(InputUtils.GetRichtextButtonIconFromInputAction("UAUICtrlX", "", EUAINPUT_DEVICE_CONTROLLER, InputUtils.ICON_SCALE_TOOLBAR));
908 toolbar_y.SetText(InputUtils.GetRichtextButtonIconFromInputAction("UAUICtrlY", "", EUAINPUT_DEVICE_CONTROLLER, InputUtils.ICON_SCALE_TOOLBAR));
909 toolbar_tr.SetText(InputUtils.GetRichtextButtonIconFromInputAction("UAUIThumbRight", "", EUAINPUT_DEVICE_CONTROLLER, InputUtils.ICON_SCALE_TOOLBAR));
910 }
911
912 override void OnShow()
913 {
914 super.OnShow();
915 OnInputDeviceChanged(g_Game.GetInput().GetCurrentInputDevice());
916 }
917
918 override void OnHide()
919 {
920 super.OnHide();
921 PPERequesterBank.GetRequester(PPERequester_ServerBrowserBlur).Stop();
922 }
923}
EScriptInvokerInsertFlags
Определения 2_GameLib/DayZ/tools.c:130
EBiosError
Possible Error codes for bios API. This is the list of errors that can be returned from bios API....
Определения BIOSErrorModule.c:7
PlayerSpawnPresetDiscreteItemSetSlotData name
one set for cargo
EDLCId
Определения ContentDLC.c:4
DayZGame g_Game
Определения DayZGame.c:4074
DayZGame GetDayZGame()
Определения DayZGame.c:4076
Icon x
Icon y
const int MAX_FAVORITES
Определения ServerBrowserMenuNew.c:1
const int SERVER_BROWSER_PAGE_SIZE
Определения ServerBrowserMenuNew.c:6
TabType GetTabType()
Определения ServerBrowserTab.c:624
TabType
Определения ServerBrowserTab.c:2
proto native UAInputAPI GetUApi()
proto bool IsDLCInstalled(EDLCId dlcId)
proto EDLCId GetDLCFromWorld(string world)
proto bool UseDLC(EDLCId dlcId)
proto bool BuyDLC(EDLCId dlcId)
static proto native bool IsValidDLCID(EDLCId dlcId)
Check if a DLC ID is valid.
ContentDLC is for query installed DLC (only as entitlement keys, not content)
Определения ContentDLC.c:19
static void WarnAndOpenStore(EDLCId dlcId)
Определения ContentDLCStorePrompt.c:13
Informs the player that a DLC is missing and opens the platform store once the warning has been confi...
Определения ContentDLCStorePrompt.c:3
void AddFavourite(string ip, int port)
Определения BiosLobbyService.c:632
GetServersInput the input structure of the GetServers operation.
Определения BiosLobbyService.c:381
GetServersResult the output structure of the GetServers operation.
Определения BiosLobbyService.c:371
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
static ref ScriptInvoker m_ServersAsyncInvoker
Определения OnlineServices.c:5
static ref ScriptInvoker m_ServerModLoadAsyncInvoker
Определения OnlineServices.c:8
static void GetFavoriteServers(TStringArray favServers)
Определения OnlineServices.c:109
Определения OnlineServices.c:2
Определения gameplay.c:317
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
override void PressThumbRight()
Определения ServerBrowserTabConsolePages.c:486
override void PressSholderRight()
Определения ServerBrowserTabConsole.c:293
override void PressA()
Определения ServerBrowserTabConsole.c:250
override void PressY()
Определения ServerBrowserTabConsole.c:260
override void RefreshList()
Определения ServerBrowserTabConsole.c:212
override void LeftHold()
Определения ServerBrowserTabConsolePages.c:523
override void OnLoadServersAsyncConsole(GetServersResult result_list, EBiosError error, string response)
Определения ServerBrowserTabConsole.c:72
override void PressSholderLeft()
Определения ServerBrowserTabConsole.c:288
override void RightRelease()
Определения ServerBrowserTabConsolePages.c:571
override void OnLoadServerModsAsync(string server_id, array< string > mods)
Определения ServerBrowserTabPc.c:1061
override void Left()
Определения ServerBrowserTabConsolePages.c:509
override void Focus()
Определения ServerBrowserTabConsole.c:339
override void OnLoadServersAsyncPC(GetServersResult result_list, EBiosError error, string response)
Определения ServerBrowserTabPc.c:240
override void RightHold()
Определения ServerBrowserTabConsolePages.c:558
override void PressX()
Определения ServerBrowserTabConsole.c:255
override void LeftRelease()
Определения ServerBrowserTabConsolePages.c:536
override void Right()
Определения ServerBrowserTabConsolePages.c:544
Определения EnWidgets.c:220
ref ServerBrowserTab m_OfficialTab
Определения ServerBrowserMenuNew.c:20
override bool OnMouseEnter(Widget w, int x, int y)
Определения ServerBrowserMenuNew.c:203
void ServerListFocus(bool focus, bool favorite)
Определения ServerBrowserMenuNew.c:440
override void OnShow()
Определения ServerBrowserMenuNew.c:912
bool SetFavoriteConsoles(string ipAddress, int port, bool favorite)
Определения ServerBrowserMenuNew.c:262
TextWidget m_OpenStoreButtonLabel
Определения ServerBrowserMenuNew.c:13
void FilterFocus(bool focus)
Определения ServerBrowserMenuNew.c:390
void BackButtonFocus()
Определения ServerBrowserMenuNew.c:435
override bool OnFocus(Widget w, int x, int y)
Определения ServerBrowserMenuNew.c:462
override void Update(float timeslice)
Определения ServerBrowserMenuNew.c:512
void UpdateAButtonLabel(string text)
Определения ServerBrowserMenuNew.c:344
void ShowThumbRButton(bool show)
Определения ServerBrowserMenuNew.c:364
TextWidget m_PlayButtonLabel
Определения ServerBrowserMenuNew.c:12
override void Refresh()
Определения ChatInputMenu.c:70
void UpdateXButtonLabel(string text)
Определения ServerBrowserMenuNew.c:354
TabberUI m_Tabber
Определения KeybindingsMenu.c:3
void Play()
Определения CameraToolsMenu.c:448
void SelectServer(ServerBrowserEntry server)
Определения ServerBrowserMenuNew.c:659
void Connect(ServerBrowserEntry server)
Определения ServerBrowserMenuNew.c:691
void ColorHighlight(Widget w)
Определения ControlsXboxNew.c:454
bool IsFocusable(Widget w)
Определения CameraToolsMenu.c:960
ServerBrowserEntry m_SelectedServer
Определения ServerBrowserMenuNew.c:27
void OnInputDeviceChanged(EInputDeviceType pInputDeviceType)
Определения ControlsXboxNew.c:71
void ButtonSetText(Widget w, string text)
Определения ServerBrowserMenuNew.c:846
void ShowAButton(bool show)
Определения ServerBrowserMenuNew.c:328
override void OnHide()
Определения ServerBrowserMenuNew.c:918
TabType GetServersLoadingTab()
Определения ServerBrowserMenuNew.c:231
void OnLoadServerModsAsync(GetServerModListResult result_list)
Определения ServerBrowserMenuNew.c:795
override bool OnFocusLost(Widget w, int x, int y)
Определения ServerBrowserMenuNew.c:472
override bool OnMouseLeave(Widget w, Widget enterW, int x, int y)
Определения ServerBrowserMenuNew.c:213
void OnTabSwitch()
Определения ServerBrowserMenuNew.c:770
void Back()
Определения ControlsXboxNew.c:96
void SetServersLoadingTab(TabType refreshing)
Определения ServerBrowserMenuNew.c:223
void OnLoadServersAsync(GetServersResult result_list, EBiosError error, string response)
Определения ServerBrowserMenuNew.c:803
void DetailsFocus(bool focus)
Определения ServerBrowserMenuNew.c:417
void ~ServerBrowserMenuNew()
Определения ServerBrowserMenuNew.c:107
void LoadFavoriteServers()
Определения ServerBrowserMenuNew.c:618
TabType m_IsRefreshing
Определения ServerBrowserMenuNew.c:25
ref ServerBrowserTab m_LANTab
Определения ServerBrowserMenuNew.c:23
ButtonWidget m_Play
Определения CameraToolsMenu.c:41
void Play(bool warnAboutMissingDLC=true)
Определения ServerBrowserMenuNew.c:701
void CustomizeCharacter()
Определения ServerBrowserMenuNew.c:728
void UpdateControlsElements()
Определения ControlsXboxNew.c:535
Widget m_CustomizeCharacter
Определения MainMenu.c:20
void OnTabSwitch(int tab)
Определения OptionsMenu.c:201
void ButtonSetTextColor(Widget w, int color)
Определения ControlsXboxNew.c:510
void UpdateYButtonLabel(string text)
Определения ServerBrowserMenuNew.c:318
TextWidget m_PlayerName
Определения MainMenu.c:13
void PreviousCharacter()
Определения ServerBrowserMenuNew.c:741
void DeselectCurrentServer()
Определения ServerBrowserMenuNew.c:683
void AddFavoritesToFilter(GetServersInput input)
Определения ServerBrowserMenuNew.c:236
ButtonWidget m_Back
Определения ControlsXboxNew.c:35
override Widget Init()
Определения ServerBrowserMenuNew.c:29
void UpdateThumbRButtonLabel(string text)
Определения ServerBrowserMenuNew.c:380
ref ServerBrowserTab m_CommunityTab
Определения ServerBrowserMenuNew.c:21
void SelectServer()
Определения InGameMenuXbox.c:657
ref TStringArray m_Favorites
Определения ServerBrowserMenuNew.c:26
TStringArray GetFavoritedServerIds()
Определения ServerBrowserMenuNew.c:123
void AddFavorite(string ipAddress, int port, bool favorite)
Определения ServerBrowserMenuNew.c:276
override bool OnClick(Widget w, int x, int y, int button)
Определения ServerBrowserMenuNew.c:178
bool IsFavorited(string server_id)
Определения ServerBrowserMenuNew.c:251
void ButtonSetColor(Widget w, int color)
Определения ControlsXboxNew.c:497
void ColorNormal(Widget w)
Определения ControlsXboxNew.c:471
void NextCharacter()
Определения ServerBrowserMenuNew.c:735
ref ServerBrowserTab m_FavoritesTab
Определения ServerBrowserMenuNew.c:22
ServerBrowserTab GetSelectedTab()
Определения ServerBrowserMenuNew.c:746
void ShowYButton(bool show)
Определения ServerBrowserMenuNew.c:302
void SaveFavoriteServersConsoles()
Определения ServerBrowserMenuNew.c:653
void OnInputPresetChanged()
Определения ControlsXboxNew.c:63
Определения DayZGame.c:64
Определения EnWidgets.c:190
Result for an object found in CGame.IsBoxCollidingGeometryProxy.
class array< Class T > TStringArray
const int MENU_CHARACTER
Определения 3_Game/DayZ/constants.c:180
MouseState
Определения EnSystem.c:311
proto native void SetFocus(Widget w)
EInputDeviceType
Определения input.c:3
int ARGB(int a, int r, int g, int b)
Определения proto.c:322