Added "ignore" plaform.

If <platform> is set to "ignore", the system will not show up in the "SCRAPE NOW" systems list, and the "SCRAPE" button will be missing in the "EDIT METADATA" screen.
Useful for single-game systems, systems made up of shortcuts, and pre-configured systems in distributions.
This commit is contained in:
Aloshi 2014-05-26 20:17:17 -05:00
parent d102ef1485
commit 1122476de6
4 changed files with 12 additions and 4 deletions

View file

@ -53,7 +53,8 @@ namespace PlatformIds
"pcengine", // = 45,
"zxspectrum", // = 46,
"invalid" // = 47
"ignore", // = 47 // do not allow scraping for this system
"invalid" // = 48
};
PlatformId getPlatformId(const char* str)

View file

@ -55,7 +55,8 @@ namespace PlatformIds
TURBOGRAFX_16 = 45,
ZX_SPECTRUM = 46,
PLATFORM_COUNT = 47
PLATFORM_IGNORE = 47, // do not allow scraping for this system
PLATFORM_COUNT = 48
};
PlatformId getPlatformId(const char* str);

View file

@ -128,7 +128,10 @@ GuiMetaDataEd::GuiMetaDataEd(Window* window, MetaDataList* md, const std::vector
}
std::vector< std::shared_ptr<ButtonComponent> > buttons;
buttons.push_back(std::make_shared<ButtonComponent>(mWindow, "SCRAPE", "scrape", std::bind(&GuiMetaDataEd::fetch, this)));
if(scraperParams.system->getPlatformId() != PlatformIds::PLATFORM_IGNORE)
buttons.push_back(std::make_shared<ButtonComponent>(mWindow, "SCRAPE", "scrape", std::bind(&GuiMetaDataEd::fetch, this)));
buttons.push_back(std::make_shared<ButtonComponent>(mWindow, "SAVE", "save", [&] { save(); delete this; }));
buttons.push_back(std::make_shared<ButtonComponent>(mWindow, "CANCEL", "cancel", [&] { delete this; }));

View file

@ -23,7 +23,10 @@ GuiScraperStart::GuiScraperStart(Window* window) : GuiComponent(window),
//add systems (all with a platformid specified selected)
mSystems = std::make_shared< OptionListComponent<SystemData*> >(mWindow, "SCRAPE THESE SYSTEMS", true);
for(auto it = SystemData::sSystemVector.begin(); it != SystemData::sSystemVector.end(); it++)
mSystems->add((*it)->getFullName(), *it, (*it)->getPlatformId() != PlatformIds::PLATFORM_UNKNOWN);
{
if((*it)->getPlatformId() != PlatformIds::PLATFORM_IGNORE)
mSystems->add((*it)->getFullName(), *it, (*it)->getPlatformId() != PlatformIds::PLATFORM_UNKNOWN);
}
mMenu.addWithLabel("Systems", mSystems);
mApproveResults = std::make_shared<SwitchComponent>(mWindow);