mirror of
https://github.com/RetroDECK/ES-DE.git
synced 2024-11-22 14:15:38 +00:00
Add an UI option to automatically load a system gamelist (Fixes #253)
This commit is contained in:
parent
3c60235363
commit
c1f836c713
|
@ -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));
|
||||
}
|
||||
|
||||
|
@ -503,7 +515,7 @@ void ViewController::monitorUIMode()
|
|||
{
|
||||
std::string uimode = Settings::getInstance()->getString("UIMode");
|
||||
if (uimode != mCurUIMode) // UIMODE HAS CHANGED
|
||||
{
|
||||
{
|
||||
mCurUIMode = uimode;
|
||||
reloadAll();
|
||||
goToStart();
|
||||
|
|
|
@ -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