From: Samual Lenks Date: Sat, 12 Oct 2013 23:15:26 +0000 (-0400) Subject: Properly handle the cvars for serverlist categories now X-Git-Tag: xonotic-v0.8.0~256^2~9 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=73bd0b89a16b515778ccb1910bd3b94a316b0ad2;p=xonotic%2Fxonotic-data.pk3dir.git Properly handle the cvars for serverlist categories now --- diff --git a/defaultXonotic.cfg b/defaultXonotic.cfg index d967d53d5..7ba487f6e 100644 --- a/defaultXonotic.cfg +++ b/defaultXonotic.cfg @@ -978,6 +978,28 @@ seta menu_slist_showfull 1 "show servers even if they are full and have no slots seta menu_slist_showempty 1 "show servers even if they are no empty and have no opponents to play against" seta menu_slist_modfilter "" // set to either: !modname or modname. modname of = means "same as we are running now". +// other serverlist cvars +seta menu_slist_categories 1 +seta menu_slist_categories_onlyifmultiple 1 +seta menu_slist_purethreshold 0 +seta menu_slist_modimpurity 0 +seta menu_slist_recommendations 3 +seta menu_slist_recommendations_maxping 150 +seta menu_slist_recommendations_minfreeslots 1 +seta menu_slist_recommendations_minhumans 0 +seta menu_slist_recommendations_purethreshold -1 + +// serverlist category override cvars +seta menu_slist_categories_CAT_FAVORITED_override "" +seta menu_slist_categories_CAT_RECOMMENDED_override "" +seta menu_slist_categories_CAT_NORMAL_override "" +seta menu_slist_categories_CAT_SERVERS_override "CAT_NORMAL" +seta menu_slist_categories_CAT_XPM_override "CAT_NORMAL" +seta menu_slist_categories_CAT_MODIFIED_override "" +seta menu_slist_categories_CAT_OVERKILL_override "" +seta menu_slist_categories_CAT_MINSTAGIB_override "" +seta menu_slist_categories_CAT_DEFRAG_override "" + seta menu_weaponarena "" seta menu_maxplayers 16 "maxplayers value when the menu starts a game" diff --git a/qcsrc/menu/xonotic/serverlist.c b/qcsrc/menu/xonotic/serverlist.c index 795e68a4b..417806c3f 100644 --- a/qcsrc/menu/xonotic/serverlist.c +++ b/qcsrc/menu/xonotic/serverlist.c @@ -67,16 +67,15 @@ ENDCLASS(XonoticServerList) entity makeXonoticServerList(); #ifndef IMPLEMENTATION -var float autocvar_menu_slist_categories = TRUE; -var float autocvar_menu_slist_categories_onlyifmultiple = TRUE; -var float autocvar_menu_slist_purethreshold = 10; -var float autocvar_menu_slist_modimpurity = 10; -var float autocvar_menu_slist_recommendations = 3; -var float autocvar_menu_slist_recommendations_maxping = 150; -var float autocvar_menu_slist_recommendations_minfreeslots = 1; -var float autocvar_menu_slist_recommendations_minhumans = 0; -var float autocvar_menu_slist_recommendations_purethreshold = -1; -//var string autocvar_menu_slist_recommended = "76.124.107.5:26004"; +float autocvar_menu_slist_categories; +float autocvar_menu_slist_categories_onlyifmultiple; +float autocvar_menu_slist_purethreshold; +float autocvar_menu_slist_modimpurity; +float autocvar_menu_slist_recommendations; +float autocvar_menu_slist_recommendations_maxping; +float autocvar_menu_slist_recommendations_minfreeslots; +float autocvar_menu_slist_recommendations_minhumans; +float autocvar_menu_slist_recommendations_purethreshold; // server cache fields #define SLIST_FIELDS \ @@ -107,13 +106,13 @@ const float REFRESHSERVERLIST_ASK = 2; // ..., also suggest querying serve const float REFRESHSERVERLIST_RESET = 3; // ..., also clear the list first // function declarations -entity RetrieveCategoryEnt(float catnum); - float IsServerInList(string list, string srv); #define IsFavorite(srv) IsServerInList(cvar_string("net_slist_favorites"), srv) #define IsPromoted(srv) IsServerInList(_Nex_ExtResponseSystem_PromotedServers, srv) #define IsRecommended(srv) IsServerInList(_Nex_ExtResponseSystem_RecommendedServers, srv) +entity RetrieveCategoryEnt(float catnum); + float CheckCategoryOverride(float cat); float CheckCategoryForEntry(float entry); float m_gethostcachecategory(float entry) { return CheckCategoryOverride(CheckCategoryForEntry(entry)); }