diff options
4 files changed, 54 insertions, 12 deletions
diff --git a/src/main/java/io/github/moulberry/notenoughupdates/options/separatesections/AHTweaks.java b/src/main/java/io/github/moulberry/notenoughupdates/options/separatesections/AHTweaks.java index f11a9dde..1c9971a8 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/options/separatesections/AHTweaks.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/options/separatesections/AHTweaks.java @@ -71,6 +71,19 @@ public class AHTweaks { @ConfigAccordionId(id = 0) public boolean escFullClose = true; + @Expose + @ConfigOption( + name = "Search History Size", + desc = "Changes how many search items get stored" + ) + @ConfigEditorSlider( + minValue = 1, + maxValue = 15, + minStep = 1 + ) + @ConfigAccordionId(id = 0) + public int ahSearchHistorySize = 5; + @ConfigOption( name = "BIN Warning", desc = "" diff --git a/src/main/java/io/github/moulberry/notenoughupdates/options/separatesections/BazaarTweaks.java b/src/main/java/io/github/moulberry/notenoughupdates/options/separatesections/BazaarTweaks.java index ee49fa7a..fd855ddc 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/options/separatesections/BazaarTweaks.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/options/separatesections/BazaarTweaks.java @@ -74,6 +74,19 @@ public class BazaarTweaks { @Expose @ConfigOption( + name = "Search History Size", + desc = "Changes how many search items get stored" + ) + @ConfigEditorSlider( + minValue = 1, + maxValue = 15, + minStep = 1 + ) + @ConfigAccordionId(id = 0) + public int bzSearchHistorySize = 5; + + @Expose + @ConfigOption( name = "Bazaar Overpay Warning", desc = "Warns you before you would pay more than this amount of coins for an item in the /bz" ) @@ -83,7 +96,7 @@ public class BazaarTweaks { @Expose @ConfigOption( name = "CTRL+F for search", - desc = "Open search GUI when pressing CTRL + F in the bazzar" + desc = "Open search GUI when pressing CTRL + F in the bazaar" ) @ConfigEditorBoolean() public boolean ctrlFSearch = true; diff --git a/src/main/java/io/github/moulberry/notenoughupdates/overlays/AuctionSearchOverlay.java b/src/main/java/io/github/moulberry/notenoughupdates/overlays/AuctionSearchOverlay.java index 0c4b11df..7f633ca1 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/overlays/AuctionSearchOverlay.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/overlays/AuctionSearchOverlay.java @@ -134,7 +134,7 @@ public class AuctionSearchOverlay { Minecraft.getMinecraft().getTextureManager().bindTexture(SEARCH_OVERLAY_TEXTURE); GlStateManager.color(1, 1, 1, 1); - Utils.drawTexturedRect(width / 2 - 100, topY - 1, 203, h, 0, 203 / 512f, 0, h / 256f, GL11.GL_NEAREST); + Utils.drawTexturedRect(width / 2 - 100, topY - 1, 203, 145, 0, 203 / 512f, 0, 145 / 256f, GL11.GL_NEAREST); Minecraft.getMinecraft().getTextureManager().bindTexture(STAR_BOARD); Utils.drawTexturedRect(width / 2 + 105, topY + 27, 105, 13, GL11.GL_NEAREST); @@ -258,9 +258,13 @@ public class AuctionSearchOverlay { 0xdddddd, true ); + Minecraft.getMinecraft().getTextureManager().bindTexture(SEARCH_OVERLAY_TEXTURE); + Utils.drawTexturedRect(width / 2 - 100, topY - 1 + 160, 203, 4, 0, 203 / 512f, 160 / 256f, 163 / 256f, GL11.GL_NEAREST); - for (int i = 0; i < 5; i++) { - if (i >= NotEnoughUpdates.INSTANCE.config.hidden.previousAuctionSearches.size()) break; + for (int i = 0; i < NotEnoughUpdates.INSTANCE.config.ahTweaks.ahSearchHistorySize; i++) { + Minecraft.getMinecraft().getTextureManager().bindTexture(SEARCH_OVERLAY_TEXTURE); + Utils.drawTexturedRect(width / 2 - 100, topY - 1 + 160 + 4 + i * 10, 203, 10, 0, 203 / 512f, 164 / 256f, 174 / 256f, GL11.GL_NEAREST); + if (i >= NotEnoughUpdates.INSTANCE.config.hidden.previousAuctionSearches.size()) continue; String s = NotEnoughUpdates.INSTANCE.config.hidden.previousAuctionSearches.get(i); Minecraft.getMinecraft().fontRendererObj.drawString( @@ -272,6 +276,11 @@ public class AuctionSearchOverlay { ); } + int size = NotEnoughUpdates.INSTANCE.config.ahTweaks.ahSearchHistorySize; + Minecraft.getMinecraft().getTextureManager().bindTexture(SEARCH_OVERLAY_TEXTURE); + Utils.drawTexturedRect(width / 2 - 100, topY - 1 + 160 + 4 + size * 10, 203, 4, 0, 203 / 512f, 215 / 256f, 219 / 256f, GL11.GL_NEAREST); + + if (tooltipToDisplay != null) { Utils.drawHoveringText(tooltipToDisplay, mouseX, mouseY, width, height, -1); } @@ -371,7 +380,7 @@ public class AuctionSearchOverlay { previousAuctionSearches.remove(searchString); previousAuctionSearches.remove(searchString); previousAuctionSearches.add(0, searchString); - while (previousAuctionSearches.size() > 5) { + while (previousAuctionSearches.size() > NotEnoughUpdates.INSTANCE.config.ahTweaks.ahSearchHistorySize) { previousAuctionSearches.remove(previousAuctionSearches.size() - 1); } } @@ -658,7 +667,7 @@ public class AuctionSearchOverlay { } if (NotEnoughUpdates.INSTANCE.config.ahTweaks.showPastSearches) { - for (int i = 0; i < 5; i++) { + for (int i = 0; i < NotEnoughUpdates.INSTANCE.config.ahTweaks.ahSearchHistorySize; i++) { if (i >= NotEnoughUpdates.INSTANCE.config.hidden.previousAuctionSearches.size()) break; String s = NotEnoughUpdates.INSTANCE.config.hidden.previousAuctionSearches.get(i); diff --git a/src/main/java/io/github/moulberry/notenoughupdates/overlays/BazaarSearchOverlay.java b/src/main/java/io/github/moulberry/notenoughupdates/overlays/BazaarSearchOverlay.java index 6ad33e74..00203bcd 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/overlays/BazaarSearchOverlay.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/overlays/BazaarSearchOverlay.java @@ -24,7 +24,6 @@ import com.google.gson.JsonObject; import io.github.moulberry.notenoughupdates.NotEnoughUpdates; import io.github.moulberry.notenoughupdates.commands.help.SettingsCommand; import io.github.moulberry.notenoughupdates.core.GuiElementTextField; -import io.github.moulberry.notenoughupdates.core.GuiScreenElementWrapper; import io.github.moulberry.notenoughupdates.mixins.AccessorGuiEditSign; import io.github.moulberry.notenoughupdates.util.Utils; import net.minecraft.client.Minecraft; @@ -124,7 +123,7 @@ public class BazaarSearchOverlay { Minecraft.getMinecraft().getTextureManager().bindTexture(SEARCH_OVERLAY_TEXTURE); GlStateManager.color(1, 1, 1, 1); - Utils.drawTexturedRect(width / 2 - 100, topY - 1, 203, h, 0, 203 / 512f, 0, h / 256f, GL11.GL_NEAREST); + Utils.drawTexturedRect(width / 2 - 100, topY - 1, 203, 145, 0, 203 / 512f, 0, 145 / 256f, GL11.GL_NEAREST); Minecraft.getMinecraft().fontRendererObj.drawString("Enter Query:", width / 2 - 100, topY - 10, 0xdddddd, true); @@ -210,9 +209,13 @@ public class BazaarSearchOverlay { 0xdddddd, true ); + Minecraft.getMinecraft().getTextureManager().bindTexture(SEARCH_OVERLAY_TEXTURE); + Utils.drawTexturedRect(width / 2 - 100, topY - 1 + 160, 203, 4, 0, 203 / 512f, 160 / 256f, 163 / 256f, GL11.GL_NEAREST); - for (int i = 0; i < 5; i++) { - if (i >= NotEnoughUpdates.INSTANCE.config.hidden.previousBazaarSearches.size()) break; + for (int i = 0; i < NotEnoughUpdates.INSTANCE.config.bazaarTweaks.bzSearchHistorySize; i++) { + Minecraft.getMinecraft().getTextureManager().bindTexture(SEARCH_OVERLAY_TEXTURE); + Utils.drawTexturedRect(width / 2 - 100, topY - 1 + 160 + 4 + i * 10, 203, 10, 0, 203 / 512f, 164 / 256f, 174 / 256f, GL11.GL_NEAREST); + if (i >= NotEnoughUpdates.INSTANCE.config.hidden.previousBazaarSearches.size()) continue; String s = NotEnoughUpdates.INSTANCE.config.hidden.previousBazaarSearches.get(i); Minecraft.getMinecraft().fontRendererObj.drawString( @@ -224,6 +227,10 @@ public class BazaarSearchOverlay { ); } + int size = NotEnoughUpdates.INSTANCE.config.bazaarTweaks.bzSearchHistorySize; + Minecraft.getMinecraft().getTextureManager().bindTexture(SEARCH_OVERLAY_TEXTURE); + Utils.drawTexturedRect(width / 2 - 100, topY - 1 + 160 + 4 + size * 10, 203, 4, 0, 203 / 512f, 215 / 256f, 219 / 256f, GL11.GL_NEAREST); + if (tooltipToDisplay != null) { Utils.drawHoveringText(tooltipToDisplay, mouseX, mouseY, width, height, -1); } @@ -320,7 +327,7 @@ public class BazaarSearchOverlay { previousBazaarSearches.remove(searchString); previousBazaarSearches.remove(searchString); previousBazaarSearches.add(0, searchString); - while (previousBazaarSearches.size() > 5) { + while (previousBazaarSearches.size() > NotEnoughUpdates.INSTANCE.config.bazaarTweaks.bzSearchHistorySize) { previousBazaarSearches.remove(previousBazaarSearches.size() - 1); } } @@ -543,7 +550,7 @@ public class BazaarSearchOverlay { } if (NotEnoughUpdates.INSTANCE.config.bazaarTweaks.showPastSearches) { - for (int i = 0; i < 5; i++) { + for (int i = 0; i < NotEnoughUpdates.INSTANCE.config.bazaarTweaks.bzSearchHistorySize; i++) { if (i >= NotEnoughUpdates.INSTANCE.config.hidden.previousBazaarSearches.size()) break; String s = NotEnoughUpdates.INSTANCE.config.hidden.previousBazaarSearches.get(i); |
