autocam = 0;
crouchkey = 0,jumpkey = 0,forwardkey = 0,chatkey = 0,backkey = 0,leftkey = 0,rightkey = 0,drawkey = 0,throwkey = 0,attackkey = 0;
+ consolekey = 0;
oldattackkey = 0;
loading = 0;
break;
case 8: attackkey=keycode;
break;
+ case 9: consolekey=keycode;
+ break;
default:
break;
}
bool autocam;
unsigned short crouchkey,jumpkey,forwardkey,chatkey,backkey,leftkey,rightkey,drawkey,throwkey,attackkey;
+ unsigned short consolekey;
bool oldattackkey;
static void LoadTexture(const string fileName, GLuint *textureid,int mipmap, bool hasalpha);
else sprintf (menustring[8], "Attack: _");
startx[8]=10+20;
starty[8]=80;
-
- sprintf (menustring[9], "Back");
- startx[9]=10;
- starty[9]=10;
+
+ if(debugmode) {
+ if(keyselect!=9)sprintf (menustring[9], "Console: %s",Input::keyToChar(consolekey));
+ else sprintf (menustring[9], "Console: _");
+ startx[9]=10+10;
+ starty[9]=40;
+ nummenuitems++;
+ }
+
+ sprintf (menustring[nummenuitems-1], "Back");
+ startx[nummenuitems-1]=10;
+ starty[nummenuitems-1]=10;
}
break;
case 5: {
case 4:
if(!waiting) {
fireSound();
- if(selected<9 && keyselect==-1)
+ if(selected<nummenuitems-1 && keyselect==-1)
keyselect=selected;
if(keyselect!=-1)
setKeySelected();
- if(selected==9){
+ if(selected==nummenuitems-1){
flash();
mainmenu=3;
if(chatting)
keyboardfrozen=true;
- if(Input::isKeyPressed(SDLK_BACKQUOTE)&&debugmode){
+ if(Input::isKeyPressed(consolekey)&&debugmode){
console=!console;
if(console){
OPENAL_SetFrequency(OPENAL_ALL, 0.001);
game.drawkey=SDLK_e;
game.throwkey=SDLK_q;
game.attackkey=MOUSEBUTTON1;
+ game.consolekey=SDLK_BACKQUOTE;
game.chatkey=SDLK_t;
}
opstream << Input::keyToChar(game.throwkey);
opstream << "\nAttack key:\n";
opstream << Input::keyToChar(game.attackkey);
+ opstream << "\nConsole key:\n";
+ opstream << Input::keyToChar(game.consolekey);
opstream << "\nChat key:\n";
opstream << Input::keyToChar(game.chatkey);
opstream << "\nDamage bar:\n";
} else if ( !strncmp(setting, "Attack key", 10) ) {
ipstream.getline( string, sizeof(string) );
game.attackkey = Input::CharToKey(string);
+ } else if ( !strncmp(setting, "Console key", 11) ) {
+ ipstream.getline( string, sizeof(string) );
+ game.consolekey = Input::CharToKey(string);
} else if ( !strncmp(setting, "Chat key", 8) ) {
ipstream.getline( string, sizeof(string) );
game.chatkey = Input::CharToKey(string);