gServerFavorites Class Reference

#include <gServerFavorites.h>

List of all members.

Static Public Member Functions

static void AlternativesMenu ()
 open the alternative masters
static void FavoritesMenu ()
 open the favorites menu
static void CustomConnectMenu ()
 open the single custom connect menu
static bool AddFavorite (nServerInfoBase const *server)
 add a server to the list of favorites
static bool IsFavorite (nServerInfoBase const *server)
 test whether a server is bookmarked


Detailed Description

Definition at line 49 of file gServerFavorites.h.


Member Function Documentation

void gServerFavorites::AlternativesMenu ( void   )  [static]

open the alternative masters

Definition at line 469 of file gServerFavorites.cpp.

References gServerFavoritesHolder::AddFavorite(), tDirectories::Config(), nServerInfo::DeleteAll(), nServerInfo::GetFirstServer(), gServerFavoritesHolder::IsFavorite(), nServerInfo::Load(), gServerBrowser::lowPort, tListItem< T >::Next(), sg_AlternativeMaster(), sg_FavoritesMenu(), sg_languageIDPrefix, and sg_masterHolder.

Referenced by net_game().

00470 {
00471     // load default subcultures
00472     nServerInfo::DeleteAll();
00473     nServerInfo::Load( tDirectories::Config(), "subcultures.srv" );
00474 
00475     // add them
00476     nServerInfo * run = nServerInfo::GetFirstServer();
00477     while( run )
00478     {
00479         if ( !sg_masterHolder.IsFavorite( run ) )
00480         {
00481             sg_masterHolder.AddFavorite( run );
00482         }
00483 
00484         run = run->Next();
00485     }
00486 
00487     nServerInfo::DeleteAll();
00488 
00489     sg_languageIDPrefix = "$masters_";
00490     sg_FavoritesMenu( &sg_AlternativeMaster, sg_masterHolder, gServerBrowser::lowPort - 10 );
00491 }

Here is the call graph for this function:

Here is the caller graph for this function:

void gServerFavorites::FavoritesMenu ( void   )  [static]

open the favorites menu

Definition at line 454 of file gServerFavorites.cpp.

References gServerBrowser::lowPort, sg_ConnectFavorite(), sg_favoriteHolder, sg_FavoritesMenu(), and sg_languageIDPrefix.

Referenced by net_game().

Here is the call graph for this function:

Here is the caller graph for this function:

void gServerFavorites::CustomConnectMenu ( void   )  [static]

open the single custom connect menu

Definition at line 502 of file gServerFavorites.cpp.

References uMenu::Enter(), gServerFavoritesHolder::GetFavorite(), sg_favoriteHolder, and sg_TransferCustomServer().

Referenced by net_game().

00503 {
00504     sg_TransferCustomServer();
00505 
00506     uMenu net_menu("$network_custjoin_text");
00507     sg_connectionMenu = & net_menu;
00508 
00509     gServerFavorite & fav = sg_favoriteHolder.GetFavorite(-1);
00510 
00511     // create menu entries
00512     gCustomConnectEntries submenu( fav, &net_menu );
00513 
00514     net_menu.Enter();
00515 }

Here is the call graph for this function:

Here is the caller graph for this function:

bool gServerFavorites::AddFavorite ( nServerInfoBase const *  server  )  [static]

add a server to the list of favorites

Parameters:
server the server to add to the favorites
Returns:
true if successful, false if favorite list is full

Definition at line 528 of file gServerFavorites.cpp.

References gServerFavoritesHolder::AddFavorite(), and sg_favoriteHolder.

Referenced by gServerMenuItem::Event(), and sg_TransferCustomServer().

00529 {
00530     return sg_favoriteHolder.AddFavorite( server );
00531 }

Here is the call graph for this function:

Here is the caller graph for this function:

bool gServerFavorites::IsFavorite ( nServerInfoBase const *  server  )  [static]

test whether a server is bookmarked

Parameters:
server server to check whether it is bookmarked
Returns:
true if the server is in the list of favorites

Definition at line 544 of file gServerFavorites.cpp.

References gServerFavoritesHolder::IsFavorite(), and sg_favoriteHolder.

Referenced by gServerMenuItem::SetServer().

00545 {
00546     return sg_favoriteHolder.IsFavorite( server );
00547 }

Here is the call graph for this function:

Here is the caller graph for this function:


The documentation for this class was generated from the following files:
Generated on Sat Mar 15 23:45:11 2008 for Armagetron Advanced by  doxygen 1.5.4