diff options
author | Lorenz <lo.scherf@gmail.com> | 2022-08-16 20:02:17 +0200 |
---|---|---|
committer | Lorenz <lo.scherf@gmail.com> | 2022-08-16 20:02:17 +0200 |
commit | dbe107baafdaab9f7c79fcadfc2c30949aded24e (patch) | |
tree | 1384edc9dccfd8dd41548a113824980be27e7abd /src | |
parent | 2d57900a61f1a979289c33e7f68e91e64529d655 (diff) | |
download | NotEnoughUpdates-dbe107baafdaab9f7c79fcadfc2c30949aded24e.tar.gz NotEnoughUpdates-dbe107baafdaab9f7c79fcadfc2c30949aded24e.tar.bz2 NotEnoughUpdates-dbe107baafdaab9f7c79fcadfc2c30949aded24e.zip |
changed format for coins in overlay
Diffstat (limited to 'src')
-rw-r--r-- | src/main/java/io/github/moulberry/notenoughupdates/miscgui/minionhelper/render/MinionHelperOverlay.java | 24 |
1 files changed, 16 insertions, 8 deletions
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 55cd0784..c2fe0503 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 @@ -219,13 +219,22 @@ public class MinionHelperOverlay { } Utils.drawTexturedRect(guiLeft + xSize + 4 + 149, guiTop + 109, 10, 10, 0, 1f, 0, 1f, GL11.GL_NEAREST); - int a = guiLeft + xSize + 4; + int x = guiLeft + xSize + 10; int i = 0; - int y = 0; + int y = guiTop + 6; FontRenderer fontRendererObj = minecraft.fontRendererObj; for (Map.Entry<String, OverviewLine> entry : renderMap.entrySet()) { String line = entry.getKey(); - fontRendererObj.drawString(line, a + 6, guiTop + 6 + y, -1, false); + + if (line.contains("§6")) { + String[] split = line.split("§6"); + line = split[0]; + String price = "§6§l" + split[1]; + int lineLen = Minecraft.getMinecraft().fontRendererObj.getStringWidth(line); + fontRendererObj.drawString(price, x + lineLen, y, -1, true); + } + + fontRendererObj.drawString(line, x, y, -1, false); i++; if (i == 2) { y += 15; @@ -272,14 +281,13 @@ public class MinionHelperOverlay { if (index == neededForNextSlot) break; } String format = manager.getPriceCalculation().formatCoins(priceNeeded); - //TODO jani - String text = color + "Next slot: §3" + neededForNextSlot + " minions §8(" + format + "§8)"; + format = format.replace(" coins", ""); + String text = color + "Next slot: §3" + neededForNextSlot + " minions §8- " + format; renderMap.put(text, new OverviewText(Collections.emptyList(), () -> {})); } private void addTitle(Map<Minion, Long> prices, LinkedHashMap<String, OverviewLine> renderMap) { - //TODO jani - String name = "§8" + prices.size() + (showOnlyAvailable ? " craftable" : "") + " minions "; + String name = "§8" + prices.size() + " " + (showOnlyAvailable ? "craftable" : "total") + " minions"; renderMap.put(name, new OverviewText(Collections.emptyList(), () -> {})); } @@ -353,7 +361,7 @@ public class MinionHelperOverlay { for (Map.Entry<String, OverviewLine> entry : renderMap.entrySet()) { String text = entry.getKey(); int width = fontRenderer.getStringWidth(StringUtils.cleanColour(text)); - if (mouseX > x && mouseX < x + width && + if (mouseX > x && mouseX < x + width + 4 && mouseY > y && mouseY < y + 11) { return entry.getValue(); } |