Package net.storm.sdk.widgets
Class Widgets
java.lang.Object
net.storm.sdk.widgets.Widgets
Provides utility methods for interacting with the game's widget system.
Widgets are the fundamental UI elements in the game client, representing everything from inventory slots and chat boxes to bank interfaces and skill menus. This class offers methods to query, retrieve, and check the visibility of widgets.
Widgets are organized hierarchically using a group/id/child structure:
- Group: The parent interface (e.g., inventory, bank, skills)
- ID: A specific widget within the group
- Child: A child element within a widget (optional)
Example Usage:
// Get a specific widget by group and id
IWidget bankWidget = Widgets.get(12, 0);
// Check if a widget is visible
if (Widgets.isVisible(bankWidget)) {
// Interact with the widget
}
// Get all widgets in a group matching a filter
List<IWidget> itemWidgets = Widgets.getAll(149, widget -> widget.getItemId() != -1);
// Close all open interfaces
Widgets.closeInterfaces();
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidCloses all currently open interfaces.static IWidgetget(int component) Retrieves a widget by its packed component ID.static IWidgetget(int group, int id) Retrieves a specific widget by its group and ID.static IWidgetget(int group, int id, int child) Retrieves a specific widget by its group, ID, and child index.static IWidgetRetrieves the first widget within a group that matches the given filter.static IWidgetget(InterfaceAddress interfaceAddress) Deprecated, for removal: This API element is subject to removal in a future version.This method is scheduled for removal.getAll(int group) Retrieves all widgets within the specified group.Retrieves all widgets within the specified group that match the given filter.getChild(int component, int child) Retrieves a child widget from a packed component ID.getChildren(int group, int id, int child, Predicate<IWidget> filter) Retrieves all children of the widget at the specified group, ID, and child index that match the filter.getChildren(int group, int id, Predicate<IWidget> filter) Retrieves all children of the widget at the specified group and ID that match the filter.getChildren(int component, Predicate<IWidget> filter) Retrieves all children of the widget with the specified packed component ID that match the filter.getChildren(IWidget widget, Predicate<IWidget> filter) Retrieves all children of a widget that match the specified filter.getChildren(InterfaceAddress interfaceAddress, Predicate<IWidget> filter) Deprecated, for removal: This API element is subject to removal in a future version.This method is scheduled for removal.static booleanisVisible(int component) Checks whether the widget with the specified packed component ID is visible.static booleanisVisible(int group, int id) Checks whether the widget at the specified group and ID is currently visible.static booleanisVisible(int group, int id, int child) Checks whether the widget at the specified group, ID, and child index is visible.static booleanChecks whether the specified widget is currently visible on screen.static booleanisVisible(InterfaceAddress interfaceAddress) Deprecated, for removal: This API element is subject to removal in a future version.This method is scheduled for removal.
-
Constructor Details
-
Widgets
public Widgets()
-
-
Method Details
-
getAll
Retrieves all widgets within the specified group.- Parameters:
group- the widget group ID to query- Returns:
- a list of all widgets in the specified group, or an empty list if none exist
-
getAll
Retrieves all widgets within the specified group that match the given filter.- Parameters:
group- the widget group ID to queryfilter- a predicate to filter the widgets- Returns:
- a list of widgets matching the filter, or an empty list if none match
-
get
Retrieves a specific widget by its group and ID.- Parameters:
group- the widget group IDid- the widget ID within the group- Returns:
- the widget if found, or null if not found
-
get
Retrieves a specific widget by its group, ID, and child index.- Parameters:
group- the widget group IDid- the widget ID within the groupchild- the child index within the widget- Returns:
- the child widget if found, or null if not found
-
get
Retrieves a widget by its packed component ID.The component ID is a packed integer containing both the group and widget ID.
- Parameters:
component- the packed component ID- Returns:
- the widget if found, or null if not found
-
get
Deprecated, for removal: This API element is subject to removal in a future version.This method is scheduled for removal. Useget(int, int)instead.Retrieves a widget by its interface address.- Parameters:
interfaceAddress- the interface address specifying the widget location- Returns:
- the widget if found, or null if not found
-
get
Retrieves the first widget within a group that matches the given filter.- Parameters:
group- the widget group ID to searchfilter- a predicate to match widgets- Returns:
- the first matching widget, or null if none match
-
getChild
Retrieves a child widget from a packed component ID.- Parameters:
component- the packed component ID of the parent widgetchild- the child index within the widget- Returns:
- the child widget if found, or null if not found
-
isVisible
Checks whether the specified widget is currently visible on screen.- Parameters:
widget- the widget to check- Returns:
- true if the widget is visible, false otherwise
-
isVisible
public static boolean isVisible(int group, int id) Checks whether the widget at the specified group and ID is currently visible.- Parameters:
group- the widget group IDid- the widget ID within the group- Returns:
- true if the widget is visible, false otherwise
-
isVisible
public static boolean isVisible(int group, int id, int child) Checks whether the widget at the specified group, ID, and child index is visible.- Parameters:
group- the widget group IDid- the widget ID within the groupchild- the child index within the widget- Returns:
- true if the widget is visible, false otherwise
-
isVisible
public static boolean isVisible(int component) Checks whether the widget with the specified packed component ID is visible.- Parameters:
component- the packed component ID- Returns:
- true if the widget is visible, false otherwise
-
isVisible
Deprecated, for removal: This API element is subject to removal in a future version.This method is scheduled for removal. UseisVisible(int, int)instead.Checks whether the widget at the specified interface address is visible.- Parameters:
interfaceAddress- the interface address of the widget- Returns:
- true if the widget is visible, false otherwise
-
getChildren
Retrieves all children of a widget that match the specified filter.- Parameters:
widget- the parent widgetfilter- a predicate to filter child widgets- Returns:
- a list of matching child widgets, or an empty list if none match
-
getChildren
Retrieves all children of the widget at the specified group and ID that match the filter.- Parameters:
group- the widget group IDid- the widget ID within the groupfilter- a predicate to filter child widgets- Returns:
- a list of matching child widgets, or an empty list if none match
-
getChildren
Retrieves all children of the widget at the specified group, ID, and child index that match the filter.- Parameters:
group- the widget group IDid- the widget ID within the groupchild- the child index within the widgetfilter- a predicate to filter child widgets- Returns:
- a list of matching child widgets, or an empty list if none match
-
getChildren
Retrieves all children of the widget with the specified packed component ID that match the filter.- Parameters:
component- the packed component IDfilter- a predicate to filter child widgets- Returns:
- a list of matching child widgets, or an empty list if none match
-
getChildren
@Deprecated(forRemoval=true) public static List<IWidget> getChildren(InterfaceAddress interfaceAddress, Predicate<IWidget> filter) Deprecated, for removal: This API element is subject to removal in a future version.This method is scheduled for removal. UsegetChildren(int, int, Predicate)instead.Retrieves all children of the widget at the specified interface address that match the filter.- Parameters:
interfaceAddress- the interface address of the parent widgetfilter- a predicate to filter child widgets- Returns:
- a list of matching child widgets, or an empty list if none match
-
closeInterfaces
public static void closeInterfaces()Closes all currently open interfaces.This is equivalent to pressing the Escape key to close modal interfaces such as the bank, shop, or dialog windows.
-