mirror of
https://github.com/RetroDECK/ES-DE.git
synced 2024-11-25 23:55:38 +00:00
Merge pull request #257 from raelgc/master
Alow to select a system to go directly to the game list (Fixes #253)
This commit is contained in:
commit
de42e1c2bd
|
@ -3,6 +3,7 @@
|
|||
#include "Window.h"
|
||||
#include "Sound.h"
|
||||
#include "Log.h"
|
||||
#include "SystemData.h"
|
||||
#include "Settings.h"
|
||||
#include "PowerSaver.h"
|
||||
#include "guis/GuiMsgBox.h"
|
||||
|
@ -266,6 +267,21 @@ void GuiMenu::openUISettings()
|
|||
ViewController::get()->reloadAll();
|
||||
});
|
||||
|
||||
// Optionally start in selected system
|
||||
auto systemfocus_list = std::make_shared< OptionListComponent<std::string> >(mWindow, "START ON SYSTEM", false);
|
||||
systemfocus_list->add("NONE", "", Settings::getInstance()->getString("StartupSystem") == "");
|
||||
for (auto it = SystemData::sSystemVector.begin(); it != SystemData::sSystemVector.end(); it++)
|
||||
{
|
||||
if ("retropie" != (*it)->getName())
|
||||
{
|
||||
systemfocus_list->add((*it)->getName(), (*it)->getName(), Settings::getInstance()->getString("StartupSystem") == (*it)->getName());
|
||||
}
|
||||
}
|
||||
s->addWithLabel("START ON SYSTEM", systemfocus_list);
|
||||
s->addSaveFunc([systemfocus_list] {
|
||||
Settings::getInstance()->setString("StartupSystem", systemfocus_list->getSelected());
|
||||
});
|
||||
|
||||
// show help
|
||||
auto show_help = std::make_shared<SwitchComponent>(mWindow);
|
||||
show_help->setState(Settings::getInstance()->getBool("ShowHelpPrompts"));
|
||||
|
|
|
@ -44,6 +44,18 @@ ViewController::~ViewController()
|
|||
|
||||
void ViewController::goToStart()
|
||||
{
|
||||
// If specific system is requested, go directly to the game list
|
||||
auto requestedSystem = Settings::getInstance()->getString("StartupSystem");
|
||||
if("" != requestedSystem && "retropie" != requestedSystem)
|
||||
{
|
||||
for(auto it = SystemData::sSystemVector.begin(); it != SystemData::sSystemVector.end(); it++){
|
||||
if ((*it)->getName() == requestedSystem)
|
||||
{
|
||||
goToGameList(*it);
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
goToSystemView(SystemData::sSystemVector.at(0));
|
||||
}
|
||||
|
||||
|
|
|
@ -47,6 +47,7 @@ void Settings::setDefaults()
|
|||
mBoolMap["ShowExit"] = true;
|
||||
mBoolMap["Windowed"] = false;
|
||||
mBoolMap["SplashScreen"] = true;
|
||||
mStringMap["StartupSystem"] = "";
|
||||
|
||||
#ifdef _RPI_
|
||||
// don't enable VSync by default on the Pi, since it already
|
||||
|
|
Loading…
Reference in a new issue