Moved PAGEUP/PAGEDOWN configuration to the end of the enums to preserve backwards compatibility with older es_input.cfgs.

This commit is contained in:
Aloshi 2012-11-12 09:27:07 -06:00
parent ae4498f5f4
commit 38bbbb3fb7
3 changed files with 4 additions and 4 deletions

View file

@ -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);

View file

@ -4,7 +4,7 @@
#include <fstream>
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()

View file

@ -166,14 +166,14 @@ void GuiList<listType>::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();