本文整理汇总了C++中IDesktopPlatform::GetNativeFeedbackContext方法的典型用法代码示例。如果您正苦于以下问题:C++ IDesktopPlatform::GetNativeFeedbackContext方法的具体用法?C++ IDesktopPlatform::GetNativeFeedbackContext怎么用?C++ IDesktopPlatform::GetNativeFeedbackContext使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IDesktopPlatform
的用法示例。
在下文中一共展示了IDesktopPlatform::GetNativeFeedbackContext方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: GenerateProjectFiles
bool GenerateProjectFiles(const FString& ProjectFileName)
{
IDesktopPlatform* DesktopPlatform = FDesktopPlatformModule::Get();
// Check it's a code project
FString SourceDir = FPaths::GetPath(ProjectFileName) / TEXT("Source");
if(!IPlatformFile::GetPlatformPhysical().DirectoryExists(*SourceDir))
{
FPlatformMisc::MessageBoxExt(EAppMsgType::Ok, TEXT("This project does not have any source code. You need to add C++ source files to the project from the Editor before you can generate project files."), TEXT("Error"));
return false;
}
// Get the engine root directory
FString RootDir;
if (!GetValidatedEngineRootDir(ProjectFileName, RootDir))
{
return false;
}
// Build the argument list
FString Arguments = TEXT("-game");
if (FDesktopPlatformModule::Get()->IsSourceDistribution(RootDir))
{
Arguments += TEXT(" -engine");
}
// Start capturing the log output
FStringOutputDevice LogCapture;
LogCapture.SetAutoEmitLineTerminator(true);
GLog->AddOutputDevice(&LogCapture);
// Generate project files
FFeedbackContext* Warn = DesktopPlatform->GetNativeFeedbackContext();
bool bResult = DesktopPlatform->GenerateProjectFiles(RootDir, ProjectFileName, Warn);
GLog->RemoveOutputDevice(&LogCapture);
// Display an error dialog if we failed
if(!bResult)
{
FPlatformInstallation::ErrorDialog(TEXT("Failed to generate project files."), LogCapture);
return false;
}
return true;
}