Interface DialogBase
Represents the base of all dialogs.
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic interface
Builder interface for creating dialog bases.static enum
Actions to take after the dialog is closed. -
Method Summary
Modifier and TypeMethodDescriptionThe action to take after the dialog is closed.body()
The body of the dialog.static DialogBase.Builder
Creates a new dialog base builder.boolean
Returns if this dialog can be closed with the "escape" keybind.static DialogBase
create
(Component title, @Nullable Component externalTitle, boolean canCloseWithEscape, boolean pause, DialogBase.DialogAfterAction afterAction, List<? extends DialogBody> body, List<? extends DialogInput> inputs) Creates a new dialog base.The external title of the dialog.inputs()
The inputs of the dialog.boolean
pause()
Returns if this dialog should pause the game when opened (single-player only).title()
The title of the dialog.
-
Method Details
-
create
@Contract(value="_, _, _, _, _, _, _ -> new", pure=true) static DialogBase create(Component title, @Nullable Component externalTitle, boolean canCloseWithEscape, boolean pause, DialogBase.DialogAfterAction afterAction, List<? extends DialogBody> body, List<? extends DialogInput> inputs) Creates a new dialog base.- Parameters:
title
- the title of the dialogexternalTitle
- the external title of the dialog, or null if not setcanCloseWithEscape
- if the dialog can be closed with the "escape" keybindpause
- if the dialog should pause the game when opened (single-player only)afterAction
- the action to take after the dialog is closedbody
- the body of the dialoginputs
- the inputs of the dialog- Returns:
- a new dialog base instance
-
builder
Creates a new dialog base builder.- Parameters:
title
- the title of the dialog- Returns:
- a new dialog base builder
-
title
The title of the dialog.- Returns:
- the title
-
externalTitle
The external title of the dialog. This title is used on buttons that open this dialog.- Returns:
- the external title or null
-
canCloseWithEscape
Returns if this dialog can be closed with the "escape" keybind.- Returns:
- if the dialog can be closed with "escape"
-
pause
Returns if this dialog should pause the game when opened (single-player only).- Returns:
- if the dialog pauses the game
-
afterAction
The action to take after the dialog is closed.- Returns:
- the action to take after the dialog is closed
-
body
The body of the dialog.The body is a list of
DialogBody
elements that will be displayed in the dialog.- Returns:
- the body of the dialog
-
inputs
The inputs of the dialog.The inputs are a list of
DialogInput
elements that will be displayed in the dialog.- Returns:
- the inputs of the dialog
-