当前位置: 首页>>代码示例>>C++>>正文


C++ TSharedPtr::CanAutoPrompt方法代码示例

本文整理汇总了C++中TSharedPtr::CanAutoPrompt方法的典型用法代码示例。如果您正苦于以下问题:C++ TSharedPtr::CanAutoPrompt方法的具体用法?C++ TSharedPtr::CanAutoPrompt怎么用?C++ TSharedPtr::CanAutoPrompt使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在TSharedPtr的用法示例。


在下文中一共展示了TSharedPtr::CanAutoPrompt方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: OnReadFileComplete

void FEpicSurvey::OnReadFileComplete( bool bSuccess, const FString& DLName )
{
	if ( bSuccess )
	{
		if ( DLName == SurveyIndexCloudFile.DLName )
		{
			LoadSurveyIndexFile();
		}
		else
		{
			int32 FileHeaderIndex = INDEX_NONE;
			TArray< FCloudFileHeader > FileHeaders;
			TitleCloud->GetFileList( FileHeaders );

			for (int Index = 0; Index < FileHeaders.Num(); Index++)
			{
				if ( FileHeaders[ Index ].DLName == DLName )
				{
					FileHeaderIndex = Index;
					break;
				}
			}

			if ( FileHeaderIndex > INDEX_NONE )
			{
				const FCloudFileHeader FileHeader = FileHeaders[ FileHeaderIndex ];
				const FString FileExtension = FPaths::GetExtension( FileHeader.FileName );
				
				if ( FileExtension == TEXT("json") )
				{
					TArray< uint8 > FileContents;
					TitleCloud->GetFileContents( DLName, FileContents );

					FString SurveyJson;
					FFileHelper::BufferToString( SurveyJson, FileContents.GetData(), FileContents.Num() );

					TSharedPtr< FJsonObject > SurveyObject = NULL;
					TSharedRef< TJsonReader<> > Reader = TJsonReaderFactory<TCHAR>::Create( SurveyJson );
					if ( FJsonSerializer::Deserialize( Reader, SurveyObject ) )
					{
						TSharedPtr< FSurvey > NewSurvey = FSurvey::Create( SharedThis( this ), SurveyObject.ToSharedRef() );
						if ( NewSurvey.IsValid() )
						{
							switch( NewSurvey->GetSurveyType() )
							{
							case ESurveyType::Normal:
								{
									auto* Settings = GetDefault<UEditorSettings>();

									Surveys.Add( NewSurvey.ToSharedRef() );
									const bool IsActiveSurveyInProgress = ActiveSurvey.IsValid() ? Settings->InProgressSurveys.Contains( ActiveSurvey->GetIdentifier() ) : false;

									if ( !IsActiveSurveyInProgress )
									{
										const bool HasBeenCompleted = Settings->CompletedSurveys.Contains( NewSurvey->GetIdentifier() );

										if ( !HasBeenCompleted )
										{
											const bool IsInProgress = Settings->InProgressSurveys.Contains( NewSurvey->GetIdentifier() );

											if ( NewSurvey->CanAutoPrompt() )
											{
												SetActiveSurvey( NewSurvey );
											}
											else if ( IsInProgress )
											{
												SetActiveSurvey( NewSurvey );
											}
										}
									}
								}
								break;
							case ESurveyType::Branch:
								BranchSurveys.Add( FileHeader.FileName, NewSurvey );
								break;
							}
						}
					}
					else
					{
						UE_LOG(LogEpicSurvey, Verbose, TEXT("Parsing JSON survey failed. Filename: %s Message: %s"), *FileHeader.FileName, *Reader->GetErrorMessage());
					}
				}
				else if ( FileExtension == TEXT("png") )
				{
					TArray< FOnBrushLoaded > MapResults;
					FilenameToLoadCallbacks.MultiFind( FileHeaders[ FileHeaderIndex ].FileName, MapResults );

					if ( MapResults.Num() > 0 )
					{
						TArray< uint8 > FileContents;
						TitleCloud->GetFileContents( DLName, FileContents );

						for (int Index = 0; Index < MapResults.Num(); Index++)
						{
							MapResults[ Index ].Execute( LoadRawDataAsBrush( *(FString(TEXT("EpicSurvey.")) + FileHeaders[ FileHeaderIndex ].FileName), FileContents ) );
						}

						FilenameToLoadCallbacks.Remove( FileHeaders[ FileHeaderIndex ].FileName );
					}
//.........这里部分代码省略.........
开发者ID:PickUpSU,项目名称:UnrealEngine4,代码行数:101,代码来源:EpicSurvey.cpp


注:本文中的TSharedPtr::CanAutoPrompt方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。