diff --git a/src/Components/Modules/Auth.cpp b/src/Components/Modules/Auth.cpp index f1253b3f..e67ddd05 100644 --- a/src/Components/Modules/Auth.cpp +++ b/src/Components/Modules/Auth.cpp @@ -41,7 +41,7 @@ namespace Components { if (Auth::TokenContainer.command.empty()) { - Game::MessageBox(Utils::String::VA("Your new security level is %d", Auth::GetSecurityLevel()), "Success"); + Game::ShowMessageBox(Utils::String::VA("Your new security level is %d", Auth::GetSecurityLevel()), "Success"); } else { diff --git a/src/Components/Modules/Friends.cpp b/src/Components/Modules/Friends.cpp index 729c370c..9f29cca2 100644 --- a/src/Components/Modules/Friends.cpp +++ b/src/Components/Modules/Friends.cpp @@ -484,7 +484,10 @@ namespace Components Friends::ClearPresence("iw4x_playing"); #ifdef DEBUG - Steam::Proxy::SteamFriends->ClearRichPresence(); + if (Steam::Proxy::SteamFriends) + { + Steam::Proxy::SteamFriends->ClearRichPresence(); + } #endif if(Steam::Proxy::SteamLegacyFriends) @@ -525,9 +528,8 @@ namespace Components Steam::Proxy::UnregisterCallback(336); Steam::Proxy::UnregisterCallback(304); - { - std::lock_guard _(Friends::Mutex); - Friends::FriendsList.clear(); - } + std::lock_guard _(Friends::Mutex); + Friends::FriendsList.clear(); + } } diff --git a/src/Components/Modules/Maps.cpp b/src/Components/Modules/Maps.cpp index 0a9b6118..a59f810a 100644 --- a/src/Components/Modules/Maps.cpp +++ b/src/Components/Modules/Maps.cpp @@ -521,13 +521,13 @@ namespace Components { if (map == std::string(mapname)) { - if(error) Components::Logger::SoftError("Missing DLC pack %s (%d) containing map %s (%s).\nPlease download it to play this map.", + Components::Logger::SoftError("Missing DLC pack %s (%d) containing map %s (%s).\nPlease download it to play this map.", pack.name.data(), pack.index, Game::UI_LocalizeMapName(mapname), mapname); } } } - if (error) Components::Logger::SoftError("Missing map file %s.\nYou may have a damaged installation or are attempting to load a non-existant map.", mapname); + Components::Logger::SoftError("Missing map file %s.\nYou may have a damaged installation or are attempting to load a non-existant map.", mapname); return false; } @@ -561,7 +561,7 @@ namespace Components } } - Game::MessageBox(Utils::String::VA("DLC %d does not exist!", dlc), "ERROR"); + Game::ShowMessageBox(Utils::String::VA("DLC %d does not exist!", dlc), "ERROR"); }); }); diff --git a/src/Components/Modules/News.cpp b/src/Components/Modules/News.cpp index 1527a033..f5fed33e 100644 --- a/src/Components/Modules/News.cpp +++ b/src/Components/Modules/News.cpp @@ -149,7 +149,7 @@ namespace Components { Localization::ClearTemp(); Command::Execute("closemenu popup_reconnectingtoparty", false); - Game::MessageBox("Failed to download the updater!", "Error"); + Game::ShowMessageBox("Failed to download the updater!", "Error"); } else { diff --git a/src/Components/Modules/ServerList.cpp b/src/Components/Modules/ServerList.cpp index 73abbc51..040efa9a 100644 --- a/src/Components/Modules/ServerList.cpp +++ b/src/Components/Modules/ServerList.cpp @@ -292,7 +292,7 @@ namespace Components if (!object.is_array()) { Logger::Print("Favourites storage file is invalid!\n"); - Game::MessageBox("Favourites storage file is invalid!", "Error"); + Game::ShowMessageBox("Favourites storage file is invalid!", "Error"); return; } @@ -303,7 +303,7 @@ namespace Components if (!storedServers[i].is_string()) continue; if (storedServers[i].string_value() == server) { - Game::MessageBox("Server already marked as favourite.", "Error"); + Game::ShowMessageBox("Server already marked as favourite.", "Error"); return; } @@ -315,7 +315,7 @@ namespace Components json11::Json data = json11::Json(servers); Utils::IO::WriteFile("players/favourites.json", data.dump()); - Game::MessageBox("Server added to favourites.", "Success"); + Game::ShowMessageBox("Server added to favourites.", "Success"); } void ServerList::RemoveFavourite(std::string server) @@ -330,7 +330,7 @@ namespace Components if (!object.is_array()) { Logger::Print("Favourites storage file is invalid!\n"); - Game::MessageBox("Favourites storage file is invalid!", "Error"); + Game::ShowMessageBox("Favourites storage file is invalid!", "Error"); return; } @@ -351,7 +351,7 @@ namespace Components ServerList::RefreshVisibleList(UIScript::Token()); - Game::MessageBox("Server removed from favourites.", "Success"); + Game::ShowMessageBox("Server removed from favourites.", "Success"); } void ServerList::LoadFavourties() @@ -367,7 +367,7 @@ namespace Components if (!object.is_array()) { Logger::Print("Favourites storage file is invalid!\n"); - Game::MessageBox("Favourites storage file is invalid!", "Error"); + Game::ShowMessageBox("Favourites storage file is invalid!", "Error"); return; } diff --git a/src/Game/Functions.cpp b/src/Game/Functions.cpp index fc213270..0fbfa024 100644 --- a/src/Game/Functions.cpp +++ b/src/Game/Functions.cpp @@ -508,7 +508,8 @@ namespace Game } } - void MessageBox(std::string message, std::string title) + // this cant be MessageBox because windows.h has a define that converts it to MessageBoxW. which is just stupid + void ShowMessageBox(std::string message, std::string title) { if (!Game::CL_IsCgameInitialized()) { diff --git a/src/Game/Functions.hpp b/src/Game/Functions.hpp index d03714d4..e2553ce3 100644 --- a/src/Game/Functions.hpp +++ b/src/Game/Functions.hpp @@ -719,7 +719,7 @@ namespace Game void FS_AddLocalizedGameDirectory(const char *path, const char *dir); - void MessageBox(std::string message, std::string title); + void ShowMessageBox(std::string message, std::string title); unsigned int R_HashString(const char* string); void R_LoadSunThroughDvars(const char* mapname, sunflare_t* sun);