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

26 lines
686 B
C
Raw Permalink Normal View History

2023-07-03 16:17:13 +00:00
// 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);
}
};