ClickOnGadget(level_editor_gadget[id], button);
else if (letter == '.')
ClickOnGadget(level_editor_gadget[GADGET_ID_SINGLE_ITEMS], button);
- else if (key == KSYM_space || key == KSYM_Return)
+ else if (key == KSYM_Return || key == setup.shortcut.toggle_pause)
ClickOnGadget(level_editor_gadget[GADGET_ID_TEST], button);
else
for (i=0; i<ED_NUM_CTRL_BUTTONS; i++)
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;
}
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);
}
}
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);
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);
}
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)
switch(key)
{
case KSYM_Return:
- case KSYM_space:
game_status = MAINMENU;
DrawMainMenu();
BackToFront();
/* shortcut setup */
#define SETUP_TOKEN_SAVE_GAME 0
#define SETUP_TOKEN_LOAD_GAME 1
+#define SETUP_TOKEN_TOGGLE_PAUSE 2
-#define NUM_SHORTCUT_SETUP_TOKENS 2
+#define NUM_SHORTCUT_SETUP_TOKENS 3
/* player setup */
#define SETUP_TOKEN_USE_JOYSTICK 0
{
/* shortcut setup */
{ TYPE_KEY_X11, &ssi.save_game, "shortcut.save_game" },
- { TYPE_KEY_X11, &ssi.load_game, "shortcut.load_game" }
+ { TYPE_KEY_X11, &ssi.load_game, "shortcut.load_game" },
+ { TYPE_KEY_X11, &ssi.toggle_pause, "shortcut.toggle_pause" }
};
static struct TokenInfo player_setup_tokens[] =
si->shortcut.save_game = DEFAULT_KEY_SAVE_GAME;
si->shortcut.load_game = DEFAULT_KEY_LOAD_GAME;
+ si->shortcut.toggle_pause = DEFAULT_KEY_TOGGLE_PAUSE;
for (i=0; i<MAX_PLAYERS; i++)
{
#define JOY_RIGHT MV_RIGHT
#define JOY_UP MV_UP
#define JOY_DOWN MV_DOWN
-#define JOY_BUTTON_1 MV_BUTTON_1
-#define JOY_BUTTON_2 MV_BUTTON_2
-#define JOY_MOTION MV_MOTION
-#define JOY_BUTTON MV_BUTTON
+#define JOY_BUTTON_1 KEY_BUTTON_1
+#define JOY_BUTTON_2 KEY_BUTTON_2
+#define JOY_MOTION KEY_MOTION
+#define JOY_BUTTON KEY_BUTTON
+#define JOY_ACTION KEY_ACTION
#define JOY_BUTTON_NOT_PRESSED 0
#define JOY_BUTTON_PRESSED 1
/* default shortcut keys */
#define DEFAULT_KEY_SAVE_GAME KSYM_F1
#define DEFAULT_KEY_LOAD_GAME KSYM_F2
+#define DEFAULT_KEY_TOGGLE_PAUSE KSYM_space
/* values for move directions and special "button" keys */
#define MV_NO_MOVING 0
#define MV_RIGHT (1 << 1)
#define MV_UP (1 << 2)
#define MV_DOWN (1 << 3)
-#define MV_BUTTON_1 (1 << 4)
-#define MV_BUTTON_2 (1 << 5)
-#define MV_MOTION (MV_LEFT | MV_RIGHT | MV_UP | MV_DOWN)
-#define MV_BUTTON (MV_BUTTON_1 | MV_BUTTON_2)
+#define KEY_BUTTON_1 (1 << 4)
+#define KEY_BUTTON_2 (1 << 5)
+#define KEY_MOTION (MV_LEFT | MV_RIGHT | MV_UP | MV_DOWN)
+#define KEY_BUTTON (KEY_BUTTON_1 | KEY_BUTTON_2)
+#define KEY_ACTION (KEY_MOTION | KEY_BUTTON)
/* values for button status */
#define MB_NOT_PRESSED FALSE
{
Key save_game;
Key load_game;
+ Key toggle_pause;
};
struct SetupInfo
{ TYPE_KEY, &setup.shortcut.save_game, "" },
{ TYPE_KEYTEXT, NULL, "Quick Load Game:", },
{ TYPE_KEY, &setup.shortcut.load_game, "" },
+ { TYPE_KEYTEXT, NULL, "Toggle Pause:", },
+ { TYPE_KEY, &setup.shortcut.toggle_pause, "" },
{ TYPE_EMPTY, NULL, "" },
{ TYPE_LEAVE_MENU, execSetupMain, "Exit" },
{ 0, NULL, NULL }
-#define COMPILE_DATE_STRING "[2002-04-18 02:20]"
+#define COMPILE_DATE_STRING "[2002-04-19 23:17]"