// Copyright Epic Games, Inc. All Rights Reserved. #pragma once #include "CoreMinimal.h" #include "Layout/Visibility.h" #include "Widgets/DeclarativeSyntaxSupport.h" #include "Styling/SlateColor.h" #include "Input/Reply.h" #include "Widgets/SWidget.h" #include "Widgets/SCompoundWidget.h" #include "Widgets/Views/STableViewBase.h" #include "Widgets/Views/STableRow.h" #include "Widgets/Input/SComboBox.h" #include "ToolMenus.h" #include "UObject/StrongObjectPtr.h" #include "ToolMenusEditor.h" class UToolMenuEditorDialogEntry; /** * A dialog to customize a menu */ class SEditToolMenuDialog : public SCompoundWidget { public: SLATE_BEGIN_ARGS( SEditToolMenuDialog ) {} /** A reference to the parent window */ SLATE_ARGUMENT(TSharedPtr, ParentWindow) SLATE_ARGUMENT(UToolMenu*, SourceMenu) SLATE_END_ARGS() /** Constructs this widget with InArgs */ void Construct( const FArguments& InArgs ); void OnToggleVisibleClicked(TSharedRef InBlock, TWeakPtr BaseWidget); /** Closes the window that contains this widget */ void CloseContainingWindow(); void OnWindowClosed(const TSharedRef& Window); private: TSharedRef ModifyBlockWidgetAfterMake(const TSharedRef& InMultiBoxWidget, const FMultiBlock& InBlock, const TSharedRef& InBlockWidget); void BuildWidget(); void HandleOnLiveCodingPatchComplete(); void InitMenu(UToolMenu* InMenu); FReply Refresh(); FReply HandleResetClicked(); FReply HandleResetAllClicked(); FReply UndoAllChanges(); void LoadSelectedObjectState(); void SaveSettingsToDisk(); TSharedRef BuildMenuPropertiesWidget(); TSharedRef MakeMenuNameComboEntryWidget(TSharedPtr InEntry); void OnMenuNamesSelectionChanged(TSharedPtr InEntry, ESelectInfo::Type SelectInfo); void OnSelectedEntryChanged(TSharedRef InBlock); void SetSelectedItem(const FName InName, ESelectedEditMenuEntryType InType); TWeakObjectPtr MenuDialogOpenedWith; TWeakObjectPtr CurrentGeneratedMenu; TArray MenuNames; TArray> MenuNameComboData; TSharedPtr PropertiesWidget; TStrongObjectPtr SelectedObject; TArray OriginalSettings; };