mirror of
https://github.com/RetroDECK/ES-DE.git
synced 2024-11-22 22:25: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
|
// Whether to enable alternative emulators per game (the option to disable this is intended
|
||||||
// primarily for testing purposes).
|
// primarily for testing purposes).
|
||||||
auto alternativeEmulatorPerGame = std::make_shared<SwitchComponent>(mWindow);
|
auto alternativeEmulatorPerGame = std::make_shared<SwitchComponent>(mWindow);
|
||||||
|
|
|
@ -961,7 +961,11 @@ void ViewController::preload()
|
||||||
std::to_string(systemCount) + ")");
|
std::to_string(systemCount) + ")");
|
||||||
}
|
}
|
||||||
(*it)->getIndex()->resetFilters();
|
(*it)->getIndex()->resetFilters();
|
||||||
getGameListView(*it);
|
|
||||||
|
if (Settings::getInstance()->getBool("PreloadGamelists"))
|
||||||
|
getGameListView(*it)->preloadGamelist();
|
||||||
|
else
|
||||||
|
getGameListView(*it);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Load navigation sounds, either from the theme if it supports it, or otherwise from
|
// Load navigation sounds, either from the theme if it supports it, or otherwise from
|
||||||
|
|
|
@ -25,6 +25,8 @@ public:
|
||||||
virtual std::string getName() const override { return "detailed"; }
|
virtual std::string getName() const override { return "detailed"; }
|
||||||
virtual void launch(FileData* game) override;
|
virtual void launch(FileData* game) override;
|
||||||
|
|
||||||
|
virtual void preloadGamelist() override { updateInfoPanel(); }
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
virtual void update(int deltaTime) override;
|
virtual void update(int deltaTime) override;
|
||||||
|
|
||||||
|
|
|
@ -32,6 +32,8 @@ public:
|
||||||
void setTheme(const std::shared_ptr<ThemeData>& theme);
|
void setTheme(const std::shared_ptr<ThemeData>& theme);
|
||||||
const std::shared_ptr<ThemeData>& getTheme() const { return mTheme; }
|
const std::shared_ptr<ThemeData>& getTheme() const { return mTheme; }
|
||||||
|
|
||||||
|
virtual void preloadGamelist(){};
|
||||||
|
|
||||||
virtual FileData* getCursor() = 0;
|
virtual FileData* getCursor() = 0;
|
||||||
virtual void setCursor(FileData*) = 0;
|
virtual void setCursor(FileData*) = 0;
|
||||||
virtual FileData* getNextEntry() = 0;
|
virtual FileData* getNextEntry() = 0;
|
||||||
|
|
|
@ -28,6 +28,8 @@ public:
|
||||||
virtual std::string getName() const override { return "video"; }
|
virtual std::string getName() const override { return "video"; }
|
||||||
virtual void launch(FileData* game) override;
|
virtual void launch(FileData* game) override;
|
||||||
|
|
||||||
|
virtual void preloadGamelist() override { updateInfoPanel(); }
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
virtual void update(int deltaTime) override;
|
virtual void update(int deltaTime) override;
|
||||||
|
|
||||||
|
|
|
@ -242,6 +242,7 @@ void Settings::setDefaults()
|
||||||
mBoolMap["VideoHardwareDecoding"] = {false, false};
|
mBoolMap["VideoHardwareDecoding"] = {false, false};
|
||||||
#endif
|
#endif
|
||||||
mBoolMap["VideoUpscaleFrameRate"] = {false, false};
|
mBoolMap["VideoUpscaleFrameRate"] = {false, false};
|
||||||
|
mBoolMap["PreloadGamelists"] = {true, true};
|
||||||
mBoolMap["AlternativeEmulatorPerGame"] = {true, true};
|
mBoolMap["AlternativeEmulatorPerGame"] = {true, true};
|
||||||
mBoolMap["ShowHiddenFiles"] = {true, true};
|
mBoolMap["ShowHiddenFiles"] = {true, true};
|
||||||
mBoolMap["ShowHiddenGames"] = {true, true};
|
mBoolMap["ShowHiddenGames"] = {true, true};
|
||||||
|
|
Loading…
Reference in a new issue