Search in sources :

Example 1 with WidgetNode

use of org.powerbot.bot.rt4.client.WidgetNode in project powerbot by powerbot.

the class Component method parentId.

public int parentId() {
    final Client client = ctx.client();
    final org.powerbot.bot.rt4.client.Widget w = getInternal();
    if (client == null || w == null) {
        return -1;
    }
    final int p = w.getParentId();
    if (p != -1) {
        return p;
    }
    final int uid = id() >>> 16;
    for (final WidgetNode node : new HashTable<WidgetNode>(client.getWidgetTable(), WidgetNode.class)) {
        if (uid == node.getUid()) {
            return (int) node.getId();
        }
    }
    return -1;
}
Also used : HashTable(org.powerbot.bot.rt4.HashTable) WidgetNode(org.powerbot.bot.rt4.client.WidgetNode) Client(org.powerbot.bot.rt4.client.Client) Point(java.awt.Point)

Aggregations

Point (java.awt.Point)1 HashTable (org.powerbot.bot.rt4.HashTable)1 Client (org.powerbot.bot.rt4.client.Client)1 WidgetNode (org.powerbot.bot.rt4.client.WidgetNode)1