mirror of
https://github.com/edubart/otclient.git
synced 2025-12-18 06:37:12 +01:00
display MessageBox in win32 on fatal errors
This commit is contained in:
@@ -82,6 +82,8 @@ public:
|
||||
/// Get the app user directory, the place to save files configurations files
|
||||
std::string getAppUserDir();
|
||||
|
||||
void displayFatalError(const std::string& message);
|
||||
|
||||
private:
|
||||
int m_lastTicks;
|
||||
};
|
||||
|
||||
@@ -289,7 +289,7 @@ void Platform::init(PlatformListener* platformListener, const char *appName)
|
||||
wc.lpszClassName = win32.appName.c_str(); // Set The Class Name
|
||||
|
||||
if(!RegisterClassA(&wc))
|
||||
logFatal("FATAL ERROR: Failed to register the window class.");
|
||||
logFatal("Failed to register the window class.");
|
||||
|
||||
// force first tick
|
||||
updateTicks();
|
||||
@@ -737,3 +737,9 @@ LRESULT CALLBACK WndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
void Platform::displayFatalError(const std::string& message)
|
||||
{
|
||||
MessageBoxA(NULL, message.c_str(), "Fatal Error", MB_OK | MB_ICONERROR);
|
||||
}
|
||||
|
||||
|
||||
@@ -962,3 +962,8 @@ std::string Platform::getAppUserDir()
|
||||
logError("Couldn't create directory for saving configuration file. (",sdir.str(),")");
|
||||
return sdir.str();
|
||||
}
|
||||
|
||||
void Platform::displayFatalError(const std::string& message)
|
||||
{
|
||||
// nothing to do
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user