| 212 | //========================================================================== |
| 213 | |
| 214 | std::vector<std::string> GetGameFronUserFiles() |
| 215 | { |
| 216 | std::vector<std::string> Files; |
| 217 | |
| 218 | if (userConfig.AddFilesPre) for (auto& file : *userConfig.AddFilesPre) |
| 219 | { |
| 220 | D_AddFile(Files, file.GetChars(), true, -1, GameConfig); |
| 221 | } |
| 222 | if (userConfig.AddFiles) |
| 223 | { |
| 224 | for (auto& file : *userConfig.AddFiles) |
| 225 | { |
| 226 | D_AddFile(Files, file.GetChars(), true, -1, GameConfig); |
| 227 | } |
| 228 | |
| 229 | // Finally, if the last entry in the chain is a directory, it's being considered the mod directory, and all GRPs inside need to be loaded, too. |
| 230 | if (userConfig.AddFiles->NumArgs() > 0) |
| 231 | { |
| 232 | auto fn = (*userConfig.AddFiles)[userConfig.AddFiles->NumArgs() - 1]; |
| 233 | bool isdir = false; |
| 234 | if (DirEntryExists(fn.GetChars(), &isdir) && isdir) |
| 235 | { |
| 236 | // Insert the GRPs before this entry itself. |
| 237 | std::string lastfn = std::move(Files.back()); |
| 238 | Files.pop_back(); |
| 239 | for (auto ext : validexts) |
| 240 | { |
| 241 | D_AddDirectory(Files, fn.GetChars(), ext, GameConfig); |
| 242 | } |
| 243 | Files.push_back(std::move(lastfn)); |
| 244 | } |
| 245 | } |
| 246 | } |
| 247 | return CheckGameInfo(Files); |
| 248 | } |
| 249 | |
| 250 | //========================================================================== |
| 251 | // |
no test coverage detected