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