Announcement

Collapse
No announcement yet.

FScopedSlowTask - Is this working or am I doing something wrong?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    FScopedSlowTask - Is this working or am I doing something wrong?

    Hi,

    I am in need of a progress bar for my construction script when loading and doing calculations on imported data.

    Currently I find the hang workable but it's something that could essentially be variable in time to calculate so a progress bar is the way to go.

    Now there are two ways. A depreciated version that is currently "still in heavy use" and the new version that the source advises to use. FScopedSlowTask.

    At the top of the function in question I have this code :

    Code:
    FScopedSlowTask Progress(1.f, LoadingProgressText, true);
    Progress.MakeDialog(false, true);
    Progress.EnterProgressFrame(1.f);
    The hang still occurs and there is no dialog. I presume I am doing something wrong here even though the comments seem simple enough.

    Code:
    /**
     * 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();
     *	}
     *
     */
    Any suggestions?
    http://unrealdeveloper.uk
Working...
X