From 6f85e90873fe98653d1e79ade81a6db1c3518ff0 Mon Sep 17 00:00:00 2001 From: Darryl Pogue Date: Mon, 14 Aug 2023 21:12:24 -0700 Subject: [PATCH] Pass ST::string to some hsMessageBoxes --- Sources/Plasma/Apps/plClient/Mac-Cocoa/main.mm | 3 +-- Sources/Plasma/Apps/plClient/plClient.cpp | 4 ++-- Sources/Plasma/Apps/plClient/plClientLoader.cpp | 2 +- Sources/Plasma/Apps/plClient/win32/winmain.cpp | 8 ++++---- Sources/Plasma/Apps/plCrashHandler/winmain.cpp | 2 +- Sources/Plasma/Apps/plUruLauncher/plClientLauncher.cpp | 4 ++-- Sources/Plasma/FeatureLib/pfConsole/pfConsole.cpp | 2 +- Sources/Plasma/FeatureLib/pfConsole/pfConsoleDirSrc.cpp | 2 +- Sources/Plasma/FeatureLib/pfDXPipeline/plDXPipeline.cpp | 2 +- Sources/Plasma/PubUtilLib/plAvatar/plAvatarClothing.cpp | 2 +- Sources/Plasma/PubUtilLib/plGImage/plAVIWriter.cpp | 2 +- Sources/Plasma/PubUtilLib/plResMgr/plResManager.cpp | 2 +- 12 files changed, 17 insertions(+), 18 deletions(-) diff --git a/Sources/Plasma/Apps/plClient/Mac-Cocoa/main.mm b/Sources/Plasma/Apps/plClient/Mac-Cocoa/main.mm index 5812cefc3b..a621a51efd 100644 --- a/Sources/Plasma/Apps/plClient/Mac-Cocoa/main.mm +++ b/Sources/Plasma/Apps/plClient/Mac-Cocoa/main.mm @@ -304,8 +304,7 @@ - (void)applicationDidFinishLaunching:(NSNotification*)notification pfConsoleEngine tempConsole; tempConsole.ExecuteFile(serverIni); } else { - hsMessageBox("No server.ini file found. Please check your URU installation.", "Error", - hsMessageBoxNormal); + hsMessageBox(ST_LITERAL("No server.ini file found. Please check your URU installation."), ST_LITERAL("Error"), hsMessageBoxNormal); [NSApplication.sharedApplication terminate:nil]; } diff --git a/Sources/Plasma/Apps/plClient/plClient.cpp b/Sources/Plasma/Apps/plClient/plClient.cpp index 5c8af209ba..5aba7b4b43 100644 --- a/Sources/Plasma/Apps/plClient/plClient.cpp +++ b/Sources/Plasma/Apps/plClient/plClient.cpp @@ -442,7 +442,7 @@ bool plClient::InitPipeline(hsWindowHndl display, uint32_t devType) if (!devSel.GetRequested(&dmr, devType)) { - hsMessageBox("No suitable rendering devices found.","Plasma", hsMessageBoxNormal, hsMessageBoxIconError); + hsMessageBox(ST_LITERAL("No suitable rendering devices found."), ST_LITERAL("Plasma"), hsMessageBoxNormal, hsMessageBoxIconError); return true; } @@ -490,7 +490,7 @@ bool plClient::InitPipeline(hsWindowHndl display, uint32_t devType) { ISetGraphicsDefaults(); #ifdef PLASMA_EXTERNAL_RELEASE - hsMessageBox("There was an error initializing the video card.\nSetting defaults.", "Error", hsMessageBoxNormal); + hsMessageBox(ST_LITERAL("There was an error initializing the video card.\nSetting defaults."), ST_LITERAL("Error"), hsMessageBoxNormal); #else hsMessageBox( pipe->GetErrorString(), "Error creating pipeline", hsMessageBoxNormal ); #endif diff --git a/Sources/Plasma/Apps/plClient/plClientLoader.cpp b/Sources/Plasma/Apps/plClient/plClientLoader.cpp index 40dfa79176..1ced151838 100644 --- a/Sources/Plasma/Apps/plClient/plClientLoader.cpp +++ b/Sources/Plasma/Apps/plClient/plClientLoader.cpp @@ -57,7 +57,7 @@ void plClientLoader::Run() hsgResMgr::Init(resMgr); if (!plFileInfo("resource.dat").Exists()) { - hsMessageBox("Required file 'resource.dat' not found.", "Error", hsMessageBoxNormal); + hsMessageBox(ST_LITERAL("Required file 'resource.dat' not found."), ST_LITERAL("Error"), hsMessageBoxNormal); return; } plClientResMgr::Instance().ILoadResources("resource.dat"); diff --git a/Sources/Plasma/Apps/plClient/win32/winmain.cpp b/Sources/Plasma/Apps/plClient/win32/winmain.cpp index 02cc0f9f14..89f0f40f90 100644 --- a/Sources/Plasma/Apps/plClient/win32/winmain.cpp +++ b/Sources/Plasma/Apps/plClient/win32/winmain.cpp @@ -1140,7 +1140,7 @@ int WINAPI WinMain(HINSTANCE hInst, HINSTANCE hPrevInst, LPSTR lpCmdLine, int nC { if(!CreateProcessW(s_patcherExeName, nullptr, nullptr, nullptr, FALSE, 0, nullptr, nullptr, &si, &pi)) { - hsMessageBox("Failed to launch patcher", "Error", hsMessageBoxNormal); + hsMessageBox(ST_LITERAL("Failed to launch patcher"), ST_LITERAL("Error"), hsMessageBoxNormal); } CloseHandle( pi.hThread ); CloseHandle( pi.hProcess ); @@ -1194,7 +1194,7 @@ int WINAPI WinMain(HINSTANCE hInst, HINSTANCE hPrevInst, LPSTR lpCmdLine, int nC message = ST_LITERAL("Another copy of URU is already running"); break; } - hsMessageBox(message.to_wchar().c_str(), caption.to_wchar().c_str(), hsMessageBoxNormal); + hsMessageBox(message, caption, hsMessageBoxNormal); return PARABLE_NORMAL_EXIT; } #endif @@ -1212,13 +1212,13 @@ int WINAPI WinMain(HINSTANCE hInst, HINSTANCE hPrevInst, LPSTR lpCmdLine, int nC } else { - hsMessageBox("No server.ini file found. Please check your URU installation.", "Error", hsMessageBoxNormal); + hsMessageBox(ST_LITERAL("No server.ini file found. Please check your URU installation."), ST_LITERAL("Error"), hsMessageBoxNormal); return PARABLE_NORMAL_EXIT; } // Begin initializing the client in the background if (!WinInit(hInst)) { - hsMessageBox("Failed to initialize plClient", "Error", hsMessageBoxNormal); + hsMessageBox(ST_LITERAL("Failed to initialize plClient"), ST_LITERAL("Error"), hsMessageBoxNormal); return PARABLE_NORMAL_EXIT; } diff --git a/Sources/Plasma/Apps/plCrashHandler/winmain.cpp b/Sources/Plasma/Apps/plCrashHandler/winmain.cpp index 064306157c..c1f8b589f5 100644 --- a/Sources/Plasma/Apps/plCrashHandler/winmain.cpp +++ b/Sources/Plasma/Apps/plCrashHandler/winmain.cpp @@ -380,7 +380,7 @@ int WINAPI wWinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, PWSTR pCmdLine IShowCrashDialog(hInstance); return 0; } else { - hsMessageBox("You should never run this manually.", "Error", hsMessageBoxNormal, hsMessageBoxIconExclamation); + hsMessageBox(ST_LITERAL("You should never run this manually."), ST_LITERAL("Error"), hsMessageBoxNormal, hsMessageBoxIconExclamation); return 1; } } diff --git a/Sources/Plasma/Apps/plUruLauncher/plClientLauncher.cpp b/Sources/Plasma/Apps/plUruLauncher/plClientLauncher.cpp index 91188ce131..06de5424c9 100644 --- a/Sources/Plasma/Apps/plUruLauncher/plClientLauncher.cpp +++ b/Sources/Plasma/Apps/plUruLauncher/plClientLauncher.cpp @@ -327,11 +327,11 @@ bool plClientLauncher::CompleteSelfPatch(const std::function& waitProc) // so now we need to unlink the old patcher, and move ME into that fool's place... // then we can continue on our merry way! if (!plFileSystem::Unlink(plManifest::PatcherExecutable())) { - hsMessageBox("Failed to delete old patcher executable!", "Error", hsMessageBoxNormal, hsMessageBoxIconError); + hsMessageBox(ST_LITERAL("Failed to delete old patcher executable!"), ST_LITERAL("Error"), hsMessageBoxNormal, hsMessageBoxIconError); return true; } if (!plFileSystem::Move(plFileSystem::GetCurrentAppPath(), plManifest::PatcherExecutable())) { - hsMessageBox("Failed to move patcher executable!", "Error", hsMessageBoxNormal, hsMessageBoxIconError); + hsMessageBox(ST_LITERAL("Failed to move patcher executable!"), ST_LITERAL("Error"), hsMessageBoxNormal, hsMessageBoxIconError); return true; } diff --git a/Sources/Plasma/FeatureLib/pfConsole/pfConsole.cpp b/Sources/Plasma/FeatureLib/pfConsole/pfConsole.cpp index e80177823c..48c1f41d44 100644 --- a/Sources/Plasma/FeatureLib/pfConsole/pfConsole.cpp +++ b/Sources/Plasma/FeatureLib/pfConsole/pfConsole.cpp @@ -358,7 +358,7 @@ bool pfConsole::MsgReceive( plMessage *msg ) #else "\nPress OK to continue parsing files." ); - hsMessageBox( msg.c_str(), str.c_str(), hsMessageBoxNormal ); + hsMessageBox(msg, str, hsMessageBoxNormal); #endif } } diff --git a/Sources/Plasma/FeatureLib/pfConsole/pfConsoleDirSrc.cpp b/Sources/Plasma/FeatureLib/pfConsole/pfConsoleDirSrc.cpp index 3b5b27f12d..6a65dc351e 100644 --- a/Sources/Plasma/FeatureLib/pfConsole/pfConsoleDirSrc.cpp +++ b/Sources/Plasma/FeatureLib/pfConsole/pfConsoleDirSrc.cpp @@ -76,7 +76,7 @@ bool pfConsoleDirSrc::ParseDirectory(const plFileName& path, const char* mask /* error << fEngine->GetErrorMsg() << ":\n\nCommand: '" << fEngine->GetLastErrorLine() << "'\n\nPress OK to continue parsing files."; - hsMessageBox(error.to_string().c_str(), caption.to_string().c_str(), hsMessageBoxNormal); + hsMessageBox(error.to_string(), caption.to_string(), hsMessageBoxNormal); SetCheckProcessedFiles(true); return false; diff --git a/Sources/Plasma/FeatureLib/pfDXPipeline/plDXPipeline.cpp b/Sources/Plasma/FeatureLib/pfDXPipeline/plDXPipeline.cpp index 569c3f4a1c..0c709d171a 100644 --- a/Sources/Plasma/FeatureLib/pfDXPipeline/plDXPipeline.cpp +++ b/Sources/Plasma/FeatureLib/pfDXPipeline/plDXPipeline.cpp @@ -1879,7 +1879,7 @@ void plDXPipeline::IPrintDeviceInitError() message = ST_LITERAL("There was an error initializing your video card. We have reset it to its Default settings."); break; } - hsMessageBox(message.to_wchar().c_str(), caption.to_wchar().c_str(), hsMessageBoxNormal, hsMessageBoxIconError); + hsMessageBox(message, caption, hsMessageBoxNormal, hsMessageBoxIconError); } // Reset device creation parameters to default and write to ini file diff --git a/Sources/Plasma/PubUtilLib/plAvatar/plAvatarClothing.cpp b/Sources/Plasma/PubUtilLib/plAvatar/plAvatarClothing.cpp index adc7bef9c4..8d50952ffb 100644 --- a/Sources/Plasma/PubUtilLib/plAvatar/plAvatarClothing.cpp +++ b/Sources/Plasma/PubUtilLib/plAvatar/plAvatarClothing.cpp @@ -253,7 +253,7 @@ void plClothingItem::Write(hsStream *s, hsResMgr *mgr) if (accessoryKey == nullptr) { strBuf = ST::format("Couldn't find accessory \"{}\". It won't show at runtime.", fAccessoryName); - hsMessageBox(strBuf.c_str(), GetKeyName().c_str(), hsMessageBoxNormal); + hsMessageBox(strBuf, GetKeyName(), hsMessageBoxNormal); } } mgr->WriteKey(s, accessoryKey); diff --git a/Sources/Plasma/PubUtilLib/plGImage/plAVIWriter.cpp b/Sources/Plasma/PubUtilLib/plGImage/plAVIWriter.cpp index 707a76be84..308b048cc4 100644 --- a/Sources/Plasma/PubUtilLib/plGImage/plAVIWriter.cpp +++ b/Sources/Plasma/PubUtilLib/plGImage/plAVIWriter.cpp @@ -237,7 +237,7 @@ bool plAVIWriterImp::Open(const char* fileName, plPipeline* pipeline) &fBitmapInfo, // stream format fBitmapInfo.biSize); } while (err != AVIERR_OK && - hsMessageBox("Codec unavailable, try again?", "AVI Writer", hsMessageBoxYesNo) == hsMBoxYes); + hsMessageBox(ST_LITERAL("Codec unavailable, try again?"), ST_LITERAL("AVI Writer"), hsMessageBoxYesNo) == hsMBoxYes); if (err != AVIERR_OK) { diff --git a/Sources/Plasma/PubUtilLib/plResMgr/plResManager.cpp b/Sources/Plasma/PubUtilLib/plResMgr/plResManager.cpp index 6ea5d8131f..b7149f92c5 100644 --- a/Sources/Plasma/PubUtilLib/plResMgr/plResManager.cpp +++ b/Sources/Plasma/PubUtilLib/plResMgr/plResManager.cpp @@ -1171,7 +1171,7 @@ void plResManager::PageInRoom(const plLocation& page, uint16_t objClassToRef, pl ST::string msg = ST::format("Data Problem: Age:{} Page:{} Error:{}", pageNode->GetPageInfo().GetAge(), pageNode->GetPageInfo().GetPage(), condStr); - hsMessageBox(msg.c_str(), "Error", hsMessageBoxNormal, hsMessageBoxIconError); + hsMessageBox(msg, ST_LITERAL("Error"), hsMessageBoxNormal, hsMessageBoxIconError); hsRefCnt_SafeUnRef(refMsg); return;