diff --git a/README.md b/README.md index 37bf54f6e8..74fe485504 100644 --- a/README.md +++ b/README.md @@ -172,6 +172,10 @@ All systems must be contained within the tag.--> You MUST include the period at the start of the extension! It's also case sensitive. --> .smc .sfc .SMC .SFC + + "filename1.bin" "filename2.iso" "filename3.zip" + snesemulator %ROM% diff --git a/es-app/src/CollectionSystemManager.cpp b/es-app/src/CollectionSystemManager.cpp index 372c64bf41..42e9904c22 100644 --- a/es-app/src/CollectionSystemManager.cpp +++ b/es-app/src/CollectionSystemManager.cpp @@ -46,6 +46,8 @@ CollectionSystemManager::CollectionSystemManager(Window* window) : mWindow(windo mCollectionEnvData->mStartPath = ""; std::vector exts; mCollectionEnvData->mSearchExtensions = exts; + std::vector ignores; + mCollectionEnvData->mFilesToIgnore = ignores; mCollectionEnvData->mLaunchCommand = ""; std::vector allPlatformIds; allPlatformIds.push_back(PlatformIds::PLATFORM_IGNORE); diff --git a/es-app/src/SystemData.cpp b/es-app/src/SystemData.cpp index 66b1cf83e7..7e843579ab 100644 --- a/es-app/src/SystemData.cpp +++ b/es-app/src/SystemData.cpp @@ -102,7 +102,12 @@ void SystemData::populateFolder(FileData* folder) // skip hidden files and folders if(!showHidden && Utils::FileSystem::isHidden(filePath)) continue; - + + // skip ignored files and folders + std::string fileName = Utils::String::toLower(Utils::FileSystem::getFileName(filePath)); + if(std::find(mEnvData->mFilesToIgnore.cbegin(), mEnvData->mFilesToIgnore.cend(), fileName) != mEnvData->mFilesToIgnore.cend()) + continue; + //this is a little complicated because we allow a list of extensions to be defined (delimited with a space) //we first get the extension of the file itself: extension = Utils::String::toLower(Utils::FileSystem::getExtension(filePath)); @@ -189,6 +194,27 @@ SystemData* SystemData::loadSystem(pugi::xml_node system) extensions.push_back(xt); } + list.clear(); + + list = readList(system.child("ignore").text().get()); + std::vector ignores; + + for (auto ignore = list.cbegin(); ignore != list.cend(); ignore++) + { + std::string ig = Utils::String::toLower(*ignore); + + + + ig = Utils::String::replace(ig, "\"", ""); + + + + if (std::find(ignores.begin(), ignores.end(), ig) == ignores.end()) + ignores.push_back(ig); + } + + list.clear(); + cmd = system.child("command").text().get(); // platform id list @@ -239,6 +265,7 @@ SystemData* SystemData::loadSystem(pugi::xml_node system) SystemEnvironmentData* envData = new SystemEnvironmentData; envData->mStartPath = path; envData->mSearchExtensions = extensions; + envData->mFilesToIgnore = ignores; envData->mLaunchCommand = cmd; envData->mPlatformIds = platformIds; @@ -409,6 +436,10 @@ void SystemData::writeExampleConfig(const std::string& path) " You MUST include the period at the start of the extension! It's also case sensitive. -->\n" " .nes .NES\n" "\n" + " \n" + " \"filename1.bin\" \"filename2.iso\" \"filename3.zip\"\n" + "\n" "