Package org.vyang.parkourwarrior
Class DialogScreen
java.lang.Object
org.vyang.parkourwarrior.DialogScreen
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 Summary
FieldsModifier and TypeFieldDescriptionCallback invoked with the dialog result (truefor yes,falsefor no).intThe currently highlighted selection (yes or no).static final intConstant for the no selection state.static final intConstant for the yes selection state.static final intConstant for dialog with only a no option.static final intConstant for informational dialog without selection.static final intConstant for dialog with only a yes option.static final intConstant for yes/no selection dialog.intThe current dialog mode determining which type of prompt to display.intThe target map state to transition to when yes is selected (used as fallback when no callback is set).intThe map state to return to when no is selected (used as fallback when no callback is set). -
Constructor Summary
ConstructorsConstructorDescriptionDialogScreen(ParkourMain parkourMain) Constructs a newDialogScreenwith a reference to the main game panel. -
Method Summary
Modifier and TypeMethodDescriptionvoiddrawDialogScreen(Graphics2D graphics2D) Draws the dialog screen based on the currentdialogueOption.
-
Field Details
-
dialogueOption
public int dialogueOptionThe current dialog mode determining which type of prompt to display.- Since:
- 1.4
-
DIALOGUE_OPTION_YES_NO
public static final int DIALOGUE_OPTION_YES_NOConstant for yes/no selection dialog.- Since:
- 1.4
- See Also:
-
DIALOGUE_OPTION_YES
public static final int DIALOGUE_OPTION_YESConstant for dialog with only a yes option.- Since:
- 1.4
- See Also:
-
DIALOGUE_OPTION_NO
public static final int DIALOGUE_OPTION_NOConstant for dialog with only a no option.- Since:
- 1.4
- See Also:
-
DIALOGUE_OPTION_NONE
public static final int DIALOGUE_OPTION_NONEConstant for informational dialog without selection.- Since:
- 1.4
- See Also:
-
currentSelection
public int currentSelectionThe currently highlighted selection (yes or no).- Since:
- 1.4
-
DIALOGUE_CURRENT_YES
public static final int DIALOGUE_CURRENT_YESConstant for the yes selection state.- Since:
- 1.4
- See Also:
-
DIALOGUE_CURRENT_NO
public static final int DIALOGUE_CURRENT_NOConstant for the no selection state.- Since:
- 1.4
- See Also:
-
gotoMapState
public int gotoMapStateThe target map state to transition to when yes is selected (used as fallback when no callback is set).- Since:
- 1.4
-
initialMapState
public int initialMapStateThe map state to return to when no is selected (used as fallback when no callback is set).- Since:
- 1.4
-
callback
Callback invoked with the dialog result (truefor yes,falsefor no). When set, this takes precedence overgotoMapStateandinitialMapState.- Since:
- 1.4
-
-
Constructor Details
-
DialogScreen
Constructs a newDialogScreenwith a reference to the main game panel.- Parameters:
parkourMain- the main game panel instance- Since:
- 1.4
-
-
Method Details
-
drawDialogScreen
Draws the dialog screen based on the currentdialogueOption.Displays an informational dialog when set to
DIALOGUE_OPTION_NONE, or a selection dialog (yes/no) for other modes.- Parameters:
graphics2D- theGraphics2Dcontext to draw on- Since:
- 1.4
-