| 60 | } |
| 61 | |
| 62 | void SpawnList::SetList(std::vector<ModuleFactory::Spawnable> spawnables) |
| 63 | { |
| 64 | if (mSpawnList == nullptr) |
| 65 | mSpawnList = new DropdownList(mOwner, mLabel.c_str(), mPos.x, mPos.y, &mSpawnIndex); |
| 66 | |
| 67 | mSpawnList->Clear(); |
| 68 | mSpawnList->SetUnknownItemString(mLabel); |
| 69 | mSpawnables = spawnables; |
| 70 | for (int i = 0; i < mSpawnables.size(); ++i) |
| 71 | { |
| 72 | std::string name = mSpawnables[i].mLabel; |
| 73 | if (mShowDecorators && !mSpawnables[i].mDecorator.empty()) |
| 74 | name += " " + mSpawnables[i].mDecorator; |
| 75 | if (TheSynth->GetModuleFactory()->IsExperimental(name)) |
| 76 | name += " (exp.)"; |
| 77 | mSpawnList->AddLabel(name, i); |
| 78 | } |
| 79 | } |
| 80 | |
| 81 | namespace |
| 82 | { |
no test coverage detected