From 498d96e20090063953164110dcd21e2b68e453a7 Mon Sep 17 00:00:00 2001 From: Bukz Date: Thu, 31 Mar 2011 19:27:44 +0000 Subject: [PATCH] megabind git-svn-id: svn://svn.code.sf.net/p/actiongame/code/trunk/ac@6177 e016b1c5-ed68-44aa-a2f7-31cac88cffde --- config/docs.cfg | 13 +++++++++++-- config/scripts.cfg | 7 +++++++ docs/reference.xml | 31 ++++++++++++++++++++++++++++++- 3 files changed, 48 insertions(+), 3 deletions(-) diff --git a/config/docs.cfg b/config/docs.cfg index 813621a3..736f5c74 100644 --- a/config/docs.cfg +++ b/config/docs.cfg @@ -184,6 +184,14 @@ docident [bind] [Binds a key to a command.]; docargument [K] [the key to bind] [string] [0]; docargument [A] [the command] [string, usually an alias] [0]; docremark [To find out what key names and their default bindings are, look at config/keymap.cfg, then add bind commands to your autoexec.cfg.]; +docident [megabind] [Binds a key to many different actions depending on the current game state.]; +docargument [K] [the key to bind]; +docargument [D] [body of code to execute if watching a demo]; +docargument [E] [body of code to execute if editing or in coop-edit mode]; +docargument [C] [body of code to execute if connected to a server]; +docargument [B] [body of code to execute if in a bot mode]; +docargument [O] [body of code to execute if none of the other arguments have been met]; +docremark [This command requires 6 arguments, no more no less. Use an empty set of brackets [] for any of the arguments that you want to "do nothing".]; docident [browsefiledesc] [Toggles getting descriptive text from CGZ or DMO files in menudirlist.]; docargument [B] [] [min 0/max 1/default 1]; docident [changeteam] [Swaps your player to the enemy team.]; @@ -1561,8 +1569,9 @@ docident [showmapbackdrop] [change wether to have a see-through map overview (0) docargument [B] [backdrop-style] [min 0/max 2/default 0]; docident [showmapbackdroptransparency] []; docargument [T] [transparency] [min 0/max 100/default 75]; -docident [soundmuted] [TODO: Description]; -docargument [A] [TODO] [] [0]; +docident [soundmuted] [Returns 1 if sound A is muted, else 0.]; +docargument [A] [sound ID] [See /config/sounds.cfg for valid sound ID's.] [0]; +docexample [mutesound 5; if (soundmuted 5) [echo Sound 5 is muted!] [echo Sound 5 is not muted!]] [Output: Sound 5 is muted!]; docident [testvel] [TODO]; docargument [N] [TODO] [min 0/max 1/default 0]; docident [texreduce] [-1: 2x2 : 0 : 1: x0.5 : 2: x0.25 : 3: x0.125]; diff --git a/config/scripts.cfg b/config/scripts.cfg index 6396926f..737d4930 100644 --- a/config/scripts.cfg +++ b/config/scripts.cfg @@ -264,6 +264,13 @@ 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) + ] [] +] + // 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 ddbdd772..3423ca45 100644 --- a/docs/reference.xml +++ b/docs/reference.xml @@ -797,7 +797,35 @@ + + + + + + + Binds a key to many different actions depending on the current game state. + + + + + + + + + + + + + + + This command requires 6 arguments, no more no less. Use an empty set of brackets [] for any of the arguments that you want to "do nothing". + + + + + + Executes a command on the release of a key/button. @@ -811,6 +839,7 @@ + @@ -4186,7 +4215,7 @@ Output: - +