diff --git a/src/Window.cpp b/src/Window.cpp index e69a1c1bb..72952b524 100644 --- a/src/Window.cpp +++ b/src/Window.cpp @@ -241,5 +241,30 @@ void Window::setHelpPrompts(const std::vector& 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); }