endstone::MessageForm
Represents a form with two buttons.
Bases: endstone::Form< MessageForm >
Types:
Name | Description |
---|---|
OnSubmitCallback |
Functions:
Name | Description |
---|---|
getButton1 | Get the text of button1. |
getButton2 | Get the text of button2. |
getContent | Get the content of the form. |
getOnSubmit | Gets the on submit callback of the form. |
setButton1 | Set the text of button1. |
setButton2 | Set the text of button2. |
setContent | Set the content of the form. |
setOnSubmit | Sets the on submit callback of the form. |
OnSubmitCallback
using endstone::MessageForm::OnSubmitCallback =
std::function<void(Player *, int)>;
getButton1
Message getButton1() const
Get the text of button1.
Returns:
The text of button1.
getButton2
Message getButton2() const
Get the text of button2.
Returns:
The text of button2.
getContent
Message getContent() const
Get the content of the form.
Returns:
The content of the form.
getOnSubmit
OnSubmitCallback getOnSubmit() const
Gets the on submit callback of the form.
Returns:
The on submit callback of the form.
setButton1
MessageForm &setButton1(Message text)
Set the text of button1.
Parameters:
text
The text to set as the button1 text.
Returns:
A reference to the current form.
setButton2
MessageForm &setButton2(Message text)
Set the text of button2.
Parameters:
text
The text to set as the button2 text.
Returns:
A reference to the current form.
setContent
MessageForm &setContent(Message text)
Set the content of the form.
Parameters:
text
The text to set as the content.
Returns:
A reference to the current form.
setOnSubmit
MessageForm &setOnSubmit(OnSubmitCallback on_submit)
Sets the on submit callback of the form.
Parameters:
on_submit
The callback to be set.
Returns:
A reference to the current form.
Last updated on