| 593 | } |
| 594 | preview = MissionLanguageDetector::DetectPreview(bank); |
| 595 | filename = GetOverviewFile(bank); |
| 596 | } |
| 597 | else |
| 598 | { |
| 599 | preview = MissionLanguageDetector::DetectPreview(directory + RString("\\")); |
| 600 | filename = GetOverviewFile(directory + RString("\\")); |
| 601 | } |
| 602 | if (filename.GetLength() > 0 || preview.missionViewDistance.has_value() || |
| 603 | MissionLanguageDetector::FormatTextLanguages(preview.languages) != RString("-") || |
| 604 | MissionLanguageDetector::FormatVoiceLanguages(preview.languages) != RString("-")) |
| 605 | { |
| 606 | LoadMissionPreviewHtml(html, filename, preview); |
| 607 | } |
| 608 | |
| 609 | // update buttons |
| 610 | RString dir = GetMissionSaveDirectory(_directory + mission); |
| 611 | EnsureContinueSave(dir); |
| 612 | RString save = dir + RString("continue.fps"); |
| 613 | if (QIFStream::FileExists(save)) |
| 614 | { |
| 615 | CActiveText* ctrl = static_cast<CActiveText*>(GetCtrl(IDC_OK)); |
| 616 | if (ctrl) |
| 617 | { |
| 618 | ctrl->SetText(LocalizeString(kSingleRestartKey)); |
| 619 | } |
| 620 | ctrl = static_cast<CActiveText*>(GetCtrl(IDC_SINGLE_LOAD)); |
| 621 | if (ctrl) |
| 622 | { |
| 623 | int day, month, year, hour, minute; |
| 624 | if (getFileLocalTime(save, day, month, year, hour, minute)) |
| 625 | { |
| 626 | char buffer[256]; |
| 627 | snprintf(buffer, sizeof(buffer), LocalizeString(kSingleResumeKey), month, day, year, hour, minute); |
| 628 | ctrl->SetText(buffer); |
| 629 | ctrl->ShowCtrl(true); |
| 630 | } |
| 631 | } |
| 632 | } |
| 633 | else |
| 634 | { |
| 635 | CActiveText* ctrl = static_cast<CActiveText*>(GetCtrl(IDC_OK)); |
| 636 | if (ctrl) |
| 637 | { |
| 638 | ctrl->SetText(LocalizeString(kSinglePlayKey)); |
| 639 | } |
| 640 | ctrl = static_cast<CActiveText*>(GetCtrl(IDC_SINGLE_LOAD)); |
| 641 | if (ctrl) |
| 642 | { |
| 643 | ctrl->ShowCtrl(false); |
| 644 | } |
| 645 | } |
| 646 | } |
| 647 | |
| 648 | void DisplaySingleMission::OnChangeDifficulty() |
| 649 | { |
| 650 | CActiveText* ctrl = dynamic_cast<CActiveText*>(GetCtrl(IDC_SINGLE_DIFF)); |
| 651 | if (!ctrl) |
| 652 | { |
nothing calls this directly
no test coverage detected