3 protected const int SERVERS_VISIBLE_COUNT = 24;
4 protected const int PAGES_BUTTONS_COUNT = 10;
6 protected int m_TotalServersCount;
8 protected int m_PageStartNum;
9 protected int m_PageEndNum;
10 protected int m_PagesCount;
11 protected int m_ServersEstimateCount;
13 protected Widget m_PnlPagesPanel;
30#ifdef PLATFORM_CONSOLE
31 m_Root =
GetGame().GetWorkspace().CreateWidgets(
"gui/layouts/new_ui/server_browser/xbox/server_browser_tab.layout", parent);
33#ifdef PLATFORM_WINDOWS
34 m_Root =
GetGame().GetWorkspace().CreateWidgets(
"gui/layouts/new_ui/server_browser/pc/server_browser_tab_pages.layout", parent);
70 m_FilterSearchIP =
m_Root.FindAnyWidget(
"search_ip_setting");
71 m_FilterSearchIPBox =
m_Root.FindAnyWidget(
"search_ip_setting_option");
73 m_FilterPanelAccTime =
m_Root.FindAnyWidget(
"accelerated_time_setting");
74 m_FilterPanelPing =
m_Root.FindAnyWidget(
"ping_setting");
84 m_Filters =
new ServerBrowserFilterContainer(
m_Root.FindAnyWidget(
"filters_content"),
this);
97 Error(
"ServerBrowserTabPage->PAGES_BUTTONS_COUNT must be in range 3 - 10!");
114 m_PnlPagesPanel =
m_Root.FindAnyWidget(
"servers_navigation_spacer");
117 m_BtnPagesFirst =
ButtonWidget.Cast(
m_Root.FindAnyWidget(
"servers_navigation_page_first")) ;
118 m_BtnPagesLast =
ButtonWidget.Cast(
m_Root.FindAnyWidget(
"servers_navigation_page_last")) ;
120 m_PnlPagesPanel.Show(
true);
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);
149 m_TotalServersCount = 0;
151 m_ServersEstimateCount = 0;
157 ButtonRefreshToCancel();
189 ButtonCancelToRefresh();
205 m_TotalServersCount++;
208 result.m_SortTime = GetTimeOfDayEnum(
result.m_TimeOfDay);
232 OnLoadServersAsyncPCFinished();
242 LoadingServersStop();
261 LoadingServersStop();
277 else if (
w == m_BtnPagesLast)
282 else if (
w == m_BtnPagesFirst)
289 bool click = OnClickPage(
w);
311 else if (
w == m_FilterSearchIP)
391 SetPageIndex(m_PagesCount - 1);
404 SetPageIndex(m_PagesCount - 1);
414 for (
int i = 0;
i < m_BtnPages.Count(); ++
i)
416 if (m_BtnPages[
i] ==
w)
418 SetPageIndex(m_PageStartNum +
i - 1);
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);
471 m_Root.FindAnyWidget(
"time_sort").Show(
false);
472 m_Root.FindAnyWidget(
"ping_sort").Show(
false);
494 r_name =
"server_list_content_header_host_label";
500 r_name =
"server_list_content_header_time_label";
506 r_name =
"server_list_content_header_population_label";
507 w_name =
"population_sort";
512 r_name =
"server_list_content_header_slots_label";
518 r_name =
"server_list_content_header_ping_label";
541 if (m_TempTime.Count() > 0)
543 int h = m_TempTime[0].ToInt();
553 if (m_TempTime.Count() > 1)
555 int m = m_TempTime[0].ToInt();
598#ifdef PLATFORM_CONSOLE
645 list.InsertAt(entry,
i);
704 list.InsertAt(entry,
i);
739 list.InsertAt(entry,
i);
794 list.InsertAt(entry,
i);
829 list.InsertAt(entry,
i);
857 if (m_PagesCount > 1)
859 m_PnlPagesPanel.Show(
true);
864 m_PageEndNum = PAGES_BUTTONS_COUNT;
866 if (m_PagesCount <= PAGES_BUTTONS_COUNT)
868 m_PageEndNum = m_PagesCount;
871 for (
i = 1;
i <= m_BtnPages.Count(); ++
i)
899 if (m_PageEndNum > m_PagesCount)
902 m_PageStartNum -= m_PageEndNum - m_PagesCount;
903 m_PageEndNum -= m_PageEndNum - m_PagesCount;
912 if (m_PageEndNum == m_PagesCount)
925 for (
i = 0;
i < m_BtnPages.Count(); ++
i)
927 m_BtnPages[
i].SetText((m_PageStartNum +
i).ToString());
957 if (m_PageStartNum == 1)
959 m_BtnPagesFirst.SetText(
"");
960 m_BtnPagesFirst.Enable(
false);
964 m_BtnPagesFirst.SetText(
"<<");
965 m_BtnPagesFirst.Enable(
true);
969 if (m_PageEndNum == m_PagesCount)
971 m_BtnPagesLast.SetText(
"");
972 m_BtnPagesLast.Enable(
false);
976 m_BtnPagesLast.SetText(
">>");
977 m_BtnPagesLast.Enable(
true);
981 m_PnlPagesPanel.Show(
false);
988 ServerBrowserEntry entry;
992 for (
int i = 0;
i < SERVERS_VISIBLE_COUNT; ++
i)
1005 entry.SetIsOnline(
true);
1008 entry.UpdateEntry();
1011 entry.SetName(
"#dayz_game_loading");
1017 entry = GetServerEntryByIndex(
i,
"-1");
1047 ref ServerBrowserEntry entry;
1051 if (
index < m_ServerListEntries.Count())
1052 entry = m_ServerListEntries[
index];
1055 entry =
new ServerBrowserEntry(
null,
index,
this);
1058 m_ServerListEntries.Insert(entry);
1074 if (
super.IsFocusable(
w))
1083 if (
w == m_FilterPanelAccTime || m_FilterPanelPing)
1094 btn.SetText(
"#menu_cancel");
1100 btn.SetText(
"#STR_server_browser_tab_root_filters_root_filters_content_refresh_list_button0");
EBiosError
Possible Error codes for bios API. This is the list of errors that can be returned from bios API....
int GetValueInt(ESortType sort_type)
string GetValueStr(ESortType sort_type)
ref ServerBrowserFilterContainer m_Filters
ref map< ESortType, ref array< ref GetServersResultRow > > m_EntriesSorted
Widget m_FilterSearchText
ServerBrowserEntry m_SelectedServer
void ButtonDisable(Widget w)
ButtonWidget m_BtnPageNext
ref map< ESortType, ESortOrder > m_SortInverted
ref map< string, ref ServerBrowserEntry > m_EntryWidgets
void ScrollToEntry(ServerBrowserEntry entry)
ScrollWidget m_ServerListScroller
bool PassFilter(GetServersResultRow result)
ServerBrowserMenuNew m_Menu
ref map< string, ref array< string > > m_EntryMods
void ColorNormal(Widget w)
ButtonWidget m_BtnPagePrev
void ButtonEnable(Widget w)
SpacerBaseWidget m_ServerList
Widget m_FilterSearchTextBox
bool IsFocusable(Widget w)
void ColorHighlight(Widget w)
ref set< string > m_OnlineFavServers
int AddSorted(GetServersResultRow entry)
ServerBrowserMenuNew GetRootMenu()
GetServersResult the output structure of the GetServers operation.
static ref ScriptInvoker m_ServersAsyncInvoker
int GetTimeOfDayEnum(string time_of_day)
override void OnLoadServersAsyncPC(ref GetServersResult result_list, EBiosError error, string response)
override bool IsFocusable(Widget w)
override void ApplyFilters()
override bool OnClick(Widget w, int x, int y, int button)
void ToggleSort(ESortType type)
override bool OnMouseLeave(Widget w, Widget enterW, int x, int y)
void LoadingServersStop()
override void SetSort(ESortType type, ESortOrder order)
override void SelectServer(ServerBrowserEntry server)
int SortedInsertDesc(GetServersResultRow entry, ESortType sort_type)
void SetPageIndex(int page_index)
override int AddSorted(GetServersResultRow entry)
void ButtonCancelToRefresh()
ref array< ButtonWidget > m_BtnPages
ref array< ref ServerBrowserEntry > m_ServerListEntries
override void ResetFilters()
Widget m_FilterPanelAccTime
int SortedInsertAsc(GetServersResultRow entry, ESortType sort_type)
ButtonWidget m_BtnPagesFirst
override void RefreshList()
Widget m_FilterSearchIPBox
ServerBrowserEntry GetServerEntryByIndex(int index, string server_id)
override void OnFilterChanged()
override bool OnMouseEnter(Widget w, int x, int y)
int SortedInsertEx(GetServersResultRow entry, ESortType sortType, bool isDescending)
int SortedInsert(GetServersResultRow entry, ESortType sort_type)
void ~ServerBrowserTabPc()
override void OnLoadServerModsAsync(string server_id, array< string > mods)
override void Construct(Widget parent, ServerBrowserMenuNew menu, TabType type)
ButtonWidget m_BtnPagesLast
void OnLoadServersAsyncPCFinished()
override bool OnMouseButtonUp(Widget w, int x, int y, int button)
void ButtonRefreshToCancel()
bool OnClickPage(Widget w)
override void RefreshList()
override void LoadExtraEntries(int index)
proto native CGame GetGame()
void Error(string err)
Messagebox with error message.
array< string > TStringArray
static proto float Floor(float f)
Returns floor of value.
static proto float Min(float x, float y)
Returns smaller of two given values.
static proto float Round(float f)
Returns mathematical round of value.
static proto float Ceil(float f)
Returns ceil of value.
int ARGBF(float fa, float fr, float fg, float fb)
Converts <0.0, 1.0> ARGB into color.