projects
/
supertux.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
18f921d
)
Added MENU_BACK button (i.e. B on Xbox360 controller)
author
Ingo Ruhnke
<grumbel@gmail.com>
Wed, 6 Aug 2014 04:37:29 +0000
(06:37 +0200)
committer
Ingo Ruhnke
<grumbel@gmail.com>
Wed, 6 Aug 2014 04:37:29 +0000
(06:37 +0200)
src/control/controller.cpp
patch
|
blob
|
history
src/control/controller.hpp
patch
|
blob
|
history
src/control/game_controller_manager.cpp
patch
|
blob
|
history
src/gui/menu.cpp
patch
|
blob
|
history
diff --git
a/src/control/controller.cpp
b/src/control/controller.cpp
index
93d6536
..
6a3882e
100644
(file)
--- a/
src/control/controller.cpp
+++ b/
src/control/controller.cpp
@@
-25,6
+25,7
@@
const char* Controller::controlNames[] = {
"action",
"pause-menu",
"menu-select",
+ "menu-back",
"console",
"peek-left",
"peek-right",
diff --git
a/src/control/controller.hpp
b/src/control/controller.hpp
index
5bec758
..
b73695d
100644
(file)
--- a/
src/control/controller.hpp
+++ b/
src/control/controller.hpp
@@
-33,6
+33,7
@@
public:
PAUSE_MENU,
MENU_SELECT,
+ MENU_BACK,
CONSOLE,
diff --git
a/src/control/game_controller_manager.cpp
b/src/control/game_controller_manager.cpp
index
160e598
..
b76d41f
100644
(file)
--- a/
src/control/game_controller_manager.cpp
+++ b/
src/control/game_controller_manager.cpp
@@
-49,6
+49,7
@@
GameControllerManager::process_button_event(const SDL_ControllerButtonEvent& ev)
break;
case SDL_CONTROLLER_BUTTON_B:
+ controller->set_control(Controller::MENU_BACK, ev.state);
break;
case SDL_CONTROLLER_BUTTON_X:
diff --git
a/src/gui/menu.cpp
b/src/gui/menu.cpp
index
e3fce4b
..
c2917e7
100644
(file)
--- a/
src/gui/menu.cpp
+++ b/
src/gui/menu.cpp
@@
-273,7
+273,8
@@
Menu::update()
|| controller->pressed(Controller::MENU_SELECT)) {
menuaction = MENU_ACTION_HIT;
}
- if(controller->pressed(Controller::PAUSE_MENU)) {
+ if(controller->pressed(Controller::PAUSE_MENU)
+ || controller->pressed(Controller::MENU_BACK)) {
menuaction = MENU_ACTION_BACK;
}