diff options
author | Lulonaut <67191924+Lulonaut@users.noreply.github.com> | 2022-01-30 19:44:54 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-01-30 13:44:54 -0500 |
commit | 73d441245e33461f5ee9e2f44bfc15891f50f9c1 (patch) | |
tree | 5f7c7f13d64d907b38b53bbd6ba4338995527c37 | |
parent | 593b2c8c1078d0bf40d08d3f100afb8f947da422 (diff) | |
download | NotEnoughUpdates-73d441245e33461f5ee9e2f44bfc15891f50f9c1.tar.gz NotEnoughUpdates-73d441245e33461f5ee9e2f44bfc15891f50f9c1.tar.bz2 NotEnoughUpdates-73d441245e33461f5ee9e2f44bfc15891f50f9c1.zip |
fix missing accessories page in AccessoryBagOverlay (#71)
-rw-r--r-- | src/main/java/io/github/moulberry/notenoughupdates/miscgui/AccessoryBagOverlay.java | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/src/main/java/io/github/moulberry/notenoughupdates/miscgui/AccessoryBagOverlay.java b/src/main/java/io/github/moulberry/notenoughupdates/miscgui/AccessoryBagOverlay.java index 929176e3..584f6bf7 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/miscgui/AccessoryBagOverlay.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/miscgui/AccessoryBagOverlay.java @@ -5,6 +5,7 @@ import com.google.gson.JsonElement; import com.google.gson.JsonObject; import io.github.moulberry.notenoughupdates.NEUEventListener; import io.github.moulberry.notenoughupdates.NotEnoughUpdates; +import io.github.moulberry.notenoughupdates.auction.APIManager; import io.github.moulberry.notenoughupdates.core.util.StringUtils; import io.github.moulberry.notenoughupdates.profileviewer.PlayerStats; import io.github.moulberry.notenoughupdates.util.Constants; @@ -32,12 +33,12 @@ import org.lwjgl.opengl.GL14; import java.awt.*; import java.io.ByteArrayInputStream; import java.io.IOException; -import java.util.*; import java.util.List; +import java.util.*; import java.util.regex.Matcher; import java.util.regex.Pattern; -import static io.github.moulberry.notenoughupdates.util.GuiTextures.*; +import static io.github.moulberry.notenoughupdates.util.GuiTextures.accessory_bag_overlay; public class AccessoryBagOverlay { private static final int TAB_BASIC = 0; @@ -565,14 +566,22 @@ public class AccessoryBagOverlay { if (o1Auc != null && o1Auc.has("price")) { cost1 = o1Auc.get("price").getAsFloat(); } else { - cost1 = NotEnoughUpdates.INSTANCE.manager.auctionManager.getCraftCost(o1).craftCost; + APIManager.CraftInfo info = NotEnoughUpdates.INSTANCE.manager.auctionManager.getCraftCost(o1); + if (info != null) + cost1 = info.craftCost; + else + cost1 = 0; } float cost2; JsonObject o2Auc = NotEnoughUpdates.INSTANCE.manager.auctionManager.getItemAuctionInfo(o2); if (o2Auc != null && o2Auc.has("price")) { cost2 = o2Auc.get("price").getAsFloat(); } else { - cost2 = NotEnoughUpdates.INSTANCE.manager.auctionManager.getCraftCost(o2).craftCost; + APIManager.CraftInfo info = NotEnoughUpdates.INSTANCE.manager.auctionManager.getCraftCost(o2); + if (info != null) + cost2 = info.craftCost; + else + cost2 = 0; } if (cost1 == -1 && cost2 == -1) return o1.compareTo(o2); |