From 1b66150fe7ce20d5e1d6600bf47c934649f53ba4 Mon Sep 17 00:00:00 2001 From: Aloshi Date: Sun, 6 Apr 2014 19:24:01 -0500 Subject: [PATCH] Help prompts are now sorted, to the order [dpad] [face buttons] [start/select]. --- src/Window.cpp | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) 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); }