• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C++ FUIAction函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C++中FUIAction函数的典型用法代码示例。如果您正苦于以下问题:C++ FUIAction函数的具体用法?C++ FUIAction怎么用?C++ FUIAction使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



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

示例1: LOCTEXT

void FIntroTutorials::AddSummonBlueprintTutorialsMenuExtension(FMenuBuilder& MenuBuilder, UObject* PrimaryObject)
{
	MenuBuilder.BeginSection("Tutorials", LOCTEXT("TutorialsLabel", "Tutorials"));
	MenuBuilder.AddMenuEntry(
		LOCTEXT("BlueprintMenuEntryTitle", "Blueprint Overview"),
		LOCTEXT("BlueprintMenuEntryToolTip", "Opens up an introductory overview of Blueprints."),
		FSlateIcon(FEditorStyle::GetStyleSetName(), "LevelEditor.Tutorials"),
		FUIAction(FExecuteAction::CreateRaw(this, &FIntroTutorials::SummonBlueprintTutorialHome, PrimaryObject, true)));

	if(PrimaryObject != nullptr)
	{
		UBlueprint* BP = Cast<UBlueprint>(PrimaryObject);
		if(BP != nullptr)
		{
			UEnum* Enum = FindObject<UEnum>(ANY_PACKAGE, TEXT("EBlueprintType"), true);
			check(Enum);
			MenuBuilder.AddMenuEntry(
				FText::Format(LOCTEXT("BlueprintTutorialsMenuEntryTitle", "{0} Tutorial"), Enum->GetEnumText(BP->BlueprintType)),
				LOCTEXT("BlueprintTutorialsMenuEntryToolTip", "Opens up an introductory tutorial covering this particular part of the Blueprint editor."),
				FSlateIcon(FEditorStyle::GetStyleSetName(), "LevelEditor.Tutorials"),
				FUIAction(FExecuteAction::CreateRaw(this, &FIntroTutorials::SummonBlueprintTutorialHome, PrimaryObject, false)));
		}
	}

	MenuBuilder.EndSection();
}
开发者ID:PickUpSU,项目名称:UnrealEngine4,代码行数:26,代码来源:IntroTutorials.cpp


示例2: LOCTEXT

void FThumbnailSection::BuildSectionContextMenu(FMenuBuilder& MenuBuilder, const FGuid& ObjectBinding)
{
	MenuBuilder.BeginSection(NAME_None, LOCTEXT("ViewMenuText", "View"));
	{
		MenuBuilder.AddSubMenu(
			LOCTEXT("ThumbnailsMenu", "Thumbnails"),
			FText(),
			FNewMenuDelegate::CreateLambda([=](FMenuBuilder& InMenuBuilder){

				TSharedPtr<ISequencer> Sequencer = SequencerPtr.Pin();

				FText CurrentTime = FText::FromString(Sequencer->GetZeroPadNumericTypeInterface()->ToString(Sequencer->GetGlobalTime()));

				InMenuBuilder.BeginSection(NAME_None, LOCTEXT("ThisSectionText", "This Section"));
				{
					InMenuBuilder.AddMenuEntry(
						LOCTEXT("RefreshText", "Refresh"),
						LOCTEXT("RefreshTooltip", "Refresh this section's thumbnails"),
						FSlateIcon(),
						FUIAction(FExecuteAction::CreateRaw(this, &FThumbnailSection::RedrawThumbnails))
					);
					InMenuBuilder.AddMenuEntry(
						FText::Format(LOCTEXT("SetSingleTime", "Set Thumbnail Time To {0}"), CurrentTime),
						LOCTEXT("SetSingleTimeTooltip", "Defines the time at which this section should draw its single thumbnail to the current cursor position"),
						FSlateIcon(),
						FUIAction(
							FExecuteAction::CreateLambda([=]{
								SetSingleTime(Sequencer->GetGlobalTime());
								GetMutableDefault<UMovieSceneUserThumbnailSettings>()->bDrawSingleThumbnails = true;
								GetMutableDefault<UMovieSceneUserThumbnailSettings>()->SaveConfig();
							})
						)
					);
				}
				InMenuBuilder.EndSection();

				InMenuBuilder.BeginSection(NAME_None, LOCTEXT("GlobalSettingsText", "Global Settings"));
				{
					InMenuBuilder.AddMenuEntry(
						LOCTEXT("RefreshAllText", "Refresh All"),
						LOCTEXT("RefreshAllTooltip", "Refresh all sections' thumbnails"),
						FSlateIcon(),
						FUIAction(FExecuteAction::CreateLambda([]{
							GetDefault<UMovieSceneUserThumbnailSettings>()->BroadcastRedrawThumbnails();
						}))
					);

					FPropertyEditorModule& PropertyModule = FModuleManager::LoadModuleChecked<FPropertyEditorModule>("PropertyEditor");

					FDetailsViewArgs Args(false, false, false, FDetailsViewArgs::HideNameArea);
					TSharedRef<IDetailsView> DetailView = PropertyModule.CreateDetailView(Args);
					DetailView->SetObject(GetMutableDefault<UMovieSceneUserThumbnailSettings>());
					InMenuBuilder.AddWidget(DetailView, FText(), true);
				}
				InMenuBuilder.EndSection();
			})
		);
	}
	MenuBuilder.EndSection();
}
开发者ID:zhaoyizheng0930,项目名称:UnrealEngine,代码行数:60,代码来源:ThumbnailSection.cpp


示例3: LOCTEXT

void FAssetTypeActions_SoundCue::GetActions( const TArray<UObject*>& InObjects, FMenuBuilder& MenuBuilder )
{
	auto SoundCues = GetTypedWeakObjectPtrs<USoundCue>(InObjects);

	MenuBuilder.AddMenuEntry(
		LOCTEXT("SoundCue_Edit", "Edit"),
		LOCTEXT("SoundCue_EditTooltip", "Opens the selected sound cues in the sound cue editor."),
		FSlateIcon(),
		FUIAction(
			FExecuteAction::CreateSP( this, &FAssetTypeActions_SoundCue::ExecuteEdit, SoundCues ),
			FCanExecuteAction()
			)
		);

	FAssetTypeActions_SoundBase::GetActions(InObjects, MenuBuilder);

	MenuBuilder.AddMenuEntry(
		LOCTEXT("SoundCue_ConsolidateAttenuation", "Consolidate Attenuation"),
		LOCTEXT("SoundCue_ConsolidateAttenuationTooltip", "Creates shared attenuation packages for sound cues with identical override attenuation settings."),
		FSlateIcon(),
		FUIAction(
			FExecuteAction::CreateSP( this, &FAssetTypeActions_SoundCue::ExecuteConsolidateAttenuation, SoundCues ),
			FCanExecuteAction::CreateSP( this, &FAssetTypeActions_SoundCue::CanExecuteConsolidateCommand, SoundCues )
			)
		);
}
开发者ID:Tigrouzen,项目名称:UnrealEngine-4,代码行数:26,代码来源:AssetTypeActions_SoundCue.cpp


示例4: NSLOCTEXT

void FAssetTypeActions_StaticMesh::GetActions( const TArray<UObject*>& InObjects, FMenuBuilder& MenuBuilder )
{
	auto Meshes = GetTypedWeakObjectPtrs<UStaticMesh>(InObjects);

	MenuBuilder.AddMenuEntry(
		NSLOCTEXT("AssetTypeActions_StaticMesh", "StaticMesh_Edit", "Edit"),
		NSLOCTEXT("AssetTypeActions_StaticMesh", "StaticMesh_EditTooltip", "Opens the selected meshes in the static mesh editor."),
		FSlateIcon(),
		FUIAction(
			FExecuteAction::CreateSP( this, &FAssetTypeActions_StaticMesh::ExecuteEdit, Meshes ),
			FCanExecuteAction()
			)
		);

	MenuBuilder.AddMenuEntry(
		NSLOCTEXT("AssetTypeActions_StaticMesh", "StaticMesh_Reimport", "Reimport"),
		NSLOCTEXT("AssetTypeActions_StaticMesh", "StaticMesh_ReimportTooltip", "Reimports the selected meshes from file."),
		FSlateIcon(),
		FUIAction(
			FExecuteAction::CreateSP( this, &FAssetTypeActions_StaticMesh::ExecuteReimport, Meshes ),
			FCanExecuteAction()
			)
		);

	MenuBuilder.AddSubMenu(
		NSLOCTEXT("AssetTypeActions_StaticMesh", "StaticMesh_ImportLOD", "ImportLOD"),
		NSLOCTEXT("AssetTypeActions_StaticMesh", "StaticMesh_ImportLODtooltip", "Imports meshes into the LODs"),
		FNewMenuDelegate::CreateSP( this, &FAssetTypeActions_StaticMesh::GetImportLODMenu, Meshes )
	);

	MenuBuilder.AddMenuEntry(
		NSLOCTEXT("AssetTypeActions_StaticMesh", "StaticMesh_FindInExplorer", "Find Source"),
		NSLOCTEXT("AssetTypeActions_StaticMesh", "StaticMesh_FindInExplorerTooltip", "Opens explorer at the location of this asset."),
		FSlateIcon(),
		FUIAction(
			FExecuteAction::CreateSP( this, &FAssetTypeActions_StaticMesh::ExecuteFindInExplorer, Meshes ),
			FCanExecuteAction::CreateSP( this, &FAssetTypeActions_StaticMesh::CanExecuteSourceCommands, Meshes )
			)
		);

	MenuBuilder.AddMenuEntry(
		NSLOCTEXT("AssetTypeActions_StaticMesh", "StaticMesh_OpenInExternalEditor", "Open Source"),
		NSLOCTEXT("AssetTypeActions_StaticMesh", "StaticMesh_OpenInExternalEditorTooltip", "Opens the selected asset in an external editor."),
		FSlateIcon(),
		FUIAction(
			FExecuteAction::CreateSP( this, &FAssetTypeActions_StaticMesh::ExecuteOpenInExternalEditor, Meshes ),
			FCanExecuteAction::CreateSP( this, &FAssetTypeActions_StaticMesh::CanExecuteSourceCommands, Meshes )
			)
		);

	MenuBuilder.AddMenuEntry(
		NSLOCTEXT("AssetTypeActions_StaticMesh", "ObjectContext_CreateDestructibleMesh", "Create Destructible Mesh"),
		NSLOCTEXT("AssetTypeActions_StaticMesh", "ObjectContext_CreateDestructibleMeshTooltip", "Creates a DestructibleMesh from the StaticMesh and opens it in the DestructibleMesh editor."),
		FSlateIcon(),
		FUIAction(
			FExecuteAction::CreateSP( this, &FAssetTypeActions_StaticMesh::ExecuteCreateDestructibleMesh, Meshes ),
			FCanExecuteAction()
			)
		);
}
开发者ID:Tigrouzen,项目名称:UnrealEngine-4,代码行数:60,代码来源:AssetTypeActions_StaticMesh.cpp


示例5: NSLOCTEXT

void FAssetTypeActions_StaticMesh::GetActions( const TArray<UObject*>& InObjects, FMenuBuilder& MenuBuilder )
{
	auto Meshes = GetTypedWeakObjectPtrs<UStaticMesh>(InObjects);

	if (CVarEnableSaveGeneratedLODsInPackage.GetValueOnGameThread() != 0)
	{
		MenuBuilder.AddMenuEntry(
			NSLOCTEXT("AssetTypeActions_StaticMesh", "ObjectContext_SaveGeneratedLODsInPackage", "Save Generated LODs"),
			NSLOCTEXT("AssetTypeActions_StaticMesh", "ObjectContext_SaveGeneratedLODsInPackageTooltip", "Run the mesh reduce and save the generated LODs as part of the package."),
			FSlateIcon(),
			FUIAction(
				FExecuteAction::CreateSP(this, &FAssetTypeActions_StaticMesh::ExecuteSaveGeneratedLODsInPackage, Meshes),
				FCanExecuteAction()
				)
			);
	}

	MenuBuilder.AddMenuEntry(
		NSLOCTEXT("AssetTypeActions_StaticMesh", "ObjectContext_CreateDestructibleMesh", "Create Destructible Mesh"),
		NSLOCTEXT("AssetTypeActions_StaticMesh", "ObjectContext_CreateDestructibleMeshTooltip", "Creates a DestructibleMesh from the StaticMesh and opens it in the DestructibleMesh editor."),
		FSlateIcon(FEditorStyle::GetStyleSetName(), "ClassIcon.DestructibleComponent"),
		FUIAction(
			FExecuteAction::CreateSP( this, &FAssetTypeActions_StaticMesh::ExecuteCreateDestructibleMesh, Meshes ),
			FCanExecuteAction()
			)
		);

	MenuBuilder.AddSubMenu(
		NSLOCTEXT("AssetTypeActions_StaticMesh", "StaticMesh_ImportLOD", "Import LOD"),
		NSLOCTEXT("AssetTypeActions_StaticMesh", "StaticMesh_ImportLODtooltip", "Imports meshes into the LODs"),
		FNewMenuDelegate::CreateSP( this, &FAssetTypeActions_StaticMesh::GetImportLODMenu, Meshes )
	);
}
开发者ID:PickUpSU,项目名称:UnrealEngine4,代码行数:33,代码来源:AssetTypeActions_StaticMesh.cpp


示例6: MenuBuilder

void SScrubWidget::CreateContextMenu(float CurrentFrameTime)
{
	if ((OnCropAnimSequence.IsBound() || OnReZeroAnimSequence.IsBound()) && (SequenceLength.Get() >= MINIMUM_ANIMATION_LENGTH))
	{
		const bool CloseAfterSelection = true;
		FMenuBuilder MenuBuilder( CloseAfterSelection, NULL );

		MenuBuilder.BeginSection("SequenceEditingContext", LOCTEXT("SequenceEditing", "Sequence Editing") );
		{
			float CurrentFrameFraction = CurrentFrameTime / SequenceLength.Get();
			uint32 CurrentFrameNumber = CurrentFrameFraction * NumOfKeys.Get();

			FUIAction Action;
			FText Label;

			if (OnCropAnimSequence.IsBound())
			{
				//Menu - "Remove Before"
				//Only show this option if the selected frame is greater than frame 1 (first frame)
				if (CurrentFrameNumber > 0)
				{
					CurrentFrameFraction = float(CurrentFrameNumber) / (float)NumOfKeys.Get();

					//Corrected frame time based on selected frame number
					float CorrectedFrameTime = CurrentFrameFraction * SequenceLength.Get();

					Action = FUIAction(FExecuteAction::CreateSP(this, &SScrubWidget::OnSequenceCropped, true, CorrectedFrameTime));
					Label = FText::Format(LOCTEXT("RemoveTillFrame", "Remove frame 0 to frame {0}"), FText::AsNumber(CurrentFrameNumber));
					MenuBuilder.AddMenuEntry(Label, LOCTEXT("RemoveBefore_ToolTip", "Remove sequence before current position"), FSlateIcon(), Action);
				}

				uint32 NextFrameNumber = CurrentFrameNumber + 1;

				//Menu - "Remove After"
				//Only show this option if next frame (CurrentFrameNumber + 1) is valid
				if (NextFrameNumber < NumOfKeys.Get())
				{
					float NextFrameFraction = float(NextFrameNumber) / (float)NumOfKeys.Get();
					float NextFrameTime = NextFrameFraction * SequenceLength.Get();
					Action = FUIAction(FExecuteAction::CreateSP(this, &SScrubWidget::OnSequenceCropped, false, NextFrameTime));
					Label = FText::Format(LOCTEXT("RemoveFromFrame", "Remove from frame {0} to frame {1}"), FText::AsNumber(NextFrameNumber), FText::AsNumber(NumOfKeys.Get()));
					MenuBuilder.AddMenuEntry(Label, LOCTEXT("RemoveAfter_ToolTip", "Remove sequence after current position"), FSlateIcon(), Action);
				}
			}

			if (OnReZeroAnimSequence.IsBound())
			{
				//Menu - "ReZero"
				Action = FUIAction(FExecuteAction::CreateSP(this, &SScrubWidget::OnReZero));
				Label = FText::Format(LOCTEXT("ReZeroAtFrame", "ReZero at frame {0}"), FText::AsNumber(CurrentFrameNumber));
				MenuBuilder.AddMenuEntry(Label, LOCTEXT("ReZeroAtFrame_ToolTip", "Resets the root track of the frame to (0, 0, 0), and apply the difference to all root transform of the sequence. It moves whole sequence to the amount of current root transform. "), FSlateIcon(), Action);
			}
		}
		MenuBuilder.EndSection();

		FSlateApplication::Get().PushMenu( SharedThis( this ), MenuBuilder.MakeWidget(), FSlateApplication::Get().GetCursorPos(), FPopupTransitionEffect( FPopupTransitionEffect::ContextMenu ) );
	}
}
开发者ID:1vanK,项目名称:AHRUnrealEngine,代码行数:58,代码来源:SScrubWidget.cpp


示例7: LOCTEXT

void FCinematicShotSection::BuildSectionContextMenu(FMenuBuilder& MenuBuilder, const FGuid& ObjectBinding)
{
	FThumbnailSection::BuildSectionContextMenu(MenuBuilder, ObjectBinding);

	MenuBuilder.BeginSection(NAME_None, LOCTEXT("ShotMenuText", "Shot"));
	{
		if (SequenceInstance.IsValid())
		{
			MenuBuilder.AddSubMenu(
				LOCTEXT("TakesMenu", "Takes"),
				LOCTEXT("TakesMenuTooltip", "Shot takes"),
				FNewMenuDelegate::CreateLambda([=](FMenuBuilder& InMenuBuilder){ AddTakesMenu(InMenuBuilder); }));

			MenuBuilder.AddMenuEntry(
				LOCTEXT("NewTake", "New Take"),
				FText::Format(LOCTEXT("NewTakeTooltip", "Create a new take for {0}"), SectionObject.GetShotDisplayName()),
				FSlateIcon(),
				FUIAction(FExecuteAction::CreateSP(CinematicShotTrackEditor.Pin().ToSharedRef(), &FCinematicShotTrackEditor::NewTake, &SectionObject))
			);
		}

		MenuBuilder.AddMenuEntry(
			LOCTEXT("InsertNewShot", "Insert Shot"),
			FText::Format(LOCTEXT("InsertNewShotTooltip", "Insert a new shot after {0}"), SectionObject.GetShotDisplayName()),
			FSlateIcon(),
			FUIAction(FExecuteAction::CreateSP(CinematicShotTrackEditor.Pin().ToSharedRef(), &FCinematicShotTrackEditor::InsertShot, &SectionObject))
		);

		if (SequenceInstance.IsValid())
		{
			MenuBuilder.AddMenuEntry(
				LOCTEXT("DuplicateShot", "Duplicate Shot"),
				FText::Format(LOCTEXT("DuplicateShotTooltip", "Duplicate {0} to create a new shot"), SectionObject.GetShotDisplayName()),
				FSlateIcon(),
				FUIAction(FExecuteAction::CreateSP(CinematicShotTrackEditor.Pin().ToSharedRef(), &FCinematicShotTrackEditor::DuplicateShot, &SectionObject))
			);

			MenuBuilder.AddMenuEntry(
				LOCTEXT("RenderShot", "Render Shot"),
				FText::Format(LOCTEXT("RenderShotTooltip", "Render shot movie"), SectionObject.GetShotDisplayName()),
				FSlateIcon(),
				FUIAction(FExecuteAction::CreateSP(CinematicShotTrackEditor.Pin().ToSharedRef(), &FCinematicShotTrackEditor::RenderShot, &SectionObject))
			);

			/*
			//@todo
			MenuBuilder.AddMenuEntry(
				LOCTEXT("RenameShot", "Rename Shot"),
				FText::Format(LOCTEXT("RenameShotTooltip", "Rename {0}"), SectionObject.GetShotDisplayName()),
				FSlateIcon(),
				FUIAction(FExecuteAction::CreateSP(CinematicShotTrackEditor.Pin().ToSharedRef(), &FCinematicShotTrackEditor::RenameShot, &SectionObject))
			);
			*/
		}
	}
	MenuBuilder.EndSection();
}
开发者ID:zhaoyizheng0930,项目名称:UnrealEngine,代码行数:57,代码来源:CinematicShotSection.cpp


示例8: LOCTEXT

void FAssetTypeActions_SoundWave::GetActions( const TArray<UObject*>& InObjects, FMenuBuilder& MenuBuilder )
{
    FAssetTypeActions_SoundBase::GetActions(InObjects, MenuBuilder);

    auto SoundNodes = GetTypedWeakObjectPtrs<USoundWave>(InObjects);

    /*MenuBuilder.AddMenuEntry(
    	LOCTEXT("SoundWave_CompressionPreview", "Compression Preview"),
    	LOCTEXT("SoundWave_CompressionPreviewTooltip", "Opens the selected sound node waves in the compression preview window."),
    	FSlateIcon(),
    	FUIAction(
    		FExecuteAction::CreateSP( this, &FAssetTypeActions_SoundWave::ExecuteCompressionPreview, SoundNodes ),
    		FCanExecuteAction()
    		)
    	);*/

    MenuBuilder.AddMenuEntry(
        LOCTEXT("SoundWave_Reimport", "Reimport"),
        LOCTEXT("SoundWave_ReimportTooltip", "Reimports the selected waves from file."),
        FSlateIcon(),
        FUIAction(
            FExecuteAction::CreateSP( this, &FAssetTypeActions_SoundWave::ExecuteReimport, SoundNodes ),
            FCanExecuteAction()
        )
    );

    MenuBuilder.AddMenuEntry(
        LOCTEXT("SoundWave_FindInExplorer", "Find Source"),
        LOCTEXT("SoundWave_FindInExplorerTooltip", "Opens explorer at the location of this asset."),
        FSlateIcon(),
        FUIAction(
            FExecuteAction::CreateSP( this, &FAssetTypeActions_SoundWave::ExecuteFindInExplorer, SoundNodes ),
            FCanExecuteAction::CreateSP( this, &FAssetTypeActions_SoundWave::CanExecuteSourceCommands, SoundNodes )
        )
    );

    MenuBuilder.AddMenuEntry(
        LOCTEXT("SoundWave_OpenInExternalEditor", "Open Source"),
        LOCTEXT("SoundWave_OpenInExternalEditorTooltip", "Opens the selected asset in an external editor."),
        FSlateIcon(),
        FUIAction(
            FExecuteAction::CreateSP( this, &FAssetTypeActions_SoundWave::ExecuteOpenInExternalEditor, SoundNodes ),
            FCanExecuteAction::CreateSP( this, &FAssetTypeActions_SoundWave::CanExecuteSourceCommands, SoundNodes )
        )
    );

    MenuBuilder.AddMenuEntry(
        LOCTEXT("SoundWave_CreateCue", "Create Cue"),
        LOCTEXT("SoundWave_CreateCueTooltip", "Creates a sound cue ."),
        FSlateIcon(),
        FUIAction(
            FExecuteAction::CreateSP( this, &FAssetTypeActions_SoundWave::ExecuteCreateSoundCue, SoundNodes ),
            FCanExecuteAction()
        )
    );
}
开发者ID:Tigrouzen,项目名称:UnrealEngine-4,代码行数:56,代码来源:AssetTypeActions_SoundWave.cpp


示例9: GetPinInformation

void UAnimGraphNode_BlendListByEnum::GetContextMenuActions(const FGraphNodeContextMenuBuilder& Context) const
{
	if (!Context.bIsDebugging && (BoundEnum != NULL))
	{
		if ((Context.Pin != NULL) && (Context.Pin->Direction == EGPD_Input))
		{
			int32 RawArrayIndex = 0;
			bool bIsPosePin = false;
			bool bIsTimePin = false;
			GetPinInformation(Context.Pin->PinName, /*out*/ RawArrayIndex, /*out*/ bIsPosePin, /*out*/ bIsTimePin);

			if (bIsPosePin || bIsTimePin)
			{
				const int32 ExposedEnumIndex = RawArrayIndex - 1;

				if (ExposedEnumIndex != INDEX_NONE)
				{
					// Offer to remove this specific pin
					FUIAction Action = FUIAction( FExecuteAction::CreateUObject( this, &UAnimGraphNode_BlendListByEnum::RemovePinFromBlendList, const_cast<UEdGraphPin*>(Context.Pin)) );
					Context.MenuBuilder->AddMenuEntry( LOCTEXT("RemovePose", "Remove Pose"), FText::GetEmpty(), FSlateIcon(), Action );
				}
			}
		}

		// Offer to add any not-currently-visible pins
		bool bAddedHeader = false;
		const int32 MaxIndex = BoundEnum->NumEnums() - 1; // we don't want to show _MAX enum
		for (int32 Index = 0; Index < MaxIndex; ++Index)
		{
			FName ElementName = BoundEnum->GetEnum(Index);
			if (!VisibleEnumEntries.Contains(ElementName))
			{
				FText PrettyElementName = BoundEnum->GetEnumText(Index);

				// Offer to add this entry
				if (!bAddedHeader)
				{
					bAddedHeader = true;
					Context.MenuBuilder->BeginSection("AnimGraphNodeAddElementPin", LOCTEXT("ExposeHeader", "Add pin for element"));
					{
						FUIAction Action = FUIAction( FExecuteAction::CreateUObject( this, &UAnimGraphNode_BlendListByEnum::ExposeEnumElementAsPin, ElementName) );
						Context.MenuBuilder->AddMenuEntry(PrettyElementName, PrettyElementName, FSlateIcon(), Action);
					}
					Context.MenuBuilder->EndSection();
				}
				else
				{
					FUIAction Action = FUIAction( FExecuteAction::CreateUObject( this, &UAnimGraphNode_BlendListByEnum::ExposeEnumElementAsPin, ElementName) );
					Context.MenuBuilder->AddMenuEntry(PrettyElementName, PrettyElementName, FSlateIcon(), Action);
				}
			}
		}
	}
}
开发者ID:Codermay,项目名称:Unreal4,代码行数:54,代码来源:AnimGraphNode_BlendListByEnum.cpp


示例10: LOCTEXT

void FCollectionContextMenu::MakeSetColorSubMenu(FMenuBuilder& MenuBuilder)
{
	// New Color
	MenuBuilder.AddMenuEntry(
		LOCTEXT("NewColor", "New Color"),
		LOCTEXT("NewCollectionColorTooltip", "Changes the color this collection should appear as."),
		FSlateIcon(),
		FUIAction( FExecuteAction::CreateSP( this, &FCollectionContextMenu::ExecutePickColor ) )
		);

	// Clear Color (only required if any of the selection has one)
	if ( SelectedHasCustomColors() )
	{
		MenuBuilder.AddMenuEntry(
			LOCTEXT("ClearColor", "Clear Color"),
			LOCTEXT("ClearCollectionColorTooltip", "Resets the color this collection appears as."),
			FSlateIcon(),
			FUIAction( FExecuteAction::CreateSP( this, &FCollectionContextMenu::ExecuteResetColor ) )
			);
	}

	// Add all the custom colors the user has chosen so far
	TArray< FLinearColor > CustomColors;
	if ( CollectionViewUtils::HasCustomColors( &CustomColors ) )
	{	
		MenuBuilder.BeginSection("PathContextCustomColors", LOCTEXT("CustomColorsExistingColors", "Existing Colors") );
		{
			for ( int32 ColorIndex = 0; ColorIndex < CustomColors.Num(); ColorIndex++ )
			{
				const FLinearColor& Color = CustomColors[ ColorIndex ];
				MenuBuilder.AddWidget(
						SNew(SHorizontalBox)
						+SHorizontalBox::Slot()
						.AutoWidth()
						.Padding(2, 0, 0, 0)
						[
							SNew(SButton)
							.ButtonStyle( FEditorStyle::Get(), "Menu.Button" )
							.OnClicked( this, &FCollectionContextMenu::OnColorClicked, Color )
							[
								SNew(SColorBlock)
								.Color( Color )
								.Size( FVector2D(77,16) )
							]
						],
					LOCTEXT("CustomColor", ""),
					/*bNoIndent=*/true
				);
			}
		}
		MenuBuilder.EndSection();
	}
}
开发者ID:1vanK,项目名称:AHRUnrealEngine,代码行数:53,代码来源:CollectionContextMenu.cpp


示例11: FUIAction

void FAssetContextMenu::BindCommands(TSharedPtr< FUICommandList > InCommandList)
{
	InCommandList->MapAction( FGenericCommands::Get().Rename, FUIAction(
		FExecuteAction::CreateSP( this, &FAssetContextMenu::ExecuteRename ),
		FCanExecuteAction::CreateSP( this, &FAssetContextMenu::CanExecuteRename )
		));

	InCommandList->MapAction( FGenericCommands::Get().Delete, FUIAction(
		FExecuteAction::CreateSP( this, &FAssetContextMenu::ExecuteDelete ),
		FCanExecuteAction::CreateSP( this, &FAssetContextMenu::CanExecuteDelete )
		));
}
开发者ID:Tigrouzen,项目名称:UnrealEngine-4,代码行数:12,代码来源:AssetContextMenu.cpp


示例12: LOCTEXT

void FMediaPlayerActions::GetActions( const TArray<UObject*>& InObjects, FMenuBuilder& MenuBuilder )
{
	FAssetTypeActions_Base::GetActions(InObjects, MenuBuilder);

	auto MediaPlayers = GetTypedWeakObjectPtrs<UMediaPlayer>(InObjects);

	MenuBuilder.AddMenuEntry(
		LOCTEXT("MediaPlayer_PlayMovie", "Play Movie"),
		LOCTEXT("MediaPlayer_PlayMovieToolTip", "Starts playback of the media."),
		FSlateIcon( FEditorStyle::GetStyleSetName(), "MediaAsset.AssetActions.Play" ),
		FUIAction(
			FExecuteAction::CreateSP(this, &FMediaPlayerActions::HandlePlayMovieActionExecute, MediaPlayers),
			FCanExecuteAction()
		)
	);

	MenuBuilder.AddMenuEntry(
		LOCTEXT("MediaPlayer_PauseMovie", "Pause Movie"),
		LOCTEXT("MediaPlayer_PauseMovieToolTip", "Pauses playback of the media."),
		FSlateIcon( FEditorStyle::GetStyleSetName(), "MediaAsset.AssetActions.Pause" ),
		FUIAction(
			FExecuteAction::CreateSP(this, &FMediaPlayerActions::HandlePauseMovieActionExecute, MediaPlayers),
			FCanExecuteAction()
		)
	);

	MenuBuilder.AddMenuSeparator();

	MenuBuilder.AddMenuEntry(
		LOCTEXT("MediaPlayer_CreateMediaSoundWave", "Create Media Sound Wave"),
		LOCTEXT("MediaPlayer_CreateMediaSoundWaveTooltip", "Creates a new MediaSoundWave using this MediaPlayer asset."),
		FSlateIcon( FEditorStyle::GetStyleSetName(), "ClassIcon.MediaSoundWave" ),
		FUIAction(
			FExecuteAction::CreateSP(this, &FMediaPlayerActions::ExecuteCreateMediaSoundWave, MediaPlayers),
			FCanExecuteAction()
		)
	);

	MenuBuilder.AddMenuEntry(
		LOCTEXT("MediaPlayer_CreateMediaTexture", "Create Media Texture"),
		LOCTEXT("MediaPlayer_CreateMediaTextureTooltip", "Creates a new MediaTexture using this MediaPlayer asset."),
		FSlateIcon( FEditorStyle::GetStyleSetName(), "ClassIcon.MediaTexture" ),
		FUIAction(
			FExecuteAction::CreateSP(this, &FMediaPlayerActions::ExecuteCreateMediaTexture, MediaPlayers),
			FCanExecuteAction()
		)
	);

	FAssetTypeActions_Base::GetActions(InObjects, MenuBuilder);
}
开发者ID:1vanK,项目名称:AHRUnrealEngine,代码行数:50,代码来源:MediaPlayerActions.cpp


示例13: MenuBuilder

FReply STutorialButton::OnMouseButtonDown(const FGeometry& MyGeometry, const FPointerEvent& MouseEvent)
{
	if (MouseEvent.GetEffectingButton() == EKeys::RightMouseButton)
	{
		const bool bInShouldCloseWindowAfterMenuSelection = true;
		FMenuBuilder MenuBuilder(bInShouldCloseWindowAfterMenuSelection, nullptr);

		if(ShouldShowAlert())
		{
			MenuBuilder.AddMenuEntry(
				LOCTEXT("DismissReminder", "Don't Remind Me Again"),
				LOCTEXT("DismissReminderTooltip", "Selecting this option will prevent the tutorial blip from being displayed again, even if you choose not to complete the tutorial."),
				FSlateIcon(),
				FUIAction(FExecuteAction::CreateSP(this, &STutorialButton::DismissAlert))
				);

			MenuBuilder.AddMenuEntry(
				LOCTEXT("DismissAllReminders", "Dismiss All Tutorial Reminders"),
				LOCTEXT("DismissAllRemindersTooltip", "Selecting this option will prevent all tutorial blips from being displayed."),
				FSlateIcon(),
				FUIAction(FExecuteAction::CreateSP(this, &STutorialButton::DismissAllAlerts))
				);

			MenuBuilder.AddMenuSeparator();
		}

		if(bTutorialAvailable)
		{
			MenuBuilder.AddMenuEntry(
				FText::Format(LOCTEXT("LaunchTutorialPattern", "Start Tutorial: {0}"), TutorialTitle),
				FText::Format(LOCTEXT("TutorialLaunchToolTip", "Click to begin the '{0}' tutorial"), TutorialTitle),
				FSlateIcon(),
				FUIAction(FExecuteAction::CreateSP(this, &STutorialButton::LaunchTutorial))
				);
		}

		MenuBuilder.AddMenuEntry(
			LOCTEXT("LaunchBrowser", "Show Available Tutorials"),
			LOCTEXT("LaunchBrowserTooltip", "Display the tutorials browser"),
			FSlateIcon(),
			FUIAction(FExecuteAction::CreateSP(this, &STutorialButton::LaunchBrowser))
			);

		FWidgetPath WidgetPath = MouseEvent.GetEventPath() != nullptr ? *MouseEvent.GetEventPath() : FWidgetPath();

		FSlateApplication::Get().PushMenu(SharedThis(this), WidgetPath, MenuBuilder.MakeWidget(), FSlateApplication::Get().GetCursorPos(), FPopupTransitionEffect::ContextMenu);
	}
	return FReply::Handled();
}
开发者ID:zhaoyizheng0930,项目名称:UnrealEngine,代码行数:49,代码来源:STutorialButton.cpp


示例14: LOCTEXT

void FAssetTypeActions_CurveTable::GetActions( const TArray<UObject*>& InObjects, FMenuBuilder& MenuBuilder )
{
	auto Tables = GetTypedWeakObjectPtrs<UObject>(InObjects);

	TArray<FString> ImportPaths;
	for (auto TableIter = Tables.CreateConstIterator(); TableIter; ++TableIter)
	{
		const UCurveTable* CurTable = Cast<UCurveTable>((*TableIter).Get());
		if (CurTable)
		{
			ImportPaths.Add(FReimportManager::ResolveImportFilename(CurTable->ImportPath, CurTable));
		}
	}

	MenuBuilder.AddMenuEntry(
		LOCTEXT("CurveTable_ExportAsCSV", "Export as CSV"),
		LOCTEXT("CurveTable_ExportAsCSVTooltip", "Export the curve table as a file containing CSV data."),
		FSlateIcon(),
		FUIAction(
			FExecuteAction::CreateSP( this, &FAssetTypeActions_CurveTable::ExecuteExportAsCSV, Tables ),
			FCanExecuteAction()
			)
		);

	MenuBuilder.AddMenuEntry(
		LOCTEXT("CurveTable_ExportAsJSON", "Export as JSON"),
		LOCTEXT("CurveTable_ExportAsJSONTooltip", "Export the curve table as a file containing JSON data."),
		FSlateIcon(),
		FUIAction(
			FExecuteAction::CreateSP( this, &FAssetTypeActions_CurveTable::ExecuteExportAsJSON, Tables ),
			FCanExecuteAction()
			)
		);

	TArray<FString> PotentialFileExtensions;
	PotentialFileExtensions.Add(TEXT(".xls"));
	PotentialFileExtensions.Add(TEXT(".xlsm"));
	PotentialFileExtensions.Add(TEXT(".csv"));
	PotentialFileExtensions.Add(TEXT(".json"));
	MenuBuilder.AddMenuEntry(
		LOCTEXT("CurveTable_OpenSourceData", "Open Source Data"),
		LOCTEXT("CurveTable_OpenSourceDataTooltip", "Opens the curve table's source data file in an external editor. It will search using the following extensions: .xls/.xlsm/.csv/.json"),
		FSlateIcon(),
		FUIAction(
			FExecuteAction::CreateSP( this, &FAssetTypeActions_CurveTable::ExecuteFindSourceFileInExplorer, ImportPaths, PotentialFileExtensions ),
			FCanExecuteAction::CreateSP(this, &FAssetTypeActions_CurveTable::CanExecuteFindSourceFileInExplorer, ImportPaths, PotentialFileExtensions)
			)
		);
}
开发者ID:a3pelawi,项目名称:UnrealEngine,代码行数:49,代码来源:AssetTypeActions_CurveTable.cpp


示例15: FUIAction

void FCollectionContextMenu::BindCommands(TSharedPtr< FUICommandList > InCommandList)
{
	InCommandList->MapAction( FGenericCommands::Get().Rename, FUIAction(
		FExecuteAction::CreateSP( this, &FCollectionContextMenu::ExecuteRenameCollection ),
		FCanExecuteAction::CreateSP( this, &FCollectionContextMenu::CanExecuteRenameCollection )
		));
}
开发者ID:1vanK,项目名称:AHRUnrealEngine,代码行数:7,代码来源:CollectionContextMenu.cpp


示例16: LOCTEXT

void FAssetTypeActions_Texture::GetActions( const TArray<UObject*>& InObjects, FMenuBuilder& MenuBuilder )
{
	auto Textures = GetTypedWeakObjectPtrs<UTexture>(InObjects);

	MenuBuilder.AddMenuEntry(
		LOCTEXT("Texture_CreateMaterial", "Create Material"),
		LOCTEXT("Texture_CreateMaterialTooltip", "Creates a new material using this texture."),
		FSlateIcon(FEditorStyle::GetStyleSetName(), "ClassIcon.Material"),
		FUIAction(
			FExecuteAction::CreateSP( this, &FAssetTypeActions_Texture::ExecuteCreateMaterial, Textures ),
			FCanExecuteAction()
			)
		);

	// @todo AssetTypeActions Implement FindMaterials using the asset registry.
	/*
	if ( InObjects.Num() == 1 )
	{
		MenuBuilder.AddMenuEntry(
			LOCTEXT("Texture_FindMaterials", "Find Materials Using This"),
			LOCTEXT("Texture_FindMaterialsTooltip", "Finds all materials that use this material in the content browser."),
			FSlateIcon(),
			FUIAction(
				FExecuteAction::CreateSP( this, &FAssetTypeActions_Texture::ExecuteFindMaterials, Textures(0) ),
				FCanExecuteAction()
				)
			);
	}
	*/
}
开发者ID:zhaoyizheng0930,项目名称:UnrealEngine,代码行数:30,代码来源:AssetTypeActions_Texture.cpp


示例17: LOCTEXT

void FTextAssetActions::GetActions(const TArray<UObject*>& InObjects, FMenuBuilder& MenuBuilder)
{
	FAssetTypeActions_Base::GetActions(InObjects, MenuBuilder);

	auto TextAssets = GetTypedWeakObjectPtrs<UTextAsset>(InObjects);

	MenuBuilder.AddMenuEntry(
		LOCTEXT("TextAsset_ReverseText", "Reverse Text"),
		LOCTEXT("TextAsset_ReverseTextToolTip", "Reverse the text stored in the selected text asset(s)."),
		FSlateIcon(),
		FUIAction(
			FExecuteAction::CreateLambda([=]{
				for (auto& TextAsset : TextAssets)
				{
					if (TextAsset.IsValid() && !TextAsset->Text.IsEmpty())
					{
						TextAsset->Text = FText::FromString(TextAsset->Text.ToString().Reverse());
						TextAsset->PostEditChange();
					}
				}
			}),
			FCanExecuteAction::CreateLambda([=] {
				for (auto& TextAsset : TextAssets)
				{
					if (TextAsset.IsValid() && !TextAsset->Text.IsEmpty())
					{
						return true;
					}
				}
				return false;
			})
		)
	);
}
开发者ID:ChunHungLiu,项目名称:TextAsset,代码行数:34,代码来源:TextAssetActions.cpp


示例18: LocationGridMenuBuilder

TSharedRef<SWidget> SDesignerToolBar::BuildLocationGridCheckBoxList(FName InExtentionHook, const FText& InHeading, const TArray<int32>& InGridSizes) const
{
	const UWidgetDesignerSettings* ViewportSettings = GetDefault<UWidgetDesignerSettings>();

	const bool bShouldCloseWindowAfterMenuSelection = true;
	FMenuBuilder LocationGridMenuBuilder(bShouldCloseWindowAfterMenuSelection, CommandList);

	LocationGridMenuBuilder.BeginSection(InExtentionHook, InHeading);
	for ( int32 CurGridSizeIndex = 0; CurGridSizeIndex < InGridSizes.Num(); ++CurGridSizeIndex )
	{
		const int32 CurGridSize = InGridSizes[CurGridSizeIndex];

		LocationGridMenuBuilder.AddMenuEntry(
			FText::AsNumber(CurGridSize),
			FText::Format(LOCTEXT("LocationGridSize_ToolTip", "Sets grid size to {0}"), FText::AsNumber(CurGridSize)),
			FSlateIcon(),
			FUIAction(FExecuteAction::CreateStatic(&SDesignerToolBar::SetGridSize, CurGridSize),
			FCanExecuteAction(),
			FIsActionChecked::CreateStatic(&SDesignerToolBar::IsGridSizeChecked, CurGridSize)),
			NAME_None,
			EUserInterfaceActionType::RadioButton);
	}
	LocationGridMenuBuilder.EndSection();

	return LocationGridMenuBuilder.MakeWidget();
}
开发者ID:Codermay,项目名称:Unreal4,代码行数:26,代码来源:SDesignerToolBar.cpp


示例19: NSLOCTEXT

void FColorPropertyTrackEditor::BuildTrackContextMenu( FMenuBuilder& MenuBuilder, UMovieSceneTrack* Track )
{
	UInterpTrackColorProp* ColorPropTrack = nullptr;
	UInterpTrackLinearColorProp* LinearColorPropTrack = nullptr;
	for ( UObject* CopyPasteObject : GUnrealEd->MatineeCopyPasteBuffer )
	{
		ColorPropTrack = Cast<UInterpTrackColorProp>( CopyPasteObject );
		LinearColorPropTrack = Cast<UInterpTrackLinearColorProp>( CopyPasteObject );
		if ( ColorPropTrack != nullptr || LinearColorPropTrack != nullptr )
		{
			break;
		}
	}
	UMovieSceneColorTrack* ColorTrack = Cast<UMovieSceneColorTrack>( Track );
	MenuBuilder.AddMenuEntry(
		NSLOCTEXT( "Sequencer", "PasteMatineeColorTrack", "Paste Matinee Color Track" ),
		NSLOCTEXT( "Sequencer", "PasteMatineeColorTrackTooltip", "Pastes keys from a Matinee color track into this track." ),
		FSlateIcon(),
		FUIAction(
			ColorPropTrack != nullptr ? 
			FExecuteAction::CreateStatic( &CopyInterpColorTrack, GetSequencer().ToSharedRef(), ColorPropTrack, ColorTrack ) : 
			FExecuteAction::CreateStatic( &CopyInterpLinearColorTrack, GetSequencer().ToSharedRef(), LinearColorPropTrack, ColorTrack ),			
			FCanExecuteAction::CreateLambda( [=]()->bool { return ((ColorPropTrack != nullptr && ColorPropTrack->GetNumKeys() > 0) || (LinearColorPropTrack != nullptr && LinearColorPropTrack->GetNumKeys() > 0)) && ColorTrack != nullptr; } ) ) );

	MenuBuilder.AddMenuSeparator();
	FKeyframeTrackEditor::BuildTrackContextMenu(MenuBuilder, Track);
}
开发者ID:zhaoyizheng0930,项目名称:UnrealEngine,代码行数:27,代码来源:ColorPropertyTrackEditor.cpp


示例20: MenuBuilder

TSharedRef<SWidget> SFilterWidget::GetRightClickMenuContent()
{
	FMenuBuilder MenuBuilder(true, NULL);

	if (IsEnabled())
	{
		FText FiletNameAsText = FText::FromString(GetFilterNameAsString());
		MenuBuilder.BeginSection("VerbositySelection", LOCTEXT("VerbositySelection", "Current verbosity selection"));
		{
			for (int32 Index = ELogVerbosity::NoLogging + 1; Index <= ELogVerbosity::VeryVerbose; Index++)
			{
				const FString VerbosityStr = FOutputDevice::VerbosityToString((ELogVerbosity::Type)Index);
				MenuBuilder.AddMenuEntry(
					FText::Format(LOCTEXT("UseVerbosity", "Use: {0}"), FText::FromString(VerbosityStr)),
					LOCTEXT("UseVerbosityTooltip", "Applay verbosity to selected flter."),
					FSlateIcon(),
					FUIAction(FExecuteAction::CreateSP(this, &SFilterWidget::SetVerbosityFilter, Index))
					);
			}
		}
		MenuBuilder.EndSection();
	}

	return MenuBuilder.MakeWidget();
}
开发者ID:Codermay,项目名称:Unreal4,代码行数:25,代码来源:SFilterWidget.cpp



注:本文中的FUIAction函数示例由纯净天空整理自Github/MSDocs等源码及文档


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ FUNC函数代码示例发布时间:2022-05-30
下一篇:
C++ FTextureRHIRef函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap