28 protected ref ServerBrowserFilterContainer
m_Filters;
30 protected ServerBrowserMenuNew
m_Menu;
73 Construct(parent, menu, type);
78 protected void Construct(
Widget parent, ServerBrowserMenuNew menu,
TabType type )
94 if (
GetGame().GetContentDLCService())
108 override bool OnClick(
Widget w,
int x,
int y,
int button )
120 foreach (ServerBrowserEntry entry : serverEntries)
122 entry.RefreshDLCIcon();
140 Widget root = entry.GetRoot();
141 Widget first_child = root.GetParent().GetChildren();
142 Widget last_child = first_child;
145 if ( last_child.GetSibling() )
146 last_child = last_child.GetSibling();
151 root.GetParent().Update();
157 float bottom_pos =
y + y_s;
159 root.GetScreenPos( x_l, y_l );
160 root.GetScreenSize( x_s, y_s );
162 if ( root == first_child )
166 else if ( root == last_child )
170 else if ( y_l + y_s >= bottom_pos )
193 m_Menu.FilterFocus(
false );
199 m_Menu.FilterFocus(
true );
202 void OnFilterChanged()
214 m_Menu.ServerListFocus( focus, favorite );
219 if ( IsFocusable( w ) )
237 if ( IsFocusable( w ) )
253 override bool OnMouseEnter(
Widget w,
int x,
int y )
255 if ( IsFocusable( w ) )
270 if ( IsFocusable( w ) )
310 void PressSholderLeft();
311 void PressSholderRight();
331 Widget sibling = focused.GetSibling();
335 if ( focused.GetName() ==
"server_browser_list_entry_root" )
340 SetFocus( focused.GetParent().GetSibling().GetChildren() );
347 if ( focused && focused.GetName() ==
"server_browser_list_entry_root" )
349 Widget sibling = focused.GetParent().GetChildren();
350 if ( focused == sibling )
355 if ( sibling && sibling.GetSibling() == focused )
361 sibling = sibling.GetSibling();
404 m_Menu.AddFavoritesToFilter( input );
422 #ifndef PLATFORM_WINDOWS // XBOX OR PS
427 #else // PLATFORM_WINDOWS
429 #ifdef PLATFORM_CONSOLE // PC client with -XBOX flag
469 void SelectServer( ServerBrowserEntry server )
471 #ifdef PLATFORM_CONSOLE
480 m_Menu.SelectServer( server );
501 int max = max_ping.Substring( 1, max_ping.Length() - 1 ).ToInt();
523 if (
m_Filters.m_PreviouslyPlayedFilter.IsSet() )
525 bool is_visited =
g_Game.IsVisited( result.m_HostIp, result.m_HostPort );
527 if ( !is_visited &&
m_Filters.m_PreviouslyPlayedFilter.IsEnabled() )
532 if ( is_visited &&
m_Filters.m_PreviouslyPlayedFilter.IsEnabled() )
573 return "currentNumberPlayers";
587 int AddSorted( GetServersResultRow entry )
594 ServerBrowserEntry entry;
597 entry.SetFavorite(
false );
621 if ( w.IsInherited( ButtonWidget ) )
623 ButtonWidget button = ButtonWidget.Cast( w );
624 button.SetTextColor(
ARGB( 255, 200, 0, 0 ) );
627 w.SetColor(
ARGB( 255, 0, 0, 0) );
632 ImageWidget image = ImageWidget.Cast( w.FindAnyWidget( w.GetName() +
"_image" ) );
633 Widget option =
Widget.Cast( w.FindAnyWidget( w.GetName() +
"_option_wrapper" ) );
634 Widget option_label = w.FindAnyWidget(
"option_label" );
638 text1.SetColor(
ARGB( 255, 255, 0, 0 ) );
643 text2.SetColor(
ARGB( 255, 255, 0, 0 ) );
648 text3.SetColor(
ARGB( 255, 255, 0, 0 ) );
654 image.SetColor(
ARGB( 255, 200, 0, 0 ) );
659 option.SetColor(
ARGB( 255, 255, 0, 0 ) );
664 option_label.SetColor(
ARGB( 255, 255, 0, 0 ) );
675 if ( w.IsInherited( ButtonWidget ) )
677 ButtonWidget button = ButtonWidget.Cast( w );
678 button.SetTextColor(
ARGB( 255, 255, 255, 255 ) );
684 ImageWidget image = ImageWidget.Cast( w.FindAnyWidget( w.GetName() +
"_image" ) );
685 Widget option = w.FindAnyWidget( w.GetName() +
"_option_wrapper" );
686 Widget option_label = w.FindAnyWidget(
"option_label" );
690 text1.SetColor(
ARGB( 255, 255, 255, 255 ) );
695 text2.SetColor(
ARGB( 255, 255, 255, 255 ) );
700 text3.SetColor(
ARGB( 255, 255, 255, 255 ) );
706 image.SetColor(
ARGB( 255, 255, 255, 255 ) );
711 option.SetColor(
ARGB( 150, 255, 255, 255 ) );
716 option_label.SetColor(
ARGB( 255, 255, 255, 255 ) );
722 #ifdef PLATFORM_WINDOWS
728 ButtonWidget button = ButtonWidget.Cast( w );
731 button.SetTextColor(
ColorManager.COLOR_DISABLED_TEXT );