aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorLulonaut <67191924+Lulonaut@users.noreply.github.com>2022-01-30 19:44:54 +0100
committerGitHub <noreply@github.com>2022-01-30 13:44:54 -0500
commit73d441245e33461f5ee9e2f44bfc15891f50f9c1 (patch)
tree5f7c7f13d64d907b38b53bbd6ba4338995527c37 /src
parent593b2c8c1078d0bf40d08d3f100afb8f947da422 (diff)
downloadNotEnoughUpdates-73d441245e33461f5ee9e2f44bfc15891f50f9c1.tar.gz
NotEnoughUpdates-73d441245e33461f5ee9e2f44bfc15891f50f9c1.tar.bz2
NotEnoughUpdates-73d441245e33461f5ee9e2f44bfc15891f50f9c1.zip
fix missing accessories page in AccessoryBagOverlay (#71)
Diffstat (limited to 'src')
-rw-r--r--src/main/java/io/github/moulberry/notenoughupdates/miscgui/AccessoryBagOverlay.java17
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);