Added support for including the left and right trigger buttons in the help prompts.

This commit is contained in:
Leon Styhre 2021-09-17 21:14:43 +02:00
parent 42458a7d76
commit 13abaf6734
4 changed files with 13 additions and 1 deletions

View file

@ -89,6 +89,10 @@ void HelpStyle::applyTheme(const std::shared_ptr<ThemeData>& theme, const std::s
mCustomButtons.button_r = elem->get<std::string>("button_r");
if (elem->has("button_lr"))
mCustomButtons.button_lr = elem->get<std::string>("button_lr");
if (elem->has("button_lt"))
mCustomButtons.button_lt = elem->get<std::string>("button_lt");
if (elem->has("button_rt"))
mCustomButtons.button_rt = elem->get<std::string>("button_rt");
// SNES.
if (elem->has("button_a_SNES"))

View file

@ -40,6 +40,8 @@ struct HelpStyle {
std::string button_l;
std::string button_r;
std::string button_lr;
std::string button_lt;
std::string button_rt;
// SNES.
std::string button_a_SNES;

View file

@ -657,8 +657,10 @@ void Window::setHelpPrompts(const std::vector<HelpPrompt>& prompts, const HelpSt
"b",
"x",
"y",
"l",
"r",
"l",
"rt",
"lt",
"start",
"back"};
int i = 0;

View file

@ -51,6 +51,10 @@ void HelpComponent::assignIcons()
mStyle.mCustomButtons.button_r;
sIconPathMap["lr"] = mStyle.mCustomButtons.button_lr.empty() ? ":/help/button_lr.svg" :
mStyle.mCustomButtons.button_lr;
sIconPathMap["lt"] = mStyle.mCustomButtons.button_lt.empty() ? ":/help/button_lt.svg" :
mStyle.mCustomButtons.button_lt;
sIconPathMap["rt"] = mStyle.mCustomButtons.button_rt.empty() ? ":/help/button_rt.svg" :
mStyle.mCustomButtons.button_rt;
// These graphics files are custom per controller type.
if (controllerType == "snes") {