| 444 | } |
| 445 | |
| 446 | void DisplaySingleMission::OnChangeMission() |
| 447 | { |
| 448 | C3DHTML* html = dynamic_cast<C3DHTML*>(GetCtrl(IDC_SINGLE_OVERVIEW)); |
| 449 | if (!html) |
| 450 | { |
| 451 | return; |
| 452 | } |
| 453 | html->Init(); |
| 454 | C3DListBox* lbox = dynamic_cast<C3DListBox*>(GetCtrl(IDC_SINGLE_MISSION)); |
| 455 | if (!lbox) |
| 456 | { |
| 457 | return; |
| 458 | } |
| 459 | int sel = lbox->GetCurSel(); |
| 460 | if (sel < 0) |
| 461 | { |
| 462 | return; |
| 463 | } |
| 464 | |
| 465 | RString mission = lbox->GetData(sel); |
| 466 | RString directory = RString("missions\\") + _directory + mission; |
| 467 | |
| 468 | if (lbox->GetValue(sel) < 0) |
| 469 | { |
| 470 | if (lbox->GetValue(sel) == -1) |
| 471 | { |
| 472 | RString filename = GetOverviewFile(directory + RString("\\")); |
| 473 | if (filename.GetLength() > 0) |
| 474 | { |
| 475 | html->LoadBuffer(filename, LoadLocalizedMissionHtmlUtf8(filename), false); |
| 476 | } |
| 477 | } |
| 478 | |
| 479 | CActiveText* ctrl = static_cast<CActiveText*>(GetCtrl(IDC_OK)); |
| 480 | if (ctrl) |
| 481 | { |
| 482 | ctrl->SetText(LocalizeString(kSingleOpenKey)); |
| 483 | } |
| 484 | ctrl = static_cast<CActiveText*>(GetCtrl(IDC_SINGLE_LOAD)); |
| 485 | if (ctrl) |
| 486 | { |
| 487 | ctrl->ShowCtrl(false); |
| 488 | } |
| 489 | return; |
| 490 | } |
| 491 | |
| 492 | RString filename; |
| 493 | MissionLanguageDetector::MissionPreviewInfo preview; |
| 494 | if (lbox->GetValue(sel) == 1) |
| 495 | { |
| 496 | RString bank = CreateSingleMissionBank(directory); |
| 497 | if (bank.GetLength() == 0) |
| 498 | { |
| 499 | return; |
| 500 | } |
| 501 | preview = MissionLanguageDetector::DetectPreview(bank); |
| 502 | filename = GetOverviewFile(bank); |
| 503 | } |
nothing calls this directly
no test coverage detected