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;
}
Aggregations