X-Git-Url: https://git.artsoft.org/?a=blobdiff_plain;f=src%2Fevents.c;h=66e5ec642fd6fa4c88453257e7a22fd5fbe4f430;hb=5361c043c5668c9801b4682e0691d34ec428545f;hp=468da146ad5f9e4bcba47106b2cbc24b6765c4c5;hpb=4e3bc17b6150a17a76cba2da2daa96af65bde5b9;p=rocksndiamonds.git diff --git a/src/events.c b/src/events.c index 468da146..66e5ec64 100644 --- a/src/events.c +++ b/src/events.c @@ -444,7 +444,7 @@ void HandleKey(Key key, int key_status) if (tape.single_step && clear_button_2[pnr]) { - stored_player[pnr].action &= ~MV_BUTTON_2; + stored_player[pnr].action &= ~KEY_BUTTON_2; clear_button_2[pnr] = FALSE; } @@ -456,31 +456,31 @@ void HandleKey(Key key, int key_status) if (tape.single_step && tape.recording && tape.pausing) { if (key_status == KEY_PRESSED && - (key_action & (MV_MOTION | MV_BUTTON_1))) + (key_action & (KEY_MOTION | KEY_BUTTON_1))) { TapeTogglePause(TAPE_TOGGLE_AUTOMATIC); - if (key_action & MV_MOTION) + if (key_action & KEY_MOTION) { - if (stored_player[pnr].action & MV_BUTTON_2) + if (stored_player[pnr].action & KEY_BUTTON_2) bomb_placed[pnr] = TRUE; } } else if (key_status == KEY_RELEASED && - (key_action & MV_BUTTON_2)) + (key_action & KEY_BUTTON_2)) { if (!bomb_placed[pnr]) { TapeTogglePause(TAPE_TOGGLE_AUTOMATIC); - stored_player[pnr].action |= MV_BUTTON_2; + stored_player[pnr].action |= KEY_BUTTON_2; clear_button_2[pnr] = TRUE; } bomb_placed[pnr] = FALSE; } } - else if (tape.recording && tape.pausing) + else if (tape.recording && tape.pausing && (key_action & KEY_ACTION)) TapeTogglePause(TAPE_TOGGLE_MANUAL); } } @@ -509,7 +509,7 @@ void HandleKey(Key key, int key_status) if (key_status == KEY_RELEASED) return; - if ((key == KSYM_Return || key == KSYM_space) && + if ((key == KSYM_Return || key == setup.shortcut.toggle_pause) && game_status == PLAYING && AllPlayersGone) { CloseDoor(DOOR_CLOSE_1); @@ -531,13 +531,15 @@ void HandleKey(Key key, int key_status) return; } - /* special shortcuts for quick game tape saving and loading */ + /* special key shortcuts */ if (game_status == MAINMENU || game_status == PLAYING) { if (key == setup.shortcut.save_game) TapeQuickSave(); else if (key == setup.shortcut.load_game) TapeQuickLoad(); + else if (key == setup.shortcut.toggle_pause) + TapeTogglePause(TAPE_TOGGLE_MANUAL); } @@ -564,7 +566,6 @@ void HandleKey(Key key, int key_status) switch(key) { case KSYM_Return: - case KSYM_space: if (game_status == MAINMENU) HandleMainMenu(0,0, 0,0, MB_MENU_CHOICE); else if (game_status == CHOOSELEVEL) @@ -609,7 +610,6 @@ void HandleKey(Key key, int key_status) switch(key) { case KSYM_Return: - case KSYM_space: game_status = MAINMENU; DrawMainMenu(); BackToFront();