Package net.storm.api.widgets
Interface IDialog
public interface IDialog
Interface for interacting with dialog interfaces in the game.
This interface provides methods to handle NPC dialogs, player dialogs, option menus, and various input dialogs. It supports continuing conversations, selecting options, entering text or numeric input, and managing dialog state.
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionbooleanChecks if the dialog can be continued (has a "Click here to continue" prompt).booleanchooseOption(int index) Chooses a dialog option by its one-based index.default booleanchooseOption(String... options) Chooses a dialog option that contains any of the specified text strings.default booleanchooseOption(Predicate<String> option) Chooses a dialog option that matches the specified predicate.voidContinues the dialog by pressing space or clicking the continue button.voidContinues the tutorial dialog by clicking the appropriate button.default voidenterAmount(int input) Enters a numeric amount into an amount input dialog.default voidenterChatChannelName(String input) Enters a chat channel name into the chat channel input dialog.default voidenterFriendName(String input) Enters a friend's name into the friend name input dialog.default voidEnters a name into a general name input dialog.default voidEnters text into a general text input dialog.voidForces the dialog interface to close.voidForces the dialog interface to open.getName()Gets the name displayed in the dialog (typically the NPC name).default IWidgetGets the widget for a dialog option matching the specified text.default IWidgetGets the widget for a dialog option matching the specified predicate.Gets all available dialog option widgets.Gets the title widget displayed above the dialog options.getText()Gets the main text content of the current dialog.default booleanChecks if the dialog has an option matching the specified text.default booleanChecks if the dialog has an option matching the specified predicate.voidSends input to the currently open input dialog with a specific input type.booleanChecks if an input dialog (for entering text or numbers) is currently open.booleanisOpen()Checks if any dialog interface is currently open.default booleanChecks if the dialog is currently showing selectable options.
-
Method Details
-
continueTutorial
void continueTutorial()Continues the tutorial dialog by clicking the appropriate button. Used specifically for tutorial island and similar guided content. -
isEnterInputOpen
boolean isEnterInputOpen()Checks if an input dialog (for entering text or numbers) is currently open.- Returns:
trueif an input dialog is open,falseotherwise
-
isOpen
boolean isOpen()Checks if any dialog interface is currently open.- Returns:
trueif a dialog is open,falseotherwise
-
input
Sends input to the currently open input dialog with a specific input type.- Parameters:
inputType- the type of input (2=friend name, 7=amount, 8=name, 9=text, 10=chat channel)value- the value to input
-
enterFriendName
Enters a friend's name into the friend name input dialog.- Parameters:
input- the friend's name to enter
-
enterChatChannelName
Enters a chat channel name into the chat channel input dialog.- Parameters:
input- the chat channel name to enter
-
enterName
Enters a name into a general name input dialog.- Parameters:
input- the name to enter
-
enterText
Enters text into a general text input dialog.- Parameters:
input- the text to enter
-
enterAmount
default void enterAmount(int input) Enters a numeric amount into an amount input dialog.- Parameters:
input- the amount to enter
-
hasOption
Checks if the dialog has an option matching the specified text.- Parameters:
option- the exact text to match- Returns:
trueif a matching option exists,falseotherwise
-
hasOption
Checks if the dialog has an option matching the specified predicate.- Parameters:
option- the predicate to match against option text- Returns:
trueif a matching option exists,falseotherwise
-
getOption
Gets the widget for a dialog option matching the specified text.- Parameters:
option- the exact text to match- Returns:
- the matching option widget, or
nullif not found
-
getOption
Gets the widget for a dialog option matching the specified predicate.- Parameters:
option- the predicate to match against option text- Returns:
- the matching option widget, or
nullif not found
-
chooseOption
Chooses a dialog option that contains any of the specified text strings.- Parameters:
options- the option texts to search for (partial match)- Returns:
trueif an option was successfully selected,falseotherwise
-
chooseOption
Chooses a dialog option that matches the specified predicate.- Parameters:
option- the predicate to match against option text- Returns:
trueif an option was successfully selected,falseotherwise
-
chooseOption
boolean chooseOption(int index) Chooses a dialog option by its one-based index.- Parameters:
index- the one-based index of the option to select (1 for first option, etc.)- Returns:
trueif the option was successfully selected,falseotherwise
-
canContinue
boolean canContinue()Checks if the dialog can be continued (has a "Click here to continue" prompt).- Returns:
trueif the dialog can be continued,falseotherwise
-
continueSpace
void continueSpace()Continues the dialog by pressing space or clicking the continue button. -
isViewingOptions
default boolean isViewingOptions()Checks if the dialog is currently showing selectable options.- Returns:
trueif options are visible,falseotherwise
-
getOptionTitle
IWidget getOptionTitle()Gets the title widget displayed above the dialog options.- Returns:
- the title widget, or
nullif no title is present
-
getOptions
Gets all available dialog option widgets.- Returns:
- a list of option widgets, empty list if no options are available
-
forceOpen
void forceOpen()Forces the dialog interface to open. This is typically used for debugging or special cases. -
forceClose
void forceClose()Forces the dialog interface to close. -
getText
String getText()Gets the main text content of the current dialog.- Returns:
- the dialog text, or
nullif no dialog is open
-
getName
String getName()Gets the name displayed in the dialog (typically the NPC name).- Returns:
- the name shown in the dialog, or
nullif not available
-