| 548 | } |
| 549 | |
| 550 | std::vector<ModuleFactory::Spawnable> ModuleFactory::GetSpawnableModules(ModuleCategory moduleCategory) |
| 551 | { |
| 552 | std::vector<ModuleFactory::Spawnable> modules{}; |
| 553 | for (auto iter = mFactoryMap.begin(); iter != mFactoryMap.end(); ++iter) |
| 554 | { |
| 555 | if (iter->second.mCategory == moduleCategory && |
| 556 | (!iter->second.mIsHidden || gShowDevModules)) |
| 557 | { |
| 558 | ModuleFactory::Spawnable spawnable{}; |
| 559 | spawnable.mLabel = iter->first; |
| 560 | modules.push_back(spawnable); |
| 561 | } |
| 562 | } |
| 563 | |
| 564 | if (moduleCategory == kModuleCategory_Audio) |
| 565 | { |
| 566 | std::vector<std::string> effects = TheSynth->GetEffectFactory()->GetSpawnableEffects(); |
| 567 | for (auto effect : effects) |
| 568 | { |
| 569 | ModuleFactory::Spawnable spawnable{}; |
| 570 | spawnable.mLabel = effect; |
| 571 | spawnable.mDecorator = kEffectChainSuffix; |
| 572 | spawnable.mSpawnMethod = SpawnMethod::EffectChain; |
| 573 | modules.push_back(spawnable); |
| 574 | } |
| 575 | } |
| 576 | |
| 577 | std::sort(modules.begin(), modules.end(), Spawnable::CompareAlphabetical); |
| 578 | return modules; |
| 579 | } |
| 580 | |
| 581 | namespace |
| 582 | { |
no test coverage detected