aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/io/github/moulberry/notenoughupdates/miscgui/TradeWindow.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/io/github/moulberry/notenoughupdates/miscgui/TradeWindow.java')
-rw-r--r--src/main/java/io/github/moulberry/notenoughupdates/miscgui/TradeWindow.java34
1 files changed, 20 insertions, 14 deletions
diff --git a/src/main/java/io/github/moulberry/notenoughupdates/miscgui/TradeWindow.java b/src/main/java/io/github/moulberry/notenoughupdates/miscgui/TradeWindow.java
index 371da939..91d3b981 100644
--- a/src/main/java/io/github/moulberry/notenoughupdates/miscgui/TradeWindow.java
+++ b/src/main/java/io/github/moulberry/notenoughupdates/miscgui/TradeWindow.java
@@ -55,31 +55,38 @@ public class TradeWindow {
private static int lastBackpackX;
private static int lastBackpackY;
- public static boolean tradeWindowActive() {
- if(!NotEnoughUpdates.INSTANCE.isOnSkyblock()) return false;
- if(!NotEnoughUpdates.INSTANCE.config.tradeMenu.enableCustomTrade) return false;
+ public static boolean hypixelTradeWindowActive() {
+ if(!NotEnoughUpdates.INSTANCE.hasSkyblockScoreboard()) return false;
GuiScreen guiScreen = Minecraft.getMinecraft().currentScreen;
if(guiScreen instanceof GuiChest) {
GuiChest eventGui = (GuiChest) guiScreen;
ContainerChest cc = (ContainerChest) eventGui.inventorySlots;
String containerName = cc.getLowerChestInventory().getDisplayName().getUnformattedText();
- if(containerName.trim().startsWith("You ")) {
- return true;
- }
+ return containerName.trim().startsWith("You ");
+ }
+ return false;
+ }
+
+ public static boolean tradeWindowActive() {
+ if(!NotEnoughUpdates.INSTANCE.isOnSkyblock()) return false;
+ if(!NotEnoughUpdates.INSTANCE.config.tradeMenu.enableCustomTrade) return false;
+
+ if(hypixelTradeWindowActive()) {
+ return true;
}
- lastTradeMillis = -1;
- ourTradeIndexes = new Integer[16];
- theirTradeIndexes = new Integer[16];
- theirTradeOld = new String[16];
- theirTradeChangesMillis = new Long[16];
+ if(lastTradeMillis != -99) {
+ lastTradeMillis = -99;
+ ourTradeIndexes = new Integer[16];
+ theirTradeIndexes = new Integer[16];
+ theirTradeOld = new String[16];
+ theirTradeChangesMillis = new Long[16];
+ }
return false;
}
- private static TexLoc tl = new TexLoc(0, 0, Keyboard.KEY_M);
-
private static void drawStringShadow(String str, float x, float y, int len) {
for(int xOff=-2; xOff<=2; xOff++) {
for(int yOff=-2; yOff<=2; yOff++) {
@@ -296,7 +303,6 @@ public class TradeWindow {
List<String> tooltipToDisplay = null;
ItemStack stackToRender = null;
int tooltipLen = -1;
- tl.handleKeyboardInput();
//Set index mappings
//Our slots