From e5bec72cf0a025998d32a66b1b06b1914fbbbc47 Mon Sep 17 00:00:00 2001 From: ac_stef Date: Mon, 15 Jun 2009 16:26:30 +0000 Subject: [PATCH] favourites.cfg added git-svn-id: svn://svn.code.sf.net/p/actiongame/code/trunk/ac@4511 e016b1c5-ed68-44aa-a2f7-31cac88cffde --- config/favourites.cfg | 97 ++++++++++++++++++++++++++++++++++++ config/menus.cfg | 1 + config/menus_multiplayer.cfg | 19 ++----- 3 files changed, 101 insertions(+), 16 deletions(-) create mode 100644 config/favourites.cfg diff --git a/config/favourites.cfg b/config/favourites.cfg new file mode 100644 index 00000000..6ce61f5e --- /dev/null +++ b/config/favourites.cfg @@ -0,0 +1,97 @@ +// basic favourites category definitions +// +// to add your own, it's best to copy this file to your home directory tree +// (where saved.cfg is located), and then edit that copy +// another way is to put additional categories into your autoexec.cfg + +// every category has the following attributes: +// "weight", "tag", "desc", "red", "green", "blue", "alpha", "keys", "ignore" +// weight: positive weights list a server higher in the list, negative weights list lower +// tag: short category description, shows in serverbrowser, can use escaped color commands (for example: \f3) +// desc: detailed category desription +// red, green, blue, alpha: background color for servers of this category, use values from 0..100, use alpha = 0 to disable background color +// keys: keywords to describe, which servers are in this category +// ignore: 1: disable this category, 0: enable it + +// possible key types: +// IP IP address of a server, partial addresses can be used +// IP:port IP & port address of a server +// serverdescription Description of a server, partial strings are possible +// %mapname Map name, partial names possible +// #gamemode Number of a game mode +// >ping Matches servers with ping above the given number +// $cubescript Name of an alias to check, if the server should be in the category +// you can prefix a key with '!' to invert it's meaning +// you can prefix a key with '+' to match only populated servers +// if several keys are specified (separated by spaces) every server that matches _any_ of the keys is in the category + +// example keys: +// ABC matches all servers that have "ABC" as a part of the server description +// 11.22.33.44:28763 matches the server with that IP & port address +// 11.22.33 matches all servers whose IP starts with that string +// %desert matches all servers with "desert" in the currently played map's name (for example, ac_desert, ac_desert2, ac_desert3, apollo_desertcity) +// %gema matches all servers with gema maps currently played +// >350 matches all servers with ping > 350 +// #5 #13 #14 #15 matches all servers with flag modes currently played +// $mpmap matches all servers with a map from your installed mappack currently played +// $offmap matches all servers with an official map currently played + +// cubescript aliases can be used to check more complicated conditions +// the alias gets the server properties as arguments and has to return non-zero, if the server should be in the category +// arg1: mapname, arg2: gamemode number, arg3: ping, arg4: minutesremaining, arg5: number of players, arg6: maxclients, arg7: IP, arg8: port, arg9: pongflags +// pongflags is bit-coded: bit 0: passworded, bit 1: banned, bit 2: blacklisted, bit 6: mastermode + +// these two example scripts check, if the server plays a map from either the official list or the mappack list +alias mpmap [(+ 1 (findlist $mappack_maps $arg1))] +alias offmap [(+ 1 (findlist $defaultmaps $arg1))] + + +// basic categories +addfavcategory LOVE +sbfavourite_LOVE_desc = "Your real favourites" +sbfavourite_LOVE_alpha = 20 +sbfavourite_LOVE_red = 0 +sbfavourite_LOVE_green = 100 +sbfavourite_LOVE_blue = 0 +sbfavourite_LOVE_weight = 255 // because love trumps hate, sheldon + +addfavcategory LIKE +sbfavourite_LIKE_desc = "Nice, too" +sbfavourite_LIKE_alpha = 10 +sbfavourite_LIKE_red = 0 +sbfavourite_LIKE_green = 100 +sbfavourite_LIKE_blue = 0 +sbfavourite_LIKE_weight = 50 + +addfavcategory HATE +sbfavourite_HATE_desc = "Servers of hell" +sbfavourite_HATE_alpha = 20 +sbfavourite_HATE_red = 100 +sbfavourite_HATE_green = 0 +sbfavourite_HATE_blue = 0 +sbfavourite_HATE_weight = -250 + +addfavcategory GOOD +sbfavourite_GOOD_desc = "Good maprot, nice admins" +sbfavourite_GOOD_alpha = 0 +sbfavourite_GOOD_weight = 40 + +addfavcategory BAD +sbfavourite_BAD_desc = "Bad ping, maprot, admins, etc." +sbfavourite_BAD_alpha = 0 +sbfavourite_BAD_weight = -30 +sbfavourite_BAD_keys = "+>2000" // automatically add populated servers with ping > 2000 to this category + +addfavcategory MAP +sbfavourite_MAP_desc = "Nice maps" +sbfavourite_MAP_alpha = 0 +sbfavourite_MAP_weight = 1 +sbfavourite_MAP_keys = "$mpmap" // automatically add servers with mappack maps + +addfavcategory MODE +sbfavourite_MODE_desc = "Favourite game modes" +sbfavourite_MODE_alpha = 0 +sbfavourite_MODE_weight = 1 +sbfavourite_MODE_keys = "#42" // automatically add servers playing towel mode + + diff --git a/config/menus.cfg b/config/menus.cfg index 40a5af06..71f667f9 100755 --- a/config/menus.cfg +++ b/config/menus.cfg @@ -202,4 +202,5 @@ exec config/menus_bot.cfg exec config/menus_edit.cfg exec config/menus_settings.cfg exec config/menus_multiplayer.cfg +exec config/favourites.cfg diff --git a/config/menus_multiplayer.cfg b/config/menus_multiplayer.cfg index f0680816..7b5d07d7 100644 --- a/config/menus_multiplayer.cfg +++ b/config/menus_multiplayer.cfg @@ -135,27 +135,15 @@ menuitemslider "Server IP & port: " 0 2 "$serverbrowserhideip" 1 [ "Show" "Show menuitemslider "Sort servers by: " 0 7 "$serversort" 1 [ "Ping" "Number of players" "Max players" "Minutes remaining" "Map name" "Gamemode" "IP address" "Server description"] "serversort $arg1" menuinitselection 1 -addfavcategory 1 -sbfavourite_1_alpha = 0 -sbfavourite_1_weight = 10 - -addfavcategory 2 -sbfavourite_2_alpha = 0 -sbfavourite_2_weight = 0 - -addfavcategory 3 -sbfavourite_3_alpha = 0 -sbfavourite_3_weight = -10 - alias addfavcatmenu [ i = (+ 1 (findlist (listfavcats) $arg1)) newmenu "edit favourites" if (< $i 11) [ - menuitemvar (concatword "concat " (mod $i 10) ": $" sbfavourite_ $arg1 _desc) (concatword "showmenu [favourites " $i "]") + menuitemvar (concatword "concat " (mod $i 10) ": $" sbfavourite_ $arg1 _desc " (concatword < s $" sbfavourite_ $arg1 _tag " r>)") (concatword "showmenu [favourites " $i "]") newmenu "serverbrowser help" - menuitemvar (concatword "concat " $i ": Toggle category $" sbfavourite_ $arg1 _desc) -1 + menuitemvar (concatword "concat " $i ": Toggle category $" sbfavourite_ $arg1 _desc " (concatword < s $" sbfavourite_ $arg1 _tag " r>)") -1 ][ - menuitemvar (concatword "result $" sbfavourite_ $arg1 _desc) (concatword "showmenu [favourites " $i "]") + menuitemvar (concatword "result $" sbfavourite_ $arg1 _desc " (concatword < s $" sbfavourite_ $arg1 _tag " r>)") (concatword "showmenu [favourites " $i "]") ] newmenu (concat favourites $i) menuitemtextinput "Tag: " (concatword "result $" sbfavourite_ $arg1 _tag) (concatword sbfavourite_ $arg1 _tag " = $arg1") "" 15 @@ -181,7 +169,6 @@ alias addallfavcatmenus [ menuitem "Keys to add/remove servers from categories:" -1 loop ii (listlen (listfavcats)) [addfavcatmenu (at (listfavcats) $ii)] ] -alias mpmap [(+ 1 (findlist $mappack_maps $arg1))] alias lastsearchname ""