SExtBuildProgress.h 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132
  1. // Copyright 1998-2019 Epic Games, Inc. All Rights Reserved.
  2. /*=============================================================================
  3. DlgBuildProgress.h: UnrealEd dialog for displaying map build progress and cancelling builds.
  4. =============================================================================*/
  5. #pragma once
  6. #include "CoreMinimal.h"
  7. #include "Input/Reply.h"
  8. #include "Widgets/DeclarativeSyntaxSupport.h"
  9. #include "Widgets/Layout/SBorder.h"
  10. #include "Dialogs/SBuildProgress.h"
  11. class SExtBuildProgressWidget : public SBuildProgressWidget
  12. {
  13. public:
  14. SLATE_BEGIN_ARGS( SExtBuildProgressWidget ) {}
  15. SLATE_END_ARGS()
  16. SExtBuildProgressWidget();
  17. ~SExtBuildProgressWidget();
  18. void Construct( const FArguments& InArgs );
  19. /**
  20. * Progress Control Callbacks
  21. */
  22. FText OnGetProgressText() const;
  23. FText OnGetBuildTimeText() const;
  24. TOptional<float> OnGetProgressFraction() const;
  25. /** The type of build that is occurring. */
  26. enum EBuildType
  27. {
  28. /** Do not know what is being built... */
  29. BUILDTYPE_Unknown,
  30. /** Geometry is being built. */
  31. BUILDTYPE_Geometry,
  32. /** Lighting is being built. */
  33. BUILDTYPE_Lighting,
  34. /** Paths are being built. */
  35. BUILDTYPE_Paths,
  36. /** LODs are being built */
  37. BUILDTYPE_LODs,
  38. /** Texture streaming data is being built */
  39. BUILDTYPE_TextureStreaming,
  40. };
  41. /** The various issues that can occur. */
  42. enum EBuildIssueType
  43. {
  44. /** A critical error has occurred. */
  45. BUILDISSUE_CriticalError,
  46. /** An error has occurred. */
  47. BUILDISSUE_Error,
  48. /** A warning has occurred. */
  49. BUILDISSUE_Warning
  50. };
  51. /**
  52. * Sets the current build type.
  53. * @param InBuildType The build that is occurring.
  54. */
  55. void SetBuildType(EBuildType InBuildType);
  56. /**
  57. * Updates the label displaying the current time.
  58. */
  59. void UpdateTime();
  60. void UpdateProgressText();
  61. /**
  62. * Sets the text that describes what part of the build we are currently on.
  63. *
  64. * @param StatusText Text to set the status label to.
  65. */
  66. void SetBuildStatusText( const FText& StatusText );
  67. /**
  68. * Sets the build progress bar percentage.
  69. *
  70. * @param ProgressNumerator Numerator for the progress meter (its current value).
  71. * @param ProgressDenominitator Denominiator for the progress meter (its range).
  72. */
  73. void SetBuildProgressPercent( int32 InProgressNumerator, int32 InProgressDenominator );
  74. /**
  75. * Records the application time in seconds; used in display of elapsed build time.
  76. */
  77. void MarkBuildStartTime();
  78. /**
  79. * Assembles the text containing the elapsed build time.
  80. */
  81. FText BuildElapsedTimeText() const;
  82. private:
  83. /**
  84. * Callback for the Stop Build button, stops the current build.
  85. */
  86. FReply OnStopBuild();
  87. /** Progress numerator */
  88. int32 ProgressNumerator;
  89. /** Progress denominator */
  90. int32 ProgressDenominator;
  91. /** Displays the elapsed time for the build */
  92. FText BuildStatusTime;
  93. /** Displays some status info about the build. */
  94. FText BuildStatusText;
  95. FText ProgressStatusText;
  96. /** The stop build button has been pressed*/
  97. bool bStoppingBuild;
  98. /** Application time in seconds at which the build began. */
  99. FDateTime BuildStartTime;
  100. /** The type of build that is currently occurring. */
  101. EBuildType BuildType;
  102. /** The warning/error/critical error counts. */
  103. int32 WarningCount;
  104. int32 ErrorCount;
  105. int32 CriticalErrorCount;
  106. };