3 private bool m_IsFilterChanged;
4 private bool m_IsFilterFocused;
6 private Widget m_WidgetNavFilters;
7 private Widget m_WidgetNavServers;
11 m_Root =
GetGame().GetWorkspace().CreateWidgets(
"gui/layouts/new_ui/server_browser/xbox/server_browser_tab.layout", parent );
35 m_WidgetNavFilters =
m_Root.FindAnyWidget(
"filters_root_nav_wrapper" );
36 m_WidgetNavServers =
m_Root.FindAnyWidget(
"server_list_root_nav_wrapper" );
38 ShowHideConsoleWidgets();
40 m_Filters =
new ServerBrowserFilterContainer(
m_Root.FindAnyWidget(
"filters_content" ),
this );
48 void ShowHideConsoleWidgets()
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 );
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 );
79 if ( result_list.m_Page == 1 )
84 if (
m_Menu.GetServersLoadingTab() !=
m_TabType || !result_list || ( !result_list.m_Results || result_list.m_Results.Count() == 0 ) )
87 m_LoadingText.SetText(
"#server_browser_tab_unable_to_get_server #server_browser_tab_no_servers_with_filter");
96 LoadEntries( result_list.m_Page, result_list.m_Results );
105 if ( result_list.m_Page == result_list.m_Pages )
107 OnLoadServersAsyncFinished();
111 void OnLoadServersAsyncFinished()
116 msg =
"#server_browser_tab_unable_to_get_server";
133 foreach ( GetServersResultRow result : page_entries )
139 ServerBrowserEntry entry =
new ServerBrowserEntry(
m_ServerList, index,
this );
140 string ipPort = result.GetIpPort();
141 entry.FillInfo( result );
142 entry.SetFavorite(
m_Menu.IsFavorited(ipPort));
197 super.OnFilterFocus( w );
204 m_IsFilterChanged =
true;
228 super.ResetFilters();
230 m_IsFilterChanged =
false;
235 m_IsFilterChanged =
false;
242 super.OnFilterFocusLost( w );
266 case SelectedPanel.BROWSER:
274 case SelectedPanel.FILTERS:
285 if ( m_IsFilterFocused )
297 if ( m_IsFilterFocused )
307 void SetFocusFilters()
309 SetEnableFilters(
true );
310 SetEnableServers(
false );
314 m_WidgetNavServers.Show(
false );
317 m_IsFilterFocused =
true;
320 override void Focus()
330 void SetFocusServers()
332 SetEnableServers(
true );
333 SetEnableFilters(
false );
335 m_WidgetNavFilters.Show(
false );
336 m_WidgetNavServers.Show(
true );
339 if ( entries.Count() > 0 )
342 m_IsFilterFocused =
false;
350 void SetEnableFilters(
bool enable)
352 Widget w_filters =
m_Root.FindAnyWidget(
"filters_content");
353 Widget w_content =
m_Root.FindAnyWidget(
"server_list_scroller");
354 w_filters.Enable( enable );
355 w_content.Enable( !enable );
358 void SetEnableServers(
bool enable)
360 Widget w_filters =
m_Root.FindAnyWidget(
"filters_content");
361 Widget w_content =
m_Root.FindAnyWidget(
"server_list_scroller");
362 w_filters.Enable( !enable );
363 w_content.Enable( enable );
374 w.SetColor(
ARGB( 255, 200, 0, 0) );
389 if ( w.IsInherited( ButtonWidget ) )
391 ButtonWidget button = ButtonWidget.Cast( w );
392 button.SetTextColor(
ARGB( 255, 255, 255, 255 ) );
398 ImageWidget image = ImageWidget.Cast( w.FindAnyWidget( w.GetName() +
"_image" ) );
400 Widget option =
Widget.Cast( w.FindAnyWidget( w.GetName() +
"_option_wrapper" ) );
404 text1.SetColor(
ARGB( 255, 255, 255, 255 ) );
409 text2.SetColor(
ARGB( 255, 255, 255, 255 ) );
414 text3.SetColor(
ARGB( 255, 255, 255, 255 ) );
420 image.SetColor(
ARGB( 255, 255, 255, 255 ) );
425 option.SetColor(
ARGB( 150, 255, 255, 255 ) );
431 #ifdef PLATFORM_WINDOWS
435 ButtonWidget button = ButtonWidget.Cast( w );
438 button.SetTextColor(
ColorManager.COLOR_DISABLED_TEXT );