From 9d91abfb9915012e2d6f34f83057fcbb2206bca8 Mon Sep 17 00:00:00 2001 From: Darryl Pogue Date: Tue, 15 Aug 2023 20:57:53 -0700 Subject: [PATCH] Move hsMessageBox from CoreLib to PubUtilLib/plMessageBox --- Sources/Plasma/Apps/plClient/CMakeLists.txt | 1 + .../Plasma/Apps/plClient/Mac-Cocoa/main.mm | 1 + Sources/Plasma/Apps/plClient/plClient.cpp | 1 + .../Plasma/Apps/plClient/plClientLoader.cpp | 1 + .../Plasma/Apps/plClient/win32/winmain.cpp | 1 + .../Plasma/Apps/plCrashHandler/CMakeLists.txt | 1 + .../Plasma/Apps/plCrashHandler/winmain.cpp | 1 + .../Plasma/Apps/plUruLauncher/CMakeLists.txt | 1 + .../Apps/plUruLauncher/plClientLauncher.cpp | 1 + Sources/Plasma/CoreLib/CMakeLists.txt | 3 - Sources/Plasma/CoreLib/HeadSpin.cpp | 39 ------ Sources/Plasma/CoreLib/HeadSpin.h | 36 ----- Sources/Plasma/CoreLib/HeadSpin_Mac.mm | 123 ------------------ .../FeatureLib/pfConsole/CMakeLists.txt | 1 + .../Plasma/FeatureLib/pfConsole/pfConsole.cpp | 1 + .../FeatureLib/pfConsole/pfConsoleDirSrc.cpp | 1 + .../FeatureLib/pfDXPipeline/CMakeLists.txt | 1 + .../FeatureLib/pfDXPipeline/plDXPipeline.cpp | 1 + Sources/Plasma/PubUtilLib/CMakeLists.txt | 1 + .../Plasma/PubUtilLib/plAvatar/CMakeLists.txt | 1 + .../PubUtilLib/plAvatar/plAvatarClothing.cpp | 1 + .../Plasma/PubUtilLib/plGImage/CMakeLists.txt | 1 + .../PubUtilLib/plGImage/plAVIWriter.cpp | 1 + .../PubUtilLib/plMessageBox/CMakeLists.txt | 23 ++++ .../PubUtilLib/plMessageBox/hsMessageBox.cpp | 69 ++++++++++ .../PubUtilLib/plMessageBox/hsMessageBox.h | 81 ++++++++++++ .../plMessageBox/hsMessageBox_Mac.mm | 115 ++++++++++++++++ .../plMessageBox/hsMessageBox_Win.cpp} | 10 +- .../PubUtilLib/plNetClient/CMakeLists.txt | 1 + .../PubUtilLib/plNetClient/plNetClientMgr.cpp | 1 + .../Plasma/PubUtilLib/plResMgr/CMakeLists.txt | 1 + .../PubUtilLib/plResMgr/plResManager.cpp | 1 + Sources/Tools/MaxComponent/CMakeLists.txt | 1 + .../Tools/MaxComponent/plComponentBase.cpp | 2 + .../MaxComponent/plPythonFileComponent.cpp | 2 + Sources/Tools/MaxExport/CMakeLists.txt | 1 + Sources/Tools/MaxExport/SimpleExport.cpp | 1 + Sources/Tools/MaxExport/plExportDlg.cpp | 1 + Sources/Tools/MaxMain/CMakeLists.txt | 1 + Sources/Tools/MaxMain/plGetLocationDlg.cpp | 3 +- 40 files changed, 325 insertions(+), 209 deletions(-) delete mode 100644 Sources/Plasma/CoreLib/HeadSpin_Mac.mm create mode 100644 Sources/Plasma/PubUtilLib/plMessageBox/CMakeLists.txt create mode 100644 Sources/Plasma/PubUtilLib/plMessageBox/hsMessageBox.cpp create mode 100644 Sources/Plasma/PubUtilLib/plMessageBox/hsMessageBox.h create mode 100644 Sources/Plasma/PubUtilLib/plMessageBox/hsMessageBox_Mac.mm rename Sources/Plasma/{CoreLib/HeadSpin_Win.cpp => PubUtilLib/plMessageBox/hsMessageBox_Win.cpp} (92%) diff --git a/Sources/Plasma/Apps/plClient/CMakeLists.txt b/Sources/Plasma/Apps/plClient/CMakeLists.txt index 80d3296149..ee8ab6403d 100644 --- a/Sources/Plasma/Apps/plClient/CMakeLists.txt +++ b/Sources/Plasma/Apps/plClient/CMakeLists.txt @@ -210,6 +210,7 @@ target_link_libraries( plGLight plInputCore plMessage + plMessageBox plModifier plNetClient plNetCommon diff --git a/Sources/Plasma/Apps/plClient/Mac-Cocoa/main.mm b/Sources/Plasma/Apps/plClient/Mac-Cocoa/main.mm index a621a51efd..b88ea90982 100644 --- a/Sources/Plasma/Apps/plClient/Mac-Cocoa/main.mm +++ b/Sources/Plasma/Apps/plClient/Mac-Cocoa/main.mm @@ -65,6 +65,7 @@ #include "pfGameGUIMgr/pfGameGUIMgr.h" #include "plInputCore/plInputDevice.h" #include "plMessage/plDisplayScaleChangedMsg.h" +#include "plMessageBox/hsMessageBox.h" #include "plNetClient/plNetClientMgr.h" #include "plNetGameLib/plNetGameLib.h" #include "plProduct.h" diff --git a/Sources/Plasma/Apps/plClient/plClient.cpp b/Sources/Plasma/Apps/plClient/plClient.cpp index 5aba7b4b43..6b1d14a3de 100644 --- a/Sources/Plasma/Apps/plClient/plClient.cpp +++ b/Sources/Plasma/Apps/plClient/plClient.cpp @@ -106,6 +106,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #include "plMessage/plResPatcherMsg.h" #include "plMessage/plRoomLoadNotifyMsg.h" #include "plMessage/plTransitionMsg.h" +#include "plMessageBox/hsMessageBox.h" #include "plModifier/plSimpleModifier.h" #include "plNetClient/plLinkEffectsMgr.h" #include "plNetClient/plNetLinkingMgr.h" diff --git a/Sources/Plasma/Apps/plClient/plClientLoader.cpp b/Sources/Plasma/Apps/plClient/plClientLoader.cpp index 1ced151838..114b3c0724 100644 --- a/Sources/Plasma/Apps/plClient/plClientLoader.cpp +++ b/Sources/Plasma/Apps/plClient/plClientLoader.cpp @@ -46,6 +46,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #include "plPipeline.h" #include "plClientResMgr/plClientResMgr.h" +#include "plMessageBox/hsMessageBox.h" #include "plNetClient/plNetClientMgr.h" #include "plPhysX/plSimulationMgr.h" #include "plResMgr/plResManager.h" diff --git a/Sources/Plasma/Apps/plClient/win32/winmain.cpp b/Sources/Plasma/Apps/plClient/win32/winmain.cpp index 89f0f40f90..3a3ebabb1e 100644 --- a/Sources/Plasma/Apps/plClient/win32/winmain.cpp +++ b/Sources/Plasma/Apps/plClient/win32/winmain.cpp @@ -68,6 +68,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #include "plNetClient/plNetClientMgr.h" #include "plNetGameLib/plNetGameLib.h" #include "plMessage/plDisplayScaleChangedMsg.h" +#include "plMessageBox/hsMessageBox.h" #include "plPhysX/plPXSimulation.h" #include "plPipeline/hsG3DDeviceSelector.h" #include "plResMgr/plLocalization.h" diff --git a/Sources/Plasma/Apps/plCrashHandler/CMakeLists.txt b/Sources/Plasma/Apps/plCrashHandler/CMakeLists.txt index 2869955845..f86792d561 100644 --- a/Sources/Plasma/Apps/plCrashHandler/CMakeLists.txt +++ b/Sources/Plasma/Apps/plCrashHandler/CMakeLists.txt @@ -13,6 +13,7 @@ target_link_libraries( PRIVATE CoreLib plClipboard + plMessageBox pfCrashHandler $<$:Comctl32> diff --git a/Sources/Plasma/Apps/plCrashHandler/winmain.cpp b/Sources/Plasma/Apps/plCrashHandler/winmain.cpp index c1f8b589f5..0f4f4f28ed 100644 --- a/Sources/Plasma/Apps/plCrashHandler/winmain.cpp +++ b/Sources/Plasma/Apps/plCrashHandler/winmain.cpp @@ -59,6 +59,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #include "resource.h" #include "plClipboard/plClipboard.h" +#include "plMessageBox/hsMessageBox.h" #include "pfCrashHandler/plCrashSrv.h" diff --git a/Sources/Plasma/Apps/plUruLauncher/CMakeLists.txt b/Sources/Plasma/Apps/plUruLauncher/CMakeLists.txt index e32571fb10..62c4c23836 100644 --- a/Sources/Plasma/Apps/plUruLauncher/CMakeLists.txt +++ b/Sources/Plasma/Apps/plUruLauncher/CMakeLists.txt @@ -27,6 +27,7 @@ target_link_libraries( CoreLib pnAsyncCore pnNetBase + plMessageBox plNetGameLib plStatusLog plWinDpi diff --git a/Sources/Plasma/Apps/plUruLauncher/plClientLauncher.cpp b/Sources/Plasma/Apps/plUruLauncher/plClientLauncher.cpp index 06de5424c9..a86f8d6928 100644 --- a/Sources/Plasma/Apps/plUruLauncher/plClientLauncher.cpp +++ b/Sources/Plasma/Apps/plUruLauncher/plClientLauncher.cpp @@ -51,6 +51,7 @@ Mead, WA 99021 #include "pnAsyncCore/pnAsyncCore.h" +#include "plMessageBox/hsMessageBox.h" #include "plNetGameLib/plNetGameLib.h" #include "plStatusLog/plStatusLog.h" diff --git a/Sources/Plasma/CoreLib/CMakeLists.txt b/Sources/Plasma/CoreLib/CMakeLists.txt index ec8c64ac14..6a45faf245 100644 --- a/Sources/Plasma/CoreLib/CMakeLists.txt +++ b/Sources/Plasma/CoreLib/CMakeLists.txt @@ -23,8 +23,6 @@ set(CoreLib_SOURCES plProduct.cpp plViewTransform.cpp hsWindows.cpp - $<$:HeadSpin_Mac.mm> - $<$:HeadSpin_Win.cpp> ) if(CMAKE_USE_WIN32_THREADS_INIT) @@ -85,7 +83,6 @@ target_link_libraries( "$<$:-framework Accelerate>" PRIVATE "$<$:-framework CoreFoundation>" - "$<$:-framework Cocoa>" ) target_include_directories( CoreLib diff --git a/Sources/Plasma/CoreLib/HeadSpin.cpp b/Sources/Plasma/CoreLib/HeadSpin.cpp index 059c43ffdb..79e7f7f9f7 100644 --- a/Sources/Plasma/CoreLib/HeadSpin.cpp +++ b/Sources/Plasma/CoreLib/HeadSpin.cpp @@ -273,45 +273,6 @@ void hsStatusMessageF(const char * fmt, ...) #endif -bool hsMessageBox_SuppressPrompts = false; - -#if !defined(HS_BUILD_FOR_APPLE) && !defined(HS_BUILD_FOR_WIN32) -// Need a proper implementation for Linux, but for now let's just print out to the console -int hsMessageBoxWithOwner(hsWindowHndl owner, const ST::string& message, const ST::string& caption, int kind, int icon) -{ - if (hsMessageBox_SuppressPrompts) - return hsMBoxOk; - - hsStatusMessage(ST::format("{}\n{}", message, caption).c_str()); - return hsMBoxCancel; -} -#endif - -int hsMessageBoxWithOwner(hsWindowHndl owner, const char* message, const char* caption, int kind, int icon) -{ - return hsMessageBoxWithOwner(owner, ST::string::from_latin_1(message), ST::string::from_latin_1(caption), kind, icon); -} - -int hsMessageBoxWithOwner(hsWindowHndl owner, const wchar_t* message, const wchar_t* caption, int kind, int icon) -{ - return hsMessageBoxWithOwner(owner, ST::string::from_wchar(message), ST::string::from_wchar(caption), kind, icon); -} - -int hsMessageBox(const ST::string& message, const ST::string& caption, int kind, int icon) -{ - return hsMessageBoxWithOwner(nullptr, message, caption, kind, icon); -} - -int hsMessageBox(const char* message, const char* caption, int kind, int icon) -{ - return hsMessageBoxWithOwner(nullptr, ST::string::from_latin_1(message), ST::string::from_latin_1(caption), kind, icon); -} - -int hsMessageBox(const wchar_t* message, const wchar_t* caption, int kind, int icon) -{ - return hsMessageBoxWithOwner(nullptr, ST::string::from_wchar(message), ST::string::from_wchar(caption), kind, icon); -} - /**************************************/ char* hsStrcpy(char* dst, const char* src) { diff --git a/Sources/Plasma/CoreLib/HeadSpin.h b/Sources/Plasma/CoreLib/HeadSpin.h index 374c46902a..0f0ce3517e 100644 --- a/Sources/Plasma/CoreLib/HeadSpin.h +++ b/Sources/Plasma/CoreLib/HeadSpin.h @@ -58,8 +58,6 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #include #include -namespace ST { class string; } - //====================================== // Winblows Hacks //====================================== @@ -278,40 +276,6 @@ inline char *hsStrncpy(char *strDest, const char *strSource, size_t count) # define strnicmp strncasecmp #endif -enum { // Kind of MessageBox...passed to hsMessageBox - hsMessageBoxAbortRetyIgnore, - hsMessageBoxNormal, // Just Ok - hsMessageBoxOkCancel, - hsMessageBoxRetryCancel, - hsMessageBoxYesNo, - hsMessageBoxYesNoCancel, -}; - -enum { - hsMessageBoxIconError, - hsMessageBoxIconQuestion, - hsMessageBoxIconExclamation, - hsMessageBoxIconAsterisk, -}; - -enum { // RETURN VALUES FROM hsMessageBox - hsMBoxOk = 1, // OK button was selected. - hsMBoxCancel, // Cancel button was selected. - hsMBoxAbort, // Abort button was selected. - hsMBoxRetry, // Retry button was selected. - hsMBoxIgnore, // Ignore button was selected. - hsMBoxYes, // Yes button was selected. - hsMBoxNo // No button was selected. -}; - -extern bool hsMessageBox_SuppressPrompts; -int hsMessageBox(const ST::string& message, const ST::string& caption, int kind, int icon=hsMessageBoxIconAsterisk); -int hsMessageBox(const char* message, const char* caption, int kind, int icon=hsMessageBoxIconAsterisk); -int hsMessageBox(const wchar_t* message, const wchar_t* caption, int kind, int icon=hsMessageBoxIconAsterisk); -int hsMessageBoxWithOwner(hsWindowHndl owner, const ST::string& message, const ST::string& caption, int kind, int icon=hsMessageBoxIconAsterisk); -int hsMessageBoxWithOwner(hsWindowHndl owner, const char* message, const char* caption, int kind, int icon=hsMessageBoxIconAsterisk); -int hsMessageBoxWithOwner(hsWindowHndl owner, const wchar_t* message, const wchar_t* caption, int kind, int icon=hsMessageBoxIconAsterisk); - // flag testing / clearing #define hsCheckBits(f,c) ((f & c)==c) #define hsTestBits(f,b) ( (f) & (b) ) diff --git a/Sources/Plasma/CoreLib/HeadSpin_Mac.mm b/Sources/Plasma/CoreLib/HeadSpin_Mac.mm deleted file mode 100644 index af6a801ebe..0000000000 --- a/Sources/Plasma/CoreLib/HeadSpin_Mac.mm +++ /dev/null @@ -1,123 +0,0 @@ -/*==LICENSE==* - -CyanWorlds.com Engine - MMOG client, server and tools -Copyright (C) 2011 Cyan Worlds, Inc. - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation, either version 3 of the License, or -(at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program. If not, see . - -Additional permissions under GNU GPL version 3 section 7 - -If you modify this Program, or any covered work, by linking or -combining it with any of RAD Game Tools Bink SDK, Autodesk 3ds Max SDK, -NVIDIA PhysX SDK, Microsoft DirectX SDK, OpenSSL library, Independent -JPEG Group JPEG library, Microsoft Windows Media SDK, or Apple QuickTime SDK -(or a modified version of those libraries), -containing parts covered by the terms of the Bink SDK EULA, 3ds Max EULA, -PhysX SDK EULA, DirectX SDK EULA, OpenSSL and SSLeay licenses, IJG -JPEG Library README, Windows Media SDK EULA, or QuickTime SDK EULA, the -licensors of this Program grant you additional -permission to convey the resulting work. Corresponding Source for a -non-source form of such a combination shall include the source code for -the parts of OpenSSL and IJG JPEG Library used as well as that of the covered -work. - -You can contact Cyan Worlds, Inc. by email legal@cyan.com - or by snail mail at: - Cyan Worlds, Inc. - 14617 N Newport Hwy - Mead, WA 99021 - -*==LICENSE==*/ - -#include "HeadSpin.h" - -#include -#import - -int hsMessageBoxWithOwner(hsWindowHndl owner, NSString* message, NSString* caption, int kind, int icon) -{ - // this is a private method - caller is responsible - // for wrapping in a valid autorelease pool - __block NSModalResponse response; - NSCondition *lock = [NSCondition new]; - dispatch_block_t alertBlock = ^{ - NSAlert *alert = [NSAlert new]; - alert.messageText = caption; - alert.informativeText = message; - - if (icon == hsMessageBoxIconError) - alert.alertStyle = NSAlertStyleCritical; - else if (icon == hsMessageBoxIconQuestion) - alert.alertStyle = NSAlertStyleInformational; - else if (icon == hsMessageBoxIconExclamation) - alert.alertStyle = NSAlertStyleWarning; - else if (icon == hsMessageBoxIconAsterisk) - alert.alertStyle = NSAlertStyleWarning; - else - alert.alertStyle = NSAlertStyleCritical; - - if (kind == hsMessageBoxNormal) - [alert addButtonWithTitle:@"OK"]; - else if (kind == hsMessageBoxAbortRetyIgnore) { - [alert addButtonWithTitle:@"Retry"]; - [alert addButtonWithTitle:@"Ignore"]; - } else if (kind == hsMessageBoxOkCancel) { - [alert addButtonWithTitle:@"OK"]; - [alert addButtonWithTitle:@"Cancel"]; - } else if (kind == hsMessageBoxRetryCancel) { - [alert addButtonWithTitle:@"Retry"]; - [alert addButtonWithTitle:@"Cancel"]; - } else if (kind == hsMessageBoxYesNo) { - [alert addButtonWithTitle:@"Yes"]; - [alert addButtonWithTitle:@"No"]; - } else if (kind == hsMessageBoxYesNoCancel) { - [alert addButtonWithTitle:@"Yes"]; - [alert addButtonWithTitle:@"No"]; - [alert addButtonWithTitle:@"Cancel"]; - } else - [alert addButtonWithTitle:@"OK"]; - response = [alert runModal]; - [lock lock]; - [lock signal]; - [lock unlock]; - }; - - //Plasma may call dialogs from any thread, not just the main thread - //Check to see if we're on the main thread and directly execute - //the dialog if we are. - if ([NSRunLoop currentRunLoop] == [NSRunLoop mainRunLoop]) { - alertBlock(); - } else { - [[NSRunLoop mainRunLoop] performInModes:@[NSDefaultRunLoopMode] block:alertBlock]; - [lock lock]; - [lock wait]; - [lock unlock]; - } - - return (int)response; -} - -int hsMessageBoxWithOwner(hsWindowHndl owner, const ST::string& message, const ST::string& caption, int kind, int icon) -{ - if (hsMessageBox_SuppressPrompts) - return hsMBoxOk; - - @autoreleasepool { - return hsMessageBoxWithOwner(owner, - [NSString initWithUTF8String:message.data()], - [NSString initWithUTF8String:caption.data()], - kind, - icon); - } -} diff --git a/Sources/Plasma/FeatureLib/pfConsole/CMakeLists.txt b/Sources/Plasma/FeatureLib/pfConsole/CMakeLists.txt index 567510a212..4dcc0ed748 100644 --- a/Sources/Plasma/FeatureLib/pfConsole/CMakeLists.txt +++ b/Sources/Plasma/FeatureLib/pfConsole/CMakeLists.txt @@ -49,6 +49,7 @@ target_link_libraries( plNetGameLib plNetMessage plMessage + plMessageBox plModifier plParticleSystem plPhysical diff --git a/Sources/Plasma/FeatureLib/pfConsole/pfConsole.cpp b/Sources/Plasma/FeatureLib/pfConsole/pfConsole.cpp index 48c1f41d44..7039582f9e 100644 --- a/Sources/Plasma/FeatureLib/pfConsole/pfConsole.cpp +++ b/Sources/Plasma/FeatureLib/pfConsole/pfConsole.cpp @@ -74,6 +74,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #include "plMessage/plConsoleMsg.h" #include "plMessage/plInputEventMsg.h" #include "plMessage/plInputIfaceMgrMsg.h" +#include "plMessageBox/hsMessageBox.h" #include "plPipeline/plDebugText.h" #include "pfConsoleCore/pfConsoleEngine.h" diff --git a/Sources/Plasma/FeatureLib/pfConsole/pfConsoleDirSrc.cpp b/Sources/Plasma/FeatureLib/pfConsole/pfConsoleDirSrc.cpp index 6a65dc351e..d833caef05 100644 --- a/Sources/Plasma/FeatureLib/pfConsole/pfConsoleDirSrc.cpp +++ b/Sources/Plasma/FeatureLib/pfConsole/pfConsoleDirSrc.cpp @@ -51,6 +51,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #include "HeadSpin.h" #include "hsExceptions.h" +#include "plMessageBox/hsMessageBox.h" //// ParseDirectory ////////////////////////////////////////////////////////// diff --git a/Sources/Plasma/FeatureLib/pfDXPipeline/CMakeLists.txt b/Sources/Plasma/FeatureLib/pfDXPipeline/CMakeLists.txt index 226c63d1b9..f10ef1ffac 100644 --- a/Sources/Plasma/FeatureLib/pfDXPipeline/CMakeLists.txt +++ b/Sources/Plasma/FeatureLib/pfDXPipeline/CMakeLists.txt @@ -47,6 +47,7 @@ target_link_libraries(pfDXPipeline plGImage plGLight plMessage + plMessageBox plResMgr plScene plStatusLog diff --git a/Sources/Plasma/FeatureLib/pfDXPipeline/plDXPipeline.cpp b/Sources/Plasma/FeatureLib/pfDXPipeline/plDXPipeline.cpp index 0c709d171a..a73af795c9 100644 --- a/Sources/Plasma/FeatureLib/pfDXPipeline/plDXPipeline.cpp +++ b/Sources/Plasma/FeatureLib/pfDXPipeline/plDXPipeline.cpp @@ -113,6 +113,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #include "plGLight/plShadowMaster.h" #include "plGLight/plShadowSlave.h" #include "plMessage/plDeviceRecreateMsg.h" +#include "plMessageBox/hsMessageBox.h" #include "plResMgr/plLocalization.h" #include "plScene/plRenderRequest.h" #include "plScene/plVisMgr.h" diff --git a/Sources/Plasma/PubUtilLib/CMakeLists.txt b/Sources/Plasma/PubUtilLib/CMakeLists.txt index d32dcdb9c2..aeef85ba79 100644 --- a/Sources/Plasma/PubUtilLib/CMakeLists.txt +++ b/Sources/Plasma/PubUtilLib/CMakeLists.txt @@ -23,6 +23,7 @@ add_subdirectory(plInterp) add_subdirectory(plIntersect) add_subdirectory(plMath) add_subdirectory(plMessage) +add_subdirectory(plMessageBox) add_subdirectory(plModifier) add_subdirectory(plNetClient) add_subdirectory(plNetClientComm) diff --git a/Sources/Plasma/PubUtilLib/plAvatar/CMakeLists.txt b/Sources/Plasma/PubUtilLib/plAvatar/CMakeLists.txt index 0cf597cf88..dedc16e092 100644 --- a/Sources/Plasma/PubUtilLib/plAvatar/CMakeLists.txt +++ b/Sources/Plasma/PubUtilLib/plAvatar/CMakeLists.txt @@ -96,6 +96,7 @@ target_link_libraries( plInputCore plInterp plMessage + plMessageBox plNetClient plNetCommon plNetMessage diff --git a/Sources/Plasma/PubUtilLib/plAvatar/plAvatarClothing.cpp b/Sources/Plasma/PubUtilLib/plAvatar/plAvatarClothing.cpp index 8d50952ffb..80a6bb4275 100644 --- a/Sources/Plasma/PubUtilLib/plAvatar/plAvatarClothing.cpp +++ b/Sources/Plasma/PubUtilLib/plAvatar/plAvatarClothing.cpp @@ -63,6 +63,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #include "plDrawable/plSpaceTree.h" #include "plGImage/plMipmap.h" #include "plMessage/plRenderMsg.h" +#include "plMessageBox/hsMessageBox.h" #include "plResMgr/plKeyFinder.h" #include "plSDL/plSDL.h" #include "plSurface/hsGMaterial.h" diff --git a/Sources/Plasma/PubUtilLib/plGImage/CMakeLists.txt b/Sources/Plasma/PubUtilLib/plGImage/CMakeLists.txt index 33b51e0e9d..6b5e5ab085 100644 --- a/Sources/Plasma/PubUtilLib/plGImage/CMakeLists.txt +++ b/Sources/Plasma/PubUtilLib/plGImage/CMakeLists.txt @@ -49,6 +49,7 @@ target_link_libraries( pnDispatch pnMessage pnNucleusInc + plMessageBox plResMgr JPEG::JPEG PNG::PNG diff --git a/Sources/Plasma/PubUtilLib/plGImage/plAVIWriter.cpp b/Sources/Plasma/PubUtilLib/plGImage/plAVIWriter.cpp index 308b048cc4..2b971dcea6 100644 --- a/Sources/Plasma/PubUtilLib/plGImage/plAVIWriter.cpp +++ b/Sources/Plasma/PubUtilLib/plGImage/plAVIWriter.cpp @@ -53,6 +53,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #include "hsTimer.h" #include "plMipmap.h" #include "plMessage/plRenderMsg.h" +#include "plMessageBox/hsMessageBox.h" #include "plPipeline.h" #include "pnDispatch/plDispatch.h" #include "pnKeyedObject/plFixedKey.h" diff --git a/Sources/Plasma/PubUtilLib/plMessageBox/CMakeLists.txt b/Sources/Plasma/PubUtilLib/plMessageBox/CMakeLists.txt new file mode 100644 index 0000000000..3f04b254aa --- /dev/null +++ b/Sources/Plasma/PubUtilLib/plMessageBox/CMakeLists.txt @@ -0,0 +1,23 @@ +set(plMessageBox_SOURCES + hsMessageBox.cpp + $<$:hsMessageBox_Mac.mm> + $<$:hsMessageBox_Win.cpp> +) + +set(plMessageBox_HEADERS + hsMessageBox.h +) + +plasma_library(plMessageBox + SOURCES ${plMessageBox_SOURCES} ${plMessageBox_HEADERS} +) +target_link_libraries( + plMessageBox + PUBLIC + CoreLib + PRIVATE + "$<$:-framework Cocoa>" +) + +source_group("Source Files" FILES ${plMessageBox_SOURCES}) +source_group("Header Files" FILES ${plMessageBox_HEADERS}) diff --git a/Sources/Plasma/PubUtilLib/plMessageBox/hsMessageBox.cpp b/Sources/Plasma/PubUtilLib/plMessageBox/hsMessageBox.cpp new file mode 100644 index 0000000000..59df69e66c --- /dev/null +++ b/Sources/Plasma/PubUtilLib/plMessageBox/hsMessageBox.cpp @@ -0,0 +1,69 @@ +/*==LICENSE==* + +CyanWorlds.com Engine - MMOG client, server and tools +Copyright (C) 2011 Cyan Worlds, Inc. + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 3 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . + +Additional permissions under GNU GPL version 3 section 7 + +If you modify this Program, or any covered work, by linking or +combining it with any of RAD Game Tools Bink SDK, Autodesk 3ds Max SDK, +NVIDIA PhysX SDK, Microsoft DirectX SDK, OpenSSL library, Independent +JPEG Group JPEG library, Microsoft Windows Media SDK, or Apple QuickTime SDK +(or a modified version of those libraries), +containing parts covered by the terms of the Bink SDK EULA, 3ds Max EULA, +PhysX SDK EULA, DirectX SDK EULA, OpenSSL and SSLeay licenses, IJG +JPEG Library README, Windows Media SDK EULA, or QuickTime SDK EULA, the +licensors of this Program grant you additional +permission to convey the resulting work. Corresponding Source for a +non-source form of such a combination shall include the source code for +the parts of OpenSSL and IJG JPEG Library used as well as that of the covered +work. + +You can contact Cyan Worlds, Inc. by email legal@cyan.com + or by snail mail at: + Cyan Worlds, Inc. + 14617 N Newport Hwy + Mead, WA 99021 + +*==LICENSE==*/ + +#include "hsMessageBox.h" + +bool hsMessageBox_SuppressPrompts = false; + +#if !defined(HS_BUILD_FOR_APPLE) && !defined(HS_BUILD_FOR_WIN32) +#include + +// Need a proper implementation for Linux, but for now let's just print out to the console +hsMessageBoxResult hsMessageBox(const ST::string& message, const ST::string& caption, hsMessageBoxKind kind, hsMessageBoxIcon icon) +{ + if (hsMessageBox_SuppressPrompts) + return hsMBoxOk; + + hsStatusMessage(ST::format("{}\n{}", message, caption).c_str()); + return hsMBoxCancel; +} +#endif + +hsMessageBoxResult hsMessageBox(const char* message, const char* caption, hsMessageBoxKind kind, hsMessageBoxIcon icon) +{ + return hsMessageBox(ST::string::from_latin_1(message), ST::string::from_latin_1(caption), kind, icon); +} + +hsMessageBoxResult hsMessageBox(const wchar_t* message, const wchar_t* caption, hsMessageBoxKind kind, hsMessageBoxIcon icon) +{ + return hsMessageBox(ST::string::from_wchar(message), ST::string::from_wchar(caption), kind, icon); +} diff --git a/Sources/Plasma/PubUtilLib/plMessageBox/hsMessageBox.h b/Sources/Plasma/PubUtilLib/plMessageBox/hsMessageBox.h new file mode 100644 index 0000000000..26390d4a38 --- /dev/null +++ b/Sources/Plasma/PubUtilLib/plMessageBox/hsMessageBox.h @@ -0,0 +1,81 @@ +/*==LICENSE==* + +CyanWorlds.com Engine - MMOG client, server and tools +Copyright (C) 2011 Cyan Worlds, Inc. + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 3 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . + +Additional permissions under GNU GPL version 3 section 7 + +If you modify this Program, or any covered work, by linking or +combining it with any of RAD Game Tools Bink SDK, Autodesk 3ds Max SDK, +NVIDIA PhysX SDK, Microsoft DirectX SDK, OpenSSL library, Independent +JPEG Group JPEG library, Microsoft Windows Media SDK, or Apple QuickTime SDK +(or a modified version of those libraries), +containing parts covered by the terms of the Bink SDK EULA, 3ds Max EULA, +PhysX SDK EULA, DirectX SDK EULA, OpenSSL and SSLeay licenses, IJG +JPEG Library README, Windows Media SDK EULA, or QuickTime SDK EULA, the +licensors of this Program grant you additional +permission to convey the resulting work. Corresponding Source for a +non-source form of such a combination shall include the source code for +the parts of OpenSSL and IJG JPEG Library used as well as that of the covered +work. + +You can contact Cyan Worlds, Inc. by email legal@cyan.com + or by snail mail at: + Cyan Worlds, Inc. + 14617 N Newport Hwy + Mead, WA 99021 + +*==LICENSE==*/ + +#ifndef _hsMessageBox_h_ +#define _hsMessageBox_h_ + +#include "HeadSpin.h" +#include + +enum hsMessageBoxKind { // Kind of MessageBox...passed to hsMessageBox + hsMessageBoxAbortRetyIgnore, + hsMessageBoxNormal, // Just Ok + hsMessageBoxOkCancel, + hsMessageBoxRetryCancel, + hsMessageBoxYesNo, + hsMessageBoxYesNoCancel, +}; + +enum hsMessageBoxIcon { + hsMessageBoxIconError, + hsMessageBoxIconQuestion, + hsMessageBoxIconExclamation, + hsMessageBoxIconAsterisk, +}; + +enum hsMessageBoxResult { // RETURN VALUES FROM hsMessageBox + hsMBoxOk = 1, // OK button was selected. + hsMBoxCancel, // Cancel button was selected. + hsMBoxAbort, // Abort button was selected. + hsMBoxRetry, // Retry button was selected. + hsMBoxIgnore, // Ignore button was selected. + hsMBoxYes, // Yes button was selected. + hsMBoxNo // No button was selected. +}; + +extern bool hsMessageBox_SuppressPrompts; + +hsMessageBoxResult hsMessageBox(const ST::string& message, const ST::string& caption, hsMessageBoxKind kind, hsMessageBoxIcon icon=hsMessageBoxIconAsterisk); +hsMessageBoxResult hsMessageBox(const char* message, const char* caption, hsMessageBoxKind kind, hsMessageBoxIcon icon=hsMessageBoxIconAsterisk); +hsMessageBoxResult hsMessageBox(const wchar_t* message, const wchar_t* caption, hsMessageBoxKind kind, hsMessageBoxIcon icon=hsMessageBoxIconAsterisk); + +#endif // _hsMessageBox_h_ diff --git a/Sources/Plasma/PubUtilLib/plMessageBox/hsMessageBox_Mac.mm b/Sources/Plasma/PubUtilLib/plMessageBox/hsMessageBox_Mac.mm new file mode 100644 index 0000000000..b8fc648278 --- /dev/null +++ b/Sources/Plasma/PubUtilLib/plMessageBox/hsMessageBox_Mac.mm @@ -0,0 +1,115 @@ +/*==LICENSE==* + +CyanWorlds.com Engine - MMOG client, server and tools +Copyright (C) 2011 Cyan Worlds, Inc. + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 3 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . + +Additional permissions under GNU GPL version 3 section 7 + +If you modify this Program, or any covered work, by linking or +combining it with any of RAD Game Tools Bink SDK, Autodesk 3ds Max SDK, +NVIDIA PhysX SDK, Microsoft DirectX SDK, OpenSSL library, Independent +JPEG Group JPEG library, Microsoft Windows Media SDK, or Apple QuickTime SDK +(or a modified version of those libraries), +containing parts covered by the terms of the Bink SDK EULA, 3ds Max EULA, +PhysX SDK EULA, DirectX SDK EULA, OpenSSL and SSLeay licenses, IJG +JPEG Library README, Windows Media SDK EULA, or QuickTime SDK EULA, the +licensors of this Program grant you additional +permission to convey the resulting work. Corresponding Source for a +non-source form of such a combination shall include the source code for +the parts of OpenSSL and IJG JPEG Library used as well as that of the covered +work. + +You can contact Cyan Worlds, Inc. by email legal@cyan.com + or by snail mail at: + Cyan Worlds, Inc. + 14617 N Newport Hwy + Mead, WA 99021 + +*==LICENSE==*/ + +#include "hsMessageBox.h" + +#import + +hsMessageBoxResult hsMessageBox(const ST::string& message, const ST::string& caption, hsMessageBoxKind kind, hsMessageBoxIcon icon) +{ + if (hsMessageBox_SuppressPrompts) + return hsMBoxOk; + + NSString *nsMessage = [NSString initWithUTF8String:message.data()]; + NSString *nsCaption = [NSString initWithUTF8String:caption.data()]; + + @autoreleasepool { + __block NSModalResponse response; + NSCondition *lock = [NSCondition new]; + dispatch_block_t alertBlock = ^{ + NSAlert *alert = [NSAlert new]; + alert.messageText = nsCaption; + alert.informativeText = nsMessage; + + if (icon == hsMessageBoxIconError) + alert.alertStyle = NSAlertStyleCritical; + else if (icon == hsMessageBoxIconQuestion) + alert.alertStyle = NSAlertStyleInformational; + else if (icon == hsMessageBoxIconExclamation) + alert.alertStyle = NSAlertStyleWarning; + else if (icon == hsMessageBoxIconAsterisk) + alert.alertStyle = NSAlertStyleWarning; + else + alert.alertStyle = NSAlertStyleCritical; + + if (kind == hsMessageBoxNormal) + [alert addButtonWithTitle:@"OK"]; + else if (kind == hsMessageBoxAbortRetyIgnore) { + [alert addButtonWithTitle:@"Retry"]; + [alert addButtonWithTitle:@"Ignore"]; + } else if (kind == hsMessageBoxOkCancel) { + [alert addButtonWithTitle:@"OK"]; + [alert addButtonWithTitle:@"Cancel"]; + } else if (kind == hsMessageBoxRetryCancel) { + [alert addButtonWithTitle:@"Retry"]; + [alert addButtonWithTitle:@"Cancel"]; + } else if (kind == hsMessageBoxYesNo) { + [alert addButtonWithTitle:@"Yes"]; + [alert addButtonWithTitle:@"No"]; + } else if (kind == hsMessageBoxYesNoCancel) { + [alert addButtonWithTitle:@"Yes"]; + [alert addButtonWithTitle:@"No"]; + [alert addButtonWithTitle:@"Cancel"]; + } else + [alert addButtonWithTitle:@"OK"]; + response = [alert runModal]; + [lock lock]; + [lock signal]; + [lock unlock]; + }; + + //Plasma may call dialogs from any thread, not just the main thread + //Check to see if we're on the main thread and directly execute + //the dialog if we are. + if ([NSRunLoop currentRunLoop] == [NSRunLoop mainRunLoop]) { + alertBlock(); + } else { + [[NSRunLoop mainRunLoop] performInModes:@[NSDefaultRunLoopMode] block:alertBlock]; + [lock lock]; + [lock wait]; + [lock unlock]; + } + + // This is only really safe for OK and Cancel + return (hsMessageBoxResult)response; + } +} diff --git a/Sources/Plasma/CoreLib/HeadSpin_Win.cpp b/Sources/Plasma/PubUtilLib/plMessageBox/hsMessageBox_Win.cpp similarity index 92% rename from Sources/Plasma/CoreLib/HeadSpin_Win.cpp rename to Sources/Plasma/PubUtilLib/plMessageBox/hsMessageBox_Win.cpp index cf49c34b56..36f5b8393b 100644 --- a/Sources/Plasma/CoreLib/HeadSpin_Win.cpp +++ b/Sources/Plasma/PubUtilLib/plMessageBox/hsMessageBox_Win.cpp @@ -40,11 +40,9 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com *==LICENSE==*/ -#include "HeadSpin.h" +#include "hsMessageBox.h" #include "hsWindows.h" -#include - class hsMinimizeClientGuard { hsWindowHndl fWnd; @@ -65,7 +63,7 @@ class hsMinimizeClientGuard }; -int hsMessageBoxWithOwner(hsWindowHndl owner, const ST::string& message, const ST::string& caption, int kind, int icon) +hsMessageBoxResult hsMessageBox(const ST::string& message, const ST::string& caption, hsMessageBoxKind kind, hsMessageBoxIcon icon) { if (hsMessageBox_SuppressPrompts) return hsMBoxOk; @@ -99,7 +97,7 @@ int hsMessageBoxWithOwner(hsWindowHndl owner, const ST::string& message, const S flags |= MB_ICONERROR; hsMinimizeClientGuard guard; - int ans = MessageBoxW(owner, message.to_wchar().data(), caption.to_wchar().data(), flags); + int ans = MessageBoxW(nullptr, message.to_wchar().data(), caption.to_wchar().data(), flags); switch (ans) { @@ -112,6 +110,4 @@ int hsMessageBoxWithOwner(hsWindowHndl owner, const ST::string& message, const S case IDNO: return hsMBoxNo; default: return hsMBoxCancel; } - - return hsMBoxCancel; } diff --git a/Sources/Plasma/PubUtilLib/plNetClient/CMakeLists.txt b/Sources/Plasma/PubUtilLib/plNetClient/CMakeLists.txt index 4e3fb0547a..a2008740e9 100644 --- a/Sources/Plasma/PubUtilLib/plNetClient/CMakeLists.txt +++ b/Sources/Plasma/PubUtilLib/plNetClient/CMakeLists.txt @@ -60,6 +60,7 @@ target_link_libraries(plNetClient plContainer plDrawable plMessage + plMessageBox plModifier plNetClientRecorder plNetGameLib diff --git a/Sources/Plasma/PubUtilLib/plNetClient/plNetClientMgr.cpp b/Sources/Plasma/PubUtilLib/plNetClient/plNetClientMgr.cpp index 2d6057708d..36c0a7789d 100644 --- a/Sources/Plasma/PubUtilLib/plNetClient/plNetClientMgr.cpp +++ b/Sources/Plasma/PubUtilLib/plNetClient/plNetClientMgr.cpp @@ -71,6 +71,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #include "plMessage/plSDLModifierStateMsg.h" #include "plMessage/plSynchEnableMsg.h" #include "plMessage/plVaultNotifyMsg.h" +#include "plMessageBox/hsMessageBox.h" #include "plModifier/plResponderModifier.h" #include "plNetClientRecorder/plNetClientRecorder.h" #include "plNetCommon/plNetObjectDebugger.h" diff --git a/Sources/Plasma/PubUtilLib/plResMgr/CMakeLists.txt b/Sources/Plasma/PubUtilLib/plResMgr/CMakeLists.txt index dacac28e97..025374bf55 100644 --- a/Sources/Plasma/PubUtilLib/plResMgr/CMakeLists.txt +++ b/Sources/Plasma/PubUtilLib/plResMgr/CMakeLists.txt @@ -39,6 +39,7 @@ target_link_libraries( pnMessage pnNetCommon plMessage + plMessageBox plStatusLog INTERFACE pnFactory diff --git a/Sources/Plasma/PubUtilLib/plResMgr/plResManager.cpp b/Sources/Plasma/PubUtilLib/plResMgr/plResManager.cpp index b7149f92c5..2f89e11cd2 100644 --- a/Sources/Plasma/PubUtilLib/plResMgr/plResManager.cpp +++ b/Sources/Plasma/PubUtilLib/plResMgr/plResManager.cpp @@ -62,6 +62,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #include "pnNetCommon/plNetApp.h" #include "plAgeDescription/plAgeDescription.h" +#include "plMessageBox/hsMessageBox.h" #include "plScene/plSceneNode.h" #include "plStatusLog/plStatusLog.h" diff --git a/Sources/Tools/MaxComponent/CMakeLists.txt b/Sources/Tools/MaxComponent/CMakeLists.txt index 385f0f9e7d..d492428d54 100644 --- a/Sources/Tools/MaxComponent/CMakeLists.txt +++ b/Sources/Tools/MaxComponent/CMakeLists.txt @@ -197,6 +197,7 @@ target_link_libraries( plIntersect plMath plMessage + plMessageBox plModifier plNetCommon plPipeline diff --git a/Sources/Tools/MaxComponent/plComponentBase.cpp b/Sources/Tools/MaxComponent/plComponentBase.cpp index eecdd174e3..fb2e2554ff 100644 --- a/Sources/Tools/MaxComponent/plComponentBase.cpp +++ b/Sources/Tools/MaxComponent/plComponentBase.cpp @@ -43,6 +43,8 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #include "HeadSpin.h" #include +#include "plMessageBox/hsMessageBox.h" + #include "plComponentBase.h" #include "plComponentReg.h" #include "MaxMain/plMaxNodeBase.h" diff --git a/Sources/Tools/MaxComponent/plPythonFileComponent.cpp b/Sources/Tools/MaxComponent/plPythonFileComponent.cpp index ae3f9339d1..6bdcad6cdd 100644 --- a/Sources/Tools/MaxComponent/plPythonFileComponent.cpp +++ b/Sources/Tools/MaxComponent/plPythonFileComponent.cpp @@ -81,6 +81,8 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #include "plSurface/plGrassShaderMod.h" #include "plGrassComponent.h" +#include "plMessageBox/hsMessageBox.h" + #include "pfPython/plPythonFileMod.h" #include "pfPython/plPythonParameter.h" diff --git a/Sources/Tools/MaxExport/CMakeLists.txt b/Sources/Tools/MaxExport/CMakeLists.txt index a9bd6c2483..d1f67ccaa0 100644 --- a/Sources/Tools/MaxExport/CMakeLists.txt +++ b/Sources/Tools/MaxExport/CMakeLists.txt @@ -31,6 +31,7 @@ target_link_libraries( pnKeyedObject plAvatar plGImage + plMessageBox plPhysX plResMgr plScene diff --git a/Sources/Tools/MaxExport/SimpleExport.cpp b/Sources/Tools/MaxExport/SimpleExport.cpp index 93c31b2d60..194a4c4de7 100644 --- a/Sources/Tools/MaxExport/SimpleExport.cpp +++ b/Sources/Tools/MaxExport/SimpleExport.cpp @@ -75,6 +75,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #include "plGImage/plCubicEnvironmap.h" #include "plGImage/plDynamicTextMap.h" #include "plGImage/plMipmap.h" +#include "plMessageBox/hsMessageBox.h" #include "plScene/plSceneNode.h" #include "plExportDlg.h" diff --git a/Sources/Tools/MaxExport/plExportDlg.cpp b/Sources/Tools/MaxExport/plExportDlg.cpp index fd51b0668b..2aca99c345 100644 --- a/Sources/Tools/MaxExport/plExportDlg.cpp +++ b/Sources/Tools/MaxExport/plExportDlg.cpp @@ -56,6 +56,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #include "MaxMain/plMaxCFGFile.h" #include "MaxMain/plMaxNode.h" #include "plFileSystem.h" +#include "plMessageBox/hsMessageBox.h" extern HINSTANCE hInstance; diff --git a/Sources/Tools/MaxMain/CMakeLists.txt b/Sources/Tools/MaxMain/CMakeLists.txt index 9b2a40b482..1a74b77086 100644 --- a/Sources/Tools/MaxMain/CMakeLists.txt +++ b/Sources/Tools/MaxMain/CMakeLists.txt @@ -92,6 +92,7 @@ target_link_libraries( plGImage plInterp plMessage + plMessageBox plModifier plParticleSystem plPhysical diff --git a/Sources/Tools/MaxMain/plGetLocationDlg.cpp b/Sources/Tools/MaxMain/plGetLocationDlg.cpp index 6d140edb71..bd6809ef1e 100644 --- a/Sources/Tools/MaxMain/plGetLocationDlg.cpp +++ b/Sources/Tools/MaxMain/plGetLocationDlg.cpp @@ -44,6 +44,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #include "MaxAPI.h" #include "pnKeyedObject/plKey.h" +#include "plMessageBox/hsMessageBox.h" #include "plMaxNode.h" #include "MaxComponent/plComponent.h" @@ -204,4 +205,4 @@ INT_PTR plGetLocationDlg::DlgProc(HWND hDlg, UINT msg, WPARAM wParam, LPARAM lPa } return FALSE; -} \ No newline at end of file +}