Merge pull request #1252 from sethtroll/addgespenttext

ge plugin: Display spent price instead of original offer price
This commit is contained in:
Adam
2018-04-13 08:49:02 -04:00
committed by GitHub

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());