From 0743828b7729fda87e1cc1b02007717e4ea433d9 Mon Sep 17 00:00:00 2001 From: Aloshi Date: Wed, 14 May 2014 21:31:26 -0500 Subject: [PATCH] Added toggle for left/right changing system. Analog controller users everywhere rejoice! --- src/Settings.cpp | 1 + src/guis/GuiMenu.cpp | 6 ++++++ src/views/gamelist/BasicGameListView.cpp | 5 ++++- src/views/gamelist/ISimpleGameListView.cpp | 19 +++++++++++++------ 4 files changed, 24 insertions(+), 7 deletions(-) diff --git a/src/Settings.cpp b/src/Settings.cpp index b3d36298b..c82cf72df 100644 --- a/src/Settings.cpp +++ b/src/Settings.cpp @@ -35,6 +35,7 @@ void Settings::setDefaults() mBoolMap["ScrapeRatings"] = true; mBoolMap["IgnoreGamelist"] = false; mBoolMap["ParseGamelistOnly"] = false; + mBoolMap["QuickSystemSelect"] = true; mBoolMap["Debug"] = false; mBoolMap["DebugGrid"] = false; diff --git a/src/guis/GuiMenu.cpp b/src/guis/GuiMenu.cpp index 7a1089be8..3599580f2 100644 --- a/src/guis/GuiMenu.cpp +++ b/src/guis/GuiMenu.cpp @@ -111,6 +111,12 @@ GuiMenu::GuiMenu(Window* window) : GuiComponent(window), mMenu(window, "MAIN MEN s->addWithLabel("ON-SCREEN HELP", show_help); s->addSaveFunc([show_help] { Settings::getInstance()->setBool("ShowHelpPrompts", show_help->getState()); }); + // quick system select (left/right in game list view) + auto quick_sys_select = std::make_shared(mWindow); + quick_sys_select->setState(Settings::getInstance()->getBool("QuickSystemSelect")); + s->addWithLabel("QUICK SYSTEM SELECT", quick_sys_select); + s->addSaveFunc([quick_sys_select] { Settings::getInstance()->setBool("QuickSystemSelect", quick_sys_select->getState()); }); + // transition style auto transition_style = std::make_shared< OptionListComponent >(mWindow, "TRANSITION STYLE", false); std::vector transitions; diff --git a/src/views/gamelist/BasicGameListView.cpp b/src/views/gamelist/BasicGameListView.cpp index 75bf2b8c5..a45916614 100644 --- a/src/views/gamelist/BasicGameListView.cpp +++ b/src/views/gamelist/BasicGameListView.cpp @@ -4,6 +4,7 @@ #include "../../Window.h" #include "../../ThemeData.h" #include "../../SystemData.h" +#include "../../Settings.h" BasicGameListView::BasicGameListView(Window* window, FileData* root) : ISimpleGameListView(window, root), mList(window) @@ -68,7 +69,9 @@ void BasicGameListView::launch(FileData* game) std::vector BasicGameListView::getHelpPrompts() { std::vector prompts; - prompts.push_back(HelpPrompt("left/right", "system")); + + if(Settings::getInstance()->getBool("QuickSystemSelect")) + prompts.push_back(HelpPrompt("left/right", "system")); prompts.push_back(HelpPrompt("up/down", "choose")); prompts.push_back(HelpPrompt("a", "launch")); prompts.push_back(HelpPrompt("b", "back")); diff --git a/src/views/gamelist/ISimpleGameListView.cpp b/src/views/gamelist/ISimpleGameListView.cpp index d6d5719eb..974ab459e 100644 --- a/src/views/gamelist/ISimpleGameListView.cpp +++ b/src/views/gamelist/ISimpleGameListView.cpp @@ -3,6 +3,7 @@ #include "../../Window.h" #include "../ViewController.h" #include "../../Sound.h" +#include "../../Settings.h" ISimpleGameListView::ISimpleGameListView(Window* window, FileData* root) : IGameListView(window, root), mHeaderText(window), mHeaderImage(window), mBackground(window), mThemeExtras(window) @@ -87,14 +88,20 @@ bool ISimpleGameListView::input(InputConfig* config, Input input) return true; }else if(config->isMappedTo("right", input)) { - onFocusLost(); - mWindow->getViewController()->goToNextGameList(); - return true; + if(Settings::getInstance()->getBool("QuickSystemSelect")) + { + onFocusLost(); + mWindow->getViewController()->goToNextGameList(); + return true; + } }else if(config->isMappedTo("left", input)) { - onFocusLost(); - mWindow->getViewController()->goToPrevGameList(); - return true; + if(Settings::getInstance()->getBool("QuickSystemSelect")) + { + onFocusLost(); + mWindow->getViewController()->goToPrevGameList(); + return true; + } } }