[Base] Add ShowInfoMB / ShowErrorMB functions.
[Base] Add ShowInfoMessageBox / ShowErrorMessageBox functions.
This commit is contained in:
parent
be1a666066
commit
a77ed6f4a7
|
@ -363,4 +363,18 @@ void FatalError(const std::string_view str) {
|
|||
std::exit(1);
|
||||
}
|
||||
|
||||
void ShowInfoMessageBox(std::string m) {
|
||||
#if XE_PLATFORM_WIN32
|
||||
MessageBoxW(NULL, (LPCWSTR)xe::to_utf16(m).c_str(), L"Xenia Help",
|
||||
MB_OK | MB_ICONINFORMATION | MB_APPLMODAL | MB_SETFOREGROUND);
|
||||
#endif // WIN32
|
||||
}
|
||||
|
||||
void ShowErrorMessageBox(std::string m) {
|
||||
#if XE_PLATFORM_WIN32
|
||||
MessageBoxW(NULL, (LPCWSTR)xe::path_to_utf16(m).c_str(), L"Xenia Error",
|
||||
MB_OK | MB_ICONERROR | MB_APPLMODAL | MB_SETFOREGROUND);
|
||||
#endif // WIN32
|
||||
}
|
||||
|
||||
} // namespace xe
|
||||
|
|
|
@ -95,6 +95,11 @@ void AppendLogLine(LogLevel log_level, const char prefix_char,
|
|||
// Logs a fatal error and aborts the program.
|
||||
void FatalError(const std::string_view str);
|
||||
|
||||
// Shows error box
|
||||
void ShowErrorMessageBox(std::string m);
|
||||
|
||||
// Show info box
|
||||
void ShowInfoMessageBox(std::string m);
|
||||
} // namespace xe
|
||||
|
||||
#if XE_OPTION_ENABLE_LOGGING
|
||||
|
|
Loading…
Reference in New Issue