From 6d8fd6fc92dcd517c2190b86bb1fbc3475f7573a Mon Sep 17 00:00:00 2001 From: "simon.kagstrom" Date: Mon, 25 Jan 2010 10:49:05 +0000 Subject: [PATCH] Add ability to reset joystick bindings --- bind_keys_menu.cpp | 8 +++++++- menu_messages.cpp | 2 ++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/bind_keys_menu.cpp b/bind_keys_menu.cpp index 497bb9c..1cac06c 100644 --- a/bind_keys_menu.cpp +++ b/bind_keys_menu.cpp @@ -118,6 +118,10 @@ public: panic("Classic: impossible selection %d", this->p_submenus[4].sel); break; } break; + case 11: + printf("Resetting joystick setup to defaults\n"); + Gui::gui->popView(); + return; default: panic("Impossible menu option\n"); break; @@ -206,6 +210,8 @@ public: this->hm[8] = this->addOne(this->hm[8], this->allocOne("Horiz: %s", stringToPtr_Classic("RAH"))); this->hm[8] = this->addOne(this->hm[8], this->allocOne("Vert: %s", stringToPtr_Classic("RAV"))); + this->hm[11] = this->addOne(this->hm[11], "Revert to defaults"); + this->help->setHelpMessages(this->hm); } @@ -386,7 +392,7 @@ private: HelpBox *help; int *cur_key; - const char **hm[10]; + const char **hm[12]; }; void AnalogueBindListener::selectCallback(DialogueBox *which, int selected) diff --git a/menu_messages.cpp b/menu_messages.cpp index e44ef42..5de8723 100644 --- a/menu_messages.cpp +++ b/menu_messages.cpp @@ -158,6 +158,8 @@ const char **bind_key_menu_messages = (const char*[]){ /*07*/ "^|Horiz|Vert", /*08*/ "Classic(right analogue)", /*09*/ "^|Horiz|Vert", + /*10*/ " ", + /*11*/ "Reset to defaults", NULL };