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.AddMenuSeparator("Credits"); MenuBuilder.AddMenuEntry(FMainFrameCommands::Get().CreditsUnrealEd); } MenuBuilder.EndSection(); #if !PLATFORM_MAC // Handled by app's menu in menu bar 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(); #endif }
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); }
void FAssetEditorToolkit::FillDefaultFileMenuCommands( FMenuBuilder& MenuBuilder ) { if( IsActuallyAnAsset() ) { MenuBuilder.AddMenuEntry( FAssetEditorCommonCommands::Get().SaveAsset, "SaveAsset", TAttribute<FText>(), TAttribute<FText>(), FSlateIcon(FEditorStyle::GetStyleSetName(), "AssetEditor.SaveAsset.Greyscale") ); MenuBuilder.AddMenuSeparator(); } if( IsWorldCentricAssetEditor() ) { // @todo toolkit minor: It would be awesome if the user could just "tear off" the SToolkitDisplay to do SwitchToStandaloneEditor // Would need to probably drop at mouseup location though instead of using saved layout pos. MenuBuilder.AddMenuEntry( FAssetEditorCommonCommands::Get().SwitchToStandaloneEditor ); } else { if( GetPreviousWorldCentricToolkitHost().IsValid() ) { // @todo toolkit checkin: Disabled temporarily until we have world-centric "ready to use"! if( 0 ) { MenuBuilder.AddMenuEntry( FAssetEditorCommonCommands::Get().SwitchToWorldCentricEditor ); } } } }
void FGameplayDebugger::CreateSnappingOptionsMenu(FMenuBuilder& Builder) { #if !(UE_BUILD_SHIPPING || UE_BUILD_TEST) if (GCurrentLevelEditingViewportClient && GCurrentLevelEditingViewportClient->EngineShowFlags.DebugAI && GCurrentLevelEditingViewportClient->IsSimulateInEditorViewport()) { Builder.AddMenuSeparator(); Builder.AddSubMenu( LOCTEXT("Test_GameplayDebugger_SnappingOptions_Menu", "Gameplay Debugger"), LOCTEXT("Test_GameplayDebugger_SnappingOptions_Menu_Tooltip", "Quick setting for Gameplay Debugger tool in selected view"), FNewMenuDelegate::CreateRaw(this, &FGameplayDebugger::CreateSettingSubMenu) ); } #endif }
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); }
static void FillRecentFileAndExitMenuItems( FMenuBuilder& MenuBuilder ) { MenuBuilder.BeginSection( "FileRecentFiles" ); { if ( FMainFrameActionCallbacks::ProjectNames.Num() > 0 ) { MenuBuilder.AddSubMenu( LOCTEXT("SwitchProjectSubMenu", "Recent Projects"), LOCTEXT("SwitchProjectSubMenu_ToolTip", "Select a project to switch to"), FNewMenuDelegate::CreateStatic( &FRecentProjectsMenu::MakeMenu ), false, FSlateIcon(FEditorStyle::GetStyleSetName(), "MainFrame.RecentProjects") ); } } MenuBuilder.EndSection(); MenuBuilder.AddMenuSeparator(); MenuBuilder.AddMenuEntry( FMainFrameCommands::Get().Exit, "Exit" ); }
static void FillRecentFileAndExitMenuItems( FMenuBuilder& MenuBuilder ) { MenuBuilder.BeginSection("FileRecentFiles"); { if (GetDefault<UEditorStyleSettings>()->bShowProjectMenus && FMainFrameActionCallbacks::ProjectNames.Num() > 0) { MenuBuilder.AddSubMenu( LOCTEXT("SwitchProjectSubMenu", "Recent Projects"), LOCTEXT("SwitchProjectSubMenu_ToolTip", "Select a project to switch to"), FNewMenuDelegate::CreateStatic(&FRecentProjectsMenu::MakeMenu), false, FSlateIcon(FEditorStyle::GetStyleSetName(), "MainFrame.RecentProjects") ); } } MenuBuilder.EndSection(); #if !PLATFORM_MAC // Handled by app's menu in menu bar MenuBuilder.AddMenuSeparator(); MenuBuilder.AddMenuEntry( FMainFrameCommands::Get().Exit, "Exit" ); #endif }
void FToolBarSeparatorBlock::CreateMenuEntry(FMenuBuilder& MenuBuilder) const { MenuBuilder.AddMenuSeparator(); }
void FSequencerObjectBindingNode::AddSpawnOwnershipMenu(FMenuBuilder& MenuBuilder) { FMovieSceneSpawnable* Spawnable = GetSequencer().GetFocusedMovieSceneSequence()->GetMovieScene()->FindSpawnable(ObjectBinding); if (!Spawnable) { return; } MenuBuilder.AddMenuEntry( LOCTEXT("ThisSequence_Label", "This Sequence"), LOCTEXT("ThisSequence_Tooltip", "Indicates that this sequence will own the spawned object. The object will be destroyed at the end of the sequence."), FSlateIcon(), FUIAction( FExecuteAction::CreateLambda([=]{ Spawnable->SetSpawnOwnership(ESpawnOwnership::InnerSequence); }), FCanExecuteAction(), FIsActionChecked::CreateLambda([=]{ return Spawnable->GetSpawnOwnership() == ESpawnOwnership::InnerSequence; }) ), NAME_None, EUserInterfaceActionType::ToggleButton ); MenuBuilder.AddMenuEntry( LOCTEXT("MasterSequence_Label", "Master Sequence"), LOCTEXT("MasterSequence_Tooltip", "Indicates that the outermost sequence will own the spawned object. The object will be destroyed when the outermost sequence stops playing."), FSlateIcon(), FUIAction( FExecuteAction::CreateLambda([=]{ Spawnable->SetSpawnOwnership(ESpawnOwnership::MasterSequence); }), FCanExecuteAction(), FIsActionChecked::CreateLambda([=]{ return Spawnable->GetSpawnOwnership() == ESpawnOwnership::MasterSequence; }) ), NAME_None, EUserInterfaceActionType::ToggleButton ); MenuBuilder.AddMenuEntry( LOCTEXT("External_Label", "External"), LOCTEXT("External_Tooltip", "Indicates this object's lifetime is managed externally once spawned. It will not be destroyed by sequencer."), FSlateIcon(), FUIAction( FExecuteAction::CreateLambda([=]{ Spawnable->SetSpawnOwnership(ESpawnOwnership::External); }), FCanExecuteAction(), FIsActionChecked::CreateLambda([=]{ return Spawnable->GetSpawnOwnership() == ESpawnOwnership::External; }) ), NAME_None, EUserInterfaceActionType::ToggleButton ); MenuBuilder.AddMenuSeparator(); MenuBuilder.AddMenuEntry( LOCTEXT("IgnoreOwnership_Label", "Keep Alive Outside Playback Range (In Sequencer)"), LOCTEXT("IgnoreOwnership_Tooltip", "Keeps the spawned object alive when viewing this specific sequence outside of its playback range. Does not apply to runtime evaluation."), FSlateIcon(), FUIAction( FExecuteAction::CreateLambda([=]{ Spawnable->SetIgnoreOwnershipInEditor(!Spawnable->ShouldIgnoreOwnershipInEditor()); GetSequencer().SetGlobalTimeDirectly(GetSequencer().GetGlobalTime()); }), FCanExecuteAction(), FIsActionChecked::CreateLambda([=]{ return Spawnable->ShouldIgnoreOwnershipInEditor(); }) ), NAME_None, EUserInterfaceActionType::ToggleButton ); }