DayZ 1.24
Loading...
Searching...
No Matches
ServerBrowserTab Class Reference
Collaboration diagram for ServerBrowserTab:
[legend]

Protected Member Functions

override void Construct (Widget parent, ServerBrowserMenuNew menu, TabType type)
 
void ShowHideConsoleWidgets ()
 
override void OnLoadServersAsyncConsole (GetServersResult result_list, EBiosError error, string response)
 
void OnLoadServersAsyncFinished ()
 
void LoadEntries (int cur_page_index, GetServersResultRowArray page)
 
override void OnFilterFocus (Widget w)
 
override void OnFilterChanged ()
 
override void RefreshList ()
 
override void ResetFilters ()
 
override void ApplyFilters ()
 
override void OnFilterFocusLost (Widget w)
 
override void PressA ()
 
override void PressX ()
 
override void PressY ()
 
override void PressSholderLeft ()
 
override void PressSholderRight ()
 
void SetFocusFilters ()
 
override void Focus ()
 
void SetFocusServers ()
 
void SetEnableFilters (bool enable)
 
void SetEnableServers (bool enable)
 
override void ColorHighlight (Widget w)
 
override void ColorNormal (Widget w)
 
override void ColorDisable (Widget w)
 
override void Construct (Widget parent, ServerBrowserMenuNew menu, TabType type)
 
void ShowHideConsoleWidgets ()
 
void OnInputDeviceChanged (EInputDeviceType pInputDeviceType)
 
override void OnLoadServersAsyncConsole (GetServersResult result_list, EBiosError error, string response)
 
void OnLoadServersAsyncFinished ()
 
void LoadEntries (int cur_page_index, GetServersResultRowArray page_entries)
 
ServerBrowserEntry GetServerEntryByIndex (int index)
 
override void OnFilterChanged ()
 
bool CanRefreshServerList ()
 
override void RefreshList ()
 
override void ResetFilters ()
 
override void ApplyFilters ()
 
override void PressA ()
 
override void PressX ()
 
override void PressY ()
 
override void Left ()
 
override void LeftHold ()
 
override void LeftRelease ()
 
override void Right ()
 
override void RightHold ()
 
override void RightRelease ()
 
override void PressSholderLeft ()
 
override void PressSholderRight ()
 
override void Focus ()
 
void SetFocusFilters ()
 
void SetFocusServers ()
 
void SetEnableFilters (bool enable)
 
void SetEnableServers (bool enable)
 
void UpdatePageButtons ()
 
override bool OnClick (Widget w, int x, int y, int button)
 
override void ColorHighlight (Widget w)
 
override void ColorNormal (Widget w)
 
override void ColorDisable (Widget w)
 
override void Construct (Widget parent, ServerBrowserMenuNew menu, TabType type)
 
void ~ServerBrowserTabPc ()
 
void DisableFilters ()
 
override void RefreshList ()
 
override void ResetFilters ()
 
override void ApplyFilters ()
 
void LoadingServersStop ()
 
override void OnLoadServersAsyncPC (ref GetServersResult result_list, EBiosError error, string response)
 
void OnLoadServersAsyncPCFinished ()
 
override bool OnClick (Widget w, int x, int y, int button)
 
override bool OnMouseEnter (Widget w, int x, int y)
 
override bool OnMouseLeave (Widget w, Widget enterW, int x, int y)
 
override bool OnMouseButtonUp (Widget w, int x, int y, int button)
 
override void OnFilterChanged ()
 
void OnClickPagePrev ()
 
void OnClickPageNext ()
 
void OnClickPageEnd ()
 
void OnClickPageFirst ()
 
bool OnClickPage (Widget w)
 
void SetPageIndex (int page_index)
 
void ToggleSort (ESortType type)
 
override void SetSort (ESortType type, ESortOrder order)
 
int GetTimeOfDayEnum (string time_of_day)
 
override int AddSorted (GetServersResultRow entry)
 
override void SelectServer (ServerBrowserEntry server)
 
int SortedInsert (GetServersResultRow entry, ESortType sort_type)
 
ServerBrowserEntry GetServerEntryByIndex (int index, string server_id)
 
override bool IsFocusable (Widget w)
 
void ButtonRefreshToCancel ()
 
void ButtonCancelToRefresh ()
 

Protected Attributes

Widget m_ButtonPageLeftImg
 
Widget m_ButtonPageRightImg
 
int m_PreviousPage
 
int m_TotalServersCount
 
int m_PageStartNum
 
int m_PageEndNum
 
int m_PagesCount
 
int m_ServersEstimateCount
 
int m_TimeLastServerRefresh
 
int m_TimeLastServerRefreshHoldButton
 
Widget m_PnlPagesPanel
 
TextWidget m_PnlPagesLoadingText
 
ref array< ref ServerBrowserEntry > m_ServerListEntiers
 
const int SERVERS_VISIBLE_COUNT = 24
 
const int PAGES_BUTTONS_COUNT = 10
 
int m_PageIndex
 
ButtonWidget m_BtnPagesFirst
 
ButtonWidget m_BtnPagesLast
 
Widget m_FilterSearchIP
 
Widget m_FilterSearchIPBox
 
Widget m_FilterPanelPing
 
Widget m_FilterPanelAccTime
 
ref array< ButtonWidgetm_BtnPages
 
ref array< ref ServerBrowserEntry > m_ServerListEntries
 
ref TStringArray m_TempTime = new TStringArray
 

Private Member Functions

int SortedInsertEx (GetServersResultRow entry, ESortType sortType, bool isDescending)
 
int SortedInsertAsc (GetServersResultRow entry, ESortType sort_type)
 
int SortedInsertDesc (GetServersResultRow entry, ESortType sort_type)
 
void UpdatePageButtons ()
 
void UpdateServerList ()
 
void UpdateStatusBar ()
 
override void OnLoadServerModsAsync (string server_id, array< string > mods)
 

Private Attributes

bool m_IsFilterChanged
 
bool m_IsFilterFocused
 
Widget m_WidgetNavFilters
 
Widget m_WidgetNavServers
 

Detailed Description

Definition at line 1 of file ServerBrowserTabConsole.c.

Constructor & Destructor Documentation

◆ ~ServerBrowserTabPc()

void ServerBrowserTab::~ServerBrowserTabPc ( )
inlineprotected

Definition at line 125 of file ServerBrowserTabPc.c.

126 {
127
128 }

Member Function Documentation

◆ AddSorted()

override int ServerBrowserTab::AddSorted ( GetServersResultRow entry)
inlineprotected

Definition at line 563 of file ServerBrowserTabPc.c.

564 {
565 int index_host = SortedInsert(entry, ESortType.HOST);
566 int index_time = SortedInsert(entry, ESortType.TIME);
567 int index_popu = SortedInsert(entry, ESortType.POPULATION);
568 int index_slot = SortedInsert(entry, ESortType.SLOTS);
569 int index_ping = SortedInsert(entry, ESortType.PING);
570 int index_favo = SortedInsert(entry, ESortType.FAVORITE);
571 int index_pass = SortedInsert(entry, ESortType.PASSWORDED);
572
573 switch (m_SortType)
574 {
575 case ESortType.HOST:
576 return index_host;
577 case ESortType.TIME:
578 return index_time;
579 case ESortType.POPULATION:
580 return index_popu;
581 case ESortType.SLOTS:
582 return index_slot;
583 case ESortType.PING:
584 return index_ping;
585 case ESortType.FAVORITE:
586 return index_favo;
587 case ESortType.PASSWORDED:
588 return index_pass;
589 }
590
591 return 0;
592 }
ESortType
ESortType m_SortType
int SortedInsert(GetServersResultRow entry, ESortType sort_type)

References m_SortType.

◆ ApplyFilters() [1/3]

override void ServerBrowserTab::ApplyFilters ( )
inlineprotected

Definition at line 221 of file ServerBrowserTabConsole.c.

222 {
223 m_IsFilterChanged = false;
224 m_CurrentFilterInput = m_Filters.GetFilterOptionsConsoles();
225 RefreshList();
226 }
ref ServerBrowserFilterContainer m_Filters
ref GetServersInput m_CurrentFilterInput

References m_CurrentFilterInput, m_Filters, and RefreshList().

◆ ApplyFilters() [2/3]

override void ServerBrowserTab::ApplyFilters ( )
inlineprotected

Definition at line 285 of file ServerBrowserTabConsolePages.c.

286 {
289
290 m_IsFilterChanged = false;
291 m_CurrentFilterInput = m_Filters.GetFilterOptionsConsoles();
292 RefreshList();
293 }
void SetCurrentPage(int page_num)

References m_CurrentFilterInput, m_Filters, ServerBrowserTabConsolePages::RefreshList(), and SetCurrentPage().

◆ ApplyFilters() [3/3]

override void ServerBrowserTab::ApplyFilters ( )
inlineprotected

Definition at line 173 of file ServerBrowserTabPc.c.

174 {
175 m_Filters.SaveFilters();
176 //m_CurrentFilterInput = m_Filters.GetFilterOptionsPC();
177 RefreshList();
180 }
void ButtonDisable(Widget w)
Widget m_ApplyFilter
void ButtonEnable(Widget w)
Widget m_RefreshList

References ButtonDisable(), ButtonEnable(), m_ApplyFilter, m_Filters, m_RefreshList, and ServerBrowserTabPc::RefreshList().

◆ ButtonCancelToRefresh()

void ServerBrowserTab::ButtonCancelToRefresh ( )
inlineprotected

Definition at line 1097 of file ServerBrowserTabPc.c.

1098 {
1100 btn.SetText("#STR_server_browser_tab_root_filters_root_filters_content_refresh_list_button0");
1101 }

References m_RefreshList.

◆ ButtonRefreshToCancel()

void ServerBrowserTab::ButtonRefreshToCancel ( )
inlineprotected

Definition at line 1091 of file ServerBrowserTabPc.c.

1092 {
1094 btn.SetText("#menu_cancel");
1095 }

References m_RefreshList.

◆ CanRefreshServerList()

bool ServerBrowserTab::CanRefreshServerList ( )
inlineprotected

Definition at line 250 of file ServerBrowserTabConsolePages.c.

251 {
252 return m_LoadingFinished;
253 }
bool m_LoadingFinished

References m_LoadingFinished.

◆ ColorDisable() [1/2]

override void ServerBrowserTab::ColorDisable ( Widget w)
inlineprotected

Definition at line 393 of file ServerBrowserTabConsole.c.

394 {
395#ifdef PLATFORM_WINDOWS
396 SetFocus(null);
397#endif
398
400 if (button)
402 }
static int COLOR_DISABLED_TEXT
proto native void SetFocus(Widget w)

References ColorManager::COLOR_DISABLED_TEXT, and SetFocus().

Referenced by ButtonDisable().

◆ ColorDisable() [2/2]

override void ServerBrowserTab::ColorDisable ( Widget w)
inlineprotected

Definition at line 601 of file ServerBrowserTabConsolePages.c.

602 {
603#ifdef PLATFORM_WINDOWS
604 SetFocus(null);
605#endif
606
608 if (button)
610 }

References ColorManager::COLOR_DISABLED_TEXT, and SetFocus().

◆ ColorHighlight() [1/2]

override void ServerBrowserTab::ColorHighlight ( Widget w)
inlineprotected

Definition at line 343 of file ServerBrowserTabConsole.c.

344 {
345 if (!w)
346 return;
347
348 w.SetColor(ARGB(255, 200, 0, 0));
349 }
int ARGB(int a, int r, int g, int b)
Definition proto.c:322

References ARGB().

Referenced by OnFocus(), and OnMouseEnter().

◆ ColorHighlight() [2/2]

override void ServerBrowserTab::ColorHighlight ( Widget w)
inlineprotected

Definition at line 549 of file ServerBrowserTabConsolePages.c.

550 {
551 if (!w)
552 return;
553
554 w.SetColor(ARGB(255, 200, 0, 0));
555 }

References ARGB().

◆ ColorNormal() [1/2]

override void ServerBrowserTab::ColorNormal ( Widget w)
inlineprotected

Definition at line 351 of file ServerBrowserTabConsole.c.

352 {
353 if (!w)
354 {
355 return
356 }
357
358 if ((w.GetFlags() & WidgetFlags.IGNOREPOINTER) == WidgetFlags.IGNOREPOINTER)
359 return;
360
361 if (w.IsInherited(ButtonWidget))
362 {
364 button.SetTextColor(ARGB(255, 255, 255, 255));
365 }
366
367 TextWidget text1 = TextWidget.Cast(w.FindAnyWidget(w.GetName() + "_text"));
368 TextWidget text2 = TextWidget.Cast(w.FindAnyWidget(w.GetName() + "_text_1"));
369 TextWidget text3 = TextWidget.Cast(w.FindAnyWidget(w.GetName() + "_label"));
370 ImageWidget image = ImageWidget.Cast(w.FindAnyWidget(w.GetName() + "_image"));
371
372 Widget option = Widget.Cast(w.FindAnyWidget(w.GetName() + "_option_wrapper"));
373
374 if (text1)
375 text1.SetColor(ARGB(255, 255, 255, 255));
376
377 if (text2)
378 text2.SetColor(ARGB(255, 255, 255, 255));
379
380 if (text3)
381 {
382 text3.SetColor(ARGB(255, 255, 255, 255));
383 w.SetAlpha(0);
384 }
385
386 if (image)
387 image.SetColor(ARGB(255, 255, 255, 255));
388
389 if (option)
390 option.SetColor(ARGB(150, 255, 255, 255));
391 }
WidgetFlags
Definition EnWidgets.c:58

References ARGB().

Referenced by ButtonEnable(), OnFocusLost(), and OnMouseLeave().

◆ ColorNormal() [2/2]

override void ServerBrowserTab::ColorNormal ( Widget w)
inlineprotected

Definition at line 557 of file ServerBrowserTabConsolePages.c.

558 {
559 if (!w)
560 {
561 return
562 }
563
564 if ((w.GetFlags() & WidgetFlags.IGNOREPOINTER) == WidgetFlags.IGNOREPOINTER)
565 return;
566
567 if (w.IsInherited(ButtonWidget))
568 {
570 button.SetTextColor(ARGB(255, 255, 255, 255));
571 }
572 else if (!w.IsInherited(EditBoxWidget))
573 w.SetColor(ARGB(0, 255, 255, 255));
574
575 TextWidget text1 = TextWidget.Cast(w.FindAnyWidget(w.GetName() + "_text"));
576 TextWidget text2 = TextWidget.Cast(w.FindAnyWidget(w.GetName() + "_text_1"));
577 TextWidget text3 = TextWidget.Cast(w.FindAnyWidget(w.GetName() + "_label"));
578 ImageWidget image = ImageWidget.Cast(w.FindAnyWidget(w.GetName() + "_image"));
579
580 Widget option = Widget.Cast(w.FindAnyWidget(w.GetName() + "_option_wrapper"));
581
582 if (text1)
583 text1.SetColor(ARGB(255, 255, 255, 255));
584
585 if (text2)
586 text2.SetColor(ARGB(255, 255, 255, 255));
587
588 if (text3)
589 {
590 text3.SetColor(ARGB(255, 255, 255, 255));
591 w.SetAlpha(0);
592 }
593
594 if (image)
595 image.SetColor(ARGB(255, 255, 255, 255));
596
597 if (option)
598 option.SetColor(ARGB(150, 255, 255, 255));
599 }

References ARGB().

◆ Construct() [1/3]

override void ServerBrowserTab::Construct ( Widget parent,
ServerBrowserMenuNew menu,
TabType type )
inlineprotected

Definition at line 9 of file ServerBrowserTabConsole.c.

10 {
11 m_Root = GetGame().GetWorkspace().CreateWidgets("gui/layouts/new_ui/server_browser/xbox/server_browser_tab.layout", parent);
12
13 m_ServerListScroller = ScrollWidget.Cast(m_Root.FindAnyWidget("server_list_scroller"));
14 m_ServerList = SpacerBaseWidget.Cast(m_ServerListScroller.FindAnyWidget("server_list_content"));
15 m_ServerListScroller.VScrollToPos01(0);
16
19
22
23 m_Menu = menu;
24 m_TabType = type;
25
26 m_ApplyFilter = m_Root.FindAnyWidget("apply_filter_button");
27 m_RefreshList = m_Root.FindAnyWidget("refresh_list_button");
28 m_FiltersChanged = m_Root.FindAnyWidget("unapplied_filters_notify");
29 m_HostSort = m_Root.FindAnyWidget("server_list_content_header_host");
30 m_TimeSort = m_Root.FindAnyWidget("server_list_content_header_time");
31 m_PopulationSort = m_Root.FindAnyWidget("server_list_content_header_population");
32 m_SlotsSort = m_Root.FindAnyWidget("server_list_content_header_slots");
33 m_PingSort = m_Root.FindAnyWidget("server_list_content_header_ping");
34 m_LoadingText = TextWidget.Cast(m_Root.FindAnyWidget("loading_servers_info"));
35 m_WidgetNavFilters = m_Root.FindAnyWidget("filters_root_nav_wrapper");
36 m_WidgetNavServers = m_Root.FindAnyWidget("server_list_root_nav_wrapper");
37
39
40 m_Filters = new ServerBrowserFilterContainer(m_Root.FindAnyWidget("filters_content"), this);
41
42 SetSort(ESortType.HOST, ESortOrder.ASCENDING);
44
45 m_Root.SetHandler(this);
46 }
ESortOrder
ref map< ESortType, ref array< ref GetServersResultRow > > m_EntriesSorted
TabType m_TabType
Widget m_FiltersChanged
Widget m_SlotsSort
ref map< string, ref ServerBrowserEntry > m_EntryWidgets
ScrollWidget m_ServerListScroller
Widget m_PingSort
ServerBrowserMenuNew m_Menu
TextWidget m_LoadingText
Widget m_PopulationSort
Widget m_HostSort
SpacerBaseWidget m_ServerList
Widget m_TimeSort
Widget m_Root
Definition SizeToChild.c:85
override void SetSort(ESortType type, ESortOrder order)
proto native CGame GetGame()

References GetGame(), m_ApplyFilter, m_EntriesSorted, m_EntryWidgets, m_Filters, m_FiltersChanged, m_HostSort, m_LoadingText, m_Menu, m_PingSort, m_PopulationSort, m_RefreshList, m_Root, m_ServerList, m_ServerListScroller, m_SlotsSort, m_TabType, m_TimeSort, and SetSort().

Referenced by ServerBrowserTab().

◆ Construct() [2/3]

override void ServerBrowserTab::Construct ( Widget parent,
ServerBrowserMenuNew menu,
TabType type )
inlineprotected

Definition at line 26 of file ServerBrowserTabConsolePages.c.

27 {
28 m_Root = GetGame().GetWorkspace().CreateWidgets("gui/layouts/new_ui/server_browser/xbox/server_browser_tab_console_pages.layout", parent);
29
30 m_ServerListScroller = ScrollWidget.Cast(m_Root.FindAnyWidget("server_list_scroller"));
31 m_ServerList = SpacerBaseWidget.Cast(m_ServerListScroller.FindAnyWidget("server_list_content"));
32 m_ServerListScroller.VScrollToPos01(0);
33
37
40
41 m_Menu = menu;
42 m_TabType = type;
43
44 m_ApplyFilter = m_Root.FindAnyWidget("apply_filter_button");
45 m_ResetFilters = m_Root.FindAnyWidget("reset_filter_button");
46 m_RefreshList = m_Root.FindAnyWidget("refresh_list_button");
47 m_FiltersChanged = m_Root.FindAnyWidget("unapplied_filters_notify");
48 m_HostSort = m_Root.FindAnyWidget("server_list_content_header_host");
49 m_TimeSort = m_Root.FindAnyWidget("server_list_content_header_time");
50 m_PopulationSort = m_Root.FindAnyWidget("server_list_content_header_population");
51 m_SlotsSort = m_Root.FindAnyWidget("server_list_content_header_slots");
52 m_PingSort = m_Root.FindAnyWidget("server_list_content_header_ping");
53 m_FilterSearchText = m_Root.FindAnyWidget("search_name_button");
54 m_FilterSearchTextBox = m_Root.FindAnyWidget("search_name_setting_option");
55 m_LoadingText = TextWidget.Cast(m_Root.FindAnyWidget("loading_servers_info"));
56 m_WidgetNavFilters = m_Root.FindAnyWidget("filters_root_nav_wrapper");
57 m_WidgetNavServers = m_Root.FindAnyWidget("server_list_root_nav_wrapper");
58
59 m_BtnPagePrev = ButtonWidget.Cast(m_Root.FindAnyWidget("servers_navigation_prev")) ;
60 m_BtnPageNext = ButtonWidget.Cast(m_Root.FindAnyWidget("servers_navigation_next")) ;
61
62#ifdef PLATFORM_PS4
63 m_ButtonPageLeftImg = m_Root.FindAnyWidget("servers_navigation_page_prev_icon_ps4");
64 m_ButtonPageRightImg = m_Root.FindAnyWidget("servers_navigation_page_next_icon_ps4");
65 m_Root.FindAnyWidget("servers_navigation_page_prev_icon_xbox").Show(false);
66 m_Root.FindAnyWidget("servers_navigation_page_next_icon_xbox").Show(false);
67#else
68 m_ButtonPageLeftImg = m_Root.FindAnyWidget("servers_navigation_page_prev_icon_xbox");
69 m_ButtonPageRightImg = m_Root.FindAnyWidget("servers_navigation_page_next_icon_xbox");
70 m_Root.FindAnyWidget("servers_navigation_page_prev_icon_ps4").Show(false);
71 m_Root.FindAnyWidget("servers_navigation_page_next_icon_ps4").Show(false);
72#endif
73
75
76 m_Filters = new ServerBrowserFilterContainer(m_Root.FindAnyWidget("filters_content"), this);
77
78 m_PnlPagesPanel = m_Root.FindAnyWidget("servers_navigation_spacer");
81 m_PnlPagesPanel.Show(true);
82 m_LoadingFinished = true;
83
84 m_Filters.OnSortChanged(m_Filters.m_SortingFilter.GetValue());
87
88 m_Root.SetHandler(this);
89 m_FilterSearchTextBox.SetHandler(this);
90
91 GetGame().GetMission().GetOnInputDeviceChanged().Insert(OnInputDeviceChanged);
92
93 OnInputDeviceChanged(GetGame().GetInput().GetCurrentInputDevice());
94 }
ActionInput GetInput()
Definition ActionBase.c:989
Widget m_FilterSearchText
ButtonWidget m_BtnPageNext
ButtonWidget m_BtnPagePrev
Widget m_FilterSearchTextBox
Widget m_ResetFilters
ref array< ref ServerBrowserEntry > m_ServerListEntiers
void OnInputDeviceChanged(EInputDeviceType pInputDeviceType)

References GetGame(), GetInput(), m_ApplyFilter, m_BtnPageNext, m_BtnPagePrev, m_EntriesSorted, m_EntryWidgets, m_Filters, m_FiltersChanged, m_FilterSearchText, m_FilterSearchTextBox, m_HostSort, m_LoadingFinished, m_LoadingText, m_Menu, m_PingSort, m_PopulationSort, m_RefreshList, m_ResetFilters, m_Root, m_ServerList, m_ServerListScroller, m_SlotsSort, m_TabType, m_TimeSort, OnInputDeviceChanged(), SetCurrentPage(), and ServerBrowserTabConsolePages::SetFocusFilters().

◆ Construct() [3/3]

override void ServerBrowserTab::Construct ( Widget parent,
ServerBrowserMenuNew menu,
TabType type )
inlineprotected

Definition at line 28 of file ServerBrowserTabPc.c.

29 {
30#ifdef PLATFORM_CONSOLE
31 m_Root = GetGame().GetWorkspace().CreateWidgets("gui/layouts/new_ui/server_browser/xbox/server_browser_tab.layout", parent);
32#else
33#ifdef PLATFORM_WINDOWS
34 m_Root = GetGame().GetWorkspace().CreateWidgets("gui/layouts/new_ui/server_browser/pc/server_browser_tab_pages.layout", parent);
35#endif
36#endif
37
38 m_ServerListScroller = ScrollWidget.Cast(m_Root.FindAnyWidget("server_list_scroller"));
39 m_ServerList = SpacerBaseWidget.Cast(m_ServerListScroller.FindAnyWidget("server_list_content"));
40 m_ServerListScroller.VScrollToPos01(0);
41
47
55
56 m_Menu = menu;
57 m_TabType = type;
58
59 m_ApplyFilter = m_Root.FindAnyWidget("apply_filter_button");
60 m_RefreshList = m_Root.FindAnyWidget("refresh_list_button");
61 m_FiltersChanged = m_Root.FindAnyWidget("unapplied_filters_notify");
62 m_HostSort = m_Root.FindAnyWidget("server_list_content_header_host");
63 m_TimeSort = m_Root.FindAnyWidget("server_list_content_header_time");
64 m_PopulationSort = m_Root.FindAnyWidget("server_list_content_header_population");
65 m_SlotsSort = m_Root.FindAnyWidget("server_list_content_header_slots");
66 m_PingSort = m_Root.FindAnyWidget("server_list_content_header_ping");
67
68 m_FilterSearchText = m_Root.FindAnyWidget("search_name_setting");
69 m_FilterSearchTextBox = m_Root.FindAnyWidget("search_name_setting_option");
70 m_FilterSearchIP = m_Root.FindAnyWidget("search_ip_setting");
71 m_FilterSearchIPBox = m_Root.FindAnyWidget("search_ip_setting_option");
72
73 m_FilterPanelAccTime = m_Root.FindAnyWidget("accelerated_time_setting");
74 m_FilterPanelPing = m_Root.FindAnyWidget("ping_setting");
75 //m_FilterPanelPing.SetHandler( this );
76
77 m_LoadingText = TextWidget.Cast(m_Root.FindAnyWidget("loading_servers_info"));
78
80
81 if (type == TabType.LAN)
83
84 m_Filters = new ServerBrowserFilterContainer(m_Root.FindAnyWidget("filters_content"), this);
85
86 m_Root.SetHandler(this);
87
88 SetSort(ESortType.HOST, ESortOrder.ASCENDING);
89
91
92 int page_button_num = 1;
93 ButtonWidget page_button = ButtonWidget.Cast(m_Root.FindAnyWidget("servers_navigation_page" + page_button_num));
94
96 {
97 Error("ServerBrowserTabPage->PAGES_BUTTONS_COUNT must be in range 3 - 10!");
98 return;
99 }
100
101 while (page_button)
102 {
103 page_button.Show(false);
104
106 m_BtnPages.Insert(page_button);
107
109 page_button = ButtonWidget.Cast(m_Root.FindAnyWidget("servers_navigation_page" + page_button_num));
110 }
111
112 m_ResetFilters = ButtonWidget.Cast(m_Root.FindAnyWidget("reset_filter_button")) ;
113
114 m_PnlPagesPanel = m_Root.FindAnyWidget("servers_navigation_spacer");
115 m_BtnPagePrev = ButtonWidget.Cast(m_Root.FindAnyWidget("servers_navigation_prev")) ;
116 m_BtnPageNext = ButtonWidget.Cast(m_Root.FindAnyWidget("servers_navigation_next")) ;
117 m_BtnPagesFirst = ButtonWidget.Cast(m_Root.FindAnyWidget("servers_navigation_page_first")) ;
118 m_BtnPagesLast = ButtonWidget.Cast(m_Root.FindAnyWidget("servers_navigation_page_last")) ;
119 m_PageIndex = 0;
120 m_PnlPagesPanel.Show(true);
121
123 }
ref map< ESortType, ESortOrder > m_SortInverted
TabType
ref map< string, ref array< string > > m_EntryMods
ref array< ButtonWidget > m_BtnPages
ref array< ref ServerBrowserEntry > m_ServerListEntries
ButtonWidget m_BtnPagesFirst
const int PAGES_BUTTONS_COUNT
ButtonWidget m_BtnPagesLast
void Error(string err)
Messagebox with error message.
Definition EnDebug.c:90

References ButtonDisable(), Error(), GetGame(), m_ApplyFilter, m_BtnPageNext, m_BtnPagePrev, m_EntriesSorted, m_EntryMods, m_EntryWidgets, m_Filters, m_FiltersChanged, m_FilterSearchText, m_FilterSearchTextBox, m_HostSort, m_LoadingText, m_Menu, m_PageIndex, m_PingSort, m_PopulationSort, m_RefreshList, m_ResetFilters, m_Root, m_ServerList, m_ServerListScroller, m_SlotsSort, m_SortInverted, m_TabType, m_TimeSort, and SetSort().

◆ DisableFilters()

void ServerBrowserTab::DisableFilters ( )
inlineprotected

Definition at line 130 of file ServerBrowserTabPc.c.

131 {
132 m_Root.FindAnyWidget("filters_content").Show(false);
133 m_Root.FindAnyWidget("spacer").Show(false);
134 m_Root.FindAnyWidget("spacer2").Show(false);
135 m_Root.FindAnyWidget("reset_filter_button").Show(false);
136 m_ApplyFilter.Show(false);
137 m_FiltersChanged.Show(false);
138 }

References m_ApplyFilter, m_FiltersChanged, and m_Root.

◆ Focus() [1/2]

override void ServerBrowserTab::Focus ( )
inlineprotected

Definition at line 298 of file ServerBrowserTabConsole.c.

299 {
301 {
304 }
306 }
void ScrollToEntry(ServerBrowserEntry entry)
string m_CurrentSelectedServer

References m_CurrentSelectedServer, m_EntryWidgets, and ScrollToEntry().

◆ Focus() [2/2]

◆ GetServerEntryByIndex() [1/2]

ServerBrowserEntry ServerBrowserTab::GetServerEntryByIndex ( int index)
inlineprotected

Definition at line 223 of file ServerBrowserTabConsolePages.c.

224 {
225 ServerBrowserEntry entry;
226
227 if (index >= 0)
228 {
229 if (index < m_ServerListEntiers.Count())
230 entry = m_ServerListEntiers[index];
231 else
232 {
233 entry = new ServerBrowserEntry(m_ServerList, index, this);
234 m_ServerListEntiers.Insert(entry);
235 }
236 }
237 else
238 return null;
239
240 entry.Show(true);
241
242 return entry;
243 }

References m_ServerList.

◆ GetServerEntryByIndex() [2/2]

ServerBrowserEntry ServerBrowserTab::GetServerEntryByIndex ( int index,
string server_id )
inlineprotected

Definition at line 1045 of file ServerBrowserTabPc.c.

1046 {
1047 ref ServerBrowserEntry entry;
1048
1049 if (index >= 0)
1050 {
1051 if (index < m_ServerListEntries.Count())
1052 entry = m_ServerListEntries[index];
1053 else
1054 {
1055 entry = new ServerBrowserEntry(null, index, this);
1056 m_ServerList.AddChild(entry.GetRoot(), false);
1057
1058 m_ServerListEntries.Insert(entry);
1059 }
1060 }
1061 else
1062 return null;
1063
1064 // Refresh list
1065 m_EntryWidgets.Insert(server_id, entry);
1066
1067 return entry;
1068 }

References m_EntryWidgets, and m_ServerList.

◆ GetTimeOfDayEnum()

int ServerBrowserTab::GetTimeOfDayEnum ( string time_of_day)
inlineprotected

Definition at line 533 of file ServerBrowserTabPc.c.

534 {
535 m_TempTime.Clear();
536
537 time_of_day.Split(":", m_TempTime);
538
539 int minutes = 0;
540
541 if (m_TempTime.Count() > 0)
542 {
543 int h = m_TempTime[0].ToInt();
544
545 if (h >= 5)
546 h -= 5;
547 else
548 h += 24;
549
550 minutes = h * 60;
551 }
552
553 if (m_TempTime.Count() > 1)
554 {
555 int m = m_TempTime[0].ToInt();
556 minutes += m;
557 }
558
559 return minutes;
560 }
ref TStringArray m_TempTime

◆ IsFocusable()

override bool ServerBrowserTab::IsFocusable ( Widget w)
inlineprotected

Definition at line 1070 of file ServerBrowserTabPc.c.

1071 {
1072 if (w)
1073 {
1074 if (super.IsFocusable(w))
1075 return true;
1076
1077 if (w == m_ServerListScroller)
1078 return false;
1079
1080 if (w == m_HostSort || w == m_TimeSort || w == m_PopulationSort || w == m_SlotsSort || w == m_PingSort || w == m_FilterSearchIP)
1081 return true;
1082
1084 return true;
1085
1086 return false;
1087 }
1088 return false;
1089 }

References m_HostSort, m_PingSort, m_PopulationSort, m_ServerListScroller, m_SlotsSort, and m_TimeSort.

Referenced by OnFocus(), OnFocusLost(), OnMouseEnter(), and OnMouseLeave().

◆ Left()

override void ServerBrowserTab::Left ( )
inlineprotected

Definition at line 333 of file ServerBrowserTabConsolePages.c.

334 {
336 {
339 if (curr_page > 1)
340 {
343 }
344 }
345 }
int GetCurrentPage()

References GetCurrentPage(), and SetCurrentPage().

◆ LeftHold()

override void ServerBrowserTab::LeftHold ( )
inlineprotected

Definition at line 347 of file ServerBrowserTabConsolePages.c.

348 {
350 {
352 {
354 Left();
355 }
356 }
357 }
float GetTime()

References GetGame(), GetTime(), and Left().

◆ LeftRelease()

override void ServerBrowserTab::LeftRelease ( )
inlineprotected

◆ LoadEntries() [1/2]

void ServerBrowserTab::LoadEntries ( int cur_page_index,
GetServersResultRowArray page )
inlineprotected

Definition at line 116 of file ServerBrowserTabConsole.c.

117 {
118 if (!m_Menu || m_Menu.GetServersLoadingTab() != m_TabType)
119 return;
120
123 if (page_entries)
124 {
126 {
128
129 if (PassFilter(result))
130 {
131 ServerBrowserEntry entry = new ServerBrowserEntry(m_ServerList, index, this);
132 string ipPort = result.GetIpPort();
133 entry.FillInfo(result);
134 entry.SetFavorite(m_Menu.IsFavorited(ipPort));
135 entry.UpdateEntry();
136
137 m_EntryWidgets.Insert(ipPort, entry);
138 index++;
140
141 if (m_EntryWidgets.Count() > 0)
143 }
144
145 if (!m_Menu || m_Menu.GetServersLoadingTab() != m_TabType)
146 return;
147 }
148
149 m_ServerList.Update();
150 }
151 /*
152 if ( cur_page_index == 1 && m_EntryWidgets.Count() > 0 )
153 {
154 SetFocusServers();
155 }
156 else
157 {
158 m_LoadingText.SetText( "#server_browser_unable_with_filter" );
159 SetFocusFilters();
160 }
161 */
162
164 {
165 /*
166
167 */
168 }
169 else
170 {
171 //m_LoadingText.SetText( "#server_browser_unable_with_filter" );
172
173 }
174
175 if (!m_Menu)
176 return;
177
179 {
180 //m_LoadingText.SetText( "#server_browser_tab_loaded" + " " + m_EntryWidgets.Count() + "/" + m_EntryWidgets.Count() + " " + "#server_browser_servers_desc" );
181 m_Menu.SetServersLoadingTab(TabType.NONE);
182 }
183 }
const int SERVER_BROWSER_PAGE_SIZE
int m_TotalPages
bool PassFilter(GetServersResultRow result)
int m_TotalLoadedServers
int m_LastLoadedPage
Result for an object found in CGame.IsBoxCollidingGeometryProxy.

References Count, m_EntriesSorted, m_EntryWidgets, m_LastLoadedPage, m_Menu, m_ServerList, m_SortType, m_TabType, m_TotalLoadedServers, m_TotalPages, PassFilter(), and SERVER_BROWSER_PAGE_SIZE.

◆ LoadEntries() [2/2]

void ServerBrowserTab::LoadEntries ( int cur_page_index,
GetServersResultRowArray page_entries )
inlineprotected

Definition at line 176 of file ServerBrowserTabConsolePages.c.

177 {
178 int index = 0;
179 ServerBrowserEntry entry;
181
182 if (!m_Menu || m_Menu.GetServersLoadingTab() != m_TabType)
183 return;
184
185 // only load servers if they correspond to current page
187 return;
188
190 {
192 {
193 if (PassFilter(result))
194 {
195 string ipPort = result.GetIpPort();
196 bool isFavorited = m_Menu.IsFavorited(ipPort);
197
199 entry.SetIsOnline(true);
200 entry.FillInfo(result);
201 entry.SetFavorite(isFavorited);
202 entry.UpdateEntry();
203
204 if (isFavorited && m_OnlineFavServers.Find(ipPort) == -1)
206
207 m_EntryWidgets.Insert(ipPort, entry);
209
210 index++;
211 }
212
213 if (!m_Menu || m_Menu.GetServersLoadingTab() != m_TabType)
214 return;
215 }
216 }
217
219 m_ServerList.Update();
221 }
void LoadExtraEntries(int index)
int m_CurrentPageNum
ref set< string > m_OnlineFavServers
ServerBrowserEntry GetServerEntryByIndex(int index)

References ServerBrowserTabConsolePages::LoadExtraEntries(), m_CurrentPageNum, m_EntriesSorted, m_EntryWidgets, m_Menu, m_OnlineFavServers, m_ServerList, m_SortType, m_TabType, m_TotalLoadedServers, and ServerBrowserTabConsolePages::PassFilter().

◆ LoadingServersStop()

void ServerBrowserTab::LoadingServersStop ( )
inlineprotected

Definition at line 182 of file ServerBrowserTabPc.c.

183 {
184 OnlineServices.m_ServersAsyncInvoker.Remove(m_Menu.OnLoadServersAsync);
185
186 m_LoadingFinished = true;
187 m_Loading = false;
188
190
193 }
bool m_Loading
static ref ScriptInvoker m_ServersAsyncInvoker

References m_Loading, m_LoadingFinished, m_Menu, and OnlineServices::m_ServersAsyncInvoker.

◆ OnClick() [1/2]

override bool ServerBrowserTab::OnClick ( Widget w,
int x,
int y,
int button )
inlineprotected

Definition at line 512 of file ServerBrowserTabConsolePages.c.

513 {
514 super.OnClick(w, x, y, button);
515
516 if (button == MouseState.LEFT)
517 {
518 if (w == m_ResetFilters)
519 ResetFilters();
520 else if (w == m_ApplyFilter)
521 {
522 ApplyFilters();
523 return true;
524 }
525 else if (w == m_RefreshList)
526 {
528 PressX();
529 else
530 RefreshList();
531
532 return true;
533 }
534 else if (w == m_BtnPagePrev)
535 {
536 Left();
537 return true;
538 }
539 else if (w == m_BtnPageNext)
540 {
541 Right();
542 return true;
543 }
544 }
545 return false;
546 }
Icon x
Icon y
MouseState
Definition EnSystem.c:311

References ApplyFilters(), Left(), m_ApplyFilter, m_BtnPageNext, m_BtnPagePrev, m_Loading, m_LoadingFinished, m_RefreshList, m_ResetFilters, ServerBrowserTabConsolePages::PressX(), ServerBrowserTabConsolePages::RefreshList(), ResetFilters(), Right(), x, and y.

◆ OnClick() [2/2]

override bool ServerBrowserTab::OnClick ( Widget w,
int x,
int y,
int button )
inlineprotected

Definition at line 245 of file ServerBrowserTabPc.c.

246 {
247 super.OnClick(w, x, y, button);
248
249 if (button == MouseState.LEFT)
250 {
251 if (w == m_ResetFilters)
252 ResetFilters();
253 else if (w == m_ApplyFilter)
254 {
255 ApplyFilters();
256 return true;
257 }
258 else if (w == m_RefreshList)
259 {
262 else
263 RefreshList();
264
265 return true;
266 }
267 else if (w == m_BtnPagePrev)
268 {
270 return true;
271 }
272 else if (w == m_BtnPageNext)
273 {
275 return true;
276 }
277 else if (w == m_BtnPagesLast)
278 {
280 return true;
281 }
282 else if (w == m_BtnPagesFirst)
283 {
285 return true;
286 }
287 else
288 {
289 bool click = OnClickPage(w);
290
291 if (click)
292 return true;
293
294 return false;
295 }
296 }
297 return false;
298 }
bool OnClickPage(Widget w)

References ApplyFilters(), m_ApplyFilter, m_BtnPageNext, m_BtnPagePrev, m_Loading, m_LoadingFinished, m_RefreshList, m_ResetFilters, ServerBrowserTabPc::RefreshList(), ResetFilters(), x, and y.

◆ OnClickPage()

bool ServerBrowserTab::OnClickPage ( Widget w)
inlineprotected

Definition at line 412 of file ServerBrowserTabPc.c.

413 {
414 for (int i = 0; i < m_BtnPages.Count(); ++i)
415 {
416 if (m_BtnPages[i] == w)
417 {
419 return true;
420 }
421 }
422
423 return false;
424 }
void SetPageIndex(int page_index)

◆ OnClickPageEnd()

void ServerBrowserTab::OnClickPageEnd ( )
inlineprotected

Definition at line 402 of file ServerBrowserTabPc.c.

403 {
405 }

◆ OnClickPageFirst()

void ServerBrowserTab::OnClickPageFirst ( )
inlineprotected

Definition at line 407 of file ServerBrowserTabPc.c.

408 {
409 SetPageIndex(0);
410 }

◆ OnClickPageNext()

void ServerBrowserTab::OnClickPageNext ( )
inlineprotected

Definition at line 394 of file ServerBrowserTabPc.c.

395 {
396 if (m_PageIndex < (m_PagesCount - 1))
398 else
399 SetPageIndex(0);
400 }

References m_PageIndex.

◆ OnClickPagePrev()

void ServerBrowserTab::OnClickPagePrev ( )
inlineprotected

Definition at line 386 of file ServerBrowserTabPc.c.

387 {
388 if (m_PageIndex > 0)
390 else
392 }

References m_PageIndex.

◆ OnFilterChanged() [1/3]

override void ServerBrowserTab::OnFilterChanged ( )
inlineprotected

Definition at line 192 of file ServerBrowserTabConsole.c.

193 {
194 m_IsFilterChanged = true;
195 }

Referenced by ScriptedWidgetEventHandler::OnFilterChanged().

◆ OnFilterChanged() [2/3]

override void ServerBrowserTab::OnFilterChanged ( )
inlineprotected

Definition at line 245 of file ServerBrowserTabConsolePages.c.

246 {
247 m_IsFilterChanged = true;
248 }

◆ OnFilterChanged() [3/3]

override void ServerBrowserTab::OnFilterChanged ( )
inlineprotected

Definition at line 376 of file ServerBrowserTabPc.c.

377 {
378 //m_FiltersChanged.Show( true );
379
381
382 if (!m_Loading)
384 }

References ButtonDisable(), ButtonEnable(), m_ApplyFilter, m_Loading, and m_RefreshList.

◆ OnFilterFocus()

override void ServerBrowserTab::OnFilterFocus ( Widget w)
inlineprotected

Definition at line 185 of file ServerBrowserTabConsole.c.

186 {
187 super.OnFilterFocus(w);
188
189 //ColorHighlight( w );
190 }

Referenced by ScriptedWidgetEventHandler::OnFocus().

◆ OnFilterFocusLost()

override void ServerBrowserTab::OnFilterFocusLost ( Widget w)
inlineprotected

Definition at line 228 of file ServerBrowserTabConsole.c.

229 {
230 super.OnFilterFocusLost(w);
231 }

◆ OnInputDeviceChanged()

void ServerBrowserTab::OnInputDeviceChanged ( EInputDeviceType pInputDeviceType)
inlineprotected

Definition at line 117 of file ServerBrowserTabConsolePages.c.

118 {
119 switch (pInputDeviceType)
120 {
121 case EInputDeviceType.CONTROLLER:
127 break;
128
129 default:
130 if (GetGame().GetInput().IsEnabledMouseAndKeyboardEvenOnServer())
131 {
132 m_WidgetNavFilters.Show(false);
133 m_WidgetNavServers.Show(false);
134 m_ButtonPageLeftImg.Show(false);
135 m_ButtonPageRightImg.Show(false);
137 }
138 break;
139 }
140 }
EInputDeviceType
Definition input.c:3

References GetGame(), and GetInput().

◆ OnLoadServerModsAsync()

override void ServerBrowserTab::OnLoadServerModsAsync ( string server_id,
array< string > mods )
inlineprivate

Definition at line 1037 of file ServerBrowserTabPc.c.

1038 {
1039 super.OnLoadServerModsAsync(server_id, mods);
1040
1041 if (m_EntryWidgets.Contains(server_id))
1042 m_EntryWidgets.Get(server_id).SetMods(mods);
1043 }

References m_EntryWidgets.

◆ OnLoadServersAsyncConsole() [1/2]

override void ServerBrowserTab::OnLoadServersAsyncConsole ( GetServersResult result_list,
EBiosError error,
string response )
inlineprotected

Definition at line 67 of file ServerBrowserTabConsole.c.

68 {
69 //Print("m_NumServers: "+ result_list.m_NumServers +" m_Pages: "+ result_list.m_Pages + " m_Page: "+ result_list.m_Page);
70 //string smg = "m_NumServers: "+ result_list.m_NumServers +" m_Pages: "+ result_list.m_Pages + " m_Page: "+ result_list.m_Page +" response: "+ response +" error: "+ error;
71 //m_LoadingText.SetText( smg );
72
73 if (error != EBiosError.OK || !result_list)
74 {
75 m_LoadingText.SetText(string.Format("Error: %1", ErrorModuleHandler.GetClientMessage(ErrorCategory.BIOSError, error)));
76 return;
77 }
78
79 if (result_list.m_Page == 1)
80 {
81 m_TotalPages = result_list.m_Pages;
82 m_TotalServers = result_list.m_NumServers;
83
84 if (m_Menu.GetServersLoadingTab() != m_TabType || !result_list || (!result_list.m_Results || result_list.m_Results.Count() == 0))
85 {
86 m_Menu.SetServersLoadingTab(TabType.NONE);
87 m_LoadingText.SetText("#server_browser_tab_unable_to_get_server #server_browser_tab_no_servers_with_filter");
88 return;
89 }
90 }
91
93
94 if (m_TotalPages > 0)
95 LoadEntries(result_list.m_Page, result_list.m_Results);
96
98 {
100 return;
101 }
102
103 if (result_list.m_Page == result_list.m_Pages)
105 }
EBiosError
Possible Error codes for bios API. This is the list of errors that can be returned from bios API....
ErrorCategory
ErrorCategory - To decide what ErrorHandlerModule needs to be called and easily identify where it cam...
void GetNextPage()
int m_TotalServers
The error handler itself, for managing and distributing errors to modules Manages the ErrorHandlerMod...
static proto string GetClientMessage(ErrorCategory category, int code, string additionalInfo="")
Gets the Client Message for specified error.
void LoadEntries(int cur_page_index, GetServersResultRowArray page)

References ErrorModuleHandler::GetClientMessage(), GetNextPage(), m_LastLoadedPage, m_LoadingText, m_Menu, m_TabType, m_TotalPages, and m_TotalServers.

◆ OnLoadServersAsyncConsole() [2/2]

override void ServerBrowserTab::OnLoadServersAsyncConsole ( GetServersResult result_list,
EBiosError error,
string response )
inlineprotected

◆ OnLoadServersAsyncFinished() [1/2]

void ServerBrowserTab::OnLoadServersAsyncFinished ( )
inlineprotected

Definition at line 107 of file ServerBrowserTabConsole.c.

108 {
109 string msg = "#servers_found: " + m_TotalLoadedServers;
110 if (m_TotalLoadedServers == 0)
111 msg = "#server_browser_tab_unable_to_get_server";
112 m_LoadingText.SetText(msg);
113 m_LoadingFinished = true;
114 }

References m_LoadingFinished, m_LoadingText, and m_TotalLoadedServers.

◆ OnLoadServersAsyncFinished() [2/2]

void ServerBrowserTab::OnLoadServersAsyncFinished ( )
inlineprotected

Definition at line 165 of file ServerBrowserTabConsolePages.c.

166 {
167 string msg = "#servers_found: " + m_TotalLoadedServers;
168 if (m_TotalLoadedServers == 0)
169 msg = "#server_browser_tab_unable_to_get_server";
170 m_LoadingText.SetText(msg);
171 m_LoadingFinished = true;
172
173 m_Menu.SetServersLoadingTab(TabType.NONE);
174 }

References m_LoadingFinished, m_LoadingText, m_Menu, and m_TotalLoadedServers.

◆ OnLoadServersAsyncPC()

override void ServerBrowserTab::OnLoadServersAsyncPC ( ref GetServersResult result_list,
EBiosError error,
string response )
inlineprotected

Definition at line 195 of file ServerBrowserTabPc.c.

196 {
197 if (result_list)
198 {
199 int count = result_list.m_Results.Count();
200 if (count > 0)
201 {
202 for (int i = 0; i < count; i++)
203 {
206
207 result.m_SortName = result.m_Name.ToInt();
208 result.m_SortTime = GetTimeOfDayEnum(result.m_TimeOfDay);
209
210 if (PassFilter(result))
211 {
214 {
217 }
218 }
219
220 if (!m_Menu || m_Menu.GetServersLoadingTab() != m_TabType)
221 return;
222 }
223 }
224 else
225 m_Menu.SetServersLoadingTab(TabType.NONE);
226
227 }
228 else
229 m_Menu.SetServersLoadingTab(TabType.NONE);
230
231 if (response == "thelastone")
233 else
234 m_ServersEstimateCount = result_list.m_NumServers;
235
238 }
int GetTimeOfDayEnum(string time_of_day)
override int AddSorted(GetServersResultRow entry)
const int SERVERS_VISIBLE_COUNT

References AddSorted(), m_Menu, m_PageIndex, m_TabType, and PassFilter().

◆ OnLoadServersAsyncPCFinished()

void ServerBrowserTab::OnLoadServersAsyncPCFinished ( )
inlineprotected

Definition at line 240 of file ServerBrowserTabPc.c.

241 {
243 }

◆ OnMouseButtonUp()

override bool ServerBrowserTab::OnMouseButtonUp ( Widget w,
int x,
int y,
int button )
inlineprotected

Definition at line 336 of file ServerBrowserTabPc.c.

337 {
338 //Print("SG OnMouseButtonUp: "+ w.GetName());
339
340 if (button == MouseState.LEFT)
341 {
342 if (w == m_HostSort)
343 {
344 ToggleSort(ESortType.HOST);
346 return true;
347 }
348 else if (w == m_TimeSort)
349 {
350 ToggleSort(ESortType.TIME);
352 return true;
353 }
354 else if (w == m_PopulationSort)
355 {
356 ToggleSort(ESortType.POPULATION);
358 return true;
359 }
360 else if (w == m_SlotsSort)
361 {
362 ToggleSort(ESortType.SLOTS);
364 return true;
365 }
366 else if (w == m_PingSort)
367 {
368 ToggleSort(ESortType.PING);
370 return true;
371 }
372 }
373 return false;
374 }
void ToggleSort(ESortType type)

References m_HostSort, m_PingSort, m_PopulationSort, m_SlotsSort, and m_TimeSort.

◆ OnMouseEnter()

override bool ServerBrowserTab::OnMouseEnter ( Widget w,
int x,
int y )
inlineprotected

Definition at line 300 of file ServerBrowserTabPc.c.

301 {
302 if (IsFocusable(w))
303 {
305
306 if (w == m_FilterSearchText)
307 {
309 return true;
310 }
311 else if (w == m_FilterSearchIP)
312 {
314 return true;
315 }
316
317 return true;
318 }
319 return false;
320 }
override bool IsFocusable(Widget w)
override void ColorHighlight(Widget w)

References ColorHighlight(), IsFocusable(), m_FilterSearchText, m_FilterSearchTextBox, and SetFocus().

Referenced by ScriptedWidgetEventHandler::OnMouseEnter().

◆ OnMouseLeave()

override bool ServerBrowserTab::OnMouseLeave ( Widget w,
Widget enterW,
int x,
int y )
inlineprotected

Definition at line 322 of file ServerBrowserTabPc.c.

323 {
324 if (IsFocusable(w))
325 {
326 ColorNormal(w);
327
329 SetFocus(null);
330
331 return true;
332 }
333 return false;
334 }
override void ColorNormal(Widget w)

References ColorNormal(), IsFocusable(), m_FilterSearchText, and SetFocus().

Referenced by ScriptedWidgetEventHandler::OnMouseLeave().

◆ PressA() [1/2]

override void ServerBrowserTab::PressA ( )
inlineprotected

Definition at line 233 of file ServerBrowserTabConsole.c.

234 {
235
236 }

◆ PressA() [2/2]

override void ServerBrowserTab::PressA ( )
inlineprotected

Definition at line 295 of file ServerBrowserTabConsolePages.c.

296 {
297
298 }

◆ PressSholderLeft() [1/2]

override void ServerBrowserTab::PressSholderLeft ( )
inlineprotected

Definition at line 269 of file ServerBrowserTabConsole.c.

270 {
273 else
275 }

◆ PressSholderLeft() [2/2]

override void ServerBrowserTab::PressSholderLeft ( )
inlineprotected

Definition at line 397 of file ServerBrowserTabConsolePages.c.

398 {
401 else
403 }

References ServerBrowserTabConsolePages::SetFocusFilters().

◆ PressSholderRight() [1/2]

override void ServerBrowserTab::PressSholderRight ( )
inlineprotected

Definition at line 277 of file ServerBrowserTabConsole.c.

278 {
281 else
283 }

◆ PressSholderRight() [2/2]

override void ServerBrowserTab::PressSholderRight ( )
inlineprotected

Definition at line 405 of file ServerBrowserTabConsolePages.c.

406 {
409 else
411 }

References ServerBrowserTabConsolePages::SetFocusFilters().

◆ PressX() [1/2]

override void ServerBrowserTab::PressX ( )
inlineprotected

Definition at line 238 of file ServerBrowserTabConsole.c.

239 {
240 RefreshList();
241 }

References RefreshList().

◆ PressX() [2/2]

override void ServerBrowserTab::PressX ( )
inlineprotected

◆ PressY() [1/2]

override void ServerBrowserTab::PressY ( )
inlineprotected

Definition at line 243 of file ServerBrowserTabConsole.c.

244 {
245 /*
246 if( m_Menu.GetServersLoadingTab() != TabType.NONE )
247 {
248 return;
249 }
250 */
251
252 switch (m_SelectedPanel)
253 {
254 case SelectedPanel.BROWSER:
255 {
257 m_Menu.ServerListFocus(true, m_SelectedServer.ToggleFavorite());
258 break;
259 }
260 case SelectedPanel.FILTERS:
261 {
262 if (m_Filters)
263 m_Filters.ResetFilters();
264 break;
265 }
266 }
267 }
ServerBrowserEntry m_SelectedServer
SelectedPanel m_SelectedPanel

References m_Filters, m_Menu, m_SelectedPanel, and m_SelectedServer.

◆ PressY() [2/2]

override void ServerBrowserTab::PressY ( )
inlineprotected

Definition at line 314 of file ServerBrowserTabConsolePages.c.

315 {
316 switch (m_SelectedPanel)
317 {
318 case SelectedPanel.BROWSER:
319 {
321 m_Menu.ServerListFocus(true, m_SelectedServer.ToggleFavorite());
322 break;
323 }
324 case SelectedPanel.FILTERS:
325 {
326 if (m_Filters)
327 m_Filters.ResetFilters();
328 break;
329 }
330 }
331 }

References m_Filters, m_Menu, m_SelectedPanel, and m_SelectedServer.

◆ RefreshList() [1/3]

override void ServerBrowserTab::RefreshList ( )
inlineprotected

Definition at line 197 of file ServerBrowserTabConsole.c.

198 {
199 for (int i = 0; i < m_EntriesSorted.Count(); i++)
200 m_EntriesSorted.GetElement(i).Clear();
201
202 m_Filters.SaveFilters();
203
204 super.RefreshList();
205
206 m_ServerListScroller.VScrollToPos01(0);
207
208 m_LoadingText.SetText("#dayz_game_loading");
209
211 //UpdateStatusBar();
212 }

References m_EntriesSorted, m_Filters, m_LoadingText, and m_ServerListScroller.

Referenced by PressX().

◆ RefreshList() [2/3]

override void ServerBrowserTab::RefreshList ( )
inlineprotected

Definition at line 255 of file ServerBrowserTabConsolePages.c.

256 {
257 for (int i = 0; i < m_ServerListEntiers.Count(); i++)
258 m_ServerListEntiers[i].Show(false);
259
260 for (int j = 0; j < m_EntriesSorted.Count(); j++)
261 {
263
264 if (result_rows)
265 result_rows.Clear();
266 }
267
268 m_IsFilterChanged = false;
269 m_Filters.SaveFilters();
270
271 super.RefreshList();
272
273 m_ServerListScroller.VScrollToPos01(0);
274
275 m_LoadingText.SetText("#dayz_game_loading");
276 }
void Show()
Definition DayZGame.c:155

References m_EntriesSorted, m_Filters, m_LoadingText, m_ServerListScroller, and Show().

◆ RefreshList() [3/3]

override void ServerBrowserTab::RefreshList ( )
inlineprotected

Definition at line 140 of file ServerBrowserTabPc.c.

141 {
142 for (int i = 0; i < m_EntriesSorted.Count(); i++)
143 m_EntriesSorted.GetElement(i).Clear();
144
146
147 m_LoadingFinished = false;
148 m_Loading = true;
152 m_PageIndex = 0;
153
154 super.RefreshList();
155
156 m_ServerListScroller.VScrollToPos01(0);
161 }
EScriptInvokerInsertFlags
Definition tools.c:130

References m_EntriesSorted, m_Loading, m_LoadingFinished, m_Menu, m_PageIndex, m_ServerListScroller, OnlineServices::m_ServersAsyncInvoker, and m_TotalLoadedServers.

◆ ResetFilters() [1/3]

override void ServerBrowserTab::ResetFilters ( )
inlineprotected

Definition at line 214 of file ServerBrowserTabConsole.c.

215 {
216 super.ResetFilters();
217
218 m_IsFilterChanged = false;
219 }

◆ ResetFilters() [2/3]

override void ServerBrowserTab::ResetFilters ( )
inlineprotected

Definition at line 278 of file ServerBrowserTabConsolePages.c.

279 {
280 super.ResetFilters();
281
282 m_IsFilterChanged = false;
283 }

◆ ResetFilters() [3/3]

override void ServerBrowserTab::ResetFilters ( )
inlineprotected

Definition at line 163 of file ServerBrowserTabPc.c.

164 {
165 m_Filters.ResetFilters();
166
168
169 if (!m_Loading)
171 }

References ButtonDisable(), ButtonEnable(), m_ApplyFilter, m_Filters, m_Loading, and m_RefreshList.

◆ Right()

override void ServerBrowserTab::Right ( )
inlineprotected

Definition at line 365 of file ServerBrowserTabConsolePages.c.

366 {
368 {
372 {
375 }
376 }
377 }

References GetCurrentPage(), and SetCurrentPage().

◆ RightHold()

override void ServerBrowserTab::RightHold ( )
inlineprotected

Definition at line 379 of file ServerBrowserTabConsolePages.c.

380 {
382 {
384 {
386 Right();
387 }
388 }
389 }

References GetGame(), GetTime(), and Right().

◆ RightRelease()

override void ServerBrowserTab::RightRelease ( )
inlineprotected

◆ SelectServer()

override void ServerBrowserTab::SelectServer ( ServerBrowserEntry server)
inlineprotected

Definition at line 594 of file ServerBrowserTabPc.c.

595 {
596 super.SelectServer(server);
597
598#ifdef PLATFORM_CONSOLE
600#endif
601
603
604 if (!m_Menu)
605 return;
606
607 m_Menu.SelectServer(server);
608 }

References m_Menu, m_SelectedServer, and ScrollToEntry().

Referenced by ScriptedWidgetEventHandler::Select().

◆ SetEnableFilters() [1/2]

void ServerBrowserTab::SetEnableFilters ( bool enable)
inlineprotected

Definition at line 326 of file ServerBrowserTabConsole.c.

327 {
328 Widget w_filters = m_Root.FindAnyWidget("filters_content");
329 Widget w_content = m_Root.FindAnyWidget("server_list_scroller");
330 w_filters.Enable(enable);
331 w_content.Enable(!enable);
332 }

References m_Root.

◆ SetEnableFilters() [2/2]

void ServerBrowserTab::SetEnableFilters ( bool enable)
inlineprotected

Definition at line 470 of file ServerBrowserTabConsolePages.c.

471 {
472 Widget w_filters = m_Root.FindAnyWidget("filters_content");
473 Widget w_content = m_Root.FindAnyWidget("server_list_scroller");
474 w_content.Enable(!enable);
475
476 if (enable)
477 SetFocus(ButtonWidget.Cast(w_filters.FindWidget("sort_button")));
478 }

References m_Root, and SetFocus().

◆ SetEnableServers() [1/2]

void ServerBrowserTab::SetEnableServers ( bool enable)
inlineprotected

Definition at line 334 of file ServerBrowserTabConsole.c.

335 {
336 Widget w_filters = m_Root.FindAnyWidget("filters_content");
337 Widget w_content = m_Root.FindAnyWidget("server_list_scroller");
338 w_filters.Enable(!enable);
339 w_content.Enable(enable);
340 }

References m_Root.

◆ SetEnableServers() [2/2]

void ServerBrowserTab::SetEnableServers ( bool enable)
inlineprotected

Definition at line 480 of file ServerBrowserTabConsolePages.c.

481 {
482 Widget w_filters = m_Root.FindAnyWidget("filters_content");
483 Widget w_content = m_Root.FindAnyWidget("server_list_scroller");
484 w_content.Enable(enable);
485 }

References m_Root.

◆ SetFocusFilters() [1/2]

void ServerBrowserTab::SetFocusFilters ( )
inlineprotected

Definition at line 285 of file ServerBrowserTabConsole.c.

286 {
287 SetEnableFilters(true);
288 SetEnableServers(false);
289
290 // if loaded servers is 0, then hide Top navigation menu <Left / Right>
291 m_WidgetNavFilters.Show((m_EntryWidgets.Count() > 0));
292 m_WidgetNavServers.Show(false);
293
294 m_Filters.Focus();
295 m_IsFilterFocused = true;
296 }
void SetEnableServers(bool enable)
void SetEnableFilters(bool enable)

References m_EntryWidgets, and m_Filters.

◆ SetFocusFilters() [2/2]

void ServerBrowserTab::SetFocusFilters ( )
inlineprotected

Definition at line 428 of file ServerBrowserTabConsolePages.c.

429 {
430 SetEnableFilters(true);
431 SetEnableServers(false);
432
433 // if loaded servers is 0, then hide Top navigation menu <Left / Right>
435 {
436 m_WidgetNavFilters.Show(true);
437 m_WidgetNavServers.Show(false);
438 }
439
440 m_Filters.Focus();
441 m_IsFilterFocused = true;
442
444 }

References m_Filters.

◆ SetFocusServers() [1/2]

void ServerBrowserTab::SetFocusServers ( )
inlineprotected

Definition at line 308 of file ServerBrowserTabConsole.c.

309 {
310 SetEnableServers(true);
311 SetEnableFilters(false);
312
313 m_WidgetNavFilters.Show(false);
314 m_WidgetNavServers.Show(true);
315
317 if (entries.Count() > 0)
318 {
319 m_EntryWidgets.Get(entries.Get(0).GetIpPort()).Focus();
320 m_IsFilterFocused = false;
321 }
322 else
324 }

References m_EntriesSorted, m_EntryWidgets, and m_SortType.

◆ SetFocusServers() [2/2]

void ServerBrowserTab::SetFocusServers ( )
inlineprotected

Definition at line 446 of file ServerBrowserTabConsolePages.c.

447 {
448 SetEnableServers(true);
449 SetEnableFilters(false);
450
452 {
453 m_WidgetNavFilters.Show(false);
454 m_WidgetNavServers.Show(true);
455 }
456
458 if (entries && entries.Count() > 0)
459 m_EntryWidgets.Get(entries.Get(0).GetIpPort()).Focus();
460 else
461 SetFocus(null);
462
463 m_IsFilterFocused = false;
464 m_Menu.ShowYButton(true);
465 m_Menu.ShowAButton(true);
466
468 }

References m_EntriesSorted, m_EntryWidgets, m_Menu, m_SortType, and SetFocus().

◆ SetPageIndex()

void ServerBrowserTab::SetPageIndex ( int page_index)
inlineprotected

Definition at line 426 of file ServerBrowserTabPc.c.

427 {
431 }

References m_PageIndex.

◆ SetSort()

override void ServerBrowserTab::SetSort ( ESortType type,
ESortOrder order )
inlineprotected

Definition at line 462 of file ServerBrowserTabPc.c.

463 {
464 super.SetSort(type, order);
465
466#ifdef PLATFORM_WINDOWS
467 m_Root.FindAnyWidget("host_sort").Show(false);
468 m_Root.FindAnyWidget("population_sort").Show(false);
469 m_Root.FindAnyWidget("slots_sort").Show(false);
470
471 m_Root.FindAnyWidget("time_sort").Show(false);
472 m_Root.FindAnyWidget("ping_sort").Show(false);
473
475 root = TextWidget.Cast(m_Root.FindAnyWidget("server_list_content_header_host_label"));
476 root.SetColor(ARGBF(1, 1, 1, 1));
477 root = TextWidget.Cast(m_Root.FindAnyWidget("server_list_content_header_population_label"));
478 root.SetColor(ARGBF(1, 1, 1, 1));
479 root = TextWidget.Cast(m_Root.FindAnyWidget("server_list_content_header_slots_label"));
480 root.SetColor(ARGBF(1, 1, 1, 1));
481
482 root = TextWidget.Cast(m_Root.FindAnyWidget("server_list_content_header_ping_label"));
483 root.SetColor(ARGBF(1, 1, 1, 1));
484 root = TextWidget.Cast(m_Root.FindAnyWidget("server_list_content_header_time_label"));
485 root.SetColor(ARGBF(1, 1, 1, 1));
486
487 string r_name;
488 string w_name;
489
490 switch (type)
491 {
492 case ESortType.HOST:
493 {
494 r_name = "server_list_content_header_host_label";
495 w_name = "host_sort";
496 break;
497 }
498 case ESortType.TIME:
499 {
500 r_name = "server_list_content_header_time_label";
501 w_name = "time_sort";
502 break;
503 }
504 case ESortType.POPULATION:
505 {
506 r_name = "server_list_content_header_population_label";
507 w_name = "population_sort";
508 break;
509 }
510 case ESortType.SLOTS:
511 {
512 r_name = "server_list_content_header_slots_label";
513 w_name = "slots_sort";
514 break;
515 }
516 case ESortType.PING:
517 {
518 r_name = "server_list_content_header_ping_label";
519 w_name = "ping_sort";
520 break;
521 }
522 }
523
524 root = TextWidget.Cast(m_Root.FindAnyWidget(r_name));
525 root.SetColor(ARGBF(1, 1, 0, 0));
526
527 m_Root.FindAnyWidget(w_name).Show(true);
528 m_Root.FindAnyWidget(w_name + "_asc").Show(!m_SortOrder);
529 m_Root.FindAnyWidget(w_name + "_dsc").Show(m_SortOrder);
530#endif
531 }
ESortOrder m_SortOrder
int ARGBF(float fa, float fr, float fg, float fb)
Converts <0.0, 1.0> ARGB into color.
Definition proto.c:332

References ARGBF(), m_Root, and m_SortOrder.

Referenced by ScriptedWidgetEventHandler::OnSortChanged().

◆ ShowHideConsoleWidgets() [1/2]

void ServerBrowserTab::ShowHideConsoleWidgets ( )
inlineprotected

Definition at line 48 of file ServerBrowserTabConsole.c.

49 {
50#ifdef PLATFORM_PS4
51 bool is_xbox = false;
52#else
53 bool is_xbox = true;
54#endif
55
56 m_Root.FindAnyWidget("filters_root_nav_img_lb_xbox").Show(is_xbox);
57 m_Root.FindAnyWidget("filters_root_nav_img_rb_xbox").Show(is_xbox);
58 m_Root.FindAnyWidget("server_list_root_nav_img_lb_xbox").Show(is_xbox);
59 m_Root.FindAnyWidget("server_list_root_nav_img_rb_xbox").Show(is_xbox);
60
61 m_Root.FindAnyWidget("filters_root_nav_img_l1_ps4").Show(!is_xbox);
62 m_Root.FindAnyWidget("filters_root_nav_img_r1_ps4").Show(!is_xbox);
63 m_Root.FindAnyWidget("server_list_root_nav_img_l1_ps4").Show(!is_xbox);
64 m_Root.FindAnyWidget("server_list_root_nav_img_r1_ps4").Show(!is_xbox);
65 }

References m_Root.

◆ ShowHideConsoleWidgets() [2/2]

void ServerBrowserTab::ShowHideConsoleWidgets ( )
inlineprotected

Definition at line 96 of file ServerBrowserTabConsolePages.c.

97 {
98 bool is_xbox = true;
99
100#ifdef PLATFORM_PS4
101 is_xbox = false;
102#endif
103
104 m_Root.FindAnyWidget("filters_button_wrapper").Show(GetGame().GetInput().IsEnabledMouseAndKeyboard());
105
106 m_Root.FindAnyWidget("filters_root_nav_img_lb_xbox").Show(is_xbox);
107 m_Root.FindAnyWidget("filters_root_nav_img_rb_xbox").Show(is_xbox);
108 m_Root.FindAnyWidget("server_list_root_nav_img_lb_xbox").Show(is_xbox);
109 m_Root.FindAnyWidget("server_list_root_nav_img_rb_xbox").Show(is_xbox);
110
111 m_Root.FindAnyWidget("filters_root_nav_img_l1_ps4").Show(!is_xbox);
112 m_Root.FindAnyWidget("filters_root_nav_img_r1_ps4").Show(!is_xbox);
113 m_Root.FindAnyWidget("server_list_root_nav_img_l1_ps4").Show(!is_xbox);
114 m_Root.FindAnyWidget("server_list_root_nav_img_r1_ps4").Show(!is_xbox);
115 }

References GetGame(), GetInput(), and m_Root.

◆ SortedInsert()

int ServerBrowserTab::SortedInsert ( GetServersResultRow entry,
ESortType sort_type )
inlineprotected

Definition at line 610 of file ServerBrowserTabPc.c.

611 {
613 }
int SortedInsertEx(GetServersResultRow entry, ESortType sortType, bool isDescending)

References m_SortInverted.

◆ SortedInsertAsc()

int ServerBrowserTab::SortedInsertAsc ( GetServersResultRow entry,
ESortType sort_type )
inlineprivate

Definition at line 675 of file ServerBrowserTabPc.c.

676 {
678
679 int i;
680 int index_min = 0;
681 int index_max = list.Count() - 1;
682 int target_index = Math.Floor(index_max / 2);
683
684 if (index_max == -1)
685 {
686 list.Insert(entry);
687 return 0;
688 }
689
690 if (sort_type == ESortType.HOST)
691 {
692 string entry_value_str = entry.GetValueStr(ESortType.HOST);
693
694 while (true)
695 {
696 string target_value_str = list[target_index].GetValueStr(ESortType.HOST);
697
699 {
700 for (i = index_min; i <= index_max; i++)
701 {
703 {
704 list.InsertAt(entry, i);
705 return i;
706 }
707 }
708
709 index_max++;
710 list.InsertAt(entry, index_max);
711 return target_index;
712 }
714 {
717 }
719 {
722 }
723 }
724 }
725 else
726 {
727 int entry_value_int = entry.GetValueInt(sort_type);
728
729 while (true)
730 {
731 int target_value_int = list[target_index].GetValueInt(sort_type);
732
734 {
735 for (i = index_min; i <= index_max; i++)
736 {
738 {
739 list.InsertAt(entry, i);
740 return i;
741 }
742 }
743
744 index_max++;
745 list.InsertAt(entry, index_max);
746 return target_index;
747 }
749 {
752 }
754 {
757 }
758 }
759 }
760
761 return target_index;
762 }
int GetValueInt(ESortType sort_type)
string GetValueStr(ESortType sort_type)
Definition EnMath.c:7
static proto float Floor(float f)
Returns floor of value.

References Math::Floor(), GetValueInt(), GetValueStr(), and m_EntriesSorted.

◆ SortedInsertDesc()

int ServerBrowserTab::SortedInsertDesc ( GetServersResultRow entry,
ESortType sort_type )
inlineprivate

Definition at line 765 of file ServerBrowserTabPc.c.

766 {
768
769 int i;
770 int index_min = 0;
771 int index_max = list.Count() - 1;
772 int target_index = Math.Floor(index_max / 2);
773
774 if (index_max == -1)
775 {
776 list.Insert(entry);
777 return 0;
778 }
779
780 if (sort_type == ESortType.HOST)
781 {
782 string entry_value_str = entry.GetValueStr(ESortType.HOST);
783
784 while (true)
785 {
786 string target_value_str = list[target_index].GetValueStr(ESortType.HOST);
787
789 {
790 for (i = index_min; i <= index_max; i++)
791 {
793 {
794 list.InsertAt(entry, i);
795 return i;
796 }
797 }
798
799 index_max++;
800 list.InsertAt(entry, index_max);
801 return target_index;
802 }
804 {
807 }
809 {
812 }
813 }
814 }
815 else
816 {
817 int entry_value_int = entry.GetValueInt(sort_type);
818
819 while (true)
820 {
821 int target_value_int = list[target_index].GetValueInt(sort_type);
822
824 {
825 for (i = index_min; i <= index_max; i++)
826 {
828 {
829 list.InsertAt(entry, i);
830 return i;
831 }
832 }
833
834 index_max++;
835 list.InsertAt(entry, index_max);
836 return target_index;
837 }
839 {
842 }
844 {
847 }
848 }
849 }
850
851 return target_index;
852 }

References Math::Floor(), GetValueInt(), GetValueStr(), and m_EntriesSorted.

◆ SortedInsertEx()

int ServerBrowserTab::SortedInsertEx ( GetServersResultRow entry,
ESortType sortType,
bool isDescending )
inlineprivate

Definition at line 615 of file ServerBrowserTabPc.c.

616 {
618 int indexMax = list.Count() - 1;
619 int indexMin = 0;
620 int targetIndex = Math.Floor(indexMax / 2);
621 int comparisonMultiplier = 1;
622
623 // if order is descending, then invert comparison results
624 if (isDescending == true)
626
627 if (indexMax == -1)
628 {
629 list.Insert(entry);
630 return 0;
631 }
632
633 while (true)
634 {
636
637 if ((indexMax - indexMin) <= 1)
638 {
639 for (int i = indexMin; i <= indexMax; i++)
640 {
641 comparisonResult = comparisonMultiplier * entry.CompareTo(list[i], sortType);
642
643 if (comparisonResult > 0)
644 {
645 list.InsertAt(entry, i);
646 return i;
647 }
648 }
649
650 // adding entry AFTER indexMax
651 targetIndex = Math.Min(indexMax + 1, list.Count());
652 list.InsertAt(entry, targetIndex);
653 return targetIndex;
654 }
655
656 if (comparisonResult == 0)
657 {
658 list.InsertAt(entry, targetIndex);
659 return targetIndex;
660 }
661
662 if (comparisonResult > 0)
664
665 else if (comparisonResult < 0)
667
669 }
670
671 return 0;
672 }
static proto float Min(float x, float y)
Returns smaller of two given values.

References Math::Floor(), m_EntriesSorted, and Math::Min().

◆ ToggleSort()

void ServerBrowserTab::ToggleSort ( ESortType type)
inlineprotected

Definition at line 433 of file ServerBrowserTabPc.c.

434 {
435 ESortOrder order = ESortOrder.ASCENDING;
436
437 if (m_SortType != type)
438 {
439 if (m_SortInverted[type] == true)
440 m_EntriesSorted[type].Invert();
441
442 m_SortInverted[type] = false;
443 }
444 else
445 {
446 if (m_SortOrder == ESortOrder.ASCENDING)
447 {
448 m_EntriesSorted[type].Invert();
449 m_SortInverted[type] = true;
450 order = ESortOrder.DESCENDING;
451 }
452 else
453 {
454 m_EntriesSorted[type].Invert();
455 m_SortInverted[type] = false;
456 }
457 }
458
459 SetSort(type, order);
460 }

References m_EntriesSorted, m_SortInverted, m_SortOrder, m_SortType, and SetSort().

◆ UpdatePageButtons() [1/2]

void ServerBrowserTab::UpdatePageButtons ( )
inlineprotected

Definition at line 487 of file ServerBrowserTabConsolePages.c.

488 {
489 TextWidget wgt_page_stat = TextWidget.Cast(m_Root.FindAnyWidget("servers_navigation_page_status"));
490
491 wgt_page_stat.SetText(GetCurrentPage().ToString() + " / " + m_PagesCount.ToString());
492
494 {
495 bool can_left = (GetCurrentPage() > 1);
498
502 }
503 else
504 {
505 m_ButtonPageLeftImg.Show(false);
506 m_BtnPagePrev.Show(false);
507 m_ButtonPageRightImg.Show(false);
508 m_BtnPageNext.Show(false);
509 }
510 }
proto string ToString()

References GetCurrentPage(), m_BtnPageNext, m_BtnPagePrev, m_Root, and ToString().

◆ UpdatePageButtons() [2/2]

void ServerBrowserTab::UpdatePageButtons ( )
inlineprivate

Definition at line 854 of file ServerBrowserTabPc.c.

855 {
857 if (m_PagesCount > 1)
858 {
859 m_PnlPagesPanel.Show(true);
860
861 int i;
863 m_PageStartNum = 1;
865
867 {
869
870 // Pages are less like buttons - changing selected button
871 for (i = 1; i <= m_BtnPages.Count(); ++i)
872 {
874
875 int page_index = (i - 1);
877 m_BtnPages[page_index].SetText(i.ToString());
878
879 if (m_PageIndex == page_index)
880 m_BtnPages[page_index].SetState(true);
881 else
882 m_BtnPages[page_index].SetState(false);
883 }
884 }
885 else
886 {
887 // Pages are more like buttons
889 {
890 //Left side (start of pages)
891 //m_PageStartNum = 1;
892 //m_PageEndNum = PAGES_BUTTONS_COUNT;
893 }
894 else
895 {
898
900 {
901 // Right side (end of pages)
904 }
905 }
906
907
908 // Button Selection
911 {
913 {
914 //Right
916 }
917 else
918 {
919 //Center
921 }
922 }
923
924
925 for (i = 0; i < m_BtnPages.Count(); ++i)
926 {
927 m_BtnPages[i].SetText((m_PageStartNum + i).ToString());
928 m_BtnPages[i].SetState((i == selected_btn_index));
929 }
930 }
931
932 // Button GoTo Prev Page
933 if (m_PageIndex > 0)
934 {
935 m_BtnPagePrev.SetText("<");
936 m_BtnPagePrev.Enable(true);
937 }
938 else
939 {
940 m_BtnPagePrev.SetText("");
941 m_BtnPagePrev.Enable(false);
942 }
943
944 // Button GoTo Next Page
945 if (m_PageIndex < (m_PagesCount - 1))
946 {
947 m_BtnPageNext.SetText(">");
948 m_BtnPageNext.Enable(true);
949 }
950 else
951 {
952 m_BtnPageNext.SetText("");
953 m_BtnPageNext.Enable(false);
954 }
955
956 // Button GoTo First Page
957 if (m_PageStartNum == 1)
958 {
959 m_BtnPagesFirst.SetText("");
960 m_BtnPagesFirst.Enable(false);
961 }
962 else
963 {
964 m_BtnPagesFirst.SetText("<<");
965 m_BtnPagesFirst.Enable(true);
966 }
967
968 // Button GoTo Last Page
970 {
971 m_BtnPagesLast.SetText("");
972 m_BtnPagesLast.Enable(false);
973 }
974 else
975 {
976 m_BtnPagesLast.SetText(">>");
977 m_BtnPagesLast.Enable(true);
978 }
979 }
980 else
981 m_PnlPagesPanel.Show(false);
982 }
static proto float Round(float f)
Returns mathematical round of value.
static proto float Ceil(float f)
Returns ceil of value.

References Math::Ceil(), m_BtnPageNext, m_BtnPagePrev, m_PageIndex, m_TotalLoadedServers, and Math::Round().

◆ UpdateServerList()

void ServerBrowserTab::UpdateServerList ( )
inlineprivate

Definition at line 984 of file ServerBrowserTabPc.c.

985 {
986 int lastFilledIndexOnPage = 0;
988 ServerBrowserEntry entry;
989
990 m_EntryWidgets.Clear();
991
992 for (int i = 0; i < SERVERS_VISIBLE_COUNT; ++i)
993 {
995
997 {
999
1000 if (server_info.m_Favorite)
1001 m_OnlineFavServers.Insert(server_info.m_Id);
1002
1003 entry = GetServerEntryByIndex(i, server_info.m_Id);
1004 entry.Show(true);
1005 entry.SetIsOnline(true);
1006 entry.FillInfo(server_info);
1007 entry.SetMods(m_EntryMods.Get(server_info.m_Id));
1008 entry.UpdateEntry();
1009
1010 if (GetRootMenu() && GetRootMenu().GetServersLoadingTab() != TabType.NONE)
1011 entry.SetName("#dayz_game_loading");
1012
1014 }
1015 else
1016 {
1017 entry = GetServerEntryByIndex(i, "-1");
1018
1019 if (entry)
1020 entry.Show(false);
1021 }
1022 }
1024
1025 m_ServerList.Update();
1026 }
ServerBrowserMenuNew GetRootMenu()

References Count, GetRootMenu(), ServerBrowserTabPc::LoadExtraEntries(), m_EntriesSorted, m_EntryMods, m_EntryWidgets, m_OnlineFavServers, m_PageIndex, m_ServerList, m_SortType, and m_TotalLoadedServers.

◆ UpdateStatusBar()

void ServerBrowserTab::UpdateStatusBar ( )
inlineprivate

Definition at line 1028 of file ServerBrowserTabPc.c.

1029 {
1030 string serversFound = string.Format("#servers_found: %1", m_TotalLoadedServers);
1032 m_LoadingText.SetText(serversFound);
1033 else
1034 m_LoadingText.SetText(string.Format("#dayz_game_loading %1", serversFound));
1035 }

References m_LoadingFinished, m_LoadingText, and m_TotalLoadedServers.

Member Data Documentation

◆ m_BtnPages

ref array<ButtonWidget> ServerBrowserTab::m_BtnPages
protected

Definition at line 23 of file ServerBrowserTabPc.c.

◆ m_BtnPagesFirst

ButtonWidget ServerBrowserTab::m_BtnPagesFirst
protected

Definition at line 15 of file ServerBrowserTabPc.c.

◆ m_BtnPagesLast

ButtonWidget ServerBrowserTab::m_BtnPagesLast
protected

Definition at line 16 of file ServerBrowserTabPc.c.

◆ m_ButtonPageLeftImg

Widget ServerBrowserTab::m_ButtonPageLeftImg
protected

Definition at line 10 of file ServerBrowserTabConsolePages.c.

◆ m_ButtonPageRightImg

Widget ServerBrowserTab::m_ButtonPageRightImg
protected

Definition at line 11 of file ServerBrowserTabConsolePages.c.

◆ m_FilterPanelAccTime

Widget ServerBrowserTab::m_FilterPanelAccTime
protected

Definition at line 21 of file ServerBrowserTabPc.c.

◆ m_FilterPanelPing

Widget ServerBrowserTab::m_FilterPanelPing
protected

Definition at line 20 of file ServerBrowserTabPc.c.

◆ m_FilterSearchIP

Widget ServerBrowserTab::m_FilterSearchIP
protected

Definition at line 18 of file ServerBrowserTabPc.c.

◆ m_FilterSearchIPBox

Widget ServerBrowserTab::m_FilterSearchIPBox
protected

Definition at line 19 of file ServerBrowserTabPc.c.

◆ m_IsFilterChanged

bool ServerBrowserTab::m_IsFilterChanged
private

Definition at line 3 of file ServerBrowserTabConsole.c.

◆ m_IsFilterFocused

bool ServerBrowserTab::m_IsFilterFocused
private

Definition at line 4 of file ServerBrowserTabConsole.c.

◆ m_PageEndNum

int ServerBrowserTab::m_PageEndNum
protected

Definition at line 16 of file ServerBrowserTabConsolePages.c.

◆ m_PageIndex

int ServerBrowserTab::m_PageIndex
protected

Definition at line 7 of file ServerBrowserTabPc.c.

◆ m_PagesCount

int ServerBrowserTab::m_PagesCount
protected

Definition at line 17 of file ServerBrowserTabConsolePages.c.

◆ m_PageStartNum

int ServerBrowserTab::m_PageStartNum
protected

Definition at line 15 of file ServerBrowserTabConsolePages.c.

◆ m_PnlPagesLoadingText

TextWidget ServerBrowserTab::m_PnlPagesLoadingText
protected

Definition at line 23 of file ServerBrowserTabConsolePages.c.

◆ m_PnlPagesPanel

Widget ServerBrowserTab::m_PnlPagesPanel
protected

Definition at line 22 of file ServerBrowserTabConsolePages.c.

◆ m_PreviousPage

int ServerBrowserTab::m_PreviousPage
protected

Definition at line 13 of file ServerBrowserTabConsolePages.c.

◆ m_ServerListEntiers

ref array<ref ServerBrowserEntry> ServerBrowserTab::m_ServerListEntiers
protected

Definition at line 24 of file ServerBrowserTabConsolePages.c.

◆ m_ServerListEntries

ref array<ref ServerBrowserEntry> ServerBrowserTab::m_ServerListEntries
protected

Definition at line 24 of file ServerBrowserTabPc.c.

◆ m_ServersEstimateCount

int ServerBrowserTab::m_ServersEstimateCount
protected

Definition at line 18 of file ServerBrowserTabConsolePages.c.

◆ m_TempTime

ref TStringArray ServerBrowserTab::m_TempTime = new TStringArray
protected

Definition at line 26 of file ServerBrowserTabPc.c.

◆ m_TimeLastServerRefresh

int ServerBrowserTab::m_TimeLastServerRefresh
protected

Definition at line 19 of file ServerBrowserTabConsolePages.c.

◆ m_TimeLastServerRefreshHoldButton

int ServerBrowserTab::m_TimeLastServerRefreshHoldButton
protected

Definition at line 20 of file ServerBrowserTabConsolePages.c.

◆ m_TotalServersCount

int ServerBrowserTab::m_TotalServersCount
protected

Definition at line 14 of file ServerBrowserTabConsolePages.c.

◆ m_WidgetNavFilters

Widget ServerBrowserTab::m_WidgetNavFilters
private

Definition at line 6 of file ServerBrowserTabConsole.c.

◆ m_WidgetNavServers

Widget ServerBrowserTab::m_WidgetNavServers
private

Definition at line 7 of file ServerBrowserTabConsole.c.

◆ PAGES_BUTTONS_COUNT

const int ServerBrowserTab::PAGES_BUTTONS_COUNT = 10
protected

Definition at line 4 of file ServerBrowserTabPc.c.

◆ SERVERS_VISIBLE_COUNT

const int ServerBrowserTab::SERVERS_VISIBLE_COUNT = 24
protected

Definition at line 3 of file ServerBrowserTabPc.c.


The documentation for this class was generated from the following files: