Mineserver
A rewrite of Minecraft 1.8.9 in C++ !
Loading...
Searching...
No Matches
ChatMessage::ClickEvent Class Reference

Click Event. More...

#include <chatmessage.h>

Public Types

enum  ActionType {
  NONE , OPEN_URL , RUN_COMMAND , SUGGEST_COMMAND ,
  CHANGE_PAGE , COPY_TO_CLIPBOARD
}
 Type of action to perform. More...
 

Public Member Functions

 ClickEvent (ActionType action, std::string value)
 Construct a new Click Event object.
 
 ClickEvent (std::uint32_t changePage)
 Construct a new Click Event object.
 
 ClickEvent ()
 Construct a new Click Event object.
 
 ~ClickEvent ()=default
 Destroy the Click Event object.
 
void load (const rapidjson::Value &document)
 Load click event from JSON.
 
void save (rapidjson::Value &document, rapidjson::Document::AllocatorType &alloc) const
 Save click event to JSON.
 

Static Public Member Functions

static void loadLua (lua_State *state, const char *namespaceName)
 Loads Click Event to lua.
 

Public Attributes

ActionType action
 Action to perform.
 
std::string value
 Value of action.
 

Detailed Description

Click Event.

On message click event

Member Enumeration Documentation

◆ ActionType

Type of action to perform.

Enumerator
NONE 

No action.

Click event will not be saved to JSON.

OPEN_URL 

Open URL.

RUN_COMMAND 

Run command.

SUGGEST_COMMAND 

Suggest command to user.

CHANGE_PAGE 

Change page (book only)

COPY_TO_CLIPBOARD 

Copy text to clipboard.

Constructor & Destructor Documentation

◆ ClickEvent() [1/2]

ChatMessage::ClickEvent::ClickEvent ( ActionType action,
std::string value )

Construct a new Click Event object.

Parameters
actionthe action type
valuethe value of action

◆ ClickEvent() [2/2]

ChatMessage::ClickEvent::ClickEvent ( std::uint32_t changePage)

Construct a new Click Event object.

Parameters
changePagesee ActionType::CHANGE_PAGE

Member Function Documentation

◆ load()

void ChatMessage::ClickEvent::load ( const rapidjson::Value & document)

Load click event from JSON.

Parameters
documentthe document to load from

◆ loadLua()

void ChatMessage::ClickEvent::loadLua ( lua_State * state,
const char * namespaceName )
static

Loads Click Event to lua.

Parameters
statethe state of lua
namespaceNamethe namespace name

◆ save()

void ChatMessage::ClickEvent::save ( rapidjson::Value & document,
rapidjson::Document::AllocatorType & alloc ) const

Save click event to JSON.

Parameters
documentthe document to save to
allocthe document allocator

The documentation for this class was generated from the following files: