Ark Server API (ASA) - Wiki
|
#include <ScopedSlowTask.h>
Public Member Functions | |
FORCEINLINE | FScopedSlowTask (float InAmountOfWork, const FText &InDefaultMessage=FText(), bool bInEnabled=true, FFeedbackContext &InContext= *GWarn) |
FORCEINLINE | ~FScopedSlowTask () |
Public Member Functions inherited from FSlowTask | |
FSlowTask (float InAmountOfWork, const FText &InDefaultMessage=FText(), bool bInEnabled=true, FFeedbackContext &InContext= *GWarn) | |
void | Initialize () |
void | Destroy () |
void | MakeDialogDelayed (float Threshold, bool bShowCancelButton=false, bool bAllowInPIE=false) |
void | MakeDialog (bool bShowCancelButton=false, bool bAllowInPIE=false) |
void | EnterProgressFrame (float ExpectedWorkThisFrame=1.f, const FText &Text=FText()) |
void | TickProgress () |
const FText & | GetCurrentMessage () const |
bool | ShouldCancel () const |
Additional Inherited Members | |
Static Public Member Functions inherited from FSlowTask | |
static bool | ShouldCreateThrottledSlowTask () |
Public Attributes inherited from FSlowTask | |
FText | DefaultMessage |
FText | FrameMessage |
float | TotalAmountOfWork |
float | CompletedWork |
float | CurrentFrameScope |
ESlowTaskVisibility | Visibility |
double | StartTime |
TOptional< float > | OpenDialogThreshold |
A scope block representing an amount of work divided up into sections. Use one scope at the top of each function to give accurate feedback to the user of a slow operation's progress.
Example Usage: void DoSlowWork() { FScopedSlowTask Progress(2.f, LOCTEXT("DoingSlowWork", "Doing Slow Work...")); // Optionally make this show a dialog if not already shown Progress.MakeDialog();
// Indicate that we are entering a frame representing 1 unit of work Progress.EnterProgressFrame(1.f);
// DoFirstThing() can follow a similar pattern of creating a scope divided into frames. These contribute to their parent's progress frame proportionately. DoFirstThing();
Progress.EnterProgressFrame(1.f); DoSecondThing(); }
Definition at line 31 of file ScopedSlowTask.h.
|
inline |
Construct this scope from an amount of work to do, and a message to display
InAmountOfWork | Arbitrary number of work units to perform (can be a percentage or number of steps). 0 indicates that no progress frames are to be entered in this scope (automatically enters a frame encompassing the entire scope) |
InDefaultMessage | A message to display to the user to describe the purpose of the scope |
bInEnabled | When false, this scope will have no effect. Allows for proper scoped objects that are conditionally disabled. |
Definition at line 41 of file ScopedSlowTask.h.
|
inline |