ge plugin: Display spent price instead of original offer price

This commit is contained in:
Seth
2018-04-02 22:53:36 -05:00
parent a8a2b1bd15
commit 1cf351be15

View File

@@ -134,8 +134,10 @@ public class GrandExchangeOfferSlot extends JPanel
ImageIcon newItemIcon = new ImageIcon(itemImage);
itemIcon.setIcon(newItemIcon);
offerState.setText(getNameForState(newOffer.getState()) + " at " + StackFormatter.formatNumber(newOffer.getPrice()) +
(newOffer.getTotalQuantity() > 1 ? "gp ea" : "gp"));
offerState.setText(getNameForState(newOffer.getState())
+ " at "
+ StackFormatter.formatNumber(newOffer.getState() == GrandExchangeOfferState.BOUGHT ? (newOffer.getSpent() / newOffer.getTotalQuantity()) : newOffer.getPrice())
+ (newOffer.getTotalQuantity() > 1 ? " gp ea" : " gp"));
progressBar.setMaximum(newOffer.getTotalQuantity());
progressBar.setValue(newOffer.getQuantitySold());