mirror of
https://github.com/RetroDECK/ES-DE.git
synced 2024-11-23 06:35:38 +00:00
Help prompts are now sorted, to the order [dpad] [face buttons] [start/select].
This commit is contained in:
parent
e5bada7f51
commit
1b66150fe7
|
@ -241,5 +241,30 @@ void Window::setHelpPrompts(const std::vector<HelpPrompt>& prompts)
|
||||||
addPrompts.push_back(*it);
|
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);
|
mHelp->setPrompts(addPrompts);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue