MCPcopy Create free account
hub / github.com/BohemiaInteractive/CWR / OnButtonClicked

Method OnButtonClicked

engine/Poseidon/UI/OptionsUIImpl.cpp:595–669  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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
648void DisplaySingleMission::OnChangeDifficulty()
649{
650 CActiveText* ctrl = dynamic_cast<CActiveText*>(GetCtrl(IDC_SINGLE_DIFF));
651 if (!ctrl)
652 {

Callers

nothing calls this directly

Calls 12

GetCtrlFunction · 0.85
PlayCreditsCutsceneFunction · 0.85
SubstringMethod · 0.80
PushPageMethod · 0.80
RStringClass · 0.50
GetCurSelMethod · 0.45
GetValueMethod · 0.45
GetDataMethod · 0.45
GetLengthMethod · 0.45
CloseMethod · 0.45
GetSizeMethod · 0.45
SizeMethod · 0.45

Tested by

no test coverage detected