Class Dialogue.Builder

java.lang.Object
org.aselstudios.luxdialoguesapi.Builders.Dialogue.Builder
Enclosing class:
Dialogue

public static class Dialogue.Builder extends Object
Builder for Dialogue instances.
  • Constructor Details

    • Builder

      public Builder()
  • Method Details

    • setDialogueID

      public Dialogue.Builder setDialogueID(String dialogueID)
      Sets the unique ID of this dialogue.
      Parameters:
      dialogueID - unique dialogue identifier
      Returns:
      this builder for chaining
    • setEffect

      public Dialogue.Builder setEffect(String effect)
      Sets a visual or gameplay effect identifier applied during the dialogue.
      Parameters:
      effect - effect identifier, implementation specific
      Returns:
      this builder for chaining
    • setRange

      public Dialogue.Builder setRange(Double range)
      Sets the range in blocks in which the dialogue should be visible/active.
      Parameters:
      range - range in blocks
      Returns:
      this builder for chaining
    • setPreventExit

      public Dialogue.Builder setPreventExit(Boolean value)
      Sets whether the player is prevented from exiting the dialogue manually.
      Parameters:
      value - true to prevent manual exit
      Returns:
      this builder for chaining
    • setPreventSkip

      public Dialogue.Builder setPreventSkip(Boolean value)
      Sets whether the player is prevented from skipping pages.
      Parameters:
      value - true to prevent skipping
      Returns:
      this builder for chaining
    • setCharacterNameText

      public Dialogue.Builder setCharacterNameText(String text, String color, Integer offset)
      Configures the character name text.
      Parameters:
      text - display text
      color - color code or identifier
      offset - vertical offset in pixels/lines (implementation specific)
      Returns:
      this builder for chaining
    • setCharacterImage

      public Dialogue.Builder setCharacterImage(String image, String color, Integer offset)
      Configures the character image.
      Parameters:
      image - image identifier
      color - color tint
      offset - vertical offset
      Returns:
      this builder for chaining
    • setArrowImage

      public Dialogue.Builder setArrowImage(String image, String color, Integer offset)
      Configures the arrow image used for prompts.
      Parameters:
      image - image identifier
      color - color tint
      offset - vertical offset
      Returns:
      this builder for chaining
    • setDialogueBackgroundImage

      public Dialogue.Builder setDialogueBackgroundImage(String image, String color, Integer offset)
      Configures the dialogue background image.
      Parameters:
      image - image identifier
      color - color tint
      offset - vertical offset
      Returns:
      this builder for chaining
    • setAnswerBackgroundImage

      public Dialogue.Builder setAnswerBackgroundImage(String image, String color, Integer offset)
      Configures the answer background image.
      Parameters:
      image - image identifier
      color - color tint
      offset - vertical offset
      Returns:
      this builder for chaining
    • setNameImage

      public Dialogue.Builder setNameImage(String startImage, String midImage, String endImage, String color, Integer offset)
      Configures the composite name background image.
      Parameters:
      startImage - starting segment image
      midImage - middle segment image
      endImage - ending segment image
      color - color tint
      offset - vertical offset
      Returns:
      this builder for chaining
    • setFogImage

      public Dialogue.Builder setFogImage(String image, String color)
      Configures the fog overlay image.
      Parameters:
      image - image identifier
      color - color tint
      Returns:
      this builder for chaining
    • setDialogueText

      public Dialogue.Builder setDialogueText(String color, Integer offset)
      Configures dialogue text color and offset.
      Parameters:
      color - text color
      offset - vertical offset
      Returns:
      this builder for chaining
    • setAnswerText

      public Dialogue.Builder setAnswerText(String color, Integer offset, String selectedColor)
      Configures answer text formatting.
      Parameters:
      color - normal answer color
      offset - vertical offset
      selectedColor - color used for the selected answer
      Returns:
      this builder for chaining
    • setAnswerNumbers

      public Dialogue.Builder setAnswerNumbers(Boolean value)
      Enables or disables numeric prefixes for answers.
      Parameters:
      value - true to show answer numbers
      Returns:
      this builder for chaining
    • setDialogueSpeed

      public Dialogue.Builder setDialogueSpeed(Integer dialogueSpeed)
      Sets the dialogue typing speed.
      Parameters:
      dialogueSpeed - speed value (implementation specific)
      Returns:
      this builder for chaining
    • setTypingSound

      public Dialogue.Builder setTypingSound(String typingSound, String typingSoundSource, Double typingSoundVolume, Double typingSoundPitch)
      Configures the typing sound effect.
      Parameters:
      typingSound - sound name
      typingSoundSource - sound source (e.g. MASTER, VOICE)
      typingSoundVolume - volume (0.0–1.0)
      typingSoundPitch - pitch
      Returns:
      this builder for chaining
    • setSelectionSound

      public Dialogue.Builder setSelectionSound(String selectionSound, String selectionSoundSource, Double selectionSoundVolume, Double selectionSoundPitch)
      Configures the answer selection sound effect.
      Parameters:
      selectionSound - sound name
      selectionSoundSource - sound source
      selectionSoundVolume - volume (0.0–1.0)
      selectionSoundPitch - pitch
      Returns:
      this builder for chaining
    • addPage

      public Dialogue.Builder addPage(Page page)
      Adds a page to this dialogue.
      Parameters:
      page - page instance
      Returns:
      this builder for chaining
    • build

      public Dialogue build()
      Builds the Dialogue instance.

      Missing required fields are logged to console instead of throwing, but an empty page list is treated as an error.

      Returns:
      built dialogue (may be incomplete if required fields are missing)