I’m writing a low level error type for better and more civilized error handling from C++, is there a way in Slate to create a window with its own message pump so I can display potentially fatal errors to the user while blocking the engine tick? I’m on this endeavour to give a more unified better UX for error handling in my plugins.
FPlatformMisc::MessageBoxExt
is too limitting for me (it doesn’t even allow to set my own buttons with their own text on the bottom of the message).
I’m asking this first before I resort to build my own UI with an external library, which wouldn’t be very kosher in an Unreal Engine code base
On FSlateApplication
I found the following function promising
/**
* Adds a modal window to the application.
* In most cases, this function does not return until the modal window is closed (the only exception is a modal window for slow tasks)
*
* @param InSlateWindow A SlateWindow to which to add a native window.
* @param InParentWindow The parent of the modal window. All modal windows must have a parent.
* @param bSlowTaskWindow true if the window is for a slow task and this function should return before the window is closed
*/
SLATE_API void AddModalWindow( TSharedRef<SWindow> InSlateWindow, const TSharedPtr<const SWidget> InParentWidget, bool bSlowTaskWindow = false );
which according to its source does exactly what I meant to do (it has an internal while loop as well), I haven’t tested yet.