Commit d0dfe480 authored by Aloshi's avatar Aloshi

Work on new OptionListComponent.

parent 8928ce49
......@@ -104,6 +104,9 @@ void ComponentList::onCursorChanged(const CursorState& state)
void ComponentList::render(const Eigen::Affine3f& parentTrans)
{
if(!size())
return;
Eigen::Affine3f trans = parentTrans * getTransform();
// clip everything to be inside our bounds
......
This diff is collapsed.
......@@ -23,20 +23,18 @@ GuiScraperStart::GuiScraperStart(Window* window) : GuiComponent(window),
using namespace Eigen;
//add filters (with first one selected)
mFiltersOpt.addEntry(mFiltersOpt.makeEntry("All Games",
[](SystemData*, FileData*) -> bool { return true; }, true));
mFiltersOpt.addEntry(mFiltersOpt.makeEntry("Missing Image",
[](SystemData*, FileData* g) -> bool { return g->metadata.get("image").empty(); }));
mFiltersOpt.add("All Games",
[](SystemData*, FileData*) -> bool { return true; }, true);
mFiltersOpt.add("Missing Image",
[](SystemData*, FileData* g) -> bool { return g->metadata.get("image").empty(); }, false);
mList.setEntry(Vector2i(0, 0), Vector2i(1, 1), &mFilterLabel, false, ComponentGrid::AlignRight);
mList.setEntry(Vector2i(1, 0), Vector2i(1, 1), &mFiltersOpt, true, ComponentGrid::AlignLeft);
//add systems (all with a platformid specified selected)
std::vector<SystemData*> sys = SystemData::sSystemVector;
mSystemsOpt.populate(sys,
[&](SystemData* s) {
return mSystemsOpt.makeEntry(s->getName(), s, s->getPlatformId() != PlatformIds::PLATFORM_UNKNOWN);
});
for(auto it = sys.begin(); it != sys.end(); it++)
mSystemsOpt.add((*it)->getFullName(), *it, (*it)->getPlatformId() != PlatformIds::PLATFORM_UNKNOWN);
mList.setEntry(Vector2i(0, 1), Vector2i(1, 1), &mSystemsLabel, false, ComponentGrid::AlignRight);
mList.setEntry(Vector2i(1, 1), Vector2i(1, 1), &mSystemsOpt, true, ComponentGrid::AlignLeft);
......
......@@ -41,13 +41,13 @@ GuiSettingsMenu::GuiSettingsMenu(Window* window) : GuiComponent(window),
std::vector< std::shared_ptr<Scraper> > scrapers;
scrapers.push_back(std::make_shared<GamesDBScraper>());
scrapers.push_back(std::make_shared<TheArchiveScraper>());
scraper_list->populate(scrapers, [&] (const std::shared_ptr<Scraper>& sc) {
return scraper_list->makeEntry(sc->getName(), sc, sc->getName() == Settings::getInstance()->getScraper()->getName());
});
for(auto it = scrapers.begin(); it != scrapers.end(); it++)
scraper_list->add((*it)->getName(), *it, (*it)->getName() == Settings::getInstance()->getScraper()->getName());
addSetting("Scraper:", scraper_list,
[scraper_list] {
if(scraper_list->getSelected().size() > 0)
Settings::getInstance()->setScraper(scraper_list->getSelected()[0]->object);
Settings::getInstance()->setScraper(scraper_list->getSelected());
});
// scrape ratings
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment