queries: replace some isHidden checks with isSelfHidden
The parents are known to be not hidden in these cases
This commit is contained in:
@@ -61,15 +61,16 @@ public class BankItemQuery extends WidgetItemQuery
|
|||||||
Widget[] children = bank.getDynamicChildren();
|
Widget[] children = bank.getDynamicChildren();
|
||||||
for (int i = 0; i < children.length; i++)
|
for (int i = 0; i < children.length; i++)
|
||||||
{
|
{
|
||||||
if (children[i].getItemId() == ITEM_EMPTY || children[i].isHidden())
|
Widget child = children[i];
|
||||||
|
if (child.getItemId() == ITEM_EMPTY || child.isSelfHidden())
|
||||||
{
|
{
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
// set bounds to same size as default inventory
|
// set bounds to same size as default inventory
|
||||||
Rectangle bounds = children[i].getBounds();
|
Rectangle bounds = child.getBounds();
|
||||||
bounds.setBounds(bounds.x - 1, bounds.y - 1, 32, 32);
|
bounds.setBounds(bounds.x - 1, bounds.y - 1, 32, 32);
|
||||||
// Index is set to 0 because the widget's index does not correlate to the order in the bank
|
// Index is set to 0 because the widget's index does not correlate to the order in the bank
|
||||||
widgetItems.add(new WidgetItem(children[i].getItemId(), children[i].getItemQuantity(), 0, bounds));
|
widgetItems.add(new WidgetItem(child.getItemId(), child.getItemQuantity(), 0, bounds));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return widgetItems;
|
return widgetItems;
|
||||||
|
|||||||
@@ -89,7 +89,7 @@ public class EquipmentItemQuery extends WidgetItemQuery
|
|||||||
Widget parentWidget = client.getWidget(slot);
|
Widget parentWidget = client.getWidget(slot);
|
||||||
Widget itemWidget = parentWidget.getChild(1);
|
Widget itemWidget = parentWidget.getChild(1);
|
||||||
// Check if background icon is hidden. if hidden, item is equipped.
|
// Check if background icon is hidden. if hidden, item is equipped.
|
||||||
boolean equipped = parentWidget.getChild(2).isHidden();
|
boolean equipped = parentWidget.getChild(2).isSelfHidden();
|
||||||
// set bounds to same size as default inventory
|
// set bounds to same size as default inventory
|
||||||
Rectangle bounds = itemWidget.getBounds();
|
Rectangle bounds = itemWidget.getBounds();
|
||||||
bounds.setBounds(bounds.x - 1, bounds.y - 1, 32, 32);
|
bounds.setBounds(bounds.x - 1, bounds.y - 1, 32, 32);
|
||||||
|
|||||||
@@ -81,10 +81,11 @@ public class InventoryWidgetItemQuery extends WidgetItemQuery
|
|||||||
Widget[] children = inventory.getDynamicChildren();
|
Widget[] children = inventory.getDynamicChildren();
|
||||||
for (int i = 0; i < children.length; i++)
|
for (int i = 0; i < children.length; i++)
|
||||||
{
|
{
|
||||||
|
Widget child = children[i];
|
||||||
// set bounds to same size as default inventory
|
// set bounds to same size as default inventory
|
||||||
Rectangle bounds = children[i].getBounds();
|
Rectangle bounds = child.getBounds();
|
||||||
bounds.setBounds(bounds.x - 1, bounds.y - 1, 32, 32);
|
bounds.setBounds(bounds.x - 1, bounds.y - 1, 32, 32);
|
||||||
widgetItems.add(new WidgetItem(children[i].getItemId(), children[i].getItemQuantity(), i, bounds));
|
widgetItems.add(new WidgetItem(child.getItemId(), child.getItemQuantity(), i, bounds));
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -59,10 +59,11 @@ public class ShopItemQuery extends WidgetItemQuery
|
|||||||
Widget[] children = shop.getDynamicChildren();
|
Widget[] children = shop.getDynamicChildren();
|
||||||
for (int i = 1; i < children.length; i++)
|
for (int i = 1; i < children.length; i++)
|
||||||
{
|
{
|
||||||
|
Widget child = children[i];
|
||||||
// set bounds to same size as default inventory
|
// set bounds to same size as default inventory
|
||||||
Rectangle bounds = children[i].getBounds();
|
Rectangle bounds = child.getBounds();
|
||||||
bounds.setBounds(bounds.x - 1, bounds.y - 1, 32, 32);
|
bounds.setBounds(bounds.x - 1, bounds.y - 1, 32, 32);
|
||||||
widgetItems.add(new WidgetItem(children[i].getItemId(), children[i].getItemQuantity(), i - 1, bounds));
|
widgetItems.add(new WidgetItem(child.getItemId(), child.getItemQuantity(), i - 1, bounds));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return widgetItems;
|
return widgetItems;
|
||||||
|
|||||||
Reference in New Issue
Block a user