git-svn-id: https://svn.eduke32.com/eduke32@824 1a8010ca-5511-0410-912e-c29ae57300e0

This commit is contained in:
terminx 2008-06-30 11:01:58 +00:00
parent 88120b45eb
commit 4348140d55
4 changed files with 35 additions and 23 deletions

View file

@ -382,9 +382,9 @@ void CONFIG_ReadKeys(void)
if (keynames[j].name)
boundkeys[key1].key=Bstrdup(keynames[j].name);
else boundkeys[key1].key=Bstrdup(keyname1);
if (!boundkeys[key1].name[0])
Bsprintf(tempbuf,"gamefunc_%s",CONFIG_FunctionNumToName(function));
if (!boundkeys[key1].name[0] || !Bstrcasecmp(tempbuf,boundkeys[key1].name))
{
Bsprintf(tempbuf,"gamefunc_%s",CONFIG_FunctionNumToName(function));
Bstrncpy(boundkeys[key1].name,tempbuf, MAXBINDSTRINGLENGTH-1);
}
else
@ -402,9 +402,9 @@ void CONFIG_ReadKeys(void)
if (keynames[j].name)
boundkeys[key2].key=Bstrdup(keynames[j].name);
else boundkeys[key2].key=Bstrdup(keyname2);
if (!boundkeys[key2].name[0])
Bsprintf(tempbuf,"gamefunc_%s",CONFIG_FunctionNumToName(function));
if (!boundkeys[key2].name[0] || !Bstrcasecmp(tempbuf,boundkeys[key2].name))
{
Bsprintf(tempbuf,"gamefunc_%s",CONFIG_FunctionNumToName(function));
Bstrncpy(boundkeys[key2].name,tempbuf, MAXBINDSTRINGLENGTH-1);
}
else
@ -430,7 +430,7 @@ void MapKey(int32 which, kb_scancode key1, kb_scancode oldkey1, kb_scancode key2
int j;
CONTROL_MapKey(which, key1, key2);
if (key1)
if (key1 && key1 != 0xff)
{
boundkeys[key1].repeat = 1;
for (j=0;keynames[j].name;j++)
@ -438,10 +438,19 @@ void MapKey(int32 which, kb_scancode key1, kb_scancode oldkey1, kb_scancode key2
break;
if (keynames[j].name)
boundkeys[key1].key=Bstrdup(keynames[j].name);
Bsprintf(tempbuf,"gamefunc_%s",CONFIG_FunctionNumToName(which));
Bstrncpy(boundkeys[key1].name,tempbuf, MAXBINDSTRINGLENGTH-1);
if (!boundkeys[key1].name[0] || !Bstrcasecmp(tempbuf,boundkeys[key1].name))
{
Bstrncpy(boundkeys[key1].name,tempbuf, MAXBINDSTRINGLENGTH-1);
}
else
{
Bsprintf(tempbuf,"; gamefunc_%s",CONFIG_FunctionNumToName(which));
Bstrncat(boundkeys[key1].name,tempbuf, MAXBINDSTRINGLENGTH-1);
}
}
if (key2)
if (key2 && key2 != 0xff)
{
boundkeys[key2].repeat = 1;
for (j=0;keynames[j].name;j++)
@ -449,12 +458,21 @@ void MapKey(int32 which, kb_scancode key1, kb_scancode oldkey1, kb_scancode key2
break;
if (keynames[j].name)
boundkeys[key2].key=Bstrdup(keynames[j].name);
Bsprintf(tempbuf,"gamefunc_%s",CONFIG_FunctionNumToName(which));
Bstrncpy(boundkeys[key2].name,tempbuf, MAXBINDSTRINGLENGTH-1);
if (!boundkeys[key2].name[0] || !Bstrcasecmp(tempbuf,boundkeys[key2].name))
{
Bstrncpy(boundkeys[key2].name,tempbuf, MAXBINDSTRINGLENGTH-1);
}
else
{
Bsprintf(tempbuf,"; gamefunc_%s",CONFIG_FunctionNumToName(which));
Bstrncat(boundkeys[key2].name,tempbuf, MAXBINDSTRINGLENGTH-1);
}
}
if (!key1 && oldkey1)
if ((!key1 || key1 == 0xff) && oldkey1)
boundkeys[oldkey1].name[0] = 0;
if (!key2 && oldkey2)
if ((!key2 || key2 == 0xff) && oldkey2)
boundkeys[oldkey2].name[0] = 0;
}

View file

@ -608,7 +608,7 @@ void getpackets(void)
vscrn();
}
if (KB_KeyPressed(sc_F12))
if (KB_UnBoundKeyPressed(sc_F12))
{
KB_ClearKeyDown(sc_F12);
screencapture("duke0000.tga",0);
@ -10799,12 +10799,6 @@ MAIN_LOOP_RESTART:
gametext(160,70,"PRESS F1 TO VOTE YES, F2 TO VOTE NO",0,2+8+16);
}
// if(KB_KeyPressed(sc_F))
// {
// KB_ClearKeyDown(sc_F);
// addplayer();
// }
if (g_player[myconnectindex].ps->gm&MODE_DEMO)
goto MAIN_LOOP_RESTART;

View file

@ -3353,7 +3353,7 @@ cheat_for_port_credits:
char key[2];
key[0] = ud.config.KeyboardKeys[probey][0];
key[1] = ud.config.KeyboardKeys[probey][1];
ud.config.KeyboardKeys[probey][currentlist] = 0;
ud.config.KeyboardKeys[probey][currentlist] = 0xff;
MapKey(probey, ud.config.KeyboardKeys[probey][0], key[0], ud.config.KeyboardKeys[probey][1], key[1]);
sound(KICK_HIT);
KB_ClearKeyDown(sc_Delete);

View file

@ -21,14 +21,14 @@ void GAME_drawosdstr(int x, int y, char *ch, int len, int shade, int pal)
for (x = (x<<3)+x; len>0; len--, ch++, x++)
{
/*
if (*ch == '^' && isdigit(*(ch+1)))
/* if (*ch == '^' && isdigit(*(ch+1)))
{
char smallbuf[4];
ch++;
ch++, len--;
if (isdigit(*(ch+1)))
{
smallbuf[0] = *(ch++);
len--;
smallbuf[1] = *(ch);
smallbuf[2] = '\0';
pal = atol(smallbuf);
@ -39,9 +39,9 @@ void GAME_drawosdstr(int x, int y, char *ch, int len, int shade, int pal)
smallbuf[1] = '\0';
pal = atol(smallbuf);
}
x--;
continue;
}
*/
} */
if (*ch == 32)
{
// x+=5;