ExtFeedbackContextEditor.h 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. // Copyright 1998-2019 Epic Games, Inc. All Rights Reserved.
  2. /*=============================================================================
  3. FeedbackContextEditor.h: Feedback context tailored to UnrealEd
  4. =============================================================================*/
  5. #pragma once
  6. #include "CoreMinimal.h"
  7. #include "Misc/MessageDialog.h"
  8. #include "Misc/FeedbackContext.h"
  9. #include "Widgets/SWindow.h"
  10. class FContextSupplier;
  11. class SExtBuildProgressWidget;
  12. /**
  13. * A FFeedbackContext implementation for use in UnrealEd.
  14. */
  15. class FExtFeedbackContextEditor : public FFeedbackContext
  16. {
  17. /** Slate slow task widget */
  18. TWeakPtr<class SWindow> SlowTaskWindow;
  19. /** Special Windows/Widget popup for building */
  20. TWeakPtr<class SWindow> BuildProgressWindow;
  21. TSharedPtr<class SExtBuildProgressWidget> BuildProgressWidget;
  22. bool HasTaskBeenCancelled;
  23. public:
  24. FExtFeedbackContextEditor();
  25. virtual void Serialize( const TCHAR* V, ELogVerbosity::Type Verbosity, const class FName& Category ) override;
  26. virtual void StartSlowTask( const FText& Task, bool bShowCancelButton=false ) override;
  27. virtual void FinalizeSlowTask( ) override;
  28. virtual void ProgressReported( const float TotalProgressInterp, FText DisplayMessage ) override;
  29. virtual bool IsPlayingInEditor() const override;
  30. void SetContext( FContextSupplier* InSupplier ) override {}
  31. /** Whether or not the user has canceled out of this dialog */
  32. virtual bool ReceivedUserCancel() override;
  33. void OnUserCancel();
  34. virtual bool YesNof( const FText& Question ) override
  35. {
  36. return EAppReturnType::Yes == FMessageDialog::Open( EAppMsgType::YesNo, Question );
  37. }
  38. /**
  39. * Show the Build Progress Window
  40. * @return Handle to the Build Progress Widget created
  41. */
  42. TWeakPtr<class SBuildProgressWidget> ShowBuildProgressWindow() override;
  43. /** Close the Build Progress Window */
  44. void CloseBuildProgressWindow() override;
  45. };