diff --git a/config/docs.cfg b/config/docs.cfg index b01251e5..762d7022 100644 --- a/config/docs.cfg +++ b/config/docs.cfg @@ -257,6 +257,8 @@ docident [minlod] [Minimal level of detail.]; docargument [V] [] [min 25/max 250/default 60]; docident [modeacronyms] [Toggles use of acronyms instead of full modenames in the serverbrowser.]; docargument [B] [] [min 0/max 1/default 0]; +docident [getmodeacr] [Returns the current game mode's acronym.]; +docexample [echo (getmodeacr)] [Example output: CTF]; docident [networkdebug] [Enables output of processed network packets.]; docargument [B] [enable network debugging] [min 0/max 1/default 0]; docremark [This variable only has an effect if the client binary is compiled in debug mode.]; diff --git a/config/scripts.cfg b/config/scripts.cfg index 86182554..f68cff80 100644 --- a/config/scripts.cfg +++ b/config/scripts.cfg @@ -227,18 +227,22 @@ toggleshowmap = [ showmap 1; onrelease [ showmap 0 ] ] // arg7 "server description" // TODO: interpret a#3,4,5,6 [ft:any1:2010apr04] -sbdns = ""; sbport = ""; sbdesc = ""; sbmsg = ""; sbpwd = ""; +sbdns = ""; sbport = ""; sbdesc = ""; sbmsg = ""; sbpwd = "" sbconnect = [ - sbdns = $arg1; sbport = $arg2; sbdesc = $arg7; sbpwd = ""; sbmsg = "" - if (>= $arg6 1) [ - sbmsg = "You are banned from this server."; showmenu "password required"; ] [ - if (= $arg5 1) [ - sbmsg = "This server is set to private."; showmenu "password required"; ] [ - if (= $arg4 1) [ - sbmsg = "This server is password-protected."; showmenu "password required"; - ] [ - echo connecting to $arg7; connect $arg1 $arg2; - ] ] ] + sbdns = $arg1; sbport = $arg2; sbdesc = $arg7; sbpwd = ""; sbmsg = "" + if (>= $arg6 1) [ + sbmsg = "You are banned from this server."; showmenu "password required" + ] [ + if (= $arg5 1) [ + sbmsg = "This server is set to private."; showmenu "password required" + ] [ + if (= $arg4 1) [ + sbmsg = "This server is password-protected."; showmenu "password required" + ] [ + echo connecting to $arg7; connect $arg1 $arg2; + ] + ] + ] ] // For those players who use IRC too much... @@ -284,8 +288,8 @@ pasteent = [ // megabind - Binds a key to many different actions depending on the current game state. megabind = [ if (= $numargs 6) [ - bind $arg1 (format "if (watchingdemo) [%1] [if (|| $editing (= $gamemode 1)) [%2] [if $connected [%3] [if (curmodeattr bot) [%4] [%5]]]]" $arg2 $arg3 $arg4 $arg5 $arg6) - ] [] + bind $arg1 (format "if (watchingdemo) [ %1 ] [ if (|| $editing (= $gamemode 1)) [ %2 ] [ if $connected [ %3 ] [ if (curmodeattr bot) [ %4 ] [ %5 ] ] ] ]" $arg2 $arg3 $arg4 $arg5 $arg6) + ] ] // getscrext - Returns the proper file extension for the client's current screenshottype setting, including the "." @@ -299,6 +303,11 @@ getscrext = [ ] ] +// getmodeacr - Returns the proper current mode's acronym. +gamemodes_list = [ TDM COOP DM SURV TSURV CTF PF BTDM BDM LSS OSOK TOSOK BOSOK HTF TKTF KTF ] + +getmodeacr = [ result (at $gamemodes_list $gamemode) ] + // Simple claim-admin script for one single-server. // Fill in the 3 aliases below, and uncomment the below line to activate. // bind F3 "customclaimadminscript" diff --git a/docs/reference.xml b/docs/reference.xml index 686ce90a..6cc05fdc 100644 --- a/docs/reference.xml +++ b/docs/reference.xml @@ -650,6 +650,7 @@ + @@ -1084,6 +1085,20 @@ Toggles use of acronyms instead of full modenames in the serverbrowser. + + + Returns the current game mode's acronym. + + + + Example output: CTF + + + + + + + Resets all binds back to their default values.