JUMP,
ACTION,
- PAUSE_MENU,
+ START,
+ ESCAPE,
MENU_SELECT,
MENU_BACK,
break;
case SDL_CONTROLLER_BUTTON_START:
- set_control(Controller::PAUSE_MENU, ev.state);
+ set_control(Controller::START, ev.state);
break;
case SDL_CONTROLLER_BUTTON_LEFTSTICK:
bind_joybutton(0, 1, Controller::ACTION);
bind_joybutton(0, 4, Controller::PEEK_LEFT);
bind_joybutton(0, 5, Controller::PEEK_RIGHT);
- bind_joybutton(0, 6, Controller::PAUSE_MENU);
+ bind_joybutton(0, 6, Controller::START);
// Default joystick axis configuration
bind_joyaxis(0, -1, Controller::LEFT);
keymap[SDLK_SPACE] = Controller::JUMP;
keymap[SDLK_LCTRL] = Controller::ACTION;
keymap[SDLK_LALT] = Controller::ACTION;
- keymap[SDLK_ESCAPE] = Controller::PAUSE_MENU;
- keymap[SDLK_p] = Controller::PAUSE_MENU;
- keymap[SDLK_PAUSE] = Controller::PAUSE_MENU;
+ keymap[SDLK_ESCAPE] = Controller::ESCAPE;
+ keymap[SDLK_p] = Controller::START;
+ keymap[SDLK_PAUSE] = Controller::START;
keymap[SDLK_RETURN] = Controller::MENU_SELECT;
keymap[SDLK_KP_ENTER] = Controller::MENU_SELECT;
keymap[SDLK_CARET] = Controller::CONSOLE;
control = Controller::MENU_SELECT;
break;
case SDLK_ESCAPE:
+ control = Controller::ESCAPE;
+ break;
case SDLK_PAUSE:
- control = Controller::PAUSE_MENU;
+ control = Controller::START;
break;
default:
return;
}
if (m_cancel_button != -1 &&
- controller.pressed(Controller::MENU_BACK))
+ (controller.pressed(Controller::ESCAPE) ||
+ controller.pressed(Controller::MENU_BACK)))
{
on_button_click(m_cancel_button);
}
|| controller->pressed(Controller::MENU_SELECT)) {
menuaction = MENU_ACTION_HIT;
}
- if(controller->pressed(Controller::PAUSE_MENU)
- || controller->pressed(Controller::MENU_BACK)) {
+ if(controller->pressed(Controller::ESCAPE) ||
+ controller->pressed(Controller::START) ||
+ controller->pressed(Controller::MENU_BACK)) {
menuaction = MENU_ACTION_BACK;
}
GameSession::update(float elapsed_time)
{
// handle controller
- if(InputManager::current()->get_controller()->pressed(Controller::PAUSE_MENU))
+ if(InputManager::current()->get_controller()->pressed(Controller::ESCAPE) ||
+ InputManager::current()->get_controller()->pressed(Controller::START))
{
on_escape_press();
}
if(controller->pressed(Controller::JUMP)
|| controller->pressed(Controller::ACTION)
|| controller->pressed(Controller::MENU_SELECT)
- || controller->pressed(Controller::PAUSE_MENU)) {
+ || controller->pressed(Controller::START)
+ || controller->pressed(Controller::ESCAPE)) {
ScreenManager::current()->pop_screen(std::unique_ptr<ScreenFade>(new FadeOut(0.1)));
}
add_controlfield(Controller::RIGHT, _("Right"));
add_controlfield(Controller::JUMP, _("Jump"));
add_controlfield(Controller::ACTION, _("Action"));
- add_controlfield(Controller::PAUSE_MENU, _("Pause/Menu"));
+ add_controlfield(Controller::START, _("Pause/Menu"));
add_controlfield(Controller::PEEK_LEFT, _("Peek Left"));
add_controlfield(Controller::PEEK_RIGHT, _("Peek Right"));
add_controlfield(Controller::PEEK_UP, _("Peek Up"));
refresh_menu_item(Controller::JUMP);
refresh_menu_item(Controller::ACTION);
- refresh_menu_item(Controller::PAUSE_MENU);
+ refresh_menu_item(Controller::START);
refresh_menu_item(Controller::PEEK_LEFT);
refresh_menu_item(Controller::PEEK_RIGHT);
refresh_menu_item(Controller::PEEK_UP);
|| controller->pressed(Controller::MENU_SELECT)
)&& !(controller->pressed(Controller::UP))) // prevent skipping if jump with up is enabled
scroll += SCROLL;
- if(controller->pressed(Controller::PAUSE_MENU)) {
+ if(controller->pressed(Controller::START) ||
+ controller->pressed(Controller::ESCAPE)) {
ScreenManager::current()->pop_screen(std::unique_ptr<ScreenFade>(new FadeOut(0.5)));
}
if(!controller->pressed(Controller::UP))
enter_level = true;
}
- if(controller->pressed(Controller::PAUSE_MENU))
+ if(controller->pressed(Controller::START) ||
+ controller->pressed(Controller::ESCAPE))
{
on_escape_press();
}