CelticCraft/Plugins/VoxelFree/Source/Voxel/Public/VoxelFeedbackContext.h

26 lines
No EOL
686 B
C

// Copyright 2020 Phyronnaz
#pragma once
#include "CoreMinimal.h"
#include "Misc/ScopedSlowTask.h"
// Use this to set the plugin to use a custom feedback context for progress bars/slow tasks
VOXEL_API void SetVoxelFeedbackContext(FFeedbackContext& FeedbackContext);
struct VOXEL_API FVoxelScopedSlowTask : FScopedSlowTask
{
explicit FVoxelScopedSlowTask(float InAmountOfWork, const FText& InDefaultMessage = FText(), bool bInEnabled = true);
};
struct FVoxelScopedFeedbackContext
{
explicit FVoxelScopedFeedbackContext(FFeedbackContext& FeedbackContext)
{
SetVoxelFeedbackContext(FeedbackContext);
}
~FVoxelScopedFeedbackContext()
{
SetVoxelFeedbackContext(*GWarn);
}
};