mirror of
https://github.com/luanti-org/luanti.git
synced 2025-10-13 16:45:20 +02:00
hopefully a fix for the majority of the windows 7 problems - thanks to zerochen
This commit is contained in:
@@ -1686,6 +1686,22 @@ inline bool string_allowed(const std::string &s, const std::string &allowed_char
|
||||
return true;
|
||||
}
|
||||
|
||||
/*
|
||||
Forcefully wraps string into rows using \n
|
||||
(no word wrap, used for showing paths in gui)
|
||||
*/
|
||||
inline std::string wrap_rows(const std::string &from, u32 rowlen)
|
||||
{
|
||||
std::string to;
|
||||
for(u32 i=0; i<from.size(); i++)
|
||||
{
|
||||
if(i != 0 && i%rowlen == 0)
|
||||
to += '\n';
|
||||
to += from[i];
|
||||
}
|
||||
return to;
|
||||
}
|
||||
|
||||
/*
|
||||
Some helper stuff
|
||||
*/
|
||||
|
Reference in New Issue
Block a user