api: modify Widget.getWidgetItem to return widget items when no item exists
This allows plugins to get the canvas bounds of where items would be if they existed. Update existing usages to account for the new behavior.
This commit is contained in:
@@ -457,6 +457,7 @@ class DevToolsOverlay extends Overlay
|
||||
|
||||
WidgetItem widgetItem = widget.getWidgetItem(itemIndex);
|
||||
if (widgetItem == null
|
||||
|| widgetItem.getId() < 0
|
||||
|| widgetItem.getId() == ITEM_EMPTY
|
||||
|| widgetItem.getId() == ITEM_FILLED)
|
||||
{
|
||||
|
||||
@@ -120,7 +120,7 @@ public class ExaminePlugin extends Plugin
|
||||
int widgetChild = TO_CHILD(widgetId);
|
||||
Widget widget = client.getWidget(widgetGroup, widgetChild);
|
||||
WidgetItem widgetItem = widget.getWidgetItem(event.getActionParam());
|
||||
quantity = widgetItem != null ? widgetItem.getQuantity() : 1;
|
||||
quantity = widgetItem != null && widgetItem.getId() >= 0 ? widgetItem.getQuantity() : 1;
|
||||
break;
|
||||
}
|
||||
case EXAMINE_ITEM_BANK_EQ:
|
||||
|
||||
Reference in New Issue
Block a user