コード例 #1
0
		static void BuildViewOptionsMenu(FMenuBuilder& Menu)
		{
			Menu.BeginSection("CascadeViewOverlays", NSLOCTEXT("Cascade", "ViewOptionsHeader", "View Overlays"));
			{
				Menu.AddMenuEntry(FCascadeCommands::Get().View_ParticleCounts);
				Menu.AddMenuEntry(FCascadeCommands::Get().View_ParticleEventCounts);
				Menu.AddMenuEntry(FCascadeCommands::Get().View_ParticleTimes);
				Menu.AddMenuEntry(FCascadeCommands::Get().View_ParticleMemory);
				Menu.AddMenuEntry(FCascadeCommands::Get().View_SystemCompleted);
			}
			Menu.EndSection();
		}
		static void MakePostInfinityExtrapSubMenu(FMenuBuilder& MenuBuilder)
		{
			MenuBuilder.BeginSection( "Post-Infinity Extrapolation", LOCTEXT( "CurveEditorMenuPostInfinityExtrapHeader", "Extrapolation" ) );
			{
				MenuBuilder.AddMenuEntry( FRichCurveEditorCommands::Get().SetPostInfinityExtrapCycle);
				MenuBuilder.AddMenuEntry( FRichCurveEditorCommands::Get().SetPostInfinityExtrapCycleWithOffset);
				MenuBuilder.AddMenuEntry( FRichCurveEditorCommands::Get().SetPostInfinityExtrapOscillate);
				MenuBuilder.AddMenuEntry( FRichCurveEditorCommands::Get().SetPostInfinityExtrapLinear);
				MenuBuilder.AddMenuEntry( FRichCurveEditorCommands::Get().SetPostInfinityExtrapConstant);
			}
			MenuBuilder.EndSection();
		}
コード例 #3
0
void FAssetTypeActions_Font::GetActions(const TArray<UObject*>& InObjects, FMenuBuilder& MenuBuilder)
{
	auto Fonts = GetTypedWeakObjectPtrs<UFont>(InObjects);

	MenuBuilder.AddMenuEntry(
		LOCTEXT("ReimportFontLabel", "Reimport"),
		LOCTEXT("ReimportFontTooltip", "Reimport the selected font(s)."),
		FSlateIcon(FEditorStyle::GetStyleSetName(), "ContentBrowser.AssetActions.ReimportAsset"),
		FUIAction(
			FExecuteAction::CreateSP(this, &FAssetTypeActions_Font::ExecuteReimport, Fonts),
			FCanExecuteAction::CreateSP(this, &FAssetTypeActions_Font::CanExecuteReimport, Fonts)
			)
		);
}
コード例 #4
0
void FAssetTypeActions_PhysicsAsset::GetActions( const TArray<UObject*>& InObjects, FMenuBuilder& MenuBuilder )
{
	auto PhysicsAssets = GetTypedWeakObjectPtrs<UPhysicsAsset>(InObjects);

	MenuBuilder.AddMenuEntry(
		LOCTEXT("PhysicsAsset_Edit", "Edit"),
		LOCTEXT("PhysicsAsset_EditTooltip", "Opens the selected physics asset in PhAT."),
		FSlateIcon(),
		FUIAction(
			FExecuteAction::CreateSP( this, &FAssetTypeActions_PhysicsAsset::ExecuteEdit, PhysicsAssets ),
			FCanExecuteAction()
			)
		);
}
コード例 #5
0
void FSpriteAssetTypeActions::GetActions(const TArray<UObject*>& InObjects, FMenuBuilder& MenuBuilder)
{
	auto Sprites = GetTypedWeakObjectPtrs<UPaperSprite>(InObjects);

	MenuBuilder.AddMenuEntry(
		LOCTEXT("Sprite_CreateFlipbook", "Create Flipbook"),
		LOCTEXT("Sprite_CreateFlipbookTooltip", "Creates flipbooks from the selected sprites."),
		FSlateIcon(FEditorStyle::GetStyleSetName(), "ClassIcon.PaperFlipbook"),
		FUIAction(
		FExecuteAction::CreateSP(this, &FSpriteAssetTypeActions::ExecuteCreateFlipbook, Sprites),
		FCanExecuteAction()
		)
	);
}
コード例 #6
0
void FParticleTrackEditor::BuildObjectBindingTrackMenu(FMenuBuilder& MenuBuilder, const FGuid& ObjectBinding, const UClass* ObjectClass)
{
	if (ObjectClass->IsChildOf(AEmitter::StaticClass()) || ObjectClass->IsChildOf(UParticleSystemComponent::StaticClass()))
	{
		const TSharedPtr<ISequencer> ParentSequencer = GetSequencer();

		MenuBuilder.AddMenuEntry(
			LOCTEXT("AddParticleTrack", "Particle Toggle Track"),
			LOCTEXT("TriggerParticlesTooltip", "Adds a track for controlling particle emitter state."),
			FSlateIcon(),
			FUIAction(FExecuteAction::CreateSP(this, &FParticleTrackEditor::AddParticleKey, ObjectBinding))
		);
	}
}
void FPaperSpriteSheetAssetTypeActions::GetActions(const TArray<UObject*>& InObjects, FMenuBuilder& MenuBuilder)
{
	auto SpriteSheetImports = GetTypedWeakObjectPtrs<UPaperSpriteSheet>(InObjects);

	MenuBuilder.AddMenuEntry(
		LOCTEXT("SpriteSheet_CreateFlipbooks", "Create Flipbooks"),
		LOCTEXT("SpriteSheet_CreateFlipbooksTooltip", "Creates flipbooks from sprites in this sprite sheet."),
		FSlateIcon(FEditorStyle::GetStyleSetName(), "ClassIcon.PaperFlipbook"),
		FUIAction(
		FExecuteAction::CreateSP(this, &FPaperSpriteSheetAssetTypeActions::ExecuteCreateFlipbooks, SpriteSheetImports),
		FCanExecuteAction()
		)
	);
}
コード例 #8
0
void FAssetTypeActions_SsProject::GetActions(const TArray<UObject*>& InObjects, FMenuBuilder& MenuBuilder)
{
	auto SsProjectImports = GetTypedWeakObjectPtrs<USsProject>(InObjects);

	MenuBuilder.AddMenuEntry(
		LOCTEXT("SsProject_Reimport", "Reimport"),
		LOCTEXT("SsProject_ReimportTooltip", "reimport sspj."),
		FSlateIcon(),
		FUIAction(
		FExecuteAction::CreateSP(this, &FAssetTypeActions_SsProject::ExecuteReimport, SsProjectImports),
		FCanExecuteAction()
		)
	);
}
コード例 #9
0
void FAssetTypeActions_MaterialFunction::GetActions( const TArray<UObject*>& InObjects, FMenuBuilder& MenuBuilder )
{
	auto Materials = GetTypedWeakObjectPtrs<UMaterialFunction>(InObjects);

	MenuBuilder.AddMenuEntry(
		LOCTEXT("MaterialFunction_FindMaterials", "Find Materials Using This"),
		LOCTEXT("MaterialFunction_FindMaterialsTooltip", "Finds the materials that reference this material function in the content browser."),
		FSlateIcon(FEditorStyle::GetStyleSetName(), "Kismet.Tabs.FindResults"),
		FUIAction(
			FExecuteAction::CreateSP( this, &FAssetTypeActions_MaterialFunction::ExecuteFindMaterials, Materials ),
			FCanExecuteAction()
			)
		);
}
コード例 #10
0
ファイル: FrontendFilters.cpp プロジェクト: PopCap/GameIdea
void FFrontendFilter_ArbitraryComparisonOperation::ModifyContextMenu(FMenuBuilder& MenuBuilder)
{
	FUIAction Action;

	MenuBuilder.BeginSection(TEXT("ComparsionSection"), LOCTEXT("ComparisonSectionHeading", "AssetRegistrySearchable Comparison"));

	TSharedRef<SWidget> KeyWidget =
		SNew(SEditableTextBox)
		.Text_Raw(this, &FFrontendFilter_ArbitraryComparisonOperation::GetKeyValueAsText)
		.OnTextCommitted_Raw(this, &FFrontendFilter_ArbitraryComparisonOperation::OnKeyValueTextCommitted)
		.MinDesiredWidth(100.0f);
	TSharedRef<SWidget> ValueWidget = SNew(SEditableTextBox)
		.Text_Raw(this, &FFrontendFilter_ArbitraryComparisonOperation::GetTargetValueAsText)
		.OnTextCommitted_Raw(this, &FFrontendFilter_ArbitraryComparisonOperation::OnTargetValueTextCommitted)
		.MinDesiredWidth(100.0f);

	MenuBuilder.AddWidget(KeyWidget, LOCTEXT("KeyMenuDesc", "Tag"));
	MenuBuilder.AddWidget(ValueWidget, LOCTEXT("ValueMenuDesc", "Target Value"));

#define UE_SET_COMP_OP(Operation) \
	MenuBuilder.AddMenuEntry(FText::AsCultureInvariant(ConvertOperationToString(Operation)), \
		LOCTEXT("SwitchOpsTooltip", "Switch comparsion type"), \
		FSlateIcon(), \
		FUIAction(FExecuteAction::CreateRaw(this, &FFrontendFilter_ArbitraryComparisonOperation::SetComparisonOperation, Operation), FCanExecuteAction(), FIsActionChecked::CreateRaw(this, &FFrontendFilter_ArbitraryComparisonOperation::IsComparisonOperationEqualTo, Operation)), \
		NAME_None, \
		EUserInterfaceActionType::RadioButton);

	UE_SET_COMP_OP(ETextFilterComparisonOperation::Equal);
	UE_SET_COMP_OP(ETextFilterComparisonOperation::NotEqual);
	UE_SET_COMP_OP(ETextFilterComparisonOperation::Less);
	UE_SET_COMP_OP(ETextFilterComparisonOperation::LessOrEqual);
	UE_SET_COMP_OP(ETextFilterComparisonOperation::Greater);
	UE_SET_COMP_OP(ETextFilterComparisonOperation::GreaterOrEqual);
#undef UE_SET_COMP_OP

	MenuBuilder.EndSection();
}
コード例 #11
0
void FAssetTypeActions_DataTable::GetActions( const TArray<UObject*>& InObjects, FMenuBuilder& MenuBuilder )
{
	auto Tables = GetTypedWeakObjectPtrs<UObject>(InObjects);
	
	TArray<FString> ImportPaths;
	for (auto TableIter = Tables.CreateConstIterator(); TableIter; ++TableIter)
	{
		const UDataTable* CurTable = Cast<UDataTable>((*TableIter).Get());
		if (CurTable)
		{
			ImportPaths.Add(FReimportManager::ResolveImportFilename(CurTable->ImportPath, CurTable));
		}
	}

	MenuBuilder.AddMenuEntry(
		LOCTEXT("DataTable_JSON", "JSON"),
		LOCTEXT("DataTable_JSONTooltip", "Creates a JSON version of the data table in the lock."),
		FSlateIcon(),
		FUIAction(
			FExecuteAction::CreateSP( this, &FAssetTypeActions_DataTable::ExecuteJSON, Tables ),
			FCanExecuteAction()
			)
		);

	TArray<FString> XLSExtensions;
	XLSExtensions.Add(TEXT(".xls"));
	XLSExtensions.Add(TEXT(".xlsm"));
	MenuBuilder.AddMenuEntry(
		LOCTEXT("DataTable_OpenSourceXLS", "Open Source (.xls/.xlsm)"),
		LOCTEXT("DataTable_OpenSourceXLSTooltip", "Opens the data table's source XLS/XLSM file in an external editor."),
		FSlateIcon(),
		FUIAction(
			FExecuteAction::CreateSP( this, &FAssetTypeActions_DataTable::ExecuteFindExcelFileInExplorer, ImportPaths, XLSExtensions ),
			FCanExecuteAction::CreateSP(this, &FAssetTypeActions_DataTable::CanExecuteFindExcelFileInExplorer, ImportPaths, XLSExtensions)
			)
		);
}
コード例 #12
0
void FAssetTypeActions_Blueprint::GetActions( const TArray<UObject*>& InObjects, FMenuBuilder& MenuBuilder )
{
	auto Blueprints = GetTypedWeakObjectPtrs<UBlueprint>(InObjects);

	MenuBuilder.AddMenuEntry(
		LOCTEXT("Blueprint_EditAction", "Open in Full Editor"),
		LOCTEXT("Blueprint_EditActionTooltip", "Opens the selected blueprints in the either the blueprint editor or in Persona (depending on type)."),
		FSlateIcon(),
		FUIAction(
			FExecuteAction::CreateSP( this, &FAssetTypeActions_Blueprint::ExecuteEdit, Blueprints ),
			FCanExecuteAction()
			)
		);

	MenuBuilder.AddMenuEntry(
		LOCTEXT("Blueprint_EditDefaults", "Edit Defaults"),
		LOCTEXT("Blueprint_EditDefaultsTooltip", "Edits the default properties for the selected blueprints."),
		FSlateIcon(),
		FUIAction(
			FExecuteAction::CreateSP( this, &FAssetTypeActions_Blueprint::ExecuteEditDefaults, Blueprints ),
			FCanExecuteAction()
			)
		);

	if ( Blueprints.Num() == 1 && CanCreateNewDerivedBlueprint() )
	{
		MenuBuilder.AddMenuEntry(
			LOCTEXT("Blueprint_NewDerivedBlueprint", "Create Blueprint based on this"),
			LOCTEXT("Blueprint_NewDerivedBlueprintTooltip", "Creates a blueprint based on the selected blueprint."),
			FSlateIcon(),
			FUIAction(
				FExecuteAction::CreateSP( this, &FAssetTypeActions_Blueprint::ExecuteNewDerivedBlueprint, Blueprints[0] ),
				FCanExecuteAction()
				)
			);
	}
}
コード例 #13
0
void SFbxSSceneBaseMeshListView::FillPivotContextMenu(FMenuBuilder& MenuBuilder)
{
	TArray<FbxMeshInfoPtr> SelectedFbxMeshes;
	int32 SelectCount = GetSelectedItems(SelectedFbxMeshes);

	uint64 InvalidUid = INVALID_UNIQUE_ID;
	if (SelectedFbxMeshes.Num() == 1)
	{
		FbxMeshInfoPtr Item = SelectedFbxMeshes[0];
		if (Item->bOriginalTypeChanged)
			return;
		MenuBuilder.AddMenuEntry(Item->PivotNodeUid == INVALID_UNIQUE_ID ? LOCTEXT("ResetPivotBakeCurrent", "* No Pivot Bake") : LOCTEXT("ResetPivotBake", "No Pivot Bake"), FText(), FSlateIcon(), FUIAction(FExecuteAction::CreateSP(this, &SFbxSSceneBaseMeshListView::AssignToPivot, InvalidUid)));
		for (auto Kvp : Item->NodeReferencePivots)
		{
			//Create an entry for each pivot
			const FVector &PivotValue = Kvp.Key;
			const TArray<uint64> &NodeUids = Kvp.Value;
			bool IsCurrentPivotSelected = false;
			for (uint64 NodeUid : NodeUids)
			{
				if (Item->PivotNodeUid == NodeUid)
				{
					IsCurrentPivotSelected = true;
					break;
				}
			}
			FString MenuText = (IsCurrentPivotSelected ? TEXT("* Pivot: ") : TEXT("Pivot: ")) + PivotValue.ToCompactString();
			FString MenuTooltipText = IsCurrentPivotSelected ? LOCTEXT("PivotCurrentMenuItemTooltip", "This is the pivot that will be use to import this mesh. Node Number using this pivot: ").ToString() : LOCTEXT("PivotMenuItemTooltip", "Node Number using this pivot: ").ToString();
			MenuTooltipText.AppendInt(NodeUids.Num());
			MenuBuilder.AddMenuEntry(FText::FromString(*MenuText), FText::FromString(*MenuTooltipText), FSlateIcon(), FUIAction(FExecuteAction::CreateSP(this, &SFbxSSceneBaseMeshListView::AssignToPivot, NodeUids[0])));
		}
	}
	else
	{
		MenuBuilder.AddMenuEntry(LOCTEXT("ResetPivotBakeAll", "All No Pivot Bake"), FText(), FSlateIcon(), FUIAction(FExecuteAction::CreateSP(this, &SFbxSSceneBaseMeshListView::AssignToPivot, InvalidUid)));
	}
}
コード例 #14
0
void FAssetTypeActions_SoundCue::GetActions( const TArray<UObject*>& InObjects, FMenuBuilder& MenuBuilder )
{
	auto SoundCues = GetTypedWeakObjectPtrs<USoundCue>(InObjects);
	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 )
			)
		);
}
コード例 #15
0
bool FAssetContextMenu::AddReferenceMenuOptions(FMenuBuilder& MenuBuilder)
{
	MenuBuilder.BeginSection("AssetContextReferences", LOCTEXT("ReferencesMenuHeading", "References"));
	{
		MenuBuilder.AddMenuEntry(
			LOCTEXT("CopyReference", "Copy Reference"),
			LOCTEXT("CopyReferenceTooltip", "Copies reference paths for the selected assets to the clipboard."),
			FSlateIcon(),
			FUIAction( FExecuteAction::CreateSP( this, &FAssetContextMenu::ExecuteCopyReference ) )
			);

		MenuBuilder.AddMenuEntry(
			LOCTEXT("ReferenceViewer", "Reference Viewer..."),
			LOCTEXT("ReferenceViewerTooltip", "Shows a graph of references for this asset."),
			FSlateIcon(),
			FUIAction(
				FExecuteAction::CreateSP( this, &FAssetContextMenu::ExecuteShowReferenceViewer )
				)
			);
	}
	MenuBuilder.EndSection();

	return true;
}
コード例 #16
0
ファイル: MainMenu.cpp プロジェクト: Tigrouzen/UnrealEngine-4
void FMainMenu::FillHelpMenu( FMenuBuilder& MenuBuilder, const TSharedRef< FExtender > Extender )
{
	MenuBuilder.BeginSection("HelpOnline", NSLOCTEXT("MainHelpMenu", "Online", "Online"));
	{
		MenuBuilder.AddMenuEntry(FMainFrameCommands::Get().VisitForums);
		MenuBuilder.AddMenuEntry(FMainFrameCommands::Get().VisitSearchForAnswersPage);
		MenuBuilder.AddMenuEntry(FMainFrameCommands::Get().VisitWiki);


		const FText SupportWebSiteLabel = NSLOCTEXT("MainHelpMenu", "VisitUnrealEngineSupportWebSite", "Unreal Engine Support Web Site...");

		MenuBuilder.AddMenuSeparator("EpicGamesHelp");
		MenuBuilder.AddMenuEntry(FMainFrameCommands::Get().VisitEpicGamesDotCom, "VisitEpicGamesDotCom");
	}
	MenuBuilder.EndSection();

	MenuBuilder.BeginSection("HelpApplication", NSLOCTEXT("MainHelpMenu", "Application", "Application"));
	{
		const FText AboutWindowTitle = NSLOCTEXT("MainHelpMenu", "AboutUnrealEditor", "About Unreal Editor...");

		MenuBuilder.AddMenuEntry(FMainFrameCommands::Get().AboutUnrealEd, "AboutUnrealEd", AboutWindowTitle);
	}
	MenuBuilder.EndSection();
}
コード例 #17
0
bool FAssetContextMenu::AddCollectionMenuOptions(FMenuBuilder& MenuBuilder)
{
	// "Remove from collection" (only display option if exactly one collection is selected)
	if ( SourcesData.Collections.Num() == 1 )
	{
		MenuBuilder.BeginSection("AssetContextCollections", LOCTEXT("AssetCollectionOptionsMenuHeading", "Collections"));
		{
			MenuBuilder.AddMenuEntry(
				LOCTEXT("RemoveFromCollection", "Remove From Collection"),
				LOCTEXT("RemoveFromCollection_ToolTip", "Removes the selected asset from the current collection."),
				FSlateIcon(),
				FUIAction(
					FExecuteAction::CreateSP( this, &FAssetContextMenu::ExecuteRemoveFromCollection ),
					FCanExecuteAction::CreateSP( this, &FAssetContextMenu::CanExecuteRemoveFromCollection )
					)
				);
		}
		MenuBuilder.EndSection();

		return true;
	}

	return false;
}
コード例 #18
0
void FAssetTypeActions_SoundBase::GetActions( const TArray<UObject*>& InObjects, FMenuBuilder& MenuBuilder )
{
	auto Sounds = GetTypedWeakObjectPtrs<USoundBase>(InObjects);

	MenuBuilder.AddMenuEntry(
		LOCTEXT("Sound_PlaySound", "Play"),
		LOCTEXT("Sound_PlaySoundTooltip", "Plays the selected sound."),
		FSlateIcon(FEditorStyle::GetStyleSetName(), "MediaAsset.AssetActions.Play"),
		FUIAction(
			FExecuteAction::CreateSP( this, &FAssetTypeActions_SoundBase::ExecutePlaySound, Sounds ),
			FCanExecuteAction::CreateSP( this, &FAssetTypeActions_SoundBase::CanExecutePlayCommand, Sounds )
			)
		);

	MenuBuilder.AddMenuEntry(
		LOCTEXT("Sound_StopSound", "Stop"),
		LOCTEXT("Sound_StopSoundTooltip", "Stops the selected sounds."),
		FSlateIcon(FEditorStyle::GetStyleSetName(), "MediaAsset.AssetActions.Stop"),
		FUIAction(
			FExecuteAction::CreateSP( this, &FAssetTypeActions_SoundBase::ExecuteStopSound, Sounds ),
			FCanExecuteAction()
			)
		);
}
コード例 #19
0
void FCollectionContextMenu::MakeNewCollectionSubMenu(FMenuBuilder& MenuBuilder)
{
	MenuBuilder.BeginSection("CollectionNewCollection", LOCTEXT("NewCollectionMenuHeading", "New Collection"));
	{
		MenuBuilder.AddMenuEntry(
			LOCTEXT("NewCollection_Shared", "Shared Collection"),
			LOCTEXT("NewCollection_SharedTooltip", "Create a collection that can be seen by anyone."),
			FSlateIcon(),
			FUIAction(
			FExecuteAction::CreateSP( this, &FCollectionContextMenu::ExecuteNewCollection, ECollectionShareType::CST_Shared ),
			FCanExecuteAction::CreateSP( this, &FCollectionContextMenu::CanExecuteNewCollection, ECollectionShareType::CST_Shared )
			)
			);

		MenuBuilder.AddMenuEntry(
			LOCTEXT("NewCollection_Private", "Private Collection"),
			LOCTEXT("NewCollection_PrivateTooltip", "Create a collection that can only be seen by you."),
			FSlateIcon(),
			FUIAction(
			FExecuteAction::CreateSP( this, &FCollectionContextMenu::ExecuteNewCollection, ECollectionShareType::CST_Private ),
			FCanExecuteAction::CreateSP( this, &FCollectionContextMenu::CanExecuteNewCollection, ECollectionShareType::CST_Private )
			)
			);

		MenuBuilder.AddMenuEntry(
			LOCTEXT("NewCollection_Local", "Local Collection"),
			LOCTEXT("NewCollection_LocalTooltip", "Create a collection that is not in source control and can only be seen by you."),
			FSlateIcon(),
			FUIAction(
			FExecuteAction::CreateSP( this, &FCollectionContextMenu::ExecuteNewCollection, ECollectionShareType::CST_Local ),
			FCanExecuteAction::CreateSP( this, &FCollectionContextMenu::CanExecuteNewCollection, ECollectionShareType::CST_Local )
			)
			);
	}
	MenuBuilder.EndSection();
}
コード例 #20
0
void FAssetTypeActions_Curve::GetActions( const TArray<UObject*>& InObjects, FMenuBuilder& MenuBuilder )
{
	auto Curves = GetTypedWeakObjectPtrs<UCurveBase>(InObjects);

	MenuBuilder.AddMenuEntry(
		LOCTEXT("Curve_Edit", "Edit"),
		LOCTEXT("Curve_EditTooltip", "Opens the selected curves in the curve editor."),
		FSlateIcon(),
		FUIAction(
			FExecuteAction::CreateSP( this, &FAssetTypeActions_Curve::ExecuteEdit, Curves ),
			FCanExecuteAction()
			)
		);

	MenuBuilder.AddMenuEntry(
		LOCTEXT("Curve_Reimport", "Reimport"),
		LOCTEXT("Curve_ReimportTooltip", "Reimports the selected Curve from file."),
		FSlateIcon(),
		FUIAction(
		FExecuteAction::CreateSP( this, &FAssetTypeActions_Curve::ExecuteReimport, Curves ),
		FCanExecuteAction::CreateSP(this, &FAssetTypeActions_Curve::CanReimportCurves, Curves) //if it was from a file?
		)
		);
}
コード例 #21
0
void FAssetTypeActions_SoundWave::FillVoiceMenu(FMenuBuilder& MenuBuilder, TArray<TWeakObjectPtr<USoundWave>> Objects)
{
	TArray<const UClass*> AllowedClasses;
	AllowedClasses.Add(UDialogueVoice::StaticClass());

	TSharedRef<SWidget> VoicePicker = PropertyCustomizationHelpers::MakeAssetPickerWithMenu(
		FAssetData(),
		false,
		AllowedClasses,
		PropertyCustomizationHelpers::GetNewAssetFactoriesForClasses(AllowedClasses),
		FOnShouldFilterAsset(),
		FOnAssetSelected::CreateSP(this, &FAssetTypeActions_SoundWave::ExecuteCreateDialogueWave, Objects),
		FSimpleDelegate());

	MenuBuilder.AddWidget(VoicePicker, FText::GetEmpty(), false);
}
コード例 #22
0
void FAssetTypeActions_SoundWave::GetActions( const TArray<UObject*>& InObjects, FMenuBuilder& MenuBuilder )
{
	FAssetTypeActions_SoundBase::GetActions(InObjects, MenuBuilder);

	auto SoundNodes = GetTypedWeakObjectPtrs<USoundWave>(InObjects);

	MenuBuilder.AddMenuEntry(
		LOCTEXT("SoundWave_CreateCue", "Create Cue"),
		LOCTEXT("SoundWave_CreateCueTooltip", "Creates a sound cue using this sound wave."),
		FSlateIcon(FEditorStyle::GetStyleSetName(), "ClassIcon.SoundCue"),
		FUIAction(
		FExecuteAction::CreateSP( this, &FAssetTypeActions_SoundWave::ExecuteCreateSoundCue, SoundNodes ),
		FCanExecuteAction()
			)
		);
}
コード例 #23
0
void FAssetTypeActions_Texture2D::GetActions( const TArray<UObject*>& InObjects, FMenuBuilder& MenuBuilder )
{
	FAssetTypeActions_Texture::GetActions(InObjects, MenuBuilder);

	auto Textures = GetTypedWeakObjectPtrs<UTexture>(InObjects);

	MenuBuilder.AddMenuEntry(
		LOCTEXT("Texture2D_CreateSlateBrush", "Create Slate Brush"),
		LOCTEXT("Texture2D_CreateSlateBrushToolTip", "Creates a new slate brush using this texture."),
		FSlateIcon(),
		FUIAction(
			FExecuteAction::CreateSP( this, &FAssetTypeActions_Texture2D::ExecuteCreateSlateBrush, Textures ),
			FCanExecuteAction()
			)
		);
}
void FAssetTypeActions_TextureRenderTarget::GetActions( const TArray<UObject*>& InObjects, FMenuBuilder& MenuBuilder )
{
	FAssetTypeActions_Texture::GetActions(InObjects, MenuBuilder);

	auto RenderTargets = GetTypedWeakObjectPtrs<UTextureRenderTarget>(InObjects);

	MenuBuilder.AddMenuEntry(
		LOCTEXT("TextureRenderTarget_CreateStatic", "Create Static Texture"),
		LOCTEXT("TextureRenderTarget_CreateStaticTooltip", "Creates a static texture from the selected render targets."),
		FSlateIcon(FEditorStyle::GetStyleSetName(), "ClassIcon.Texture2D"),
		FUIAction(
			FExecuteAction::CreateSP( this, &FAssetTypeActions_TextureRenderTarget::ExecuteCreateStatic, RenderTargets ),
			FCanExecuteAction()
			)
		);
}
コード例 #25
0
void FCinematicShotSection::AddTakesMenu(FMenuBuilder& MenuBuilder)
{
	TArray<uint32> TakeNumbers;
	uint32 CurrentTakeNumber = INDEX_NONE;
	MovieSceneToolHelpers::GatherTakes(&SectionObject, TakeNumbers, CurrentTakeNumber);

	for (auto TakeNumber : TakeNumbers)
	{
		MenuBuilder.AddMenuEntry(
			FText::Format(LOCTEXT("TakeNumber", "Take {0}"), FText::AsNumber(TakeNumber)),
			FText::Format(LOCTEXT("TakeNumberTooltip", "Switch to take {0}"), FText::AsNumber(TakeNumber)),
			TakeNumber == CurrentTakeNumber ? FSlateIcon(FEditorStyle::GetStyleSetName(), "Sequencer.Star") : FSlateIcon(FEditorStyle::GetStyleSetName(), "Sequencer.Empty"),
			FUIAction(FExecuteAction::CreateSP(CinematicShotTrackEditor.Pin().ToSharedRef(), &FCinematicShotTrackEditor::SwitchTake, &SectionObject, TakeNumber))
		);
	}
}
コード例 #26
0
		static void BuildSignificanceMenu(FMenuBuilder& Menu)
		{
			Menu.BeginSection("CascadeSignificance", NSLOCTEXT("Cascade", "SignificanceHeader", "Required Significance"));
			{
				Menu.AddMenuEntry(FCascadeCommands::Get().Significance_Critical);
				Menu.AddMenuEntry(FCascadeCommands::Get().Significance_High);
				Menu.AddMenuEntry(FCascadeCommands::Get().Significance_Medium);
				Menu.AddMenuEntry(FCascadeCommands::Get().Significance_Low);
			}
			Menu.EndSection();
		}
コード例 #27
0
		/** Generates a lighting quality sub-menu */
		static void MakeLightingQualityMenu( FMenuBuilder& InMenuBuilder )
		{
			InMenuBuilder.BeginSection("LevelEditorBuildLightingQuality", LOCTEXT( "LightingQualityHeading", "Quality Level" ) );
			{
				InMenuBuilder.AddMenuEntry( FLevelEditorCommands::Get().LightingQuality_Production );
				InMenuBuilder.AddMenuEntry( FLevelEditorCommands::Get().LightingQuality_High );
				InMenuBuilder.AddMenuEntry( FLevelEditorCommands::Get().LightingQuality_Medium );
				InMenuBuilder.AddMenuEntry( FLevelEditorCommands::Get().LightingQuality_Preview );
			}
			InMenuBuilder.EndSection();
		}
コード例 #28
0
		static void BuildViewModesMenu(FMenuBuilder& Menu)
		{
			Menu.BeginSection("CascadeViewMode", NSLOCTEXT("Cascade", "ViewModeHeader", "View Mode"));
			{
				Menu.AddMenuEntry(FCascadeCommands::Get().ViewMode_Wireframe);
				Menu.AddMenuEntry(FCascadeCommands::Get().ViewMode_Unlit);
				Menu.AddMenuEntry(FCascadeCommands::Get().ViewMode_Lit);
				Menu.AddMenuEntry(FCascadeCommands::Get().ViewMode_ShaderComplexity);
			}
			Menu.EndSection();
		}
コード例 #29
0
void FGameplayDebugger::CreateSettingSubMenu(FMenuBuilder& Builder)
{
#if !(UE_BUILD_SHIPPING || UE_BUILD_TEST)
	Builder.AddMenuEntry(
		LOCTEXT("Test_GameplayDebugger_Menu", "Test Gameplay Debugger Option"),
		LOCTEXT("Test_GameplayDebugger_Menu_Tooltip", "If Enabled, actors will snap to the nearest location on the constraint plane (NOTE: Only works correctly in perspective views right now!)"),
		FSlateIcon(),
		FUIAction(
		FExecuteAction()/*FExecuteAction::CreateRaw(PlanarPolicy.Get(), &FPlanarConstraintSnapPolicy::ToggleEnabled)*/,
		FCanExecuteAction(),
		FIsActionChecked()/*FIsActionChecked::CreateRaw(PlanarPolicy.Get(), &FPlanarConstraintSnapPolicy::IsEnabled)*/
		),
		NAME_None,
		EUserInterfaceActionType::Button,
		NAME_None);
#endif
}
コード例 #30
0
void FFaceFXAnimationTrackEditor::BuildObjectBindingTrackMenu(FMenuBuilder& MenuBuilder, const FGuid& ObjectBinding, const UClass* ObjectClass)
{
	if (ObjectClass != UFaceFXComponent::StaticClass())
	{
		//only show widget on the component menu
		return;
	}

	if (UFaceFXComponent* FaceFXComponent = GetFaceFXComponent(ObjectBinding))
	{
		MenuBuilder.AddMenuEntry(
			LOCTEXT("SequencerAddSection", "Facial Animation"),
			LOCTEXT("SequencerAddSectionTooltip", "Adds a FaceFX facial animation section"),
			FSlateIcon(),
			FUIAction(FExecuteAction::CreateRaw(this, &FFaceFXAnimationTrackEditor::OnAddKey, ObjectBinding)));
	}
}