From 4d81c287382559cd1e532963b4ce067ddfe5689b Mon Sep 17 00:00:00 2001 From: louist103 <35883445+louist103@users.noreply.github.com> Date: Thu, 8 Sep 2022 19:05:16 -0400 Subject: [PATCH] boxes (#1428) --- libultraship/libultraship/CrashHandler.cpp | 5 ++++- libultraship/libultraship/Window.cpp | 5 ++--- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/libultraship/libultraship/CrashHandler.cpp b/libultraship/libultraship/CrashHandler.cpp index f454ddfdc..13c746027 100644 --- a/libultraship/libultraship/CrashHandler.cpp +++ b/libultraship/libultraship/CrashHandler.cpp @@ -12,6 +12,7 @@ extern "C" void DeinitOTR(void); #include // for dladdr #include #include +#include @@ -135,9 +136,11 @@ static void ErrorHandler(int sig, siginfo_t* sigInfo, void* data) { SPDLOG_CRITICAL("{} {}", i, functionName.c_str()); } - + SDL_ShowSimpleMessageBox(SDL_MESSAGEBOX_ERROR, "SoH has crashed", "SoH Has crashed. Please upload the logs to the support channel in discord.", nullptr); free(symbols); DeinitOTR(); + Ship::Window::GetInstance()->GetLogger()->flush(); + spdlog::shutdown(); exit(1); } diff --git a/libultraship/libultraship/Window.cpp b/libultraship/libultraship/Window.cpp index 36a10b505..ec97a71ad 100644 --- a/libultraship/libultraship/Window.cpp +++ b/libultraship/libultraship/Window.cpp @@ -540,13 +540,12 @@ namespace Ship { if (!ResMan->DidLoadSuccessfully()) { -#ifdef _WIN32 - MessageBox(nullptr, L"Main OTR file not found!", L"Uh oh", MB_OK); -#elif defined(__SWITCH__) +#if defined(__SWITCH__) printf("Main OTR file not found!\n"); #elif defined(__WIIU__) Ship::WiiU::ThrowMissingOTR(MainPath.c_str()); #else + SDL_ShowSimpleMessageBox(SDL_MESSAGEBOX_ERROR, "OTR file not found", "Main OTR file not found. Please generate one", nullptr); SPDLOG_ERROR("Main OTR file not found!"); #endif exit(1);