diff --git a/src/xenia/base/logging.cc b/src/xenia/base/logging.cc index 6464a2b8c..d928ec56a 100644 --- a/src/xenia/base/logging.cc +++ b/src/xenia/base/logging.cc @@ -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 diff --git a/src/xenia/base/logging.h b/src/xenia/base/logging.h index d2df15cce..e3144a056 100644 --- a/src/xenia/base/logging.h +++ b/src/xenia/base/logging.h @@ -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