Skip to content

Commit

Permalink
Pass ST::string to some hsMessageBoxes
Browse files Browse the repository at this point in the history
  • Loading branch information
dpogue committed Aug 16, 2023
1 parent 4959252 commit 6f85e90
Show file tree
Hide file tree
Showing 12 changed files with 17 additions and 18 deletions.
3 changes: 1 addition & 2 deletions Sources/Plasma/Apps/plClient/Mac-Cocoa/main.mm
Original file line number Diff line number Diff line change
Expand Up @@ -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];
}

Expand Down
4 changes: 2 additions & 2 deletions Sources/Plasma/Apps/plClient/plClient.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion Sources/Plasma/Apps/plClient/plClientLoader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand Down
8 changes: 4 additions & 4 deletions Sources/Plasma/Apps/plClient/win32/winmain.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 );
Expand Down Expand Up @@ -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
Expand All @@ -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;
}

Expand Down
2 changes: 1 addition & 1 deletion Sources/Plasma/Apps/plCrashHandler/winmain.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
}
Expand Down
4 changes: 2 additions & 2 deletions Sources/Plasma/Apps/plUruLauncher/plClientLauncher.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -327,11 +327,11 @@ bool plClientLauncher::CompleteSelfPatch(const std::function<void()>& 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;
}

Expand Down
2 changes: 1 addition & 1 deletion Sources/Plasma/FeatureLib/pfConsole/pfConsole.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
}
Expand Down
2 changes: 1 addition & 1 deletion Sources/Plasma/FeatureLib/pfConsole/pfConsoleDirSrc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion Sources/Plasma/FeatureLib/pfDXPipeline/plDXPipeline.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion Sources/Plasma/PubUtilLib/plAvatar/plAvatarClothing.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion Sources/Plasma/PubUtilLib/plGImage/plAVIWriter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
Expand Down
2 changes: 1 addition & 1 deletion Sources/Plasma/PubUtilLib/plResMgr/plResManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 6f85e90

Please sign in to comment.