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