From 60210cf38a497c2f58c2127150ee3060fbb212fd Mon Sep 17 00:00:00 2001 From: Adam Johnson Date: Thu, 5 Dec 2013 01:36:47 -0500 Subject: [PATCH] We have to load plFontCache... --- Sources/Tools/MaxMain/GlobalUtility.cpp | 34 +++++++++++++++---------- 1 file changed, 20 insertions(+), 14 deletions(-) diff --git a/Sources/Tools/MaxMain/GlobalUtility.cpp b/Sources/Tools/MaxMain/GlobalUtility.cpp index 9ffd9176..f258a7a5 100644 --- a/Sources/Tools/MaxMain/GlobalUtility.cpp +++ b/Sources/Tools/MaxMain/GlobalUtility.cpp @@ -63,6 +63,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #include "plMaxCFGFile.h" #include "pfLocalizationMgr/pfLocalizationMgr.h" +#include "plGImage/plFontCache.h" extern plActionTableMgr theActionTableMgr; extern HINSTANCE hInstance; @@ -208,14 +209,6 @@ DWORD PlasmaMax::Start() SceneSync::Instance(); #endif - plComponentShow::Init(); - - plCreateMenu(); - - RegisterNotification(NotifyProc, 0, NOTIFY_FILE_POST_OPEN); - - RegisterNotification(NotifyProc, 0, NOTIFY_SYSTEM_STARTUP); - #ifdef MAXSCENEVIEWER_ENABLED InitMaxFileData(); #endif @@ -225,14 +218,26 @@ DWORD PlasmaMax::Start() plFileName pathTemp = plMaxConfig::GetClientPath(false, true); if (!pathTemp.IsValid()) { - hsMessageBox("PlasmaMAX2.ini is missing or invalid", "Plasma/2.0 Error", hsMessageBoxNormal); - } - else - { - plFileName clientPath = plFileName::Join(pathTemp, "dat"); - pfLocalizationMgr::Initialize(clientPath); + hsMessageBox("PlasmaMAX2.ini is missing or invalid.\nPlasmaMAX will be unavailable until this file is added.", + "PlasmaMAX2 Error", hsMessageBoxNormal, hsMessageBoxIconExclamation); + return GUPRESULT_NOKEEP; } + // Setup the doggone plugin + plComponentShow::Init(); + plCreateMenu(); + + RegisterNotification(NotifyProc, 0, NOTIFY_FILE_POST_OPEN); + RegisterNotification(NotifyProc, 0, NOTIFY_SYSTEM_STARTUP); + + // Now we have to init like we're a real doggone client... + plFileName clientPath = plFileName::Join(pathTemp, "dat"); + pfLocalizationMgr::Initialize(clientPath); + + // init font cache singleton + plFontCache* fonts = new plFontCache(); + fonts->LoadCustomFonts(clientPath); + return GUPRESULT_KEEP; } @@ -241,6 +246,7 @@ void PlasmaMax::Stop() UnRegisterNotification(NotifyProc, 0, NOTIFY_FILE_POST_OPEN); pfLocalizationMgr::Shutdown(); + plFontCache::GetInstance().UnRegisterAs(kFontCache_KEY); PythonInterface::WeAreInShutdown(); PythonInterface::finiPython();