From 4da39275b4b5716b451379bc8486167c623b4db4 Mon Sep 17 00:00:00 2001 From: RadWolfie Date: Sat, 20 Jun 2020 03:58:55 -0500 Subject: [PATCH] rename CxbxMessageBox to PopupPlatformHandler --- src/common/Logging.cpp | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/src/common/Logging.cpp b/src/common/Logging.cpp index 138bb690e..403623161 100644 --- a/src/common/Logging.cpp +++ b/src/common/Logging.cpp @@ -248,12 +248,10 @@ void log_init_popup_msg() g_disablePopupMessages = vSettings.bFullScreen; } -PopupReturn CxbxMessageBox(const char* msg, const PopupReturn ret_default, const UINT uType, const HWND hWnd) +// TODO: Move PopupPlatformHandler into common GUI's window source code or use imgui in the future. +// PopupPlatformHandler is intended to be use as internal wrapper function. +static PopupReturn PopupPlatformHandler(const char* msg, const PopupReturn ret_default, const UINT uType, const HWND hWnd) { - // If user is using exclusive fullscreen, we need to refrain all popups. - if (g_disablePopupMessages) { - return ret_default; - } int ret = MessageBox(hWnd, msg, /*lpCaption=*/TEXT("Cxbx-Reloaded"), uType); switch (ret) { @@ -333,7 +331,12 @@ PopupReturn PopupCustomEx(const void* hwnd, const CXBXR_MODULE cxbxr_module, con EmuLogOutputEx(cxbxr_module, level, "Popup : %s", Buffer); - return CxbxMessageBox(Buffer, ret_default, uType, (const HWND)hwnd); + // If user is using exclusive fullscreen, we need to refrain all popups. + if (g_disablePopupMessages) { + return ret_default; + } + + return PopupPlatformHandler(Buffer, ret_default, uType, (const HWND)hwnd); } const bool needs_escape(const wint_t _char)