Skip to Content
⚠ Under Construction
ReferenceC++ APIMessageForm

endstone::MessageForm

Represents a form with two buttons.

Bases: endstone::Form< MessageForm >

Types:

NameDescription
OnSubmitCallback

Functions:

NameDescription
getButton1Get the text of button1.
getButton2Get the text of button2.
getContentGet the content of the form.
getOnSubmitGets the on submit callback of the form.
setButton1Set the text of button1.
setButton2Set the text of button2.
setContentSet the content of the form.
setOnSubmitSets 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