[Base] Add ShowInfoMB / ShowErrorMB functions.

[Base] Add ShowInfoMessageBox / ShowErrorMessageBox functions.
This commit is contained in:
ztjohnst 2020-07-31 22:42:05 -04:00 committed by Rick Gibbed
parent be1a666066
commit a77ed6f4a7
2 changed files with 19 additions and 0 deletions

View File

@ -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

View File

@ -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