Merge pull request #5694 from deathbeam/examine-placeholder
Make examine work for placeholder IDs and smithing interface
This commit is contained in:
@@ -219,6 +219,15 @@ public class ExaminePlugin extends Plugin
|
||||
itemId = widgetItem.getItemId();
|
||||
}
|
||||
}
|
||||
else if (WidgetInfo.SMITHING_INVENTORY_ITEMS_CONTAINER.getGroupId() == widgetGroup)
|
||||
{
|
||||
Widget widgetItem = widget.getChild(2);
|
||||
if (widgetItem != null)
|
||||
{
|
||||
quantity = widgetItem.getItemQuantity();
|
||||
itemId = widgetItem.getItemId();
|
||||
}
|
||||
}
|
||||
else if (WidgetInfo.BANK_INVENTORY_ITEMS_CONTAINER.getGroupId() == widgetGroup
|
||||
|| WidgetInfo.RUNE_POUCH_ITEM_CONTAINER.getGroupId() == widgetGroup)
|
||||
{
|
||||
@@ -261,17 +270,15 @@ public class ExaminePlugin extends Plugin
|
||||
|
||||
if (itemComposition != null)
|
||||
{
|
||||
executor.submit(() -> getItemPrice(itemComposition, itemQuantity));
|
||||
final int id = itemManager.canonicalize(itemComposition.getId());
|
||||
executor.submit(() -> getItemPrice(id, itemComposition, itemQuantity));
|
||||
}
|
||||
}
|
||||
|
||||
private void getItemPrice(ItemComposition itemComposition, int quantity)
|
||||
private void getItemPrice(int id, ItemComposition itemComposition, int quantity)
|
||||
{
|
||||
// convert to unnoted id
|
||||
final boolean note = itemComposition.getNote() != -1;
|
||||
final int id = note ? itemComposition.getLinkedNoteId() : itemComposition.getId();
|
||||
|
||||
|
||||
// quantity is at least 1
|
||||
quantity = Math.max(1, quantity);
|
||||
int itemCompositionPrice = itemComposition.getPrice();
|
||||
final int gePrice = itemManager.getItemPrice(id);
|
||||
final int alchPrice = itemCompositionPrice <= 0 ? 0 : Math.round(itemCompositionPrice * HIGH_ALCHEMY_CONSTANT);
|
||||
|
||||
Reference in New Issue
Block a user