checkbox gui element

git-svn-id: svn://svn.code.sf.net/p/actiongame/code/trunk/ac@1542 e016b1c5-ed68-44aa-a2f7-31cac88cffde
This commit is contained in:
driAn
2008-01-02 19:21:12 +00:00
parent e9a9896669
commit 472c0ef3a2
7 changed files with 250 additions and 150 deletions
+10 -6
View File
@@ -277,17 +277,21 @@ void keypress(int code, bool isdown, int cooked)
{
if(code==SDLK_RETURN)
{
if(cmdline.buf[0])
string buf; // use a copy to safely close the commandline
s_strcpy(buf, cmdline.buf);
saycommand(NULL);
if(buf[0])
{
if(vhistory.empty() || strcmp(vhistory.last(), cmdline.buf))
if(vhistory.empty() || strcmp(vhistory.last(), buf))
{
vhistory.add(newstring(cmdline.buf)); // cap this?
vhistory.add(newstring(buf)); // cap this?
}
histpos = vhistory.length();
if(cmdline.buf[0]=='/') execute(cmdline.buf+1);
else toserver(cmdline.buf);
if(buf[0]=='/') execute(buf+1);
else toserver(buf);
}
saycommand(NULL);
}
else if(code==SDLK_ESCAPE)
{