getmodeacr replaced with hardcoded getmode

git-svn-id: svn://svn.code.sf.net/p/actiongame/code/trunk/ac@6498 e016b1c5-ed68-44aa-a2f7-31cac88cffde
This commit is contained in:
Bukz
2011-06-04 18:52:06 +00:00
parent 9c9e7dc361
commit f6848c2f84
4 changed files with 19 additions and 11 deletions
+4 -2
View File
@@ -340,8 +340,10 @@ 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 [getmode] [Returns the current game mode.];
docargument [N] [0 = full mode name, 1 = mode acronym] [min 0/max 1/default 0] [0];
docexample [echo (getmode)] [Example output: capture the flag];
docexample [echo (getmode 1)] [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.];
-4
View File
@@ -328,10 +328,6 @@ 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 TPF TLSS BPF BLSS"
getmodeacr = [ result (at $gamemodes_list $gamemode) ]
// storesets - Generates an alias (list) of the current values for the given CVARs.
omit_idents = "curname curteam idlebots name"
+12 -5
View File
@@ -1096,7 +1096,7 @@
</example>
</examples>
<references>
<identifierReference identifier="getmodeacr"/>
<identifierReference identifier="getmode"/>
<identifierReference identifier="screenshottype"/>
</references>
</command>
@@ -1587,19 +1587,26 @@
<value token="B" description="" minValue="0" maxValue="1" defaultValue="0"/>
</variable>
<variable name="getmodeacr">
<description>Returns the current game mode's acronym.</description>
<command name="getmode">
<description>Returns the current game mode.</description>
<examples>
<example>
<code><![CDATA[echo (getmodeacr)]]></code>
<code><![CDATA[echo (getmode)]]></code>
<explanation>Example output: capture the flag</explanation>
</example>
<example>
<code><![CDATA[echo (getmode 1)]]></code>
<explanation>Example output: CTF</explanation>
</example>
</examples>
<arguments>
<argument token="N" description="0 = full mode name, 1 = mode acronym" valueNotes="min 0/max 1/default 0"/>
</arguments>
<references>
<identifierReference identifier="getscrext"/>
<identifierReference identifier="modeacronyms"/>
</references>
</variable>
</command>
<variable name="resetbinds">
<description>Resets all binds back to their default values.</description>
+3
View File
@@ -1490,6 +1490,8 @@ void strpos_(char *haystack, char *needle, char *occurence)
void l0(int p, int v) { string f; string r; formatstring(f)("%%0%dd", p); formatstring(r)(f, v); result(r); }
void getmode(int acr = 0) { result(modestr(gamemode, acr ? true : false)); }
COMMANDN(millis, millis_, ARG_IVAL);
COMMANDN(strlen, strlen_, ARG_1STR);
COMMANDN(substr, substr_, ARG_3STR);
@@ -1499,6 +1501,7 @@ COMMAND(systime, ARG_NONE);
COMMANDN(timestamp, timestamp_, ARG_NONE);
COMMAND(datestring, ARG_NONE);
COMMANDN(timestring, timestring_, ARG_NONE);
COMMAND(getmode, ARG_1INT);
const char *currentserver(int i, bool internal) // = false) [client version]
{