Help prompts are now sorted, to the order [dpad] [face buttons] [start/select].

This commit is contained in:
Aloshi 2014-04-06 19:24:01 -05:00
parent e5bada7f51
commit 1b66150fe7

View file

@ -241,5 +241,30 @@ void Window::setHelpPrompts(const std::vector<HelpPrompt>& prompts)
addPrompts.push_back(*it);
}
// sort prompts so it goes [dpad_all] [dpad_u/d] [dpad_l/r] [a/b/x/y/l/r] [start/select]
std::sort(addPrompts.begin(), addPrompts.end(), [](const HelpPrompt& a, const HelpPrompt& b) -> bool {
static const char* map[] = {
"up/down/left/right",
"up/down",
"left/right",
"a", "b", "x", "y", "l", "r",
"start", "select",
NULL
};
int i = 0;
while(map[i] != NULL)
{
if(a.first == map[i])
return true;
else if(b.first == map[i])
return false;
i++;
}
return true;
});
mHelp->setPrompts(addPrompts);
}