Skip to content

Commit

Permalink
fix(Lua): Errors/warnings now have color across multiple lines in the…
Browse files Browse the repository at this point in the history
… GUI console
  • Loading branch information
UE4SS committed Dec 14, 2024
1 parent 77e9efc commit a8d5627
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion UE4SS/src/GUI/ConsoleOutputDevice.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#include <chrono>
#include <locale>
#include <sstream>

#include <GUI/ConsoleOutputDevice.hpp>
#include <UE4SSProgram.hpp>
Expand Down Expand Up @@ -27,7 +28,12 @@ namespace RC::Output
fmt_copy.pop_back();
}
auto color = static_cast<Color::Color>(optional_arg);
UE4SSProgram::get_program().get_debugging_ui().get_console().add_line(m_formatter(fmt_copy), color);
auto formatted_message = m_formatter(fmt_copy);
std::wstringstream stream{formatted_message};
for (File::StringType line; std::getline(stream, line);)
{
UE4SSProgram::get_program().get_debugging_ui().get_console().add_line(line, color);
}
#endif
}
} // namespace RC::Output

0 comments on commit a8d5627

Please sign in to comment.