From 1cbb6a7969aed005c2154040729b82531cc1a2a0 Mon Sep 17 00:00:00 2001 From: ac_stef Date: Thu, 18 Sep 2008 22:45:43 +0000 Subject: [PATCH] game mode description line git-svn-id: svn://svn.code.sf.net/p/actiongame/code/trunk/ac@2702 e016b1c5-ed68-44aa-a2f7-31cac88cffde --- config/menus.cfg | 7 +++++++ source/src/clientgame.cpp | 14 ++++++++++++++ 2 files changed, 21 insertions(+) diff --git a/config/menus.cfg b/config/menus.cfg index db4936ba..a2114c71 100755 --- a/config/menus.cfg +++ b/config/menus.cfg @@ -169,3 +169,10 @@ exec config/menus_bot.cfg exec config/menus_edit.cfg exec config/menus_settings.cfg exec config/menus_multiplayer.cfg + +// game mode descriptions +gamemodedesc 5 [CTF: Steal the enemy flag and bring it to your home base. Don't let your own flag get stolen.] +gamemodedesc 13 [HTF: Find the enemy flag, frag the flag bearer and collect the flag to score. Protect your own team flag.] +gamemodedesc 14 [TKTF: There is only one flag. Get the flag and keep it. You score one point every 15 seconds. If your teammate has the flag, protect him.] +gamemodedesc 15 [KTF: Get the flag and keep it. You score one point every 15 seconds. You are alone. Everybody else will try to frag you.] + diff --git a/source/src/clientgame.cpp b/source/src/clientgame.cpp index 5bc9b217..47ae583a 100644 --- a/source/src/clientgame.cpp +++ b/source/src/clientgame.cpp @@ -624,6 +624,19 @@ void preparectf(bool cleanonly=false) } } +struct gmdesc { int mode; char *desc; }; +vector gmdescs; + +void gamemodedesc(char *modenr, char *desc) +{ + if(!modenr || !desc) return; + struct gmdesc &gd = gmdescs.add(); + gd.mode = atoi(modenr); + gd.desc = newstring(desc); +} + +COMMAND(gamemodedesc, ARG_2STR); + int suicided = -1; void startmap(const char *name) // called just after a map load @@ -657,6 +670,7 @@ void startmap(const char *name) // called just after a map load minutesremaining = -1; bool noflags = (m_ctf || m_ktf) && (!numflagspawn[0] || !numflagspawn[1]); if(*clientmap) conoutf("game mode is \"%s\"%s", modestr(gamemode, modeacronyms > 0), noflags ? " - \f2but there are no flag bases on this map" : ""); + loopv(gmdescs) if(gmdescs[i].mode == gamemode) conoutf(gmdescs[i].desc); // run once if(firstrun)