From ce331351b119653b4cca5ab93003d8ad7ca2c837 Mon Sep 17 00:00:00 2001 From: Ricardo Cruz Date: Fri, 23 Apr 2004 11:12:43 +0000 Subject: [PATCH] Added a joystick control dialog. I don't have a joystick, so please test and improve this thing. Thx. SVN-Revision: 664 --- src/menu.cpp | 3 ++- src/menu.h | 3 ++- src/setup.cpp | 41 +++++++++++++++++++++++++++++------------ 3 files changed, 33 insertions(+), 14 deletions(-) diff --git a/src/menu.cpp b/src/menu.cpp index 798dce394..db41fce82 100644 --- a/src/menu.cpp +++ b/src/menu.cpp @@ -48,7 +48,8 @@ Menu* main_menu = 0; Menu* game_menu = 0; Menu* worldmap_menu = 0; Menu* options_menu = 0; -Menu* options_controls_menu = 0; +Menu* options_keys_menu = 0; +Menu* options_joystick_menu = 0; Menu* highscore_menu = 0; Menu* load_game_menu = 0; Menu* save_game_menu = 0; diff --git a/src/menu.h b/src/menu.h index 47643507b..43aee8596 100644 --- a/src/menu.h +++ b/src/menu.h @@ -155,7 +155,8 @@ extern Menu* main_menu; extern Menu* game_menu; extern Menu* worldmap_menu; extern Menu* options_menu; -extern Menu* options_controls_menu; +extern Menu* options_keys_menu; +extern Menu* options_joystick_menu; extern Menu* highscore_menu; extern Menu* load_game_menu; extern Menu* save_game_menu; diff --git a/src/setup.cpp b/src/setup.cpp index 765f1070c..1b63b7728 100644 --- a/src/setup.cpp +++ b/src/setup.cpp @@ -365,7 +365,8 @@ void st_menu(void) { main_menu = new Menu(); options_menu = new Menu(); - options_controls_menu = new Menu(); + options_keys_menu = new Menu(); + options_joystick_menu = new Menu(); load_game_menu = new Menu(); save_game_menu = new Menu(); game_menu = new Menu(); @@ -401,20 +402,36 @@ void st_menu(void) options_menu->additem(MN_DEACTIVE,"Music ",use_music,0); } options_menu->additem(MN_TOGGLE,"Show FPS ",show_fps,0); - options_menu->additem(MN_GOTO,"Controls ",0,options_controls_menu); + options_menu->additem(MN_GOTO,"Key Setup ",0,options_keys_menu); + if(use_joystick) + options_menu->additem(MN_GOTO,"Joystick Setup ",0,options_joystick_menu); options_menu->additem(MN_HL,"",0,0); options_menu->additem(MN_BACK,"Back",0,0); - options_controls_menu->additem(MN_LABEL,"Controls",0,0); - options_controls_menu->additem(MN_HL,"",0,0); - options_controls_menu->additem(MN_CONTROLFIELD,"Left move", 0,0, &keymap.left); - options_controls_menu->additem(MN_CONTROLFIELD,"Right move", 0,0, &keymap.right); - options_controls_menu->additem(MN_CONTROLFIELD,"Jump", 0,0, &keymap.jump); - options_controls_menu->additem(MN_CONTROLFIELD,"Duck", 0,0, &keymap.duck); - options_controls_menu->additem(MN_CONTROLFIELD,"Power", 0,0, &keymap.fire); - options_controls_menu->additem(MN_HL,"",0,0); - options_controls_menu->additem(MN_BACK,"Back",0,0); - + options_keys_menu->additem(MN_LABEL,"Key Setup",0,0); + options_keys_menu->additem(MN_HL,"",0,0); + options_keys_menu->additem(MN_CONTROLFIELD,"Left move", 0,0, &keymap.left); + options_keys_menu->additem(MN_CONTROLFIELD,"Right move", 0,0, &keymap.right); + options_keys_menu->additem(MN_CONTROLFIELD,"Jump", 0,0, &keymap.jump); + options_keys_menu->additem(MN_CONTROLFIELD,"Duck", 0,0, &keymap.duck); + options_keys_menu->additem(MN_CONTROLFIELD,"Power", 0,0, &keymap.fire); + options_keys_menu->additem(MN_HL,"",0,0); + options_keys_menu->additem(MN_BACK,"Back",0,0); + + if(use_joystick) + { + options_joystick_menu->additem(MN_LABEL,"Joystick Setup",0,0); + options_joystick_menu->additem(MN_HL,"",0,0); + options_joystick_menu->additem(MN_CONTROLFIELD,"X axis", 0,0, &joystick_keymap.x_axis); + options_joystick_menu->additem(MN_CONTROLFIELD,"Y axis", 0,0, &joystick_keymap.y_axis); + options_joystick_menu->additem(MN_CONTROLFIELD,"A button", 0,0, &joystick_keymap.a_button); + options_joystick_menu->additem(MN_CONTROLFIELD,"B button", 0,0, &joystick_keymap.b_button); + options_joystick_menu->additem(MN_CONTROLFIELD,"Start", 0,0, &joystick_keymap.start_button); + options_joystick_menu->additem(MN_CONTROLFIELD,"DeadZone", 0,0, &joystick_keymap.dead_zone); + options_joystick_menu->additem(MN_HL,"",0,0); + options_joystick_menu->additem(MN_BACK,"Back",0,0); + } + load_game_menu->additem(MN_LABEL,"Start Game",0,0); load_game_menu->additem(MN_HL,"",0,0); load_game_menu->additem(MN_DEACTIVE,"Slot 1",0,0); -- 2.11.0