Class DialogueButton.Builder
java.lang.Object
com.pixelmonmod.pixelmon.api.dialogue.DialogueButton.Builder
- Enclosing class:
- DialogueButton
A builder for
DialogueButton
s.-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionacceptedInputs
(InputPattern... acceptedInputs) Sets the patterns that the user's input must match for the button to be clickable.acceptedInputs
(Iterable<InputPattern> acceptedInputs) Sets the patterns that the user's input must match for the button to be clickable.backgroundColor
(int red, int green, int blue, int alpha) Sets the background color of the button.backgroundColor
(Color backgroundColor) Sets the background color of the button.backgroundHoverColor
(int red, int green, int blue, int alpha) Sets the background color of the button that is displayed when the user hovers their mouse over it.backgroundHoverColor
(Color backgroundHoverColor) Sets the background color of the button that is displayed when the user hovers their mouse over it.build()
Creates a newDialogueButton
from the builder.onClick
(@Nullable Consumer<DialogueInputEvent.Submitted> onClick) Sets the handler for when the user clicks the button.Sets the text of the button.text
(net.minecraft.network.chat.Component text) Sets the text of the button.
-
Constructor Details
-
Builder
protected Builder()
-
-
Method Details
-
text
Sets the text of the button.- Parameters:
text
- The text.- Returns:
- The
DialogueButton.Builder
.
-
text
Sets the text of the button.- Parameters:
text
- The text.- Returns:
- The
DialogueButton.Builder
.
-
backgroundColor
Sets the background color of the button.- Parameters:
red
- The red value.green
- The green value.blue
- The blue value.alpha
- The alpha value (transparency).- Returns:
- The
DialogueButton.Builder
.
-
backgroundColor
Sets the background color of the button.- Parameters:
backgroundColor
- The background color.- Returns:
- The
DialogueButton.Builder
.
-
backgroundHoverColor
Sets the background color of the button that is displayed when the user hovers their mouse over it.- Parameters:
red
- The red value.green
- The green value.blue
- The blue value.alpha
- The alpha value (transparency).- Returns:
- The
DialogueButton.Builder
.
-
backgroundHoverColor
Sets the background color of the button that is displayed when the user hovers their mouse over it.- Parameters:
backgroundHoverColor
- The background color.- Returns:
- The
DialogueButton.Builder
.
-
acceptedInputs
Sets the patterns that the user's input must match for the button to be clickable.- Parameters:
acceptedInputs
- The patterns.- Returns:
- The
DialogueButton.Builder
.
-
acceptedInputs
Sets the patterns that the user's input must match for the button to be clickable.- Parameters:
acceptedInputs
- The patterns.- Returns:
- The
DialogueButton.Builder
.
-
onClick
public DialogueButton.Builder onClick(@Nullable @Nullable Consumer<DialogueInputEvent.Submitted> onClick) Sets the handler for when the user clicks the button.- Parameters:
onClick
- The handler.- Returns:
- The
DialogueButton.Builder
.
-
build
Creates a newDialogueButton
from the builder.- Returns:
- The
DialogueButton
.
-