Skip to content

Commit a8d5627

Browse files
committed
fix(Lua): Errors/warnings now have color across multiple lines in the GUI console
1 parent 77e9efc commit a8d5627

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

UE4SS/src/GUI/ConsoleOutputDevice.cpp

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
#include <chrono>
22
#include <locale>
3+
#include <sstream>
34

45
#include <GUI/ConsoleOutputDevice.hpp>
56
#include <UE4SSProgram.hpp>
@@ -27,7 +28,12 @@ namespace RC::Output
2728
fmt_copy.pop_back();
2829
}
2930
auto color = static_cast<Color::Color>(optional_arg);
30-
UE4SSProgram::get_program().get_debugging_ui().get_console().add_line(m_formatter(fmt_copy), color);
31+
auto formatted_message = m_formatter(fmt_copy);
32+
std::wstringstream stream{formatted_message};
33+
for (File::StringType line; std::getline(stream, line);)
34+
{
35+
UE4SSProgram::get_program().get_debugging_ui().get_console().add_line(line, color);
36+
}
3137
#endif
3238
}
3339
} // namespace RC::Output

0 commit comments

Comments
 (0)