Interface DialogBase


@NonExtendable public interface DialogBase
Represents the base of all dialogs.
  • 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 dialog
      externalTitle - the external title of the dialog, or null if not set
      canCloseWithEscape - if the dialog can be closed with the "escape" keybind
      pause - if the dialog should pause the game when opened (single-player only)
      afterAction - the action to take after the dialog is closed
      body - the body of the dialog
      inputs - the inputs of the dialog
      Returns:
      a new dialog base instance
    • builder

      @Contract(value="_ -> new", pure=true) static DialogBase.Builder builder(Component title)
      Creates a new dialog base builder.
      Parameters:
      title - the title of the dialog
      Returns:
      a new dialog base builder
    • title

      @Contract(pure=true) Component title()
      The title of the dialog.
      Returns:
      the title
    • externalTitle

      @Contract(pure=true) @Nullable Component externalTitle()
      The external title of the dialog. This title is used on buttons that open this dialog.
      Returns:
      the external title or null
    • canCloseWithEscape

      @Contract(pure=true) boolean canCloseWithEscape()
      Returns if this dialog can be closed with the "escape" keybind.
      Returns:
      if the dialog can be closed with "escape"
    • pause

      @Contract(pure=true) boolean 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