use of org.powerbot.bot.rt6.client.Widget in project powerbot by powerbot.
the class Component method tooltip.
public String tooltip() {
final Widget component = getInternalComponent();
String tip = "";
if (component != null && (tip = component.getTooltip()) == null) {
tip = "";
}
return tip;
}
use of org.powerbot.bot.rt6.client.Widget in project powerbot by powerbot.
the class Widgets method get.
/**
* {@inheritDoc}
*/
@Override
protected List<Widget> get() {
final Client client = ctx.client();
if (client == null) {
return new ArrayList<Widget>(0);
}
final Object[] cache = client.getWidgets();
if (cache == null || cache.length == 0) {
return new ArrayList<Widget>(0);
}
final List<Widget> w = new ArrayList<Widget>(cache.length);
for (int i = 0; i < cache.length; i++) {
w.add(new Widget(ctx, i));
}
return w;
}
use of org.powerbot.bot.rt6.client.Widget in project powerbot by powerbot.
the class Component method _screenPoint.
private Point _screenPoint(final int depth) {
if (depth > RECURSION_DEPTH) {
return new Point(-1, -1);
}
final Client client = ctx.client();
final Widget component = getInternalComponent();
if (client == null || component == null) {
return new Point(-1, -1);
}
final int pId = parentId();
int x = 0, y = 0;
if (pId != -1) {
final Point point = ctx.widgets.component(pId >> 16, pId & 0xffff)._screenPoint(depth + 1);
x = point.x;
y = point.y;
} else {
final Rectangle[] bounds = client.getWidgetBoundsArray();
final int index = component.getBoundsArrayIndex();
if (bounds != null && index > 0 && index < bounds.length && bounds[index] != null) {
return new Point(bounds[index].x, bounds[index].y);
}
}
if (pId != -1) {
final Component child = ctx.widgets.component(pId >> 16, pId & 0xffff);
final int horizontalScrollSize = child.scrollWidthMax(), verticalScrollSize = child.scrollHeightMax();
if (horizontalScrollSize > 0 || verticalScrollSize > 0) {
x -= child.scrollX();
y -= child.scrollY();
}
}
x += component.getX();
y += component.getY();
return new Point(x, y);
}
use of org.powerbot.bot.rt6.client.Widget in project powerbot by powerbot.
the class Component method text.
public String text() {
final Widget component = getInternalComponent();
String text = "";
if (component != null && (text = component.getText()) == null) {
text = "";
}
return text;
}
use of org.powerbot.bot.rt6.client.Widget in project powerbot by powerbot.
the class Component method actions.
public String[] actions() {
final Widget component = getInternalComponent();
String[] actions = new String[0];
if (component != null) {
if ((actions = component.getActions()) == null) {
actions = new String[0];
}
}
return actions.clone();
}