Minecraft Chat Message implementation.
More...
#include <chatmessage.h>
|
bool | bold {} |
| Boldness for text.
|
|
bool | italic {} |
| Italicness for text.
|
|
bool | underlined {} |
| Underline or not text.
|
|
bool | strikethrough {} |
| Strikethrough or not text.
|
|
bool | obfuscated {} |
| Obfuscate or not text.
|
|
std::string | color {} |
| Color of text.
|
|
std::string | insertion {} |
| Text to insert.
|
|
std::string | text {} |
| The text excluding extras.
|
|
ClickEvent | clickEvent |
| Click event for message.
|
|
Minecraft Chat Message implementation.
Following great Wiki.vg article on the implementation of Minecraft's chat system.
◆ ChatMessage() [1/2]
ChatMessage::ChatMessage |
( |
const std::string & | msg | ) |
|
Construct a new Chat Message object.
- Parameters
-
msg | the text of the chat message |
◆ ChatMessage() [2/2]
ChatMessage::ChatMessage |
( |
const std::string && | msg | ) |
|
Construct a new Chat Message object.
- Parameters
-
msg | the text of the chat message |
◆ addExtra()
Adds an extra.
Adds additional data to the chat message with another ChatMessage
- Parameters
-
cm | the chat message to add |
◆ load()
void ChatMessage::load |
( |
const rapidjson::Value & | document | ) |
|
Loads data from a document.
- Parameters
-
document | The document to load from |
◆ loadLua()
Loads the ChatMessage class to a Lua one.
- Parameters
-
state | the state to load to |
namespaceName | the namespace to load to |
◆ save()
void ChatMessage::save |
( |
rapidjson::Value & | document, |
|
|
rapidjson::Document::AllocatorType & | alloc ) const |
Saves data from a document.
- Parameters
-
document | The document to save to |
alloc | The allocator of the document |
◆ operator==
Equality operator between two chat messages.
- Parameters
-
lhs | the left-handside variable |
rhs | the righ-handside variable |
- Returns
- true the two variables are equal
-
false the two variables are not equal
◆ color
std::string ChatMessage::color {} |
Color of text.
Should be one of the normal colors, but can also be a format code (however, the fields relating to styles should be used instead for that purpose). If not present (or set to reset), then the default color for the text will be used, which varies by the situation (in some cases, it is white; in others, it is black; in still others, it is a shade of gray that isn't normally used on text).
◆ insertion
std::string ChatMessage::insertion {} |
Text to insert.
Only used for messages in chat. When shift is held, clicking the component inserts the given text into the chat box at the cursor (potentially replacing selected text). Has no effect on other locations at this time.
◆ text
std::string ChatMessage::text {} |
The text excluding extras.
Does not parse for additional string components, only text.
The documentation for this class was generated from the following files: