DayZ Scripts
v1.21.156300 ยท Jun 20, 2023
 
Loading...
Searching...
No Matches
ServerBrowserMenuNew.c
Go to the documentation of this file.
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;
12 protected Widget m_Back;
14 protected TextWidget m_PlayerName;
15 protected TextWidget m_Version;
16
17 protected TabberUI m_Tabber;
22
23 protected TabType m_IsRefreshing = TabType.NONE;
25 protected ServerBrowserEntry m_SelectedServer;
26
27 override Widget Init()
28 {
29 #ifdef PLATFORM_CONSOLE
30 layoutRoot = GetGame().GetWorkspace().CreateWidgets("gui/layouts/new_ui/server_browser/xbox/server_browser.layout");
31 m_FavoritesTab = new ServerBrowserFavoritesTabConsolePages(layoutRoot.FindAnyWidget("Tab_0"), this, TabType.FAVORITE);
32 m_OfficialTab = new ServerBrowserTabConsolePages(layoutRoot.FindAnyWidget("Tab_1"), this, TabType.OFFICIAL);
33 m_CommunityTab = new ServerBrowserTabConsolePages(layoutRoot.FindAnyWidget("Tab_2"), this, TabType.COMMUNITY);
34 #else
35 layoutRoot = GetGame().GetWorkspace().CreateWidgets("gui/layouts/new_ui/server_browser/pc/server_browser.layout");
36 m_FavoritesTab = new ServerBrowserFavoritesTabPc(layoutRoot.FindAnyWidget("Tab_0"), this, TabType.FAVORITE);
37 m_OfficialTab = new ServerBrowserTabPc(layoutRoot.FindAnyWidget("Tab_1"), this, TabType.OFFICIAL);
38 m_CommunityTab = new ServerBrowserTabPc(layoutRoot.FindAnyWidget("Tab_2"), this, TabType.COMMUNITY);
39 m_LANTab = new ServerBrowserTabPc(layoutRoot.FindAnyWidget("Tab_3"), this, TabType.LAN);
40 #endif
41
42 layoutRoot.FindAnyWidget("Tabber").GetScript(m_Tabber);
43
44 m_Play = layoutRoot.FindAnyWidget("play");
45 m_Back = layoutRoot.FindAnyWidget("back_button");
46 m_CustomizeCharacter = layoutRoot.FindAnyWidget("customize_character");
47 m_PlayerName = TextWidget.Cast(layoutRoot.FindAnyWidget("character_name_text"));
48 m_Version = TextWidget.Cast(layoutRoot.FindAnyWidget("version"));
49 m_Favorites = new TStringArray;
50
51 #ifndef PLATFORM_CONSOLE
52 layoutRoot.FindAnyWidget("customize_character").Show(false);
53 layoutRoot.FindAnyWidget("character").Show(false);
54 #endif
55
56 Refresh();
57
58 string version;
59 GetGame().GetVersion(version);
60
61 #ifdef PLATFORM_CONSOLE
62 version = "#main_menu_version" + " " + version + " (" + g_Game.GetDatabaseID() + ")";
63 if (GetGame().GetInput().IsEnabledMouseAndKeyboard())
64 {
65 layoutRoot.FindAnyWidget("play_panel_root").Show(true);
66 layoutRoot.FindAnyWidget("MouseAndKeyboardWarning").Show(true);
67 layoutRoot.FindAnyWidget("toolbar_bg").Show(false);
68 }
69 #else
70 version = "#main_menu_version" + " " + version;
71 #endif
72 m_Version.SetText(version);
73
77
78 m_Tabber.m_OnTabSwitch.Insert(OnTabSwitch);
79
80 m_FavoritesTab.RefreshList();
81
82 #ifdef PLATFORM_CONSOLE
84 //Sort init
85 TextWidget sort_text = TextWidget.Cast(layoutRoot.FindAnyWidget("SortText"));
86 sort_text.SetText("#str_serverbrowserroot_toolbar_bg_consoletoolbar_sort_sorttext0");
87 #endif
88
89 PPERequesterBank.GetRequester(PPERequester_ServerBrowserBlur).Start(new Param1<float>(0.5));
90
93 OnInputDeviceChanged(GetGame().GetInput().GetCurrentInputDevice());
94
95 return layoutRoot;
96 }
97
99 {
100 #ifdef PLATFORM_CONSOLE
102 #endif
103
104 OnlineServices.m_ServersAsyncInvoker.Remove(OnLoadServersAsync);
106 m_Tabber.m_OnTabSwitch.Remove(OnTabSwitch);
107 PPERequesterBank.GetRequester(PPERequester_ServerBrowserBlur).Stop();
108 }
109
111 {
112 return m_Favorites;
113 }
114
115 protected void OnInputPresetChanged()
116 {
117 #ifdef PLATFORM_CONSOLE
119 #endif
120 }
121
122 protected void OnInputDeviceChanged(EInputDeviceType pInputDeviceType)
123 {
124 switch (pInputDeviceType)
125 {
126 case EInputDeviceType.CONTROLLER:
127 #ifdef PLATFORM_CONSOLE
129 layoutRoot.FindAnyWidget("toolbar_bg").Show(true);
130 layoutRoot.FindAnyWidget("ConsoleControls").Show(true);
131 #endif
132 break;
133
134 default:
135 #ifdef PLATFORM_CONSOLE
136 if (GetGame().GetInput().IsEnabledMouseAndKeyboardEvenOnServer())
137 {
138 layoutRoot.FindAnyWidget("toolbar_bg").Show(false);
139 layoutRoot.FindAnyWidget("ConsoleControls").Show(false);
140 }
141 #endif
142 break;
143 }
144 }
145
146 override bool OnClick(Widget w, int x, int y, int button)
147 {
148 if (button == MouseState.LEFT)
149 {
150 if (w == m_Play)
151 {
152 Play();
153 return true;
154 }
155 else if (w == m_Back)
156 {
157 Back();
158 return true;
159 }
160 else if (w == m_CustomizeCharacter)
161 {
163 return true;
164 }
165 }
166 return false;
167 }
168
169 override bool OnMouseEnter(Widget w, int x, int y)
170 {
171 if (IsFocusable(w))
172 {
174 return true;
175 }
176 return false;
177 }
178
179 override bool OnMouseLeave(Widget w, Widget enterW, int x, int y)
180 {
181 if (IsFocusable(w))
182 {
183 ColorNormal(w);
184 return true;
185 }
186 return false;
187 }
188
190 {
191 m_IsRefreshing = refreshing;
192
193 OnlineServices.m_ServersAsyncInvoker.Remove(OnLoadServersAsync);
195 }
196
198 {
199 return m_IsRefreshing;
200 }
201
203 {
204 foreach (string id : m_Favorites)
205 {
206 array<string> output = new array<string>;
207 id.Split(":", output);
208 if (output.Count() == 2)
209 {
210 string ip = output[0];
211 int port = output[1].ToInt();
212 input.AddFavourite(ip, port);
213 }
214 }
215 }
216
217 bool IsFavorited(string server_id)
218 {
219 int index = -1;
220 if (m_Favorites)
221 {
222 index = m_Favorites.Find(server_id);
223 }
224 return (index >= 0);
225 }
226
227 // Returns whether server was favorited or not
228 bool SetFavoriteConsoles(string ipAddress, int port, bool favorite)
229 {
230 if (favorite && m_Favorites.Count() >= MAX_FAVORITES)
231 {
232 g_Game.GetUIManager().ShowDialog("#layout_notification_info_warning", "#STR_MaxFavouriteReached", 0, DBT_OK, DBB_YES, DMT_EXCLAMATION, this);
233 return false;
234 }
235
236 AddFavorite(ipAddress, port, favorite);
238
239 return favorite;
240 }
241
242 void AddFavorite(string ipAddress, int port, bool favorite)
243 {
244 string serverId = ipAddress + ":" + port;
245 bool isFavorited = IsFavorited(serverId);
246
247 if (favorite && !isFavorited)
248 {
249 m_Favorites.Insert(serverId);
250 }
251 else if (isFavorited)
252 {
253 m_Favorites.RemoveItem(serverId);
254 m_OfficialTab.Unfavorite(serverId);
255 m_CommunityTab.Unfavorite(serverId);
256 m_FavoritesTab.Unfavorite(serverId);
257#ifndef PLATFORM_CONSOLE
258 m_LANTab.Unfavorite(serverId);
259#endif
260 }
261 }
262
263 void Back()
264 {
266 }
267
268 void ShowYButton(bool show)
269 {
270 RichTextWidget yIcon = RichTextWidget.Cast(layoutRoot.FindAnyWidget("ResetIcon"));
271 TextWidget yText = TextWidget.Cast(layoutRoot.FindAnyWidget("ResetText"));
272
273 if (yIcon)
274 {
275 yIcon.Show(show);
276 }
277
278 if (yText)
279 {
280 yText.Show(show);
281 }
282 }
283
284 void ShowAButton(bool show)
285 {
286 RichTextWidget aIcon = RichTextWidget.Cast(layoutRoot.FindAnyWidget("ConnectIcon"));
287 TextWidget aText = TextWidget.Cast(layoutRoot.FindAnyWidget("ConnectText"));
288
289 if (aIcon)
290 {
291 aIcon.Show(show);
292 }
293
294 if (aText)
295 {
296 aText.Show(show);
297 }
298
299 }
300
301 void FilterFocus(bool focus)
302 {
303 #ifdef PLATFORM_CONSOLE
304 TextWidget con_text = TextWidget.Cast(layoutRoot.FindAnyWidget("ConnectText"));
305 TextWidget ref_text = TextWidget.Cast(layoutRoot.FindAnyWidget("RefreshText"));
306 TextWidget res_text = TextWidget.Cast(layoutRoot.FindAnyWidget("ResetText"));
307
308 if (focus)
309 {
310 con_text.SetText("#dialog_change");
311 ref_text.SetText("#server_browser_menu_refresh");
312 res_text.SetText("#server_browser_menu_reset_filters");
313
314 con_text.Update();
315 ref_text.Update();
316 res_text.Update();
317 }
318 #endif
319 }
320
322 {
324 }
325
326 void ServerListFocus(bool focus, bool favorite)
327 {
328 #ifdef PLATFORM_CONSOLE
329 TextWidget con_text = TextWidget.Cast(layoutRoot.FindAnyWidget("ConnectText"));
330 TextWidget ref_text = TextWidget.Cast(layoutRoot.FindAnyWidget("RefreshText"));
331 TextWidget res_text = TextWidget.Cast(layoutRoot.FindAnyWidget("ResetText"));
332
333 if (focus)
334 {
335 con_text.SetText("#server_browser_menu_connect");
336
337 float x, y;
338 res_text.GetSize(x, y);
339 if (favorite)
340 {
341 res_text.SetText("#server_browser_menu_unfavorite");
342 }
343 else
344 {
345 res_text.SetText("#server_browser_menu_favorite");
346 }
347 con_text.Update();
348 res_text.Update();
349 }
350 #endif
351 }
352
353 override bool OnFocus(Widget w, int x, int y)
354 {
355 if (IsFocusable(w))
356 {
358 return true;
359 }
360 return false;
361 }
362
363 override bool OnFocusLost(Widget w, int x, int y)
364 {
365 if (IsFocusable(w))
366 {
367 ColorNormal(w);
368 return true;
369 }
370 return false;
371 }
372
373 override void Refresh()
374 {
375 string name;
376
377 #ifdef PLATFORM_CONSOLE
378 if (GetGame().GetUserManager() && GetGame().GetUserManager().GetSelectedUser())
379 {
381 if (name.LengthUtf8() > 18)
382 {
383 name = name.SubstringUtf8(0, 18);
384 name += "...";
385 }
386 }
387 #else
388 g_Game.GetPlayerNameShort(14, name);
389 #endif
390
391 if (m_PlayerName)
392 m_PlayerName.SetText(name);
393
394 string version;
395 GetGame().GetVersion(version);
396 #ifdef PLATFORM_CONSOLE
397 version = "#main_menu_version" + " " + version + " (" + g_Game.GetDatabaseID() + ")";
398 #else
399 version = "#main_menu_version" + " " + version;
400 #endif
401 m_Version.SetText(version);
402 }
403
404 override void Update(float timeslice)
405 {
406 if (!GetGame().GetUIManager().IsDialogVisible() && !GetDayZGame().IsConnecting())
407 {
408 if (GetUApi().GetInputByID(UAUITabLeft).LocalPress())
409 {
410 m_Tabber.PreviousTab();
411 }
412
413 if (GetUApi().GetInputByID(UAUITabRight).LocalPress())
414 {
415 m_Tabber.NextTab();
416 }
417
418 if (GetUApi().GetInputByID(UAUINextDown).LocalPress())
419 {
421 }
422
423 if (GetUApi().GetInputByID(UAUINextUp).LocalPress())
424 {
426 }
427
428 if (GetUApi().GetInputByID(UAUISelect).LocalPress())
429 {
431 }
432
433 if (GetUApi().GetInputByID(UAUICtrlX).LocalPress())
434 {
436 }
437
438 if (GetUApi().GetInputByID(UAUICtrlY).LocalPress())
439 {
441 }
442
443 if (GetUApi().GetInputByID(UAUILeft).LocalPress())
444 {
446 }
447
448 // LEFT HOLD
449 if (GetUApi().GetInputByID(UAUILeft).LocalHold())
450 {
452 }
453
454 // LEFT RELEASE
455 if (GetUApi().GetInputByID(UAUILeft).LocalRelease())
456 {
458 }
459
460 if (GetUApi().GetInputByID(UAUIRight).LocalPress())
461 {
463 }
464
465 // RIGHT HOLD
466 if (GetUApi().GetInputByID(UAUIRight).LocalHold())
467 {
469 }
470
471 // RIGHT RELEASE
472 if (GetUApi().GetInputByID(UAUIRight).LocalRelease())
473 {
475 }
476
477 if (GetUApi().GetInputByID(UAUIUp).LocalPress())
478 {
479 GetSelectedTab().Up();
480 }
481
482 if (GetUApi().GetInputByID(UAUIDown).LocalPress())
483 {
484 GetSelectedTab().Down();
485 }
486
487 if (GetUApi().GetInputByID(UAUIBack).LocalPress())
488 {
489 Back();
490 }
491 }
492
493 super.Update(timeslice);
494 }
495
497 {
498 if (w)
499 {
500 return (w == m_Play || w == m_CustomizeCharacter || w == m_Back);
501 }
502 return false;
503 }
504
506 {
507 m_Favorites = new TStringArray;
508
509#ifdef PLATFORM_WINDOWS
511#else
512 GetGame().GetProfileStringList("SB_Favorites", m_Favorites);
513
514 // ignore any ids that do not follow correct IP:PORT format
515 for (int i = 0; i < m_Favorites.Count(); ++i)
516 {
517 string id = m_Favorites[i];
518 array<string> output = new array<string>;
519
520 id.Split(":", output);
521 if (output.Count() != 2)
522 {
523 m_Favorites.Remove(i);
524 --i;
525 }
526 }
527
528 // only handle MAX_FAVORITES on consoles
529 if (m_Favorites.Count() > MAX_FAVORITES)
530 {
531 // favorites are ordered by when they were favorited
532 // so keep most recent favorites and ignore oldest favorites
533 m_Favorites.Invert();
534 m_Favorites.Resize(MAX_FAVORITES);
535 m_Favorites.Invert();
536 }
537#endif
538 }
539
541 {
542 GetGame().SetProfileStringList("SB_Favorites", m_Favorites);
544
545 }
546
547 void SelectServer(ServerBrowserEntry server)
548 {
549
551 {
552 m_SelectedServer.Deselect();
553 }
554
555 m_SelectedServer = server;
556
557#ifdef PLATFORM_CONSOLE
558 // disable CONNECT button if server is offline
559 RichTextWidget aButton = RichTextWidget.Cast(layoutRoot.FindAnyWidget("ConnectIcon"));
560 TextWidget connectText = TextWidget.Cast(layoutRoot.FindAnyWidget("ConnectText"));
561
562 aButton.Show(server.IsOnline());
563 connectText.Show(server.IsOnline());
564#endif
565 }
566
567 void Connect(ServerBrowserEntry server)
568 {
569 SelectServer(server);
570#ifdef PLATFORM_CONSOLE
572#endif
573 Play();
574 }
575
576 void Play()
577 {
579 {
580 string mapNM = m_SelectedServer.GetMapToRun();
581 if (!g_Game.VerifyWorldOwnership(mapNM))
582 {
583 GetGame().GetUIManager().ShowDialog("#server_browser_connect_label", "#mod_detail_info_warning", 232, DBT_OK, DBB_NONE, DMT_INFO, GetGame().GetUIManager().GetMenu());
584 g_Game.GoBuyWorldDLC(mapNM);
585 return;
586 }
587
588 string ip = m_SelectedServer.GetIP();
589 int port = m_SelectedServer.GetPort();
590 g_Game.ConnectFromServerBrowser(ip, port, "");
591 }
592 }
593
595 {
596 PPERequesterBank.GetRequester(PPERequester_ServerBrowserBlur).Stop();
597 EnterScriptedMenu(MENU_CHARACTER);
598 }
599
601 {
602
603 }
604
606 {
607
608 }
609
611 {
612 switch (m_Tabber.GetSelectedIndex())
613 {
614 case 0:
615 {
616 return m_FavoritesTab;
617 }
618 case 1:
619 {
620 return m_OfficialTab;
621 }
622 case 2:
623 {
624 return m_CommunityTab;
625 }
626 case 3:
627 {
628 return m_LANTab;
629 }
630 }
631 return null;
632 }
633
635 {
638
640 {
642 }
643
645 }
646
648 {
649 if (GetSelectedTab())
650 {
651 GetSelectedTab().OnLoadServerModsAsync(result_list.m_Id, result_list.m_Mods);
652 }
653 }
654
655 void OnLoadServersAsync(GetServersResult result_list, EBiosError error, string response)
656 {
657 #ifdef PLATFORM_WINDOWS
658 #ifdef PLATFORM_CONSOLE
659 GetSelectedTab().OnLoadServersAsyncConsole(result_list, error, response);
660 #else
661 GetSelectedTab().OnLoadServersAsyncPC(result_list, error, response);
662 #endif
663 #else
664 GetSelectedTab().OnLoadServersAsyncConsole(result_list, error, response);
665 #endif
666 }
667
668 //Coloring functions (Until WidgetStyles are useful)
670 {
671 if (!w)
672 return;
673
674 int color_pnl = ARGB(255, 0, 0, 0);
675 int color_lbl = ARGB(255, 255, 0, 0);
676
677 #ifdef PLATFORM_CONSOLE
678 color_pnl = ARGB(255, 200, 0, 0);
679 color_lbl = ARGB(255, 255, 255, 255);
680 #endif
681
682 ButtonSetColor(w, color_pnl);
683 ButtonSetTextColor(w, color_lbl);
684 }
685
687 {
688 if (!w)
689 return;
690
691 int color_pnl = ARGB(0, 0, 0, 0);
692 int color_lbl = ARGB(255, 255, 255, 255);
693
694 ButtonSetColor(w, color_pnl);
695 ButtonSetTextColor(w, color_lbl);
696 }
697
698 void ButtonSetText(Widget w, string text)
699 {
700 if (!w)
701 return;
702
703 TextWidget label = TextWidget.Cast(w.FindWidget(w.GetName() + "_label"));
704
705 if (label)
706 {
707 label.SetText(text);
708 }
709
710 }
711
712 void ButtonSetColor(Widget w, int color)
713 {
714 if (!w)
715 return;
716
717 Widget panel = w.FindWidget(w.GetName() + "_panel");
718
719 if (panel)
720 {
721 panel.SetColor(color);
722 }
723 }
724
725 void ButtonSetTextColor(Widget w, int color)
726 {
727 if (!w)
728 return;
729
730 TextWidget label = TextWidget.Cast(w.FindAnyWidget(w.GetName() + "_label"));
731 TextWidget text = TextWidget.Cast(w.FindAnyWidget(w.GetName() + "_text"));
732 TextWidget text2 = TextWidget.Cast(w.FindAnyWidget(w.GetName() + "_text_1"));
733
734 if (label)
735 {
736 label.SetColor(color);
737 }
738
739 if (text)
740 {
741 text.SetColor(color);
742 }
743
744 if (text2)
745 {
746 text2.SetColor(color);
747 }
748 }
749
750 protected void UpdateControlsElements()
751 {
752 RichTextWidget toolbar_a = RichTextWidget.Cast(layoutRoot.FindAnyWidget("ConnectIcon"));
753 RichTextWidget toolbar_b = RichTextWidget.Cast(layoutRoot.FindAnyWidget("BackIcon"));
754 RichTextWidget toolbar_x = RichTextWidget.Cast(layoutRoot.FindAnyWidget("RefreshIcon"));
755 RichTextWidget toolbar_y = RichTextWidget.Cast(layoutRoot.FindAnyWidget("ResetIcon"));
756 toolbar_a.SetText(InputUtils.GetRichtextButtonIconFromInputAction("UAUISelect", "", EUAINPUT_DEVICE_CONTROLLER, InputUtils.ICON_SCALE_TOOLBAR));
757 toolbar_b.SetText(InputUtils.GetRichtextButtonIconFromInputAction("UAUIBack", "", EUAINPUT_DEVICE_CONTROLLER, InputUtils.ICON_SCALE_TOOLBAR));
758 toolbar_x.SetText(InputUtils.GetRichtextButtonIconFromInputAction("UAUICtrlX", "", EUAINPUT_DEVICE_CONTROLLER, InputUtils.ICON_SCALE_TOOLBAR));
759 toolbar_y.SetText(InputUtils.GetRichtextButtonIconFromInputAction("UAUICtrlY", "", EUAINPUT_DEVICE_CONTROLLER, InputUtils.ICON_SCALE_TOOLBAR));
760 }
761}
EScriptInvokerInsertFlags
Definition tools.c:130
protected void OnInputDeviceChanged(EInputDeviceType pInputDeviceType)
Definition Inventory.c:164
protected void OnInputPresetChanged()
Definition Inventory.c:157
ActionInput GetInput()
EBiosError
Possible Error codes for bios API. This is the list of errors that can be returned from bios API....
protected ButtonWidget m_Back
DayZGame g_Game
Definition DayZGame.c:3654
DayZGame GetDayZGame()
Definition DayZGame.c:3656
Icon x
Icon y
string name
const int MAX_FAVORITES
const int SERVER_BROWSER_PAGE_SIZE
TabType
bool IsNotInitialized()
protected ServerBrowserEntry m_SelectedServer
void OnLoadServerModsAsync(string server_id, array< string > mods)
proto native UAInputAPI GetUApi()
proto native owned string GetName()
proto native BiosUser GetSelectedUser()
Returns the currently selected user.
proto void GetVersion(out string version)
proto native Mission GetMission()
proto native void GetProfileStringList(string name, out TStringArray values)
Gets array of strings from profile variable.
proto native BiosUserManager GetUserManager()
proto native UIManager GetUIManager()
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.
GetServersInput the input structure of the GetServers operation.
void AddFavourite(string ip, int port)
GetServersResult the output structure of the GetServers operation.
static const float ICON_SCALE_TOOLBAR
Definition InputUtils.c:15
static string GetRichtextButtonIconFromInputAction(notnull UAInput pInput, string pLocalizedDescription, int pInputDeviceType=EUAINPUT_DEVICE_CONTROLLER, float pScale=ICON_SCALE_NORMAL, bool pVertical=false)
Definition InputUtils.c:167
ScriptInvoker GetOnInputPresetChanged()
Definition gameplay.c:833
ScriptInvoker GetOnInputDeviceChanged()
Definition gameplay.c:823
static void GetFavoriteServers(TStringArray favServers)
static ref ScriptInvoker m_ServerModLoadAsyncInvoker
static ref ScriptInvoker m_ServersAsyncInvoker
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 OnLoadServersAsyncPC(ref GetServersResult result_list, EBiosError error, string response)
override void PressSholderLeft()
override void PressSholderRight()
override void OnLoadServerModsAsync(string server_id, array< string > mods)
override void OnLoadServersAsyncConsole(GetServersResult result_list, EBiosError error, string response)
proto native void ShowDialog(string caption, string text, int id, int butts, int def, int type, UIScriptedMenu handler)
Shows message dialog.
bool Back()
Close top window on windows stack, returns true when any window is closed.
Definition UIManager.c:64
protected TabType m_IsRefreshing
protected void OnInputDeviceChanged(EInputDeviceType pInputDeviceType)
bool IsFavorited(string server_id)
void ButtonSetText(Widget w, string text)
void FilterFocus(bool focus)
override void Update(float timeslice)
void AddFavorite(string ipAddress, int port, bool favorite)
void SelectServer(ServerBrowserEntry server)
void SetServersLoadingTab(TabType refreshing)
protected Widget m_CustomizeCharacter
Definition MainMenu.c:16
bool SetFavoriteConsoles(string ipAddress, int port, bool favorite)
override void Refresh()
TStringArray GetFavoritedServerIds()
override bool OnMouseLeave(Widget w, Widget enterW, int x, int y)
void ServerListFocus(bool focus, bool favorite)
protected ref ServerBrowserTab m_OfficialTab
protected TextWidget m_PlayerName
Definition MainMenu.c:9
void ButtonSetColor(Widget w, int color)
void Connect(ServerBrowserEntry server)
void ShowYButton(bool show)
void OnLoadServersAsync(GetServersResult result_list, EBiosError error, string response)
protected ref ServerBrowserTab m_FavoritesTab
void OnLoadServerModsAsync(GetServerModListResult result_list)
protected Widget m_Back
protected void OnInputPresetChanged()
void ShowAButton(bool show)
protected ref ServerBrowserTab m_LANTab
void ButtonSetTextColor(Widget w, int color)
protected void UpdateControlsElements()
protected ref TStringArray m_Favorites
void ColorNormal(Widget w)
ServerBrowserTab GetSelectedTab()
override Widget Init()
protected TabberUI m_Tabber
protected ref ServerBrowserTab m_CommunityTab
protected TextWidget m_Version
void AddFavoritesToFilter(GetServersInput input)
override bool OnFocusLost(Widget w, int x, int y)
protected ServerBrowserEntry m_SelectedServer
bool IsFocusable(Widget w)
override bool OnMouseEnter(Widget w, int x, int y)
protected ButtonWidget m_Play
void ColorHighlight(Widget w)
override bool OnFocus(Widget w, int x, int y)
override bool OnClick(Widget w, int x, int y, int button)
proto native CGame GetGame()
array< string > TStringArray
Definition EnScript.c:685
const int MENU_CHARACTER
Definition constants.c:152
MouseState
Definition EnSystem.c:311
proto native int LengthUtf8()
Returns number of characters in UTF8 string.
proto string SubstringUtf8(int startChar, int len)
Substring of 'str' from 'startChar' position 'len' number of characters for UTF8 strings with multiby...
proto native void SetFocus(Widget w)
proto native external Widget CreateWidgets(string layout, Widget parentWidget=NULL, bool immedUpdate=true)
Create widgets from *.layout file.
EInputDeviceType
Definition input.c:3
int ARGB(int a, int r, int g, int b)
Definition proto.c:322