1
0
Fork 0
mirror of https://github.com/luanti-org/luanti.git synced 2025-06-27 16:36:03 +00:00

Add colored text (not only colored chat).

Add documentation, move files to a proper place and avoid memory leaks.
Make it work with most kind of texts, and allow backgrounds too.
This commit is contained in:
Ekdohibs 2016-05-31 17:30:11 +02:00
parent 1d40385d4a
commit 14ef2b445a
28 changed files with 689 additions and 318 deletions

View file

@ -30,6 +30,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
#include "guiTable.h"
#include "network/networkprotocol.h"
#include "util/string.h"
#include "util/enriched_string.h"
class IGameDef;
class InventoryManager;
@ -202,7 +203,8 @@ class GUIFormSpecMenu : public GUIModalMenu
fname(name),
fid(id)
{
flabel = unescape_enriched(label);
//flabel = unescape_enriched(label);
flabel = label;
fdefault = unescape_enriched(default_text);
send = false;
ftype = f_Unknown;
@ -239,7 +241,8 @@ class GUIFormSpecMenu : public GUIModalMenu
bgcolor(a_bgcolor),
color(a_color)
{
tooltip = unescape_enriched(utf8_to_wide(a_tooltip));
//tooltip = unescape_enriched(utf8_to_wide(a_tooltip));
tooltip = utf8_to_wide(a_tooltip);
}
std::wstring tooltip;
irr::video::SColor bgcolor;
@ -256,7 +259,8 @@ class GUIFormSpecMenu : public GUIModalMenu
rect(a_rect),
parent_button(NULL)
{
text = unescape_enriched(a_text);
//text = unescape_enriched(a_text);
text = a_text;
}
StaticTextSpec(const std::wstring &a_text,
const core::rect<s32> &a_rect,
@ -264,7 +268,8 @@ class GUIFormSpecMenu : public GUIModalMenu
rect(a_rect),
parent_button(a_parent_button)
{
text = unescape_enriched(a_text);
//text = unescape_enriched(a_text);
text = a_text;
}
std::wstring text;
core::rect<s32> rect;