| 402 | } |
| 403 | |
| 404 | std::string Game_Config::GetConfigPath(CmdlineParser& cp) { |
| 405 | std::string path; |
| 406 | |
| 407 | while (!cp.Done()) { |
| 408 | CmdlineArg arg; |
| 409 | if (cp.ParseNext(arg, 1, "--config-path", 'c')) { |
| 410 | if (arg.NumValues() > 0) { |
| 411 | path = arg.Value(0); |
| 412 | path = FileFinder::MakeCanonical(path, 0); |
| 413 | } |
| 414 | continue; |
| 415 | } |
| 416 | |
| 417 | cp.SkipNext(); |
| 418 | } |
| 419 | |
| 420 | if (!path.empty()) { |
| 421 | if (!FileFinder::Root().MakeDirectory(path, true)) { |
| 422 | Output::Debug("Could not create global config directory {}", path); |
| 423 | path.clear(); |
| 424 | } |
| 425 | } |
| 426 | |
| 427 | return path; |
| 428 | } |
| 429 | |
| 430 | void Game_Config::LoadFromArgs(CmdlineParser& cp) { |
| 431 | font_path.clear(); |