aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBuildTools <james.jenour@protonmail.com>2021-02-10 20:11:57 +0800
committerBuildTools <james.jenour@protonmail.com>2021-02-10 20:11:57 +0800
commit52c6dabe58005aa5a7fc5809512bd8cf4ad4f97f (patch)
tree9b71dd6e3e1478faceadf23dcfb359133cc7fe4e
parenta2292c332c22646bd177eaf3123ce31a74991e36 (diff)
downloadNotEnoughUpdates-52c6dabe58005aa5a7fc5809512bd8cf4ad4f97f.tar.gz
NotEnoughUpdates-52c6dabe58005aa5a7fc5809512bd8cf4ad4f97f.tar.bz2
NotEnoughUpdates-52c6dabe58005aa5a7fc5809512bd8cf4ad4f97f.zip
PRE18.1
-rw-r--r--src/main/java/io/github/moulberry/notenoughupdates/NEUEventListener.java26
-rw-r--r--src/main/java/io/github/moulberry/notenoughupdates/NEUManager.java69
-rw-r--r--src/main/java/io/github/moulberry/notenoughupdates/NotEnoughUpdates.java2
-rw-r--r--src/main/java/io/github/moulberry/notenoughupdates/core/config/Position.java6
-rw-r--r--src/main/java/io/github/moulberry/notenoughupdates/core/config/gui/GuiPositionEditor.java20
-rw-r--r--src/main/java/io/github/moulberry/notenoughupdates/dungeons/GuiDungeonMapEditor.java4
-rw-r--r--src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/CrystalOverlay.java2
-rw-r--r--src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/FlyFix.java13
-rw-r--r--src/main/java/io/github/moulberry/notenoughupdates/mixins/MixinNetHandlerPlayClient.java3
-rw-r--r--src/main/java/io/github/moulberry/notenoughupdates/mixins/MixinWorld.java2
-rw-r--r--src/main/java/io/github/moulberry/notenoughupdates/options/NEUConfig.java65
-rw-r--r--src/main/java/io/github/moulberry/notenoughupdates/options/NEUConfigEditor.java18
-rw-r--r--src/main/java/io/github/moulberry/notenoughupdates/overlays/AuctionSearchOverlay.java271
-rw-r--r--src/main/java/io/github/moulberry/notenoughupdates/overlays/MiningOverlay.java13
-rw-r--r--src/main/java/io/github/moulberry/notenoughupdates/overlays/RancherBootOverlay.java163
-rw-r--r--src/main/java/io/github/moulberry/notenoughupdates/util/SBInfo.java2
-rw-r--r--src/main/resources/assets/notenoughupdates/ah_search_overlay.pngbin0 -> 3513 bytes
17 files changed, 497 insertions, 182 deletions
diff --git a/src/main/java/io/github/moulberry/notenoughupdates/NEUEventListener.java b/src/main/java/io/github/moulberry/notenoughupdates/NEUEventListener.java
index 070b2d66..d32398c3 100644
--- a/src/main/java/io/github/moulberry/notenoughupdates/NEUEventListener.java
+++ b/src/main/java/io/github/moulberry/notenoughupdates/NEUEventListener.java
@@ -6,6 +6,7 @@ import com.google.gson.JsonObject;
import com.google.gson.JsonPrimitive;
import io.github.moulberry.notenoughupdates.auction.CustomAHGui;
import io.github.moulberry.notenoughupdates.core.BackgroundBlur;
+import io.github.moulberry.notenoughupdates.core.GuiScreenElementWrapper;
import io.github.moulberry.notenoughupdates.cosmetics.CapeManager;
import io.github.moulberry.notenoughupdates.dungeons.DungeonBlocks;
import io.github.moulberry.notenoughupdates.dungeons.DungeonWin;
@@ -264,6 +265,7 @@ public class NEUEventListener {
}
if(neu.hasSkyblockScoreboard()) {
+ SBInfo.getInstance().tick();
if(Loader.isModLoaded("morus")) {
MorusIntegration.getInstance().tick();
}
@@ -304,7 +306,6 @@ public class NEUEventListener {
Minecraft.getMinecraft().thePlayer.addChatMessage(new ChatComponentText(""));
}
}
- SBInfo.getInstance().tick();
}
if(currentTime - lastSkyblockScoreboard < 5*60*1000) { //5 minutes
neu.manager.auctionManager.tick();
@@ -466,6 +467,14 @@ public class NEUEventListener {
AtomicBoolean missingRecipe = new AtomicBoolean(false);
@SubscribeEvent
public void onGuiOpen(GuiOpenEvent event) {
+ if(Minecraft.getMinecraft().currentScreen instanceof GuiScreenElementWrapper &&
+ event.gui == null && !(Keyboard.getEventKeyState() && Keyboard.getEventKey() == Keyboard.KEY_ESCAPE) &&
+ System.currentTimeMillis() - NotEnoughUpdates.INSTANCE.lastOpenedGui < 500) {
+ NotEnoughUpdates.INSTANCE.lastOpenedGui = 0;
+ event.setCanceled(true);
+ return;
+ }
+
if(!(event.gui instanceof GuiContainer) && Minecraft.getMinecraft().currentScreen != null) {
CalendarOverlay.setEnabled(false);
}
@@ -788,6 +797,11 @@ public class NEUEventListener {
event.setCanceled(true);
return;
}
+ if(RancherBootOverlay.shouldReplace()) {
+ RancherBootOverlay.render();
+ event.setCanceled(true);
+ return;
+ }
if(TradeWindow.tradeWindowActive() ||
event.gui instanceof CustomAHGui || neu.manager.auctionManager.customAH.isRenderOverAuctionView()) {
@@ -1070,6 +1084,11 @@ public class NEUEventListener {
event.setCanceled(true);
return;
}
+ if(RancherBootOverlay.shouldReplace()) {
+ RancherBootOverlay.mouseEvent();
+ event.setCanceled(true);
+ return;
+ }
if(TradeWindow.tradeWindowActive() || event.gui instanceof CustomAHGui ||
neu.manager.auctionManager.customAH.isRenderOverAuctionView()) {
event.setCanceled(true);
@@ -1110,6 +1129,11 @@ public class NEUEventListener {
event.setCanceled(true);
return;
}
+ if(RancherBootOverlay.shouldReplace()) {
+ RancherBootOverlay.keyEvent();
+ event.setCanceled(true);
+ return;
+ }
if(TradeWindow.tradeWindowActive() || event.gui instanceof CustomAHGui ||
neu.manager.auctionManager.customAH.isRenderOverAuctionView()) {
diff --git a/src/main/java/io/github/moulberry/notenoughupdates/NEUManager.java b/src/main/java/io/github/moulberry/notenoughupdates/NEUManager.java
index 0381a70a..bbaa08db 100644
--- a/src/main/java/io/github/moulberry/notenoughupdates/NEUManager.java
+++ b/src/main/java/io/github/moulberry/notenoughupdates/NEUManager.java
@@ -204,48 +204,45 @@ public class NEUManager {
if (Display.isActive()) dialog.toFront();
- if (false) {
- } else {
- Utils.recursiveDelete(repoLocation);
- repoLocation.mkdirs();
+ Utils.recursiveDelete(repoLocation);
+ repoLocation.mkdirs();
- //TODO: Store hard-coded value somewhere else
- String dlUrl = "https://github.com/Moulberry/NotEnoughUpdates-REPO/archive/master.zip";
+ //TODO: Store hard-coded value somewhere else
+ String dlUrl = "https://github.com/Moulberry/NotEnoughUpdates-REPO/archive/master.zip";
- pane.setMessage("Downloading NEU Master Archive. (DL# >20)");
- dialog.pack();
- if(NotEnoughUpdates.INSTANCE.config.hidden.dev) dialog.setVisible(true);
- if (Display.isActive()) dialog.toFront();
+ pane.setMessage("Downloading NEU Master Archive. (DL# >20)");
+ dialog.pack();
+ if(NotEnoughUpdates.INSTANCE.config.hidden.dev) dialog.setVisible(true);
+ if (Display.isActive()) dialog.toFront();
- File itemsZip = new File(repoLocation, "neu-items-master.zip");
- try {
- itemsZip.createNewFile();
- } catch (IOException e) {
- return;
- }
- URL url = new URL(dlUrl);
- URLConnection urlConnection = url.openConnection();
- urlConnection.setConnectTimeout(15000);
- urlConnection.setReadTimeout(20000);
- try (BufferedInputStream inStream = new BufferedInputStream(urlConnection.getInputStream());
- FileOutputStream fileOutputStream = new FileOutputStream(itemsZip)) {
- byte dataBuffer[] = new byte[1024];
- int bytesRead;
- while ((bytesRead = inStream.read(dataBuffer, 0, 1024)) != -1) {
- fileOutputStream.write(dataBuffer, 0, bytesRead);
- }
- } catch (IOException e) {
- dialog.dispose();
- return;
+ File itemsZip = new File(repoLocation, "neu-items-master.zip");
+ try {
+ itemsZip.createNewFile();
+ } catch (IOException e) {
+ return;
+ }
+ URL url = new URL(dlUrl);
+ URLConnection urlConnection = url.openConnection();
+ urlConnection.setConnectTimeout(15000);
+ urlConnection.setReadTimeout(20000);
+ try (BufferedInputStream inStream = new BufferedInputStream(urlConnection.getInputStream());
+ FileOutputStream fileOutputStream = new FileOutputStream(itemsZip)) {
+ byte dataBuffer[] = new byte[1024];
+ int bytesRead;
+ while ((bytesRead = inStream.read(dataBuffer, 0, 1024)) != -1) {
+ fileOutputStream.write(dataBuffer, 0, bytesRead);
}
+ } catch (IOException e) {
+ dialog.dispose();
+ return;
+ }
- pane.setMessage("Unzipping NEU Master Archive.");
- dialog.pack();
- //dialog.setVisible(true);
- if (Display.isActive()) dialog.toFront();
+ pane.setMessage("Unzipping NEU Master Archive.");
+ dialog.pack();
+ //dialog.setVisible(true);
+ if (Display.isActive()) dialog.toFront();
- unzipIgnoreFirstFolder(itemsZip.getAbsolutePath(), repoLocation.getAbsolutePath());
- }
+ unzipIgnoreFirstFolder(itemsZip.getAbsolutePath(), repoLocation.getAbsolutePath());
if(currentCommitJSON == null || !currentCommitJSON.get("sha").getAsString().equals(latestRepoCommit)) {
JsonObject newCurrentCommitJSON = new JsonObject();
diff --git a/src/main/java/io/github/moulberry/notenoughupdates/NotEnoughUpdates.java b/src/main/java/io/github/moulberry/notenoughupdates/NotEnoughUpdates.java
index 1dbbb956..43f9512f 100644
--- a/src/main/java/io/github/moulberry/notenoughupdates/NotEnoughUpdates.java
+++ b/src/main/java/io/github/moulberry/notenoughupdates/NotEnoughUpdates.java
@@ -103,6 +103,7 @@ public class NotEnoughUpdates {
private static final Set<String> SKYBLOCK_IN_ALL_LANGUAGES = Sets.newHashSet("SKYBLOCK","\u7A7A\u5C9B\u751F\u5B58", "\u7A7A\u5CF6\u751F\u5B58");
public GuiScreen openGui = null;
+ public long lastOpenedGui = 0;
SimpleCommand collectionLogCommand = new SimpleCommand("neucl", new SimpleCommand.ProcessCommandRunnable() {
public void processCommand(ICommandSender sender, String[] args) {
@@ -1046,6 +1047,7 @@ public class NotEnoughUpdates {
}
Minecraft.getMinecraft().displayGuiScreen(openGui);
openGui = null;
+ lastOpenedGui = System.currentTimeMillis();
}
if(currChatMessage != null && currentTime - lastChatMessage > CHAT_MSG_COOLDOWN) {
lastChatMessage = currentTime;
diff --git a/src/main/java/io/github/moulberry/notenoughupdates/core/config/Position.java b/src/main/java/io/github/moulberry/notenoughupdates/core/config/Position.java
index e003e440..e7198631 100644
--- a/src/main/java/io/github/moulberry/notenoughupdates/core/config/Position.java
+++ b/src/main/java/io/github/moulberry/notenoughupdates/core/config/Position.java
@@ -162,9 +162,9 @@ public class Position {
this.y = screenHeight-EDGE_OFFSET;
}
} else {
- if(this.y+objHeight > -EDGE_OFFSET) {
- deltaY += -EDGE_OFFSET-objHeight-this.y;
- this.y = -EDGE_OFFSET-objHeight;
+ if(this.y+1 > -EDGE_OFFSET) {
+ deltaY += -EDGE_OFFSET-1-this.y;
+ this.y = -EDGE_OFFSET-1;
}
if(this.y+screenHeight < EDGE_OFFSET) {
deltaY += EDGE_OFFSET-screenHeight-this.y;
diff --git a/src/main/java/io/github/moulberry/notenoughupdates/core/config/gui/GuiPositionEditor.java b/src/main/java/io/github/moulberry/notenoughupdates/core/config/gui/GuiPositionEditor.java
index d7d84d28..3b0df42d 100644
--- a/src/main/java/io/github/moulberry/notenoughupdates/core/config/gui/GuiPositionEditor.java
+++ b/src/main/java/io/github/moulberry/notenoughupdates/core/config/gui/GuiPositionEditor.java
@@ -1,7 +1,6 @@
package io.github.moulberry.notenoughupdates.core.config.gui;
import io.github.moulberry.notenoughupdates.core.config.Position;
-import io.github.moulberry.notenoughupdates.core.util.render.RenderUtils;
import io.github.moulberry.notenoughupdates.util.Utils;
import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.Gui;
@@ -13,20 +12,17 @@ import java.io.IOException;
public class GuiPositionEditor extends GuiScreen {
- private Position position;
+ private final Position position;
private Position originalPosition;
- private int elementWidth;
- private int elementHeight;
- private Runnable renderCallback;
- private Runnable positionChangedCallback;
- private Runnable closedCallback;
+ private final int elementWidth;
+ private final int elementHeight;
+ private final Runnable renderCallback;
+ private final Runnable positionChangedCallback;
+ private final Runnable closedCallback;
private boolean clicked = false;
private int grabbedX = 0;
private int grabbedY = 0;
- private int oldMouseX = 0;
- private int oldMouseY = 0;
-
private int guiScaleOverride = -1;
public GuiPositionEditor(Position position, int elementWidth, int elementHeight,
@@ -63,7 +59,6 @@ public class GuiPositionEditor extends GuiScreen {
scaledResolution = new ScaledResolution(Minecraft.getMinecraft());
}
-
this.width = scaledResolution.getScaledWidth();
this.height = scaledResolution.getScaledHeight();
mouseX = Mouse.getX() * width / Minecraft.getMinecraft().displayWidth;
@@ -142,9 +137,6 @@ public class GuiPositionEditor extends GuiScreen {
mouseX = Mouse.getX() * width / Minecraft.getMinecraft().displayWidth;
mouseY = height - Mouse.getY() * height / Minecraft.getMinecraft().displayHeight - 1;
- oldMouseX = mouseX;
- oldMouseY = mouseY;
-
grabbedX += position.moveX(mouseX - grabbedX, elementWidth, scaledResolution);
grabbedY += position.moveY(mouseY - grabbedY, elementHeight, scaledResolution);
positionChangedCallback.run();
diff --git a/src/main/java/io/github/moulberry/notenoughupdates/dungeons/GuiDungeonMapEditor.java b/src/main/java/io/github/moulberry/notenoughupdates/dungeons/GuiDungeonMapEditor.java
index 817e80e9..b0e46e00 100644
--- a/src/main/java/io/github/moulberry/notenoughupdates/dungeons/GuiDungeonMapEditor.java
+++ b/src/main/java/io/github/moulberry/notenoughupdates/dungeons/GuiDungeonMapEditor.java
@@ -478,8 +478,8 @@ public class GuiDungeonMapEditor extends GuiScreen {
NotEnoughUpdates.INSTANCE.config.dungeonMap.dmPosition,
size, size, () -> {
ScaledResolution scaledResolution = Utils.pushGuiScale(2);
- demoMap.renderMap(NotEnoughUpdates.INSTANCE.config.dungeonMap.dmPosition.getAbsX(scaledResolution, size/2)+size/2,
- NotEnoughUpdates.INSTANCE.config.dungeonMap.dmPosition.getAbsY(scaledResolution, size/2)+size/2,
+ demoMap.renderMap(NotEnoughUpdates.INSTANCE.config.dungeonMap.dmPosition.getAbsX(scaledResolution, size)+size/2,
+ NotEnoughUpdates.INSTANCE.config.dungeonMap.dmPosition.getAbsY(scaledResolution, size)+size/2,
NotEnoughUpdates.INSTANCE.colourMap, decorations, 0,
players, false, 0);
Utils.pushGuiScale(-1);
diff --git a/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/CrystalOverlay.java b/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/CrystalOverlay.java
index 9e97cfc0..b96fefef 100644
--- a/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/CrystalOverlay.java
+++ b/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/CrystalOverlay.java
@@ -144,7 +144,7 @@ public class CrystalOverlay {
ItemStack held = p.getHeldItem();
String internal = NotEnoughUpdates.INSTANCE.manager.getInternalNameForItem(held);
if(internal != null) {
- if(internal.endsWith("_CRYSTAL")) {
+ if(internal.endsWith("_CRYSTAL") && !internal.equals("POWER_CRYSTAL")) {
displayMillis = System.currentTimeMillis();
}
}
diff --git a/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/FlyFix.java b/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/FlyFix.java
index d33cb7d3..0fd2100c 100644
--- a/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/FlyFix.java
+++ b/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/FlyFix.java
@@ -13,8 +13,8 @@ public class FlyFix {
private static long lastAbilitySend = 0;
public static void onSendAbilities(C13PacketPlayerAbilities packet) {
- //if(true) return;
- if(!NotEnoughUpdates.INSTANCE.config.misc.flyFix) return;
+ if(true) return;
+ //if(!NotEnoughUpdates.INSTANCE.config.misc.flyFix) return;
if(Minecraft.getMinecraft().thePlayer == null) return;
if(!Minecraft.getMinecraft().thePlayer.capabilities.allowFlying) return;
if(!NotEnoughUpdates.INSTANCE.hasSkyblockScoreboard()) return;
@@ -28,8 +28,8 @@ public class FlyFix {
}
public static void onReceiveAbilities(S39PacketPlayerAbilities packet) {
- //if(true) return;
- if(!NotEnoughUpdates.INSTANCE.config.misc.flyFix) return;
+ if(true) return;
+ //if(!NotEnoughUpdates.INSTANCE.config.misc.flyFix) return;
if(Minecraft.getMinecraft().thePlayer == null) return;
if(!Minecraft.getMinecraft().thePlayer.capabilities.allowFlying) return;
if(!NotEnoughUpdates.INSTANCE.hasSkyblockScoreboard()) return;
@@ -39,6 +39,7 @@ public class FlyFix {
long currentTime = System.currentTimeMillis();
serverWantFly = packet.isFlying();
+
if(serverWantFly != clientWantFly) {
if(currentTime - lastAbilitySend > 0 && currentTime - lastAbilitySend < 500) {
packet.setFlying(clientWantFly);
@@ -49,8 +50,8 @@ public class FlyFix {
}
public static void tick() {
- //if(true) return;
- if(!NotEnoughUpdates.INSTANCE.config.misc.flyFix) return;
+ if(true) return;
+ //if(!NotEnoughUpdates.INSTANCE.config.misc.flyFix) return;
if(Minecraft.getMinecraft().thePlayer == null) return;
if(!Minecraft.getMinecraft().thePlayer.capabilities.allowFlying) return;
if(!NotEnoughUpdates.INSTANCE.hasSkyblockScoreboard()) return;
diff --git a/src/main/java/io/github/moulberry/notenoughupdates/mixins/MixinNetHandlerPlayClient.java b/src/main/java/io/github/moulberry/notenoughupdates/mixins/MixinNetHandlerPlayClient.java
index 5cb2dc8d..10509dd1 100644
--- a/src/main/java/io/github/moulberry/notenoughupdates/mixins/MixinNetHandlerPlayClient.java
+++ b/src/main/java/io/github/moulberry/notenoughupdates/mixins/MixinNetHandlerPlayClient.java
@@ -2,10 +2,12 @@ package io.github.moulberry.notenoughupdates.mixins;
import io.github.moulberry.notenoughupdates.miscfeatures.*;
import io.github.moulberry.notenoughupdates.NotEnoughUpdates;
+import io.github.moulberry.notenoughupdates.util.SBInfo;
import net.minecraft.client.network.NetHandlerPlayClient;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.network.Packet;
import net.minecraft.network.play.client.C13PacketPlayerAbilities;
+import net.minecraft.network.play.server.S03PacketTimeUpdate;
import net.minecraft.network.play.server.S23PacketBlockChange;
import net.minecraft.network.play.server.S2FPacketSetSlot;
import net.minecraft.network.play.server.S39PacketPlayerAbilities;
@@ -19,7 +21,6 @@ import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;
@Mixin(NetHandlerPlayClient.class)
public class MixinNetHandlerPlayClient {
-
private static final String TARGET = "Lnet/minecraft/entity/player/EntityPlayer;" +
"setPositionAndRotation(DDDFF)V";
@Redirect(method="handlePlayerPosLook", at=@At(value="INVOKE", target=TARGET))
diff --git a/src/main/java/io/github/moulberry/notenoughupdates/mixins/MixinWorld.java b/src/main/java/io/github/moulberry/notenoughupdates/mixins/MixinWorld.java
index 19cc7606..6c640390 100644
--- a/src/main/java/io/github/moulberry/notenoughupdates/mixins/MixinWorld.java
+++ b/src/main/java/io/github/moulberry/notenoughupdates/mixins/MixinWorld.java
@@ -3,6 +3,7 @@ package io.github.moulberry.notenoughupdates.mixins;
import io.github.moulberry.notenoughupdates.NotEnoughUpdates;
import io.github.moulberry.notenoughupdates.miscfeatures.CustomItemEffects;
import io.github.moulberry.notenoughupdates.miscfeatures.DwarvenMinesTextures;
+import io.github.moulberry.notenoughupdates.util.SBInfo;
import net.minecraft.util.BlockPos;
import net.minecraft.world.World;
import net.minecraft.world.biome.BiomeGenBase;
@@ -14,7 +15,6 @@ import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;
@Mixin(World.class)
public class MixinWorld {
-
@Inject(method="spawnParticle(IZDDDDDD[I)V", at=@At("HEAD"), cancellable = true)
public void spawnParticle(int particleID, boolean p_175720_2_, double xCood, double yCoord, double zCoord,
double xOffset, double yOffset, double zOffset, int[] p_175720_15_, CallbackInfo ci) {
diff --git a/src/main/java/io/github/moulberry/notenoughupdates/options/NEUConfig.java b/src/main/java/io/github/moulberry/notenoughupdates/options/NEUConfig.java
index 045b4cdb..c8625088 100644
--- a/src/main/java/io/github/moulberry/notenoughupdates/options/NEUConfig.java
+++ b/src/main/java/io/github/moulberry/notenoughupdates/options/NEUConfig.java
@@ -203,6 +203,21 @@ public class NEUConfig extends Config {
@Expose
@Category(
+ name = "Smooth AOTE",
+ desc = "Smooth AOTE"
+ )
+ public SmoothAOTE smoothAOTE = new SmoothAOTE();
+
+
+ @Expose
+ @Category(
+ name = "AH Search GUI",
+ desc = "AH Search GUI"
+ )
+ public AuctionHouseSearch auctionHouseSearch = new AuctionHouseSearch();
+
+ @Expose
+ @Category(
name = "Dungeon Block Overlay",
desc = "Dungeon Block Overlay"
)
@@ -217,13 +232,6 @@ public class NEUConfig extends Config {
@Expose
@Category(
- name = "Smooth AOTE",
- desc = "Smooth AOTE"
- )
- public SmoothAOTE smoothAOTE = new SmoothAOTE();
-
- @Expose
- @Category(
name = "Custom Rod Colours",
desc = "Custom Rod Colours"
)
@@ -260,14 +268,6 @@ public class NEUConfig extends Config {
@Expose
@ConfigOption(
- name = "Private Island Fly Fix",
- desc = "Fix flying being delaying on private islands"
- )
- @ConfigEditorBoolean
- public boolean flyFix = true;
-
- @Expose
- @ConfigOption(
name = "Hide Potion Effects",
desc = "Hide the potion effects inside your inventory while on skyblock"
)
@@ -1154,6 +1154,41 @@ public class NEUConfig extends Config {
public boolean showOwnHeadAsMarker = false;
}
+ public static class AuctionHouseSearch {
+ @Expose
+ @ConfigOption(
+ name = "Enable Search GUI",
+ desc = "Use the advanced search GUI with autocomplete and history instead of the normal sign GUI"
+ )
+ @ConfigEditorBoolean
+ public boolean enableSearchOverlay = true;
+
+ @Expose
+ @ConfigOption(
+ name = "Keep Previous Search",
+ desc = "Don't clear the search bar after closing the GUI"
+ )
+ @ConfigEditorBoolean
+ public boolean keepPreviousSearch = false;
+
+ @Expose
+ @ConfigOption(
+ name = "Past Searches",
+ desc = "Show past searches below the autocomplete box"
+ )
+ @ConfigEditorBoolean
+ public boolean showPastSearches = true;
+
+ @Expose
+ @ConfigOption(
+ name = "ESC to Full Close",
+ desc = "Make pressing ESCAPE close the search GUI without opening up the AH again\n" +
+ "ENTER can still be used to search"
+ )
+ @ConfigEditorBoolean
+ public boolean escFullClose = true;
+ }
+
public static class DungeonBlock {
@Expose
@ConfigOption(
diff --git a/src/main/java/io/github/moulberry/notenoughupdates/options/NEUConfigEditor.java b/src/main/java/io/github/moulberry/notenoughupdates/options/NEUConfigEditor.java
index 0b00cd5a..5d91e268 100644
--- a/src/main/java/io/github/moulberry/notenoughupdates/options/NEUConfigEditor.java
+++ b/src/main/java/io/github/moulberry/notenoughupdates/options/NEUConfigEditor.java
@@ -63,24 +63,24 @@ public class NEUConfigEditor extends GuiElement {
this.processedConfig = ConfigProcessor.create(config);
if(categoryOpen != null) {
- for(String category : processedConfig.keySet()) {
- if(category.equalsIgnoreCase(categoryOpen)) {
- selectedCategory = category;
+ for(Map.Entry<String, ConfigProcessor.ProcessedCategory> category : processedConfig.entrySet()) {
+ if(category.getValue().name.equalsIgnoreCase(categoryOpen)) {
+ selectedCategory = category.getKey();
break;
}
}
if(selectedCategory == null) {
- for(String category : processedConfig.keySet()) {
- if(category.toLowerCase().startsWith(categoryOpen.toLowerCase())) {
- selectedCategory = category;
+ for(Map.Entry<String, ConfigProcessor.ProcessedCategory> category : processedConfig.entrySet()) {
+ if(category.getValue().name.toLowerCase().startsWith(categoryOpen.toLowerCase())) {
+ selectedCategory = category.getKey();
break;
}
}
}
if(selectedCategory == null) {
- for(String category : processedConfig.keySet()) {
- if(category.toLowerCase().contains(categoryOpen.toLowerCase())) {
- selectedCategory = category;
+ for(Map.Entry<String, ConfigProcessor.ProcessedCategory> category : processedConfig.entrySet()) {
+ if(category.getValue().name.toLowerCase().contains(categoryOpen.toLowerCase())) {
+ selectedCategory = category.getKey();
break;
}
}
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 33322f8a..3401bb21 100644
--- a/src/main/java/io/github/moulberry/notenoughupdates/overlays/AuctionSearchOverlay.java
+++ b/src/main/java/io/github/moulberry/notenoughupdates/overlays/AuctionSearchOverlay.java
@@ -4,7 +4,9 @@ import com.google.common.base.Splitter;
import com.google.gson.JsonObject;
import io.github.moulberry.notenoughupdates.NotEnoughUpdates;
import io.github.moulberry.notenoughupdates.core.GuiElementTextField;
+import io.github.moulberry.notenoughupdates.core.GuiScreenElementWrapper;
import io.github.moulberry.notenoughupdates.mixins.GuiEditSignAccessor;
+import io.github.moulberry.notenoughupdates.options.NEUConfigEditor;
import io.github.moulberry.notenoughupdates.util.SBInfo;
import io.github.moulberry.notenoughupdates.util.Utils;
import net.minecraft.client.Minecraft;
@@ -13,15 +15,26 @@ import net.minecraft.client.gui.ScaledResolution;
import net.minecraft.client.gui.inventory.GuiEditSign;
import net.minecraft.client.renderer.GlStateManager;
import net.minecraft.item.ItemStack;
+import net.minecraft.network.play.client.C0DPacketCloseWindow;
import net.minecraft.tileentity.TileEntitySign;
import net.minecraft.util.ChatComponentText;
+import net.minecraft.util.EnumChatFormatting;
+import net.minecraft.util.ResourceLocation;
+import org.apache.commons.lang3.StringUtils;
+import org.apache.commons.lang3.text.WordUtils;
import org.lwjgl.input.Keyboard;
import org.lwjgl.input.Mouse;
+import org.lwjgl.opengl.GL11;
import java.util.*;
+import java.util.concurrent.ExecutorService;
+import java.util.concurrent.Executors;
+import java.util.concurrent.atomic.AtomicInteger;
public class AuctionSearchOverlay {
+ private static final ResourceLocation SEARCH_OVERLAY_TEXTURE = new ResourceLocation("notenoughupdates:ah_search_overlay.png");
+
private static GuiElementTextField textField = new GuiElementTextField("", 200, 20, 0);
private static boolean searchFieldClicked = false;
private static String searchString = "";
@@ -29,7 +42,7 @@ public class AuctionSearchOverlay {
private static final int AUTOCOMPLETE_HEIGHT = 118;
- private static Set<String> autocompletedItems = new LinkedHashSet<>();
+ private static final Set<String> autocompletedItems = new LinkedHashSet<>();
private static final Comparator<String> salesComparator = (o1, o2) -> {