#include "editor.h"
#include "files.h"
#include "tape.h"
-#include "joystick.h"
#include "network.h"
/* values for key_status */
int i;
KeyboardAutoRepeatOn();
- old_joystick_status = joystick_status;
- joystick_status = JOYSTICK_OFF;
+ old_joystick_status = joystick.status;
+ joystick.status = JOYSTICK_NOT_AVAILABLE;
/* simulate key release events for still pressed keys */
key_joystick_mapping = 0;
KeyboardAutoRepeatOff();
}
if (old_joystick_status != -1)
- joystick_status = old_joystick_status;
+ joystick.status = old_joystick_status;
}
}
HandleSetupScreen(mx,my, 0,0, button);
break;
- case SETUPINPUT:
- HandleSetupInputScreen(mx,my, 0,0, button);
- break;
-
case PLAYING:
#ifdef DEBUG
if (button == MB_RELEASED)
}
/* allow quick escape to the main menu with the Escape key */
- if (key == KSYM_Escape && game_status != MAINMENU)
+ if (key == KSYM_Escape &&
+ game_status != MAINMENU &&
+ game_status != LEVELED &&
+ game_status != CHOOSELEVEL &&
+ game_status != SETUP)
{
- CloseDoor(DOOR_CLOSE_1 | DOOR_OPEN_2 | DOOR_NO_DELAY);
game_status = MAINMENU;
DrawMainMenu();
return;
case MAINMENU:
case CHOOSELEVEL:
case SETUP:
- case SETUPINPUT:
switch(key)
{
case KSYM_Return:
HandleChooseLevel(0,0, 0,0, MB_MENU_CHOICE);
else if (game_status == SETUP)
HandleSetupScreen(0,0, 0,0, MB_MENU_CHOICE);
- else if (game_status == SETUPINPUT)
- HandleSetupInputScreen(0,0, 0,0, MB_MENU_CHOICE);
+ break;
+
+ case KSYM_Escape:
+ if (game_status == CHOOSELEVEL)
+ HandleChooseLevel(0,0, 0,0, MB_MENU_LEAVE);
+ else if (game_status == SETUP)
+ HandleSetupScreen(0,0, 0,0, MB_MENU_LEAVE);
break;
case KSYM_Page_Up:
break;
case LEVELED:
- if (!anyTextGadgetActiveOrJustFinished)
+ if (!anyTextGadgetActiveOrJustFinished || key == KSYM_Escape)
HandleLevelEditorKeyInput(key);
break;
case MAINMENU:
case CHOOSELEVEL:
case SETUP:
- case SETUPINPUT:
{
static unsigned long joystickmove_delay = 0;
HandleChooseLevel(0,0,dx,dy,newbutton ? MB_MENU_CHOICE : MB_MENU_MARK);
else if (game_status==SETUP)
HandleSetupScreen(0,0,dx,dy,newbutton ? MB_MENU_CHOICE : MB_MENU_MARK);
- else if (game_status==SETUPINPUT)
- HandleSetupInputScreen(0,0,dx,dy,
- newbutton ? MB_MENU_CHOICE : MB_MENU_MARK);
break;
}