SerenityJS
    Preparing search index...

    Hierarchy (View Summary)

    • Form<number>
      • DialogueForm
    Index

    Constructors

    • Creates a new dialogue form.

      Parameters

      • target: Entity

        The target entity that the dialogue is focused on.

      • title: string

        The title of the dialogue form.

      • Optionalcontent: string

        The content of the dialogue form.

      • fromTrait: boolean = false

        Whether the dialogue form is from a trait.

      Returns DialogueForm

    Properties

    buttons: DialogueFormButton[] = []

    The buttons of the dialogue form.

    content: string

    The dialogue content of the form.

    formId: number = ++Form.formId

    The form id of the form.

    fromTrait: boolean

    Whether the dialogue form is from a trait.

    target: Entity

    The target entity that the dialogue is focused on.

    title: string

    The title of the form.

    type: Dialogue = ModalFormType.Dialogue

    The type of form.

    formId: number = 0

    The next form id to use when creating a new form.

    Methods

    • Adds a button to the dialogue form.

      Parameters

      • text: string

        The text of the button.

      Returns this

      The current instance of the dialogue form.

    • Shows the dialogue synchronously to a player.

      Parameters

      • player: Player

        The player to show the form to.

      • result: FormResult<number>

        The result callback to call when the form is submitted.

      Returns void

    • Shows the dialogue asynchronously to a player.

      Parameters

      • player: Player

        The player to show the form to.

      Returns Promise<number | Error>

      A promise that resolves with the form response or an error.

      If the form is cancelled, it resolves with an error.

      If the form is submitted, it resolves with the form response.