diff options
Diffstat (limited to 'src/main')
3 files changed, 14 insertions, 15 deletions
diff --git a/src/main/java/io/github/moulberry/notenoughupdates/miscgui/minionhelper/MinionHelperManager.java b/src/main/java/io/github/moulberry/notenoughupdates/miscgui/minionhelper/MinionHelperManager.java index 9a3a4883..952bd07a 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/miscgui/minionhelper/MinionHelperManager.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/miscgui/minionhelper/MinionHelperManager.java @@ -134,9 +134,10 @@ public class MinionHelperManager { minion.setMeetRequirements(false); } + needForNextSlot = -1; api.onProfileSwitch(); overlay.onProfileSwitch(); - needForNextSlot = -1; + inventoryLoader.onProfileSwitch(); } public void reloadData() { diff --git a/src/main/java/io/github/moulberry/notenoughupdates/miscgui/minionhelper/loaders/MinionHelperInventoryLoader.java b/src/main/java/io/github/moulberry/notenoughupdates/miscgui/minionhelper/loaders/MinionHelperInventoryLoader.java index fa3cc5de..3ff5a9c8 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/miscgui/minionhelper/loaders/MinionHelperInventoryLoader.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/miscgui/minionhelper/loaders/MinionHelperInventoryLoader.java @@ -59,7 +59,9 @@ public class MinionHelperInventoryLoader { checkInventory(); } else { pagesSeenAlready.clear(); - shouldCheckNextSlot = true; + if (shouldCheckNextSlot) { + shouldCheckNextSlot = true; + } } } @@ -137,4 +139,8 @@ public class MinionHelperInventoryLoader { manager.getOverlay().resetCache(); } } + + public void onProfileSwitch() { + shouldCheckNextSlot = true; + } } 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 5f1e7e16..12a8c24d 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 @@ -223,8 +223,9 @@ public class MinionHelperOverlay { LinkedHashMap<String, OverviewLine> renderMap ) { int neededForNextSlot = manager.getNeedForNextSlot(); + String color = showOnlyAvailable ? "§e" : "§c"; if (neededForNextSlot == -1) { - renderMap.put("Next slot in: ?", new OverviewText(Collections.emptyList(), () -> {})); + renderMap.put(color + "Next slot in: ?", new OverviewText(Collections.emptyList(), () -> {})); return; } @@ -236,17 +237,8 @@ public class MinionHelperOverlay { if (index == neededForNextSlot) break; } String format = manager.getPriceCalculation().formatCoins(priceNeeded); - String text = "Next slot in: §b" + neededForNextSlot + " §8- " + format; - List<String> list = new ArrayList<>(); - list.add("§7The combined upgrade cost for"); - list.add("§7the next §b" + index + " minions §7is " + format); - - if (!showOnlyAvailable) { - list.add(""); - list.add("§cThis shows minions that don't meet requirements!"); - } - - renderMap.put(text, new OverviewText(list, () -> {})); + String text = color + "Next slot in: §b" + neededForNextSlot + " §8- " + format; + renderMap.put(text, new OverviewText(Collections.emptyList(), () -> {})); } private void addTitle(Map<Minion, Long> prices, LinkedHashMap<String, OverviewLine> renderMap) { @@ -264,7 +256,7 @@ public class MinionHelperOverlay { } } String toggleText = "§eClick to " + (showOnlyAvailable ? "show" : "hide") + " minion upgrades without requirements"; - renderMap.put(name, new OverviewText(Arrays.asList(hoverText, "", toggleText), this::toggleShowAvailable)); + renderMap.put("§e" + name, new OverviewText(Arrays.asList(hoverText, "", toggleText), this::toggleShowAvailable)); } private void addMinions(Map<Minion, Long> prices, LinkedHashMap<String, OverviewLine> renderMap) { |