Class DialogScreen

java.lang.Object
org.vyang.parkourwarrior.DialogScreen

public class DialogScreen extends Object
Dialog screen class for Parkour Warrior.

This class handles rendering of overlay dialogs on the game screen, supporting both informational messages (with a simple "Press ENTER to proceed" prompt) and yes/no selection prompts. Navigation and results are handled via a callback mechanism.

Since:
1.4
  • Field Details

    • dialogueOption

      public int dialogueOption
      The current dialog mode determining which type of prompt to display.
      Since:
      1.4
    • DIALOGUE_OPTION_YES_NO

      public static final int DIALOGUE_OPTION_YES_NO
      Constant for yes/no selection dialog.
      Since:
      1.4
      See Also:
    • DIALOGUE_OPTION_YES

      public static final int DIALOGUE_OPTION_YES
      Constant for dialog with only a yes option.
      Since:
      1.4
      See Also:
    • DIALOGUE_OPTION_NO

      public static final int DIALOGUE_OPTION_NO
      Constant for dialog with only a no option.
      Since:
      1.4
      See Also:
    • DIALOGUE_OPTION_NONE

      public static final int DIALOGUE_OPTION_NONE
      Constant for informational dialog without selection.
      Since:
      1.4
      See Also:
    • currentSelection

      public int currentSelection
      The currently highlighted selection (yes or no).
      Since:
      1.4
    • DIALOGUE_CURRENT_YES

      public static final int DIALOGUE_CURRENT_YES
      Constant for the yes selection state.
      Since:
      1.4
      See Also:
    • DIALOGUE_CURRENT_NO

      public static final int DIALOGUE_CURRENT_NO
      Constant for the no selection state.
      Since:
      1.4
      See Also:
    • gotoMapState

      public int gotoMapState
      The target map state to transition to when yes is selected (used as fallback when no callback is set).
      Since:
      1.4
    • initialMapState

      public int initialMapState
      The map state to return to when no is selected (used as fallback when no callback is set).
      Since:
      1.4
    • callback

      public Consumer<Boolean> callback
      Callback invoked with the dialog result (true for yes, false for no). When set, this takes precedence over gotoMapState and initialMapState.
      Since:
      1.4
  • Constructor Details

    • DialogScreen

      public DialogScreen(ParkourMain parkourMain)
      Constructs a new DialogScreen with a reference to the main game panel.
      Parameters:
      parkourMain - the main game panel instance
      Since:
      1.4
  • Method Details

    • drawDialogScreen

      public void drawDialogScreen(Graphics2D graphics2D)
      Draws the dialog screen based on the current dialogueOption.

      Displays an informational dialog when set to DIALOGUE_OPTION_NONE, or a selection dialog (yes/no) for other modes.

      Parameters:
      graphics2D - the Graphics2D context to draw on
      Since:
      1.4