mirror of
https://github.com/RetroDECK/ES-DE.git
synced 2024-11-22 14:15:38 +00:00
Added an option to preload gamelists on startup.
This commit is contained in:
parent
62d810d46c
commit
270a2e3857
|
@ -1046,6 +1046,17 @@ void GuiMenu::openOtherOptions()
|
|||
}
|
||||
});
|
||||
|
||||
// Whether to preload the gamelists on application startup.
|
||||
auto preloadGamelists = std::make_shared<SwitchComponent>(mWindow);
|
||||
preloadGamelists->setState(Settings::getInstance()->getBool("PreloadGamelists"));
|
||||
s->addWithLabel("PRELOAD GAMELISTS ON STARTUP", preloadGamelists);
|
||||
s->addSaveFunc([preloadGamelists, s] {
|
||||
if (preloadGamelists->getState() != Settings::getInstance()->getBool("PreloadGamelists")) {
|
||||
Settings::getInstance()->setBool("PreloadGamelists", preloadGamelists->getState());
|
||||
s->setNeedsSaving();
|
||||
}
|
||||
});
|
||||
|
||||
// Whether to enable alternative emulators per game (the option to disable this is intended
|
||||
// primarily for testing purposes).
|
||||
auto alternativeEmulatorPerGame = std::make_shared<SwitchComponent>(mWindow);
|
||||
|
|
|
@ -961,6 +961,10 @@ void ViewController::preload()
|
|||
std::to_string(systemCount) + ")");
|
||||
}
|
||||
(*it)->getIndex()->resetFilters();
|
||||
|
||||
if (Settings::getInstance()->getBool("PreloadGamelists"))
|
||||
getGameListView(*it)->preloadGamelist();
|
||||
else
|
||||
getGameListView(*it);
|
||||
}
|
||||
|
||||
|
|
|
@ -25,6 +25,8 @@ public:
|
|||
virtual std::string getName() const override { return "detailed"; }
|
||||
virtual void launch(FileData* game) override;
|
||||
|
||||
virtual void preloadGamelist() override { updateInfoPanel(); }
|
||||
|
||||
protected:
|
||||
virtual void update(int deltaTime) override;
|
||||
|
||||
|
|
|
@ -32,6 +32,8 @@ public:
|
|||
void setTheme(const std::shared_ptr<ThemeData>& theme);
|
||||
const std::shared_ptr<ThemeData>& getTheme() const { return mTheme; }
|
||||
|
||||
virtual void preloadGamelist(){};
|
||||
|
||||
virtual FileData* getCursor() = 0;
|
||||
virtual void setCursor(FileData*) = 0;
|
||||
virtual FileData* getNextEntry() = 0;
|
||||
|
|
|
@ -28,6 +28,8 @@ public:
|
|||
virtual std::string getName() const override { return "video"; }
|
||||
virtual void launch(FileData* game) override;
|
||||
|
||||
virtual void preloadGamelist() override { updateInfoPanel(); }
|
||||
|
||||
protected:
|
||||
virtual void update(int deltaTime) override;
|
||||
|
||||
|
|
|
@ -242,6 +242,7 @@ void Settings::setDefaults()
|
|||
mBoolMap["VideoHardwareDecoding"] = {false, false};
|
||||
#endif
|
||||
mBoolMap["VideoUpscaleFrameRate"] = {false, false};
|
||||
mBoolMap["PreloadGamelists"] = {true, true};
|
||||
mBoolMap["AlternativeEmulatorPerGame"] = {true, true};
|
||||
mBoolMap["ShowHiddenFiles"] = {true, true};
|
||||
mBoolMap["ShowHiddenGames"] = {true, true};
|
||||
|
|
Loading…
Reference in a new issue