From 38bbbb3fb7d8bc59c3459816cc3d7dbcdd64c326 Mon Sep 17 00:00:00 2001 From: Aloshi Date: Mon, 12 Nov 2012 09:27:07 -0600 Subject: [PATCH] Moved PAGEUP/PAGEDOWN configuration to the end of the enums to preserve backwards compatibility with older es_input.cfgs. --- src/InputManager.h | 2 +- src/components/GuiInputConfig.cpp | 2 +- src/components/GuiList.cpp | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/InputManager.h b/src/InputManager.h index 1c010580f..2b62c6334 100644 --- a/src/InputManager.h +++ b/src/InputManager.h @@ -17,7 +17,7 @@ namespace InputManager { void loadConfig(); //enum for identifying input, regardless of configuration - enum InputButton { UNKNOWN, UP, DOWN, PAGEUP, PAGEDOWN, LEFT, RIGHT, BUTTON1, BUTTON2, MENU, SELECT}; + enum InputButton { UNKNOWN, UP, DOWN, LEFT, RIGHT, BUTTON1, BUTTON2, MENU, SELECT, PAGEUP, PAGEDOWN}; void processEvent(SDL_Event* event); diff --git a/src/components/GuiInputConfig.cpp b/src/components/GuiInputConfig.cpp index c263c59d5..24f8aaf11 100644 --- a/src/components/GuiInputConfig.cpp +++ b/src/components/GuiInputConfig.cpp @@ -4,7 +4,7 @@ #include std::string GuiInputConfig::sConfigPath = "./input.cfg"; -std::string GuiInputConfig::sInputs[] = { "UNKNOWN", "UP", "DOWN", "PAGEUP", "PAGEDOWN", "LEFT", "RIGHT", "BUTTON1 (Accept)", "BUTTON2 (Back)", "START (Menu)", "SELECT (Jump-to-letter)" }; //must be same order as InputManager::InputButton enum +std::string GuiInputConfig::sInputs[] = { "UNKNOWN", "UP", "DOWN", "LEFT", "RIGHT", "BUTTON1 (Accept)", "BUTTON2 (Back)", "START (Menu)", "SELECT (Jump-to-letter)", "PAGE UP", "PAGE DOWN" }; //must be same order as InputManager::InputButton enum; only add to the end to preserve backwards compatibility int GuiInputConfig::sInputCount = 9; GuiInputConfig::GuiInputConfig() diff --git a/src/components/GuiList.cpp b/src/components/GuiList.cpp index ffc22b7f8..532c9497d 100644 --- a/src/components/GuiList.cpp +++ b/src/components/GuiList.cpp @@ -166,14 +166,14 @@ void GuiList::scroll() if(mSelection < 0) { - if(mScrollDir == -10) + if(mScrollDir < -1) mSelection = 0; else mSelection += mRowVector.size(); } if(mSelection >= (int)mRowVector.size()) { - if(mScrollDir == 10) + if(mScrollDir > 1) mSelection = (int)mRowVector.size() - 1; else mSelection -= mRowVector.size();