3 private bool m_IsFilterChanged;
4 private bool m_IsFilterFocused;
5 protected bool m_MouseKeyboardControlled
8 private Widget m_WidgetNavServers;
56 m_WidgetNavFilters =
m_Root.FindAnyWidget(
"filters_root_nav_wrapper" );
57 m_WidgetNavServers =
m_Root.FindAnyWidget(
"server_list_root_nav_wrapper" );
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 );
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 );
74 ShowHideConsoleWidgets();
76 m_Filters =
new ServerBrowserFilterContainer(
m_Root.FindAnyWidget(
"filters_content" ),
this );
78 m_PnlPagesPanel =
m_Root.FindAnyWidget(
"servers_navigation_spacer" );
81 m_PnlPagesPanel.Show(
true );
104 m_Root.FindAnyWidget(
"filters_button_wrapper" ).Show(
GetGame().
GetInput().IsEnabledMouseAndKeyboard() );
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 );
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 );
119 switch (pInputDeviceType)
122 ShowHideConsoleWidgets();
124 m_WidgetNavFilters.Show(m_IsFilterFocused);
125 m_WidgetNavServers.Show(!m_IsFilterFocused);
126 m_MouseKeyboardControlled =
false;
132 m_WidgetNavFilters.Show(
false);
133 m_WidgetNavServers.Show(
false);
134 m_ButtonPageLeftImg.Show(
false);
135 m_ButtonPageRightImg.Show(
false);
136 m_MouseKeyboardControlled =
true;
153 m_PagesCount = result_list.
m_Pages;
172 msg =
"#server_browser_tab_unable_to_get_server";
183 ServerBrowserEntry entry;
197 if ( m_PagesCount && page_entries )
199 foreach ( GetServersResultRow result : page_entries )
203 string ipPort = result.GetIpPort();
204 bool isFavorited =
m_Menu.IsFavorited(ipPort);
206 entry = GetServerEntryByIndex( index );
207 entry.FillInfo( result );
208 entry.SetFavorite(isFavorited);
209 entry.SetIsOnline(
true);
237 ServerBrowserEntry entry;
241 if ( index < m_ServerListEntiers.Count() )
243 entry = m_ServerListEntiers[index];
247 entry =
new ServerBrowserEntry(
m_ServerList, index,
this );
248 m_ServerListEntiers.Insert(entry);
263 m_IsFilterChanged =
true;
273 for (
int i = 0; i < m_ServerListEntiers.Count(); i++ )
275 m_ServerListEntiers[i].Show(
false);
288 m_IsFilterChanged =
false;
300 super.ResetFilters();
302 m_IsFilterChanged =
false;
307 if ( m_IsFilterChanged )
312 m_IsFilterChanged =
false;
328 if ( m_IsFilterChanged)
342 case SelectedPanel.BROWSER:
350 case SelectedPanel.FILTERS:
363 if ( !m_IsFilterFocused )
366 m_PreviousPage = curr_page;
377 if ( !m_IsFilterFocused )
379 if ( (
GetGame().
GetTime() - m_TimeLastServerRefreshHoldButton) > 100 )
397 if ( !m_IsFilterFocused )
400 m_PreviousPage = curr_page;
401 if ( curr_page < m_PagesCount )
411 if ( !m_IsFilterFocused )
413 if ( (
GetGame().
GetTime() - m_TimeLastServerRefreshHoldButton) > 100 )
431 if ( m_IsFilterFocused )
443 if ( m_IsFilterFocused )
461 if ( entries && entries.Count() > 0 )
470 SetEnableFilters(
true);
471 SetEnableServers(
false);
474 if (!m_MouseKeyboardControlled)
476 m_WidgetNavFilters.Show(
true);
477 m_WidgetNavServers.Show(
false);
481 m_IsFilterFocused =
true;
488 SetEnableServers(
true);
489 SetEnableFilters(
false);
491 if (!m_MouseKeyboardControlled)
493 m_WidgetNavFilters.Show(
false);
494 m_WidgetNavServers.Show(
true);
498 if ( entries && entries.Count() > 0 )
507 m_IsFilterFocused =
false;
516 Widget w_filters =
m_Root.FindAnyWidget(
"filters_content");
517 Widget w_content =
m_Root.FindAnyWidget(
"server_list_scroller");
518 w_content.Enable( !enable );
522 SetFocus( ButtonWidget.Cast(w_filters.FindWidget(
"sort_button")) );
528 Widget w_filters =
m_Root.FindAnyWidget(
"filters_content");
529 Widget w_content =
m_Root.FindAnyWidget(
"server_list_scroller");
530 w_content.Enable( enable );
539 if ( !m_IsFilterFocused && (m_PagesCount > 1) && !m_MouseKeyboardControlled )
542 m_ButtonPageLeftImg.Show( can_left );
546 m_ButtonPageRightImg.Show( can_right );
551 m_ButtonPageLeftImg.Show(
false );
553 m_ButtonPageRightImg.Show(
false );
560 super.OnClick( w,
x,
y, button );
608 w.SetColor(
ARGB( 255, 200, 0, 0) );
623 if ( w.IsInherited( ButtonWidget ) )
625 ButtonWidget button = ButtonWidget.Cast( w );
626 button.SetTextColor(
ARGB( 255, 255, 255, 255 ) );
628 else if ( !w.IsInherited( EditBoxWidget ) )
630 w.SetColor(
ARGB( 0, 255, 255, 255 ) );
636 ImageWidget image = ImageWidget.Cast( w.FindAnyWidget( w.GetName() +
"_image" ) );
638 Widget option =
Widget.Cast( w.FindAnyWidget( w.GetName() +
"_option_wrapper" ) );
642 text1.SetColor(
ARGB( 255, 255, 255, 255 ) );
647 text2.SetColor(
ARGB( 255, 255, 255, 255 ) );
652 text3.SetColor(
ARGB( 255, 255, 255, 255 ) );
658 image.SetColor(
ARGB( 255, 255, 255, 255 ) );
663 option.SetColor(
ARGB( 150, 255, 255, 255 ) );
669 #ifdef PLATFORM_WINDOWS
673 ButtonWidget button = ButtonWidget.Cast( w );
protected void OnInputDeviceChanged(EInputDeviceType pInputDeviceType)
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...
protected Widget m_SlotsSort
protected Widget m_PopulationSort
protected ref ServerBrowserFilterContainer m_Filters
protected ServerBrowserMenuNew m_Menu
protected Widget m_ResetFilters
protected int m_CurrentPageNum
protected TextWidget m_LoadingText
protected ref map< ESortType, ref array< ref GetServersResultRow > > m_EntriesSorted
void ScrollToEntry(ServerBrowserEntry entry)
protected string m_CurrentSelectedServer
protected ref map< string, ref ServerBrowserEntry > m_EntryWidgets
protected TabType m_TabType
protected Widget m_ApplyFilter
protected ref GetServersInput m_CurrentFilterInput
protected Widget m_RefreshList
protected Widget m_TimeSort
protected bool m_LoadingFinished
protected Widget m_HostSort
protected ESortType m_SortType
protected int m_TotalLoadedServers
protected Widget m_FilterSearchText
protected SpacerBaseWidget m_ServerList
protected SelectedPanel m_SelectedPanel
protected Widget m_FiltersChanged
protected ServerBrowserEntry m_SelectedServer
protected ButtonWidget m_BtnPagePrev
protected Widget m_FilterSearchTextBox
protected ButtonWidget m_BtnPageNext
protected ScrollWidget m_ServerListScroller
void SetCurrentPage(int page_num)
protected ref set< string > m_OnlineFavServers
protected Widget m_PingSort
proto native Mission GetMission()
proto native WorkspaceWidget GetWorkspace()
proto int GetTime()
returns mission time in milliseconds
static int COLOR_DISABLED_TEXT
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.
GetServersResult the output structure of the GetServers operation.
ref GetServersResultRowArray m_Results
ScriptInvoker GetOnInputDeviceChanged()
proto bool Insert(func fn, int flags=EScriptInvokerInsertFlags.IMMEDIATE)
insert method to list
override void SetFocusFilters()
override void RefreshList()
protected override void LoadEntries(int cur_page_index, GetServersResultRowArray page_entries)
override void OnLoadServersAsyncFinished()
override bool PassFilter(GetServersResultRow result)
protected override void LoadExtraEntries(int index)
protected void LoadEntries(int cur_page_index, GetServersResultRowArray page_entries)
protected TextWidget m_PnlPagesLoadingText
protected void OnInputDeviceChanged(EInputDeviceType pInputDeviceType)
protected ServerBrowserEntry GetServerEntryByIndex(int index)
protected int m_PageEndNum
override void ColorDisable(Widget w)
void SetEnableServers(bool enable)
void OnLoadServersAsyncFinished()
protected ref array< ref ServerBrowserEntry > m_ServerListEntiers
protected Widget m_PnlPagesPanel
override void OnFilterChanged()
override void RefreshList()
protected int m_ServersEstimateCount
protected bool m_MouseKeyboardControlled private Widget m_WidgetNavFilters
void ShowHideConsoleWidgets()
protected Widget m_ButtonPageRightImg
bool CanRefreshServerList()
override void PressSholderLeft()
protected int m_PageStartNum
void SetEnableFilters(bool enable)
override void PressSholderRight()
protected int m_PreviousPage
override void ColorNormal(Widget w)
override void ApplyFilters()
protected int m_PagesCount
protected int m_TotalServersCount
protected override void Construct(Widget parent, ServerBrowserMenuNew menu, TabType type)
protected int m_TimeLastServerRefreshHoldButton
override void RightRelease()
protected Widget m_ButtonPageLeftImg
override void LeftRelease()
override void RightHold()
protected int m_TimeLastServerRefresh
override bool OnClick(Widget w, int x, int y, int button)
override void ResetFilters()
override void ColorHighlight(Widget w)
override void OnLoadServersAsyncConsole(GetServersResult result_list, EBiosError error, string response)
Result for an object found in CGame.IsBoxCollidingGeometryProxy.
proto native CGame GetGame()
static proto string ToString(void var, bool type=false, bool name=false, bool quotes=true)
Return string representation of variable.
int ARGB(int a, int r, int g, int b)