#include <gServerFavorites.h>
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 |
Definition at line 49 of file gServerFavorites.h.
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 }
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().
00455 { 00456 sg_languageIDPrefix = "$bookmarks_"; 00457 sg_FavoritesMenu( &sg_ConnectFavorite, sg_favoriteHolder, gServerBrowser::lowPort ); 00458 }
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 }
bool gServerFavorites::AddFavorite | ( | nServerInfoBase const * | server | ) | [static] |
add a server to the list of favorites
server | the server to add to the favorites |
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 }
bool gServerFavorites::IsFavorite | ( | nServerInfoBase const * | server | ) | [static] |
test whether a server is bookmarked
server | server to check whether it is bookmarked |
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 }