Fixed non-ASCII characters never setting an initial selected value for "jump to letter."

This commit is contained in:
Aloshi 2015-03-05 17:33:19 -06:00
parent 5d0fc6a1b7
commit a6a9fff50f

View file

@ -10,12 +10,13 @@ GuiGamelistOptions::GuiGamelistOptions(Window* window, SystemData* system) : Gui
addChild(&mMenu); addChild(&mMenu);
// jump to letter // jump to letter
char curChar = getGamelist()->getCursor()->getName()[0]; char curChar = toupper(getGamelist()->getCursor()->getName()[0]);
if(curChar < 'A' || curChar > 'Z')
curChar = 'A';
mJumpToLetterList = std::make_shared<LetterList>(mWindow, "JUMP TO LETTER", false); mJumpToLetterList = std::make_shared<LetterList>(mWindow, "JUMP TO LETTER", false);
for(char c = 'A'; c <= 'Z'; c++) for(char c = 'A'; c <= 'Z'; c++)
{
mJumpToLetterList->add(std::string(1, c), c, c == curChar); mJumpToLetterList->add(std::string(1, c), c, c == curChar);
}
ComponentListRow row; ComponentListRow row;
row.addElement(std::make_shared<TextComponent>(mWindow, "JUMP TO LETTER", Font::get(FONT_SIZE_MEDIUM), 0x777777FF), true); row.addElement(std::make_shared<TextComponent>(mWindow, "JUMP TO LETTER", Font::get(FONT_SIZE_MEDIUM), 0x777777FF), true);