| 426 | } |
| 427 | |
| 428 | std::string ReadableEditorDialog::constructStoragePath() |
| 429 | { |
| 430 | // Construct the storage path from Registry keys. |
| 431 | std::string storagePath; |
| 432 | if (_useDefaultFilename) |
| 433 | { |
| 434 | bool checkVFS = true; |
| 435 | switch (registry::getValue<int>(RKEY_READABLES_STORAGE_FOLDER)) |
| 436 | { |
| 437 | case 0: // Use Mod dir |
| 438 | storagePath = GlobalGameManager().getModPath(); |
| 439 | if (storagePath.empty()) |
| 440 | { |
| 441 | // Mod path not defined. Use base Path |
| 442 | storagePath = GlobalRegistry().get(RKEY_ENGINE_PATH) + "base/"; |
| 443 | wxutil::Messagebox::ShowError(_("Mod path not defined. Using Base path..."), this); |
| 444 | } |
| 445 | storagePath += XData::XDATA_DIR; |
| 446 | break; |
| 447 | case 1: // Use Mod Base dir |
| 448 | storagePath = GlobalGameManager().getModBasePath(); |
| 449 | if (storagePath.empty()) |
| 450 | { |
| 451 | // Mod Base Path not defined. Use Mod path or base path successively. |
| 452 | storagePath = GlobalGameManager().getModPath(); |
| 453 | if (storagePath.empty()) |
| 454 | { |
| 455 | storagePath = GlobalRegistry().get(RKEY_ENGINE_PATH) + "base/"; |
| 456 | wxutil::Messagebox::ShowError(_("Mod Base path not defined, neither is Mod path. Using Engine path..."), |
| 457 | this); |
| 458 | storagePath += XData::XDATA_DIR; |
| 459 | break; |
| 460 | } |
| 461 | wxutil::Messagebox::ShowError(_("Mod Base path not defined. Using Mod path..."), this); |
| 462 | } |
| 463 | storagePath += XData::XDATA_DIR; |
| 464 | break; |
| 465 | default: // Use custom folder |
| 466 | storagePath = GlobalRegistry().get(RKEY_READABLES_CUSTOM_FOLDER); |
| 467 | if (storagePath.empty()) |
| 468 | { |
| 469 | // Custom path not defined. Use Mod path or base path successively. |
| 470 | storagePath = GlobalGameManager().getModPath(); |
| 471 | if (storagePath.empty()) |
| 472 | { |
| 473 | storagePath = GlobalRegistry().get(RKEY_ENGINE_PATH) + "base/"; |
| 474 | wxutil::Messagebox::ShowError(_("Mod Base path not defined, neither is Mod path. Using Engine path..."), this); |
| 475 | storagePath += XData::XDATA_DIR; |
| 476 | break; |
| 477 | } |
| 478 | storagePath += XData::XDATA_DIR; |
| 479 | wxutil::Messagebox::ShowError(_("Mod Base path not defined. Using Mod path..."), this); |
| 480 | break; |
| 481 | } |
| 482 | storagePath += "/" +_mapBasedFilename; |
| 483 | checkVFS = false; |
| 484 | break; |
| 485 | } |
nothing calls this directly
no test coverage detected