From 73bd0b89a16b515778ccb1910bd3b94a316b0ad2 Mon Sep 17 00:00:00 2001 From: Samual Lenks Date: Sat, 12 Oct 2013 19:15:26 -0400 Subject: [PATCH] Properly handle the cvars for serverlist categories now --- defaultXonotic.cfg | 22 ++++++++++++++++++++++ qcsrc/menu/xonotic/serverlist.c | 23 +++++++++++------------ 2 files changed, 33 insertions(+), 12 deletions(-) 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)); } -- 2.39.2