Update some splashes.

Allow messages to be split properly across several lines.
This commit is contained in:
iProgramInCpp
2023-08-12 10:39:23 +03:00
parent d09ef3fd04
commit 826315c228
3 changed files with 28 additions and 7 deletions

View File

@@ -43,6 +43,17 @@ Gui::Gui(Minecraft* pMinecraft)
void Gui::addMessage(const std::string& s)
{
// if the message contains a new line, add each line separately:
if (s.find("\n") != std::string::npos)
{
std::stringstream ss(s);
std::string line;
while (std::getline(ss, line))
addMessage(line);
return;
}
std::string str = s;
while (m_pMinecraft->m_pFont->width(str) > 320)