DayZ 1.29
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 Play();
185 return true;
186 }
187 else if (w == m_Back)
188 {
189 Back();
190 return true;
191 }
192 else if (w == m_CustomizeCharacter)
193 {
195 return true;
196 }
197 }
198 return false;
199 }
200
201 override bool OnMouseEnter(Widget w, int x, int y)
202 {
203 if (IsFocusable(w))
204 {
206 return true;
207 }
208 return false;
209 }
210
211 override bool OnMouseLeave(Widget w, Widget enterW, int x, int y)
212 {
213 if (IsFocusable(w))
214 {
215 ColorNormal(w);
216 return true;
217 }
218 return false;
219 }
220
228
230 {
231 return m_IsRefreshing;
232 }
233
235 {
236 foreach (string id : m_Favorites)
237 {
238 array<string> output = new array<string>;
239 id.Split(":", output);
240 if (output.Count() == 2)
241 {
242 string ip = output[0];
243 int port = output[1].ToInt();
244 input.AddFavourite(ip, port);
245 }
246 }
247 }
248
249 bool IsFavorited(string server_id)
250 {
251 int index = -1;
252 if (m_Favorites)
253 {
254 index = m_Favorites.Find(server_id);
255 }
256 return (index >= 0);
257 }
258
259 // Returns whether server was favorited or not
260 bool SetFavoriteConsoles(string ipAddress, int port, bool favorite)
261 {
262 if (favorite && m_Favorites.Count() >= MAX_FAVORITES)
263 {
264 g_Game.GetUIManager().ShowDialog("#layout_notification_info_warning", "#STR_MaxFavouriteReached", 0, DBT_OK, DBB_YES, DMT_EXCLAMATION, this);
265 return false;
266 }
267
268 AddFavorite(ipAddress, port, favorite);
270
271 return favorite;
272 }
273
274 void AddFavorite(string ipAddress, int port, bool favorite)
275 {
276 string serverId = ipAddress + ":" + port;
277 bool isFavorited = IsFavorited(serverId);
278
279 if (favorite && !isFavorited)
280 {
281 m_Favorites.Insert(serverId);
282 }
283 else if (isFavorited)
284 {
285 m_Favorites.RemoveItem(serverId);
286 m_OfficialTab.Unfavorite(serverId);
287 m_CommunityTab.Unfavorite(serverId);
288 m_FavoritesTab.Unfavorite(serverId);
289 #ifndef PLATFORM_CONSOLE
290 m_LANTab.Unfavorite(serverId);
291 #endif
292 }
293 }
294
295 void Back()
296 {
297 g_Game.GetUIManager().Back();
298 }
299
300 void ShowYButton(bool show)
301 {
302 RichTextWidget yIcon = RichTextWidget.Cast(layoutRoot.FindAnyWidget("ResetIcon"));
303 TextWidget yText = TextWidget.Cast(layoutRoot.FindAnyWidget("ResetText"));
304
305 if (yIcon)
306 {
307 yIcon.Show(show);
308 }
309
310 if (yText)
311 {
312 yText.Show(show);
313 }
314 }
315
316 void UpdateYButtonLabel(string text)
317 {
318 TextWidget yText = TextWidget.Cast(layoutRoot.FindAnyWidget("ResetText"));
319 if (yText)
320 {
321 yText.SetText(text);
322 yText.Update();
323 }
324 }
325
326 void ShowAButton(bool show)
327 {
328 RichTextWidget aIcon = RichTextWidget.Cast(layoutRoot.FindAnyWidget("ConnectIcon"));
329 TextWidget aText = TextWidget.Cast(layoutRoot.FindAnyWidget("ConnectText"));
330
331 if (aIcon)
332 {
333 aIcon.Show(show);
334 }
335
336 if (aText)
337 {
338 aText.Show(show);
339 }
340 }
341
342 void UpdateAButtonLabel(string text)
343 {
344 TextWidget aText = TextWidget.Cast(layoutRoot.FindAnyWidget("ConnectText"));
345 if (aText)
346 {
347 aText.SetText(text);
348 aText.Update();
349 }
350 }
351
352 void UpdateXButtonLabel(string text)
353 {
354 TextWidget xText = TextWidget.Cast(layoutRoot.FindAnyWidget("RefreshText"));
355 if (xText)
356 {
357 xText.SetText(text);
358 xText.Update();
359 }
360 }
361
362 void ShowThumbRButton(bool show)
363 {
364 RichTextWidget trIcon = RichTextWidget.Cast(layoutRoot.FindAnyWidget("SwitchIcon"));
365 TextWidget trText = TextWidget.Cast(layoutRoot.FindAnyWidget("SwitchText"));
366
367 if (trIcon)
368 {
369 trIcon.Show(show);
370 }
371
372 if (trText)
373 {
374 trText.Show(show);
375 }
376 }
377
378 void UpdateThumbRButtonLabel(string text)
379 {
380 TextWidget trText = TextWidget.Cast(layoutRoot.FindAnyWidget("SwitchText"));
381 if (trText)
382 {
383 trText.SetText(text);
384 trText.Update();
385 }
386 }
387
388 void FilterFocus(bool focus)
389 {
390 #ifdef PLATFORM_CONSOLE
391 if (focus)
392 {
393 ShowThumbRButton(false);
394 string aButtonLabel;
395 if (GetServersLoadingTab() == TabType.FAVORITE)
396 {
397 #ifdef PLATFORM_PS4
398 aButtonLabel = "#ps4_ingame_menu_select";
399 #else
400 aButtonLabel = "#layout_xbox_ingame_menu_select";
401 #endif
402 }
403 else
404 {
405 aButtonLabel = "#dialog_change";
406 }
407
408 UpdateAButtonLabel(aButtonLabel);
409 UpdateXButtonLabel("#server_browser_menu_refresh");
410 UpdateYButtonLabel("#server_details_header");
411 }
412 #endif
413 }
414
415 void DetailsFocus(bool focus)
416 {
417 #ifdef PLATFORM_CONSOLE
418 if (focus)
419 {
420 ShowThumbRButton(false);
421 UpdateYButtonLabel("#STR_server_browser_tab_root_details_show_server_filters");
422 string aButtonLabel;
423 #ifdef PLATFORM_PS4
424 aButtonLabel = "#ps4_ingame_menu_select";
425 #else
426 aButtonLabel = "#layout_xbox_ingame_menu_select";
427 #endif
428 UpdateAButtonLabel(aButtonLabel);
429 }
430 #endif
431 }
432
434 {
436 }
437
438 void ServerListFocus(bool focus, bool favorite)
439 {
440 #ifdef PLATFORM_CONSOLE
441 if (focus)
442 {
443 UpdateAButtonLabel("#server_browser_menu_connect");
444
445 string trText;
446 if (favorite)
447 {
448 trText = "#server_browser_menu_unfavorite";
449 }
450 else
451 {
452 trText = "#server_browser_menu_favorite";
453 }
454
456 }
457 #endif
458 }
459
460 override bool OnFocus(Widget w, int x, int y)
461 {
462 if (IsFocusable(w))
463 {
465 return true;
466 }
467 return false;
468 }
469
470 override bool OnFocusLost(Widget w, int x, int y)
471 {
472 if (IsFocusable(w))
473 {
474 ColorNormal(w);
475 return true;
476 }
477 return false;
478 }
479
480 override void Refresh()
481 {
482 string name;
483
484 #ifdef PLATFORM_CONSOLE
485 if (g_Game.GetUserManager() && g_Game.GetUserManager().GetSelectedUser())
486 {
487 name = g_Game.GetUserManager().GetSelectedUser().GetName();
488 if (name.LengthUtf8() > 18)
489 {
490 name = name.SubstringUtf8(0, 18);
491 name += "...";
492 }
493 }
494 #else
495 g_Game.GetPlayerNameShort(14, name);
496 #endif
497
498 if (m_PlayerName)
499 m_PlayerName.SetText(name);
500
501 string version;
502 g_Game.GetVersion(version);
503 #ifdef PLATFORM_CONSOLE
504 version = "#main_menu_version" + " " + version + " (" + g_Game.GetDatabaseID() + ")";
505 #else
506 version = "#main_menu_version" + " " + version;
507 #endif
508 }
509
510 override void Update(float timeslice)
511 {
512 if (!g_Game.GetUIManager().IsDialogVisible() && !GetDayZGame().IsConnecting())
513 {
514 if (GetUApi().GetInputByID(UAUIThumbRight).LocalPress())
515 {
517 }
518
519 if (GetUApi().GetInputByID(UAUITabLeft).LocalPress())
520 {
521 m_Tabber.PreviousTab();
522 }
523
524 if (GetUApi().GetInputByID(UAUITabRight).LocalPress())
525 {
526 m_Tabber.NextTab();
527 }
528
529 if (GetUApi().GetInputByID(UAUINextDown).LocalPress())
530 {
532 }
533
534 if (GetUApi().GetInputByID(UAUINextUp).LocalPress())
535 {
537 }
538
539 if (GetUApi().GetInputByID(UAUISelect).LocalPress())
540 {
542 }
543
544 if (GetUApi().GetInputByID(UAUICtrlX).LocalPress())
545 {
547 }
548
549 if (GetUApi().GetInputByID(UAUICtrlY).LocalPress())
550 {
552 }
553
554 if (GetUApi().GetInputByID(UAUILeft).LocalPress())
555 {
557 }
558
559 // LEFT HOLD
560 if (GetUApi().GetInputByID(UAUILeft).LocalHold())
561 {
563 }
564
565 // LEFT RELEASE
566 if (GetUApi().GetInputByID(UAUILeft).LocalRelease())
567 {
569 }
570
571 if (GetUApi().GetInputByID(UAUIRight).LocalPress())
572 {
574 }
575
576 // RIGHT HOLD
577 if (GetUApi().GetInputByID(UAUIRight).LocalHold())
578 {
580 }
581
582 // RIGHT RELEASE
583 if (GetUApi().GetInputByID(UAUIRight).LocalRelease())
584 {
586 }
587
588 if (GetUApi().GetInputByID(UAUIUp).LocalPress())
589 {
590 GetSelectedTab().Up();
591 }
592
593 if (GetUApi().GetInputByID(UAUIDown).LocalPress())
594 {
595 GetSelectedTab().Down();
596 }
597
598 if (GetUApi().GetInputByID(UAUIBack).LocalPress())
599 {
600 Back();
601 }
602 }
603
604 super.Update(timeslice);
605 }
606
608 {
609 if (w)
610 {
611 return (w == m_Play || w == m_CustomizeCharacter || w == m_Back);
612 }
613 return false;
614 }
615
617 {
619
620 #ifdef PLATFORM_WINDOWS
622 #else
623 g_Game.GetProfileStringList("SB_Favorites", m_Favorites);
624
625 // ignore any ids that do not follow correct IP:PORT format
626 for (int i = 0; i < m_Favorites.Count(); ++i)
627 {
628 string id = m_Favorites[i];
629 array<string> output = new array<string>;
630
631 id.Split(":", output);
632 if (output.Count() != 2)
633 {
634 m_Favorites.Remove(i);
635 --i;
636 }
637 }
638
639 // only handle MAX_FAVORITES on consoles
640 if (m_Favorites.Count() > MAX_FAVORITES)
641 {
642 // favorites are ordered by when they were favorited
643 // so keep most recent favorites and ignore oldest favorites
644 m_Favorites.Invert();
646 m_Favorites.Invert();
647 }
648 #endif
649 }
650
651 protected void SwitchToOfficalTab()
652 {
653 if (GetTabberUI())
654 GetTabberUI().PerformSwitchTab(TabType.OFFICIAL);
655 }
656
658 {
659 g_Game.SetProfileStringList("SB_Favorites", m_Favorites);
660 g_Game.SaveProfile();
661 }
662
663 void SelectServer(ServerBrowserEntry server)
664 {
666 {
667 m_SelectedServer.Deselect();
668 }
669
670 m_SelectedServer = server;
671
672 string mapNM = m_SelectedServer.GetMapToRun();
673 if (!g_Game.VerifyWorldOwnership(mapNM))
674 {
675 m_PlayButtonLabel.Show(false);
676 m_OpenStoreButtonLabel.Show(true);
677 }
678 else
679 {
680 m_PlayButtonLabel.Show(true);
681 m_OpenStoreButtonLabel.Show(false);
682 }
683 }
684
686 {
688 m_SelectedServer.Deselect();
689
690 m_SelectedServer = null;
691 }
692
693 void Connect(ServerBrowserEntry server)
694 {
695 SelectServer(server);
696 #ifdef PLATFORM_CONSOLE
698 #endif
699 Play();
700 }
701
702 void Play()
703 {
705 {
706 string mapNM = m_SelectedServer.GetMapToRun();
707
708 if (!g_Game.VerifyWorldOwnership(mapNM))
709 {
710 /*JsonDataDLCList data = DlcDataLoader.GetData();
711 foreach (JsonDataDLCInfo dlcInfo : data.DLCs)
712 {
713 // fetch mod info
714 // if server runs this dlcInfo && !info.GetIsOwned()
715 //info.GoToStore();
716 }*/
717
718 g_Game.GetUIManager().ShowDialog("#server_browser_connect_label", "#mod_detail_info_warning", 232, DBT_OK, DBB_NONE, DMT_INFO, g_Game.GetUIManager().GetMenu());
719 g_Game.GoBuyWorldDLC(mapNM);
720 return;
721 }
722
723 string ip = m_SelectedServer.GetIP();
724 int port = m_SelectedServer.GetPort();
725 int steamQueryPort = m_SelectedServer.GetSteamQueryPort();
726 g_Game.ConnectFromServerBrowserEx(ip, port, steamQueryPort, "");
727 }
728 }
729
731 {
732 PPERequesterBank.GetRequester(PPERequester_ServerBrowserBlur).Stop();
733 EnterScriptedMenu(MENU_CHARACTER);
734 }
735
736 // Unused?!
738 {
739
740 }
741
742 // Unused?!
744 {
745
746 }
747
749 {
750 switch (m_Tabber.GetSelectedIndex())
751 {
752 case 0:
753 {
754 return m_FavoritesTab;
755 }
756 case 1:
757 {
758 return m_OfficialTab;
759 }
760 case 2:
761 {
762 return m_CommunityTab;
763 }
764 case 3:
765 {
766 return m_LANTab;
767 }
768 }
769 return null;
770 }
771
773 {
774 #ifdef PLATFORM_CONSOLE
775 ShowThumbRButton(false);
776 #endif
777
780
783
784 #ifdef PLATFORM_CONSOLE
786 if (GetSelectedTab().GetTabType() != TabType.FAVORITE)
787 {
788 ShowYButton(true);
789 }
790 else
791 {
792 ShowYButton(false);
793 }
794 #endif
795 }
796
797 void OnLoadServerModsAsync(GetServerModListResult result_list)
798 {
799 if (GetSelectedTab())
800 {
801 GetSelectedTab().OnLoadServerModsAsync(result_list.m_Id, result_list.m_Mods);
802 }
803 }
804
805 void OnLoadServersAsync(GetServersResult result_list, EBiosError error, string response)
806 {
807 #ifdef PLATFORM_WINDOWS
808 #ifdef PLATFORM_CONSOLE
809 GetSelectedTab().OnLoadServersAsyncConsole(result_list, error, response);
810 #else
811 GetSelectedTab().OnLoadServersAsyncPC(result_list, error, response);
812 #endif
813 #else
814 GetSelectedTab().OnLoadServersAsyncConsole(result_list, error, response);
815 #endif
816 }
817
818 //Coloring functions (Until WidgetStyles are useful)
820 {
821 if (!w)
822 return;
823
824 int color_pnl = ARGB(255, 0, 0, 0);
825 int color_lbl = ARGB(255, 255, 0, 0);
826
827 #ifdef PLATFORM_CONSOLE
828 color_pnl = ARGB(255, 200, 0, 0);
829 color_lbl = ARGB(255, 255, 255, 255);
830 #endif
831
832 ButtonSetColor(w, color_pnl);
833 ButtonSetTextColor(w, color_lbl);
834 }
835
837 {
838 if (!w)
839 return;
840
841 int color_pnl = ARGB(0, 0, 0, 0);
842 int color_lbl = ARGB(255, 255, 255, 255);
843
844 ButtonSetColor(w, color_pnl);
845 ButtonSetTextColor(w, color_lbl);
846 }
847
848 void ButtonSetText(Widget w, string text)
849 {
850 if (!w)
851 return;
852
853 TextWidget label = TextWidget.Cast(w.FindWidget(w.GetName() + "_label"));
854
855 if (label)
856 {
857 label.SetText(text);
858 }
859
860 }
861
862 void ButtonSetColor(Widget w, int color)
863 {
864 if (!w)
865 return;
866
867 Widget panel = w.FindWidget(w.GetName() + "_panel");
868
869 if (panel)
870 {
871 panel.SetColor(color);
872 }
873 }
874
875 void ButtonSetTextColor(Widget w, int color)
876 {
877 if (!w)
878 return;
879
880 TextWidget label = TextWidget.Cast(w.FindAnyWidget(w.GetName() + "_label"));
881 TextWidget text = TextWidget.Cast(w.FindAnyWidget(w.GetName() + "_text"));
882 TextWidget text2 = TextWidget.Cast(w.FindAnyWidget(w.GetName() + "_text_1"));
883
884 if (label)
885 {
886 label.SetColor(color);
887 }
888
889 if (text)
890 {
891 text.SetColor(color);
892 }
893
894 if (text2)
895 {
896 text2.SetColor(color);
897 }
898 }
899
900 protected void UpdateControlsElements()
901 {
902 RichTextWidget toolbar_a = RichTextWidget.Cast(layoutRoot.FindAnyWidget("ConnectIcon"));
903 RichTextWidget toolbar_b = RichTextWidget.Cast(layoutRoot.FindAnyWidget("BackIcon"));
904 RichTextWidget toolbar_x = RichTextWidget.Cast(layoutRoot.FindAnyWidget("RefreshIcon"));
905 RichTextWidget toolbar_y = RichTextWidget.Cast(layoutRoot.FindAnyWidget("ResetIcon"));
906 RichTextWidget toolbar_tr = RichTextWidget.Cast(layoutRoot.FindAnyWidget("SwitchIcon"));
907 toolbar_a.SetText(InputUtils.GetRichtextButtonIconFromInputAction("UAUISelect", "", EUAINPUT_DEVICE_CONTROLLER, InputUtils.ICON_SCALE_TOOLBAR));
908 toolbar_b.SetText(InputUtils.GetRichtextButtonIconFromInputAction("UAUIBack", "", EUAINPUT_DEVICE_CONTROLLER, InputUtils.ICON_SCALE_TOOLBAR));
909 toolbar_x.SetText(InputUtils.GetRichtextButtonIconFromInputAction("UAUICtrlX", "", EUAINPUT_DEVICE_CONTROLLER, InputUtils.ICON_SCALE_TOOLBAR));
910 toolbar_y.SetText(InputUtils.GetRichtextButtonIconFromInputAction("UAUICtrlY", "", EUAINPUT_DEVICE_CONTROLLER, InputUtils.ICON_SCALE_TOOLBAR));
911 toolbar_tr.SetText(InputUtils.GetRichtextButtonIconFromInputAction("UAUIThumbRight", "", EUAINPUT_DEVICE_CONTROLLER, InputUtils.ICON_SCALE_TOOLBAR));
912 }
913
914 override void OnShow()
915 {
916 super.OnShow();
917 OnInputDeviceChanged(g_Game.GetInput().GetCurrentInputDevice());
918 }
919
920 override void OnHide()
921 {
922 super.OnHide();
923 PPERequesterBank.GetRequester(PPERequester_ServerBrowserBlur).Stop();
924 }
925
926 TabberUI GetTabberUI()
927 {
928 return m_Tabber;
929 }
930
935}
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
DayZGame g_Game
Определения DayZGame.c:3942
DayZGame GetDayZGame()
Определения DayZGame.c:3944
Icon x
Icon y
const int MAX_FAVORITES
Определения ServerBrowserMenuNew.c:1
const int SERVER_BROWSER_PAGE_SIZE
Определения ServerBrowserMenuNew.c:6
TabType GetTabType()
Определения ServerBrowserTab.c:630
TabType
Определения ServerBrowserTab.c:2
proto native UAInputAPI GetUApi()
void AddFavourite(string ip, int port)
Определения BiosLobbyService.c:631
GetServersInput the input structure of the GetServers operation.
Определения BiosLobbyService.c:380
GetServersResult the output structure of the GetServers operation.
Определения BiosLobbyService.c:370
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:404
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:441
override void OnLoadServersAsyncConsole(GetServersResult result_list, EBiosError error, string response)
Определения ServerBrowserTabConsole.c:72
override void PressSholderLeft()
Определения ServerBrowserTabConsole.c:288
override void RightRelease()
Определения ServerBrowserTabConsolePages.c:489
override void OnLoadServerModsAsync(string server_id, array< string > mods)
Определения ServerBrowserTabPc.c:1151
override void Left()
Определения ServerBrowserTabConsolePages.c:427
override void Focus()
Определения ServerBrowserTabConsole.c:339
override void OnLoadServersAsyncPC(GetServersResult result_list, EBiosError error, string response)
Определения ServerBrowserTabPc.c:248
override void RightHold()
Определения ServerBrowserTabConsolePages.c:476
override void PressX()
Определения ServerBrowserTabConsole.c:255
override void LeftRelease()
Определения ServerBrowserTabConsolePages.c:454
override void Right()
Определения ServerBrowserTabConsolePages.c:462
Определения EnWidgets.c:220
ref ServerBrowserTab m_OfficialTab
Определения ServerBrowserMenuNew.c:20
override bool OnMouseEnter(Widget w, int x, int y)
Определения ServerBrowserMenuNew.c:201
void ServerListFocus(bool focus, bool favorite)
Определения ServerBrowserMenuNew.c:438
override void OnShow()
Определения ServerBrowserMenuNew.c:914
bool SetFavoriteConsoles(string ipAddress, int port, bool favorite)
Определения ServerBrowserMenuNew.c:260
TextWidget m_OpenStoreButtonLabel
Определения ServerBrowserMenuNew.c:13
void FilterFocus(bool focus)
Определения ServerBrowserMenuNew.c:388
void BackButtonFocus()
Определения ServerBrowserMenuNew.c:433
override bool OnFocus(Widget w, int x, int y)
Определения ServerBrowserMenuNew.c:460
override void Update(float timeslice)
Определения ServerBrowserMenuNew.c:510
void UpdateAButtonLabel(string text)
Определения ServerBrowserMenuNew.c:342
void ShowThumbRButton(bool show)
Определения ServerBrowserMenuNew.c:362
TextWidget m_PlayButtonLabel
Определения ServerBrowserMenuNew.c:12
override void Refresh()
Определения ChatInputMenu.c:70
void UpdateXButtonLabel(string text)
Определения ServerBrowserMenuNew.c:352
TabberUI m_Tabber
Определения KeybindingsMenu.c:3
void Play()
Определения CameraToolsMenu.c:448
void SelectServer(ServerBrowserEntry server)
Определения ServerBrowserMenuNew.c:663
ServerBrowserTab GetOfficalTab()
Определения ServerBrowserMenuNew.c:931
void Connect(ServerBrowserEntry server)
Определения ServerBrowserMenuNew.c:693
void ColorHighlight(Widget w)
Определения ControlsXboxNew.c:454
bool IsFocusable(Widget w)
Определения CameraToolsMenu.c:960
ServerBrowserEntry m_SelectedServer
Определения ServerBrowserMenuNew.c:27
TabberUI GetTabberUI()
Определения ServerBrowserMenuNew.c:926
void OnInputDeviceChanged(EInputDeviceType pInputDeviceType)
Определения ControlsXboxNew.c:71
void ButtonSetText(Widget w, string text)
Определения ServerBrowserMenuNew.c:848
void ShowAButton(bool show)
Определения ServerBrowserMenuNew.c:326
override void OnHide()
Определения ServerBrowserMenuNew.c:920
TabType GetServersLoadingTab()
Определения ServerBrowserMenuNew.c:229
void OnLoadServerModsAsync(GetServerModListResult result_list)
Определения ServerBrowserMenuNew.c:797
override bool OnFocusLost(Widget w, int x, int y)
Определения ServerBrowserMenuNew.c:470
override bool OnMouseLeave(Widget w, Widget enterW, int x, int y)
Определения ServerBrowserMenuNew.c:211
void OnTabSwitch()
Определения ServerBrowserMenuNew.c:772
void Back()
Определения ControlsXboxNew.c:96
void SetServersLoadingTab(TabType refreshing)
Определения ServerBrowserMenuNew.c:221
void OnLoadServersAsync(GetServersResult result_list, EBiosError error, string response)
Определения ServerBrowserMenuNew.c:805
void DetailsFocus(bool focus)
Определения ServerBrowserMenuNew.c:415
void ~ServerBrowserMenuNew()
Определения ServerBrowserMenuNew.c:107
void LoadFavoriteServers()
Определения ServerBrowserMenuNew.c:616
TabType m_IsRefreshing
Определения ServerBrowserMenuNew.c:25
ref ServerBrowserTab m_LANTab
Определения ServerBrowserMenuNew.c:23
ButtonWidget m_Play
Определения CameraToolsMenu.c:41
void CustomizeCharacter()
Определения ServerBrowserMenuNew.c:730
void UpdateControlsElements()
Определения ControlsXboxNew.c:535
Widget m_CustomizeCharacter
Определения MainMenu.c:16
void OnTabSwitch(int tab)
Определения OptionsMenu.c:197
void ButtonSetTextColor(Widget w, int color)
Определения ControlsXboxNew.c:510
void UpdateYButtonLabel(string text)
Определения ServerBrowserMenuNew.c:316
TextWidget m_PlayerName
Определения MainMenu.c:9
void PreviousCharacter()
Определения ServerBrowserMenuNew.c:743
void DeselectCurrentServer()
Определения ServerBrowserMenuNew.c:685
void AddFavoritesToFilter(GetServersInput input)
Определения ServerBrowserMenuNew.c:234
ButtonWidget m_Back
Определения ControlsXboxNew.c:35
override Widget Init()
Определения ServerBrowserMenuNew.c:29
void UpdateThumbRButtonLabel(string text)
Определения ServerBrowserMenuNew.c:378
ref ServerBrowserTab m_CommunityTab
Определения ServerBrowserMenuNew.c:21
void SelectServer()
Определения InGameMenuXbox.c:652
ref TStringArray m_Favorites
Определения ServerBrowserMenuNew.c:26
TStringArray GetFavoritedServerIds()
Определения ServerBrowserMenuNew.c:123
void AddFavorite(string ipAddress, int port, bool favorite)
Определения ServerBrowserMenuNew.c:274
void SwitchToOfficalTab()
Определения ServerBrowserMenuNew.c:651
override bool OnClick(Widget w, int x, int y, int button)
Определения ServerBrowserMenuNew.c:178
bool IsFavorited(string server_id)
Определения ServerBrowserMenuNew.c:249
void ButtonSetColor(Widget w, int color)
Определения ControlsXboxNew.c:497
void ColorNormal(Widget w)
Определения ControlsXboxNew.c:471
void NextCharacter()
Определения ServerBrowserMenuNew.c:737
ref ServerBrowserTab m_FavoritesTab
Определения ServerBrowserMenuNew.c:22
ServerBrowserTab GetSelectedTab()
Определения ServerBrowserMenuNew.c:748
void ShowYButton(bool show)
Определения ServerBrowserMenuNew.c:300
void SaveFavoriteServersConsoles()
Определения ServerBrowserMenuNew.c:657
void OnInputPresetChanged()
Определения ControlsXboxNew.c:63
Определения DayZGame.c:64
Определения EnWidgets.c:190
Result for an object found in CGame.IsBoxCollidingGeometryProxy.
array< string > TStringArray
Определения EnScript.c:712
const int MENU_CHARACTER
Определения 3_Game/DayZ/constants.c:174
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