Rework the surface upgrade tool to inform users without blocking

This removes the immediate confirmation dialog and insteads prints the
message to the editor log (and it also appears as a toast). The immediate dialog
is a devil's plaything, and it cannot be used in this scenario (if it can be used
anywhere at all). The condition that triggers the SUT can happen during any
attempt by the rendering server to read a mesh. This means it will conflict
with a number of editor processes, like loading, importing, preview
generation, export, CLI mode, etc.

So while this is less on the nose as far as informing users goes, it's also
our best option to use the log and the toaster.
This commit is contained in:
Yuri Sizov
2023-11-22 16:15:02 +01:00
parent a34814b0b6
commit 10b70e2498
4 changed files with 46 additions and 30 deletions

View File

@ -40,12 +40,14 @@ class SurfaceUpgradeTool : public Object {
static SurfaceUpgradeTool *singleton;
bool show_requested = false;
bool popped_up = false;
Mutex mutex;
bool show_requested = false;
bool updating = false;
static void _try_show_popup();
void _show_popup();
void _add_files(EditorFileSystemDirectory *p_dir, Vector<String> &r_reimport_paths, Vector<String> &r_resave_paths);
protected:
@ -72,6 +74,8 @@ protected:
void _notification(int p_what);
public:
void popup_on_demand();
SurfaceUpgradeDialog();
};