From b4579d88d3631c36d3c6457e85ca0996c65941ca Mon Sep 17 00:00:00 2001 From: Misa Date: Sun, 31 Dec 2023 16:54:53 -0800 Subject: [PATCH] Add SimpleMessageBox for early filesystem bail This ensures that the game won't silently fail to start if it can't initialize the filesystem. Instead, it will fail loudly by popping open a message box (using SDL_ShowSimpleMessageBox). The motivation for this comes from issue #1010 where this is likely to occur if the user has Controlled Folder Access enabled on Windows, but I didn't want to put in the work to specifically detect CFA (and not sure if it's even possible if it turns out that the OS just gives a standard "permission denied" in this case). At least any message box is better than silently failing but printing to console when most users don't know what a console is. Fixes #1010. --- desktop_version/src/main.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/desktop_version/src/main.cpp b/desktop_version/src/main.cpp index 1d4c8557..ac4a488e 100644 --- a/desktop_version/src/main.cpp +++ b/desktop_version/src/main.cpp @@ -559,6 +559,7 @@ int main(int argc, char *argv[]) if(!FILESYSTEM_init(argv[0], baseDir, assetsPath, langDir, fontsDir)) { vlog_error("Unable to initialize filesystem!"); + SDL_ShowSimpleMessageBox(SDL_MESSAGEBOX_ERROR, "Error", "Unable to initialize filesystem!", NULL); VVV_exit(1); }