diff --git a/src/Components/Modules/Debug.cpp b/src/Components/Modules/Debug.cpp index 1347d95f..14eec5a3 100644 --- a/src/Components/Modules/Debug.cpp +++ b/src/Components/Modules/Debug.cpp @@ -304,7 +304,7 @@ namespace Components if (!result) { - Logger::PrintError(1, "CopyFile failed({}) {} {}\n", GetLastError(), "console_mp.log", newFileName); + Logger::PrintError(Game::CON_CHANNEL_ERROR, "CopyFile failed({}) {} {}\n", GetLastError(), "console_mp.log", newFileName); } } diff --git a/src/Components/Modules/Logger.cpp b/src/Components/Modules/Logger.cpp index 4037303c..832bac14 100644 --- a/src/Components/Modules/Logger.cpp +++ b/src/Components/Modules/Logger.cpp @@ -70,7 +70,7 @@ namespace Components MessagePrint(Game::CON_CHANNEL_DONT_FILTER, out); } - void Logger::PrintInternal(int channel, std::string_view fmt, std::format_args&& args) + void Logger::PrintInternal(Game::conChannel_t channel, std::string_view fmt, std::format_args&& args) { const auto msg = std::vformat(fmt, args); @@ -87,7 +87,7 @@ namespace Components Game::Com_Error(error, "%s", msg.data()); } - void Logger::PrintErrorInternal(int channel, std::string_view fmt, std::format_args&& args) + void Logger::PrintErrorInternal(Game::conChannel_t channel, std::string_view fmt, std::format_args&& args) { const auto msg = "^1Error: " + std::vformat(fmt, args); @@ -100,7 +100,7 @@ namespace Components } } - void Logger::WarningInternal(int channel, std::string_view fmt, std::format_args&& args) + void Logger::WarningInternal(Game::conChannel_t channel, std::string_view fmt, std::format_args&& args) { const auto msg = "^3" + std::vformat(fmt, args); diff --git a/src/Components/Modules/Logger.hpp b/src/Components/Modules/Logger.hpp index 359e473e..ff976a45 100644 --- a/src/Components/Modules/Logger.hpp +++ b/src/Components/Modules/Logger.hpp @@ -14,10 +14,10 @@ namespace Components static void PipeOutput(const std::function& callback); - static void PrintInternal(int channel, std::string_view fmt, std::format_args&& args); + static void PrintInternal(Game::conChannel_t channel, std::string_view fmt, std::format_args&& args); static void ErrorInternal(Game::errorParm_t error, std::string_view fmt, std::format_args&& args); - static void PrintErrorInternal(int channel, std::string_view fmt, std::format_args&& args); - static void WarningInternal(int channel, std::string_view fmt, std::format_args&& args); + static void PrintErrorInternal(Game::conChannel_t channel, std::string_view fmt, std::format_args&& args); + static void WarningInternal(Game::conChannel_t channel, std::string_view fmt, std::format_args&& args); static void DebugInternal(std::string_view fmt, std::format_args&& args, const std::source_location& loc); static void Print(std::string_view fmt) @@ -25,7 +25,7 @@ namespace Components PrintInternal(Game::CON_CHANNEL_DONT_FILTER, fmt, std::make_format_args(0)); } - static void Print(int channel, std::string_view fmt) + static void Print(Game::conChannel_t channel, std::string_view fmt) { PrintInternal(channel, fmt, std::make_format_args(0)); } @@ -38,7 +38,7 @@ namespace Components } template - static void Print(int channel, std::string_view fmt, Args&&... args) + static void Print(Game::conChannel_t channel, std::string_view fmt, Args&&... args) { (Utils::String::SanitizeFormatArgs(args), ...); PrintInternal(channel, fmt, std::make_format_args(args...)); @@ -56,25 +56,25 @@ namespace Components ErrorInternal(error, fmt, std::make_format_args(args...)); } - static void Warning(int channel, std::string_view fmt) + static void Warning(Game::conChannel_t channel, std::string_view fmt) { WarningInternal(channel, fmt, std::make_format_args(0)); } template - static void Warning(int channel, std::string_view fmt, Args&&... args) + static void Warning(Game::conChannel_t channel, std::string_view fmt, Args&&... args) { (Utils::String::SanitizeFormatArgs(args), ...); WarningInternal(channel, fmt, std::make_format_args(args...)); } - static void PrintError(int channel, std::string_view fmt) + static void PrintError(Game::conChannel_t channel, std::string_view fmt) { PrintErrorInternal(channel, fmt, std::make_format_args(0)); } template - static void PrintError(int channel, std::string_view fmt, Args&&... args) + static void PrintError(Game::conChannel_t channel, std::string_view fmt, Args&&... args) { (Utils::String::SanitizeFormatArgs(args), ...); PrintErrorInternal(channel, fmt, std::make_format_args(args...)); diff --git a/src/Game/Structs.hpp b/src/Game/Structs.hpp index 41b050e1..09ffb489 100644 --- a/src/Game/Structs.hpp +++ b/src/Game/Structs.hpp @@ -9239,7 +9239,7 @@ namespace Game char* openScriptIOFileBuffers[1]; com_parse_mark_t currentScriptIOLineMark[1]; cached_tag_mat_t cachedTagMat; - int scriptPrintChannel; + conChannel_t scriptPrintChannel; float compassMapUpperLeft[2]; float compassMapWorldSize[2]; float compassNorth[2];