diff options
author | Lorenz <lo.scherf@gmail.com> | 2022-08-10 19:37:16 +0200 |
---|---|---|
committer | Lorenz <lo.scherf@gmail.com> | 2022-08-10 19:37:16 +0200 |
commit | 610595e0df9691220e0083bd34e769ea27323f8f (patch) | |
tree | 1fac929a5b5f89c70ee88d4030151ff73dabc0a6 /src/main | |
parent | a87efbe79b297e2b1ddcd7966d3dadcece80b917 (diff) | |
download | NotEnoughUpdates-610595e0df9691220e0083bd34e769ea27323f8f.tar.gz NotEnoughUpdates-610595e0df9691220e0083bd34e769ea27323f8f.tar.bz2 NotEnoughUpdates-610595e0df9691220e0083bd34e769ea27323f8f.zip |
show currently pelts owned
Diffstat (limited to 'src/main')
4 files changed, 30 insertions, 5 deletions
diff --git a/src/main/java/io/github/moulberry/notenoughupdates/miscgui/minionhelper/ApiData.java b/src/main/java/io/github/moulberry/notenoughupdates/miscgui/minionhelper/ApiData.java index 1155884b..62fda010 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/miscgui/minionhelper/ApiData.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/miscgui/minionhelper/ApiData.java @@ -30,6 +30,7 @@ public class ApiData { private final int barbariansReputation; private final boolean collectionApiDisabled; private final List<String> craftedMinions; + private final int peltCount; public ApiData( Map<String, Integer> highestCollectionTier, @@ -37,7 +38,8 @@ public class ApiData { int magesReputation, int barbariansReputation, boolean collectionApiDisabled, - List<String> craftedMinions + List<String> craftedMinions, + int peltCount ) { this.highestCollectionTier = highestCollectionTier; this.slayerTiers = slayerTiers; @@ -45,6 +47,7 @@ public class ApiData { this.barbariansReputation = barbariansReputation; this.collectionApiDisabled = collectionApiDisabled; this.craftedMinions = craftedMinions; + this.peltCount = peltCount; } public Map<String, Integer> getHighestCollectionTier() { @@ -70,4 +73,8 @@ public class ApiData { public List<String> getCraftedMinions() { return craftedMinions; } + + public int getPeltCount() { + return peltCount; + } } diff --git a/src/main/java/io/github/moulberry/notenoughupdates/miscgui/minionhelper/loaders/MinionHelperApiLoader.java b/src/main/java/io/github/moulberry/notenoughupdates/miscgui/minionhelper/loaders/MinionHelperApiLoader.java index b1a4ba06..cf12a099 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/miscgui/minionhelper/loaders/MinionHelperApiLoader.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/miscgui/minionhelper/loaders/MinionHelperApiLoader.java @@ -134,13 +134,25 @@ public class MinionHelperApiLoader { magesReputation, barbariansReputation, !collectionApiEnabled, - loadCraftedMinions(members) + loadCraftedMinions(members), + loadPeltCount(player) ); manager.reloadData(); apiReadyToUse = true; } + private int loadPeltCount(JsonObject player) { + int peltCount = 0; + if (player.has("trapper_quest")) { + JsonObject jsonObject = player.getAsJsonObject("trapper_quest"); + if (jsonObject.has("pelt_count")) { + peltCount = jsonObject.get("pelt_count").getAsInt(); + } + } + return peltCount; + } + private Map<String, Integer> getSlayers(JsonObject player) { JsonObject slayerLeveling = Constants.LEVELING.getAsJsonObject("slayer_xp"); diff --git a/src/main/java/io/github/moulberry/notenoughupdates/miscgui/minionhelper/render/MinionHelperOverlay.java b/src/main/java/io/github/moulberry/notenoughupdates/miscgui/minionhelper/render/MinionHelperOverlay.java index 0c1f9800..afea502f 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/miscgui/minionhelper/render/MinionHelperOverlay.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/miscgui/minionhelper/render/MinionHelperOverlay.java @@ -288,6 +288,7 @@ public class MinionHelperOverlay { displayName = displayName.replace(" Minion", ""); String format = manager.getPriceCalculation().calculateUpgradeCostsFormat(minion, true); + format = format.replace(" coins", ""); String requirementFormat = !minion.doesMeetRequirements() ? "§7§o" : ""; renderMap.put( requirementFormat + displayName + " " + minion.getTier() + " §r§8- " + format, diff --git a/src/main/java/io/github/moulberry/notenoughupdates/miscgui/minionhelper/render/MinionHelperOverlayHover.java b/src/main/java/io/github/moulberry/notenoughupdates/miscgui/minionhelper/render/MinionHelperOverlayHover.java index f3e6dc71..05bd4b62 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/miscgui/minionhelper/render/MinionHelperOverlayHover.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/miscgui/minionhelper/render/MinionHelperOverlayHover.java @@ -122,7 +122,7 @@ public class MinionHelperOverlayHover { lines.add(""); lines.add("§7Buy from: §9" + npcName + " (NPC)"); lines.add(""); - lines.add("§7Buy cost: " + manager.getPriceCalculation().calculateUpgradeCostsFormat(minion, true)); + lines.add("§7Cost: " + manager.getPriceCalculation().calculateUpgradeCostsFormat(minion, true)); int coins = npcSource.getCoins(); if (coins != 0) { lines.add(" §8- " + manager.getPriceCalculation().formatCoins(coins)); @@ -139,11 +139,16 @@ public class MinionHelperOverlayHover { private void formatItems(List<String> lines, Map<String, Integer> allItems) { for (Map.Entry<String, Integer> entry : allItems.entrySet()) { String internalName = entry.getKey(); - if (internalName.equals("SKYBLOCK_PELT")) continue; + int amount = entry.getValue(); + if (internalName.equals("SKYBLOCK_PELT")) { + int peltCount = manager.getApi().getApiData().getPeltCount(); + + lines.add(" §8- §5" + peltCount + "§8/§5" + amount + " Pelts"); + continue; + } String name = manager.getRepo().getDisplayName(internalName); - int amount = entry.getValue(); String amountText = amount != 1 ? amount + "§7x " : ""; String price = manager.getPriceCalculation().formatCoins( manager.getPriceCalculation().getPrice(internalName) * amount); |