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:
parent
1d40385d4a
commit
14ef2b445a
28 changed files with 689 additions and 318 deletions
17
src/chat.h
17
src/chat.h
|
@ -25,7 +25,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
|
|||
#include <list>
|
||||
|
||||
#include "irrlichttypes.h"
|
||||
#include "util/coloredstring.h"
|
||||
#include "util/enriched_string.h"
|
||||
|
||||
// Chat console related classes
|
||||
|
||||
|
@ -34,9 +34,9 @@ struct ChatLine
|
|||
// age in seconds
|
||||
f32 age;
|
||||
// name of sending player, or empty if sent by server
|
||||
std::wstring name;
|
||||
EnrichedString name;
|
||||
// message text
|
||||
ColoredString text;
|
||||
EnrichedString text;
|
||||
|
||||
ChatLine(std::wstring a_name, std::wstring a_text):
|
||||
age(0.0),
|
||||
|
@ -44,12 +44,19 @@ struct ChatLine
|
|||
text(a_text)
|
||||
{
|
||||
}
|
||||
|
||||
ChatLine(EnrichedString a_name, EnrichedString a_text):
|
||||
age(0.0),
|
||||
name(a_name),
|
||||
text(a_text)
|
||||
{
|
||||
}
|
||||
};
|
||||
|
||||
struct ChatFormattedFragment
|
||||
{
|
||||
// text string
|
||||
std::wstring text;
|
||||
EnrichedString text;
|
||||
// starting column
|
||||
u32 column;
|
||||
// formatting
|
||||
|
@ -262,7 +269,7 @@ public:
|
|||
// Get the recent messages buffer
|
||||
ChatBuffer& getRecentBuffer();
|
||||
// Concatenate all recent messages
|
||||
std::wstring getRecentChat();
|
||||
EnrichedString getRecentChat();
|
||||
// Get the console prompt
|
||||
ChatPrompt& getPrompt();
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue