aboutsummaryrefslogtreecommitdiff
path: root/src/main
diff options
context:
space:
mode:
authorunknown <james.jenour@protonmail.com>2020-07-02 00:53:17 +1000
committerunknown <james.jenour@protonmail.com>2020-07-02 00:53:17 +1000
commitbd6f658c6c53d160c40bc3b5fdead7b7b3dd20c4 (patch)
tree8cf4a287369c94e377604561d937b7096c0abf50 /src/main
parentfa7be3a200f26d53eabfc58e509fd9c6d0a2fd10 (diff)
downloadNotEnoughUpdates-BETA-1.9.tar.gz
NotEnoughUpdates-BETA-1.9.tar.bz2
NotEnoughUpdates-BETA-1.9.zip
Diffstat (limited to 'src/main')
-rw-r--r--src/main/java/io/github/moulberry/notenoughupdates/CustomAH.java208
-rw-r--r--src/main/java/io/github/moulberry/notenoughupdates/CustomItems.java6
-rw-r--r--src/main/java/io/github/moulberry/notenoughupdates/GuiTextures.java9
-rw-r--r--src/main/java/io/github/moulberry/notenoughupdates/NEUIO.java7
-rw-r--r--src/main/java/io/github/moulberry/notenoughupdates/NEUManager.java79
-rw-r--r--src/main/java/io/github/moulberry/notenoughupdates/NEUOverlay.java77
-rw-r--r--src/main/java/io/github/moulberry/notenoughupdates/NEUResourceManager.java38
-rw-r--r--src/main/java/io/github/moulberry/notenoughupdates/NotEnoughUpdates.java115
-rw-r--r--src/main/java/io/github/moulberry/notenoughupdates/StreamerMode.java63
-rw-r--r--src/main/java/io/github/moulberry/notenoughupdates/Utils.java57
-rw-r--r--src/main/java/io/github/moulberry/notenoughupdates/commands/SimpleCommand.java36
-rw-r--r--src/main/java/io/github/moulberry/notenoughupdates/infopanes/CollectionLogInfoPane.java492
-rw-r--r--src/main/java/io/github/moulberry/notenoughupdates/infopanes/InfoPane.java1
-rw-r--r--src/main/java/io/github/moulberry/notenoughupdates/infopanes/SettingsInfoPane.java138
-rw-r--r--src/main/java/io/github/moulberry/notenoughupdates/itemeditor/GuiElementTextField.java34
-rw-r--r--src/main/java/io/github/moulberry/notenoughupdates/mixins/MixinGuiIngame.java24
-rw-r--r--src/main/java/io/github/moulberry/notenoughupdates/options/Options.java95
-rw-r--r--src/main/java/io/github/moulberry/notenoughupdates/util/TexLoc.java10
-rw-r--r--src/main/resources/assets/notenoughupdates/ah_item_holder.pngbin0 -> 642 bytes
-rw-r--r--src/main/resources/assets/notenoughupdates/ah_item_tab.pngbin0 -> 627 bytes
-rw-r--r--src/main/resources/assets/notenoughupdates/item_mask.pngbin856 -> 2800 bytes
-rw-r--r--src/main/resources/assets/notenoughupdates/off.pngbin1302 -> 3331 bytes
-rw-r--r--src/main/resources/assets/notenoughupdates/order_value.pngbin0 -> 1818 bytes
-rw-r--r--src/main/resources/assets/notenoughupdates/order_value_active.pngbin0 -> 1804 bytes
-rw-r--r--src/main/resources/assets/notenoughupdates/shaders/program/blit.vsh16
-rw-r--r--src/main/resources/assets/notenoughupdates/shaders/program/grayscale.fsh15
-rw-r--r--src/main/resources/assets/notenoughupdates/shaders/program/grayscale.json17
-rw-r--r--src/main/resources/assets/notenoughupdates/slider_button.pngbin0 -> 666 bytes
-rw-r--r--src/main/resources/assets/notenoughupdates/slider_off.pngbin0 -> 765 bytes
-rw-r--r--src/main/resources/assets/notenoughupdates/slider_on.pngbin0 -> 767 bytes
-rw-r--r--src/main/resources/mixins.notenoughupdates.json3
31 files changed, 1412 insertions, 128 deletions
diff --git a/src/main/java/io/github/moulberry/notenoughupdates/CustomAH.java b/src/main/java/io/github/moulberry/notenoughupdates/CustomAH.java
new file mode 100644
index 00000000..d74d0e5c
--- /dev/null
+++ b/src/main/java/io/github/moulberry/notenoughupdates/CustomAH.java
@@ -0,0 +1,208 @@
+package io.github.moulberry.notenoughupdates;
+
+import com.google.gson.JsonArray;
+import com.google.gson.JsonObject;
+import io.github.moulberry.notenoughupdates.util.TexLoc;
+import net.minecraft.client.Minecraft;
+import net.minecraft.client.gui.Gui;
+import net.minecraft.client.gui.GuiScreen;
+import net.minecraft.client.renderer.GlStateManager;
+import net.minecraft.item.Item;
+import net.minecraft.nbt.CompressedStreamTools;
+import net.minecraft.nbt.NBTTagCompound;
+import net.minecraft.nbt.NBTTagList;
+import net.minecraft.util.ResourceLocation;
+import org.lwjgl.input.Keyboard;
+import org.lwjgl.opengl.GL11;
+
+import java.io.ByteArrayInputStream;
+import java.io.IOException;
+import java.util.Base64;
+import java.util.HashMap;
+import java.util.concurrent.ExecutorService;
+import java.util.concurrent.Executors;
+import java.util.concurrent.ScheduledExecutorService;
+import java.util.concurrent.TimeUnit;
+import java.util.concurrent.atomic.AtomicInteger;
+
+import static io.github.moulberry.notenoughupdates.GuiTextures.*;
+
+public class CustomAH extends GuiScreen {
+
+ private static final ResourceLocation inventoryBackground = new ResourceLocation("textures/gui/container/inventory.png");
+ private static final ResourceLocation creativeTabSearch = new ResourceLocation("textures/gui/container/creative_inventory/tab_item_search.png");
+ private static final ResourceLocation creativeInventoryTabs = new ResourceLocation("textures/gui/container/creative_inventory/tabs.png");
+
+ private int yScrollInitial = 0;
+ private boolean scrollClicked = false;
+
+
+ private int splits = 2;
+
+ private int ySplit = 35;
+ private int ySplitSize = 18;
+ private int ySize = 136 + ySplitSize*splits;
+ private int xSize = 195;
+
+ private float scrollAmount;
+
+ private int guiLeft = 0;
+ private int guiTop = 0;
+
+ private NEUManager manager;
+ private HashMap<String, JsonObject> auctionItems = new HashMap<>();
+
+ private TexLoc tl = new TexLoc(0, 0, Keyboard.KEY_M);
+
+ public CustomAH(NEUManager manager) {
+ this.manager = manager;
+ updateAuctions();
+ }
+
+ private void updateAuctions() {
+ HashMap<Integer, JsonObject> pages = new HashMap<>();
+
+ HashMap<String, String> args = new HashMap<>();
+ args.put("page", "0");
+ AtomicInteger totalPages = new AtomicInteger(1);
+ AtomicInteger currentPages = new AtomicInteger(0);
+ manager.hypixelApi.getHypixelApiAsync(manager.config.apiKey.value, "skyblock/profiles",
+ args, jsonObject -> {
+ if(jsonObject.get("success").getAsBoolean()) {
+ pages.put(0, jsonObject);
+ totalPages.set(jsonObject.get("totalPages").getAsInt());
+ currentPages.incrementAndGet();
+
+ for(int i=1; i<totalPages.get(); i++) {
+ int j = i;
+ HashMap<String, String> args2 = new HashMap<>();
+ args2.put("page", ""+i);
+ manager.hypixelApi.getHypixelApiAsync(manager.config.apiKey.value, "skyblock/profiles",
+ args2, jsonObject2 -> {
+ if (jsonObject2.get("success").getAsBoolean()) {
+ pages.put(j, jsonObject2);
+ currentPages.incrementAndGet();
+ }
+ }
+ );
+ }
+ }
+ }
+ );
+
+ ScheduledExecutorService ses = Executors.newSingleThreadScheduledExecutor();//1593549115 () 1593631661919
+ long startTime = System.currentTimeMillis();
+ ses.schedule(new Runnable() {
+ public void run() {
+ if(System.currentTimeMillis() - startTime > 20000) return;
+
+ if(currentPages.get() == totalPages.get()) {
+ auctionItems.clear();
+ for(int pageNum : pages.keySet()) {
+ JsonObject page = pages.get(pageNum);
+ JsonArray auctions = page.get("auctions").getAsJsonArray();
+ for(int i=0; i<auctions.size(); i++) {
+ JsonObject auction = auctions.get(i).getAsJsonObject();
+ String auctionUuid = auction.get("uuid").getAsString();
+ String auctioneerUuid = auction.get("auctioneer").getAsString();
+ int end = auction.get("end").getAsInt();
+ String category = auction.get("category").getAsString();
+
+ String item_bytes = auction.get("item_bytes").getAsString();
+
+ try {
+ NBTTagCompound tag = CompressedStreamTools.readCompressed(new ByteArrayInputStream(Base64.getDecoder().decode(item_bytes)));
+ tag = tag.getTagList("i", 10).getCompoundTagAt(0);
+ int id = tag.getShort("id");
+ int damage = tag.getShort("Damage");
+ tag = tag.getCompoundTag("tag");
+
+ String internalname = "";
+ if(tag != null && tag.hasKey("ExtraAttributes", 10)) {
+ NBTTagCompound ea = tag.getCompoundTag("ExtraAttributes");
+
+ if(ea.hasKey("id", 8)) {
+ internalname = ea.getString("id");
+ }
+ }
+
+ String[] lore = new String[0];
+ NBTTagCompound display = tag.getCompoundTag("display");
+
+ if(display.hasKey("Lore", 9)) {
+ NBTTagList list = display.getTagList("Lore", 8);
+ lore = new String[list.tagCount()];
+ for(int k=0; k<list.tagCount(); k++) {
+ lore[k] = list.getStringTagAt(k);
+ }
+ }
+
+ String itemid = Item.getItemById(id).getRegistryName();
+ String displayname = display.getString("Name");
+ String[] info = new String[0];
+ String clickcommand = "";
+
+ JsonObject item = new JsonObject();
+
+ } catch(IOException e) {}
+ }
+ }
+ return;
+ }
+
+ ses.schedule(this, 1000L, TimeUnit.MILLISECONDS);
+ }
+ }, 5000L, TimeUnit.MILLISECONDS);
+
+ }
+
+ public void drawScreen(int mouseX, int mouseY, float partialTicks) {
+ GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
+
+ tl.handleKeyboardInput();
+
+ guiLeft = (this.width - xSize)/2;
+ guiTop = (this.height - ySize)/2;
+
+ this.mc.getTextureManager().bindTexture(creativeTabSearch);
+ this.drawTexturedModalRect(guiLeft, guiTop, 0, 0, xSize, ySplit);
+ int y = guiTop+ySplit;
+ for(int i=0; i<splits; i++) {
+ this.drawTexturedModalRect(guiLeft, y, 0, ySplit, xSize, ySplit+ySplitSize);
+ y += ySplitSize;
+ }
+ this.drawTexturedModalRect(guiLeft, y, 0, ySplit, xSize, 136-ySplit);
+
+ this.mc.getTextureManager().bindTexture(creativeInventoryTabs);
+ this.drawTexturedModalRect(guiLeft+175, guiTop+18+(int)((95+ySplitSize*2)*scrollAmount),
+ 256-(scrollClicked?12:24), 0, 12, 15);
+ }
+
+ @Override
+ protected void mouseClicked(int mouseX, int mouseY, int mouseButton) throws IOException {
+ int y = guiTop+18+(int)((95+ySplitSize*2)*scrollAmount);
+ if(mouseX > guiLeft+175 && mouseX < guiLeft+175+12) {
+ if(mouseY > y && mouseY < y+15) {
+ scrollClicked = true;
+ return;
+ }
+ }
+ scrollClicked = false;
+ }
+
+ @Override
+ protected void mouseReleased(int mouseX, int mouseY, int state) {
+ scrollClicked = false;
+ }
+
+ @Override
+ protected void mouseClickMove(int mouseX, int mouseY, int clickedMouseButton, long timeSinceLastClick) {
+ if(scrollClicked) {
+ int yMin = guiTop+18 + 8;
+ int yMax = guiTop+18+(95+ySplitSize*2) + 8;
+
+ scrollAmount = (mouseY-yMin)/(float)yMax;
+ scrollAmount = Math.max(0, Math.min(1, scrollAmount));
+ }
+ }
+}
diff --git a/src/main/java/io/github/moulberry/notenoughupdates/CustomItems.java b/src/main/java/io/github/moulberry/notenoughupdates/CustomItems.java
index 148f1bc5..4328eaf4 100644
--- a/src/main/java/io/github/moulberry/notenoughupdates/CustomItems.java
+++ b/src/main/java/io/github/moulberry/notenoughupdates/CustomItems.java
@@ -8,8 +8,8 @@ import net.minecraft.util.EnumChatFormatting;
public class CustomItems {
/**
- * So it has come to this, huh? Snooping through the source to find all my carefully crafted easter eggs. Well
- * guess what, you cheated not only the game, but yourself. You didn't grow. You didn't improve. You took a
+ * So it has come to this, huh? Snooping through the source to find all my carefully crafted easter eggs. You
+ * cheated not only the game, but yourself. You didn't grow. You didn't improve. You took a
* shortcut and gained nothing. You experienced a hollow victory. Nothing was risked and nothing was gained.
* It's sad that you don't know the difference.
*/
@@ -22,7 +22,7 @@ public class CustomItems {
"Dirt, AOTD. Dirt, AOTD.",
"Ooh, Dirt to Midas! Let's shake it up a little.",
"",
- "Also, Did you know that only 10% of the people watching are subscribed?",
+ "Also, did you know that only 8.7% of the people watching are subscribed?",
"It's OK, everyone makes mistakes",
"Also follow -> twitch.tv/nullzeelive",
"Also -> discord.gg/nullzee");
diff --git a/src/main/java/io/github/moulberry/notenoughupdates/GuiTextures.java b/src/main/java/io/github/moulberry/notenoughupdates/GuiTextures.java
index 48db19a5..965a7e48 100644
--- a/src/main/java/io/github/moulberry/notenoughupdates/GuiTextures.java
+++ b/src/main/java/io/github/moulberry/notenoughupdates/GuiTextures.java
@@ -14,12 +14,19 @@ public class GuiTextures {
public static final ResourceLocation item_edit = new ResourceLocation("notenoughupdates:item_edit.png");
public static final ResourceLocation close = new ResourceLocation("notenoughupdates:close.png");
public static final ResourceLocation settings = new ResourceLocation("notenoughupdates:settings.png");
+
public static final ResourceLocation off = new ResourceLocation("notenoughupdates:off.png");
public static final ResourceLocation on = new ResourceLocation("notenoughupdates:on.png");
public static final ResourceLocation help = new ResourceLocation("notenoughupdates:help.png");
+ public static final ResourceLocation slider_off = new ResourceLocation("notenoughupdates:slider_off.png");
+ public static final ResourceLocation slider_on = new ResourceLocation("notenoughupdates:slider_on.png");
+ public static final ResourceLocation slider_button = new ResourceLocation("notenoughupdates:slider_button.png");
public static final ResourceLocation item_mask = new ResourceLocation("notenoughupdates:item_mask.png");
+ public static final ResourceLocation ah_item_holder = new ResourceLocation("notenoughupdates:ah_item_holder.png");
+ public static final ResourceLocation ah_item_tab = new ResourceLocation("notenoughupdates:ah_item_tab.png");
+
public static final ResourceLocation logo = new ResourceLocation("notenoughupdates:logo.png");
public static final ResourceLocation logo_fg = new ResourceLocation("notenoughupdates:logo_fg.png");
public static final ResourceLocation logo_bg = new ResourceLocation("notenoughupdates:logo_bg.png");
@@ -39,8 +46,10 @@ public class GuiTextures {
public static final ResourceLocation order_alphabetical = new ResourceLocation("notenoughupdates:order_alphabetical.png");
public static final ResourceLocation order_rarity = new ResourceLocation("notenoughupdates:order_rarity.png");
+ public static final ResourceLocation order_value = new ResourceLocation("notenoughupdates:order_value.png");
public static final ResourceLocation order_alphabetical_active = new ResourceLocation("notenoughupdates:order_alphabetical_active.png");
public static final ResourceLocation order_rarity_active = new ResourceLocation("notenoughupdates:order_rarity_active.png");
+ public static final ResourceLocation order_value_active = new ResourceLocation("notenoughupdates:order_value_active.png");
public static final ResourceLocation ascending_overlay = new ResourceLocation("notenoughupdates:ascending_overlay.png");
public static final ResourceLocation descending_overlay = new ResourceLocation("notenoughupdates:descending_overlay.png");
diff --git a/src/main/java/io/github/moulberry/notenoughupdates/NEUIO.java b/src/main/java/io/github/moulberry/notenoughupdates/NEUIO.java
index a7c7a1e4..d2190425 100644
--- a/src/main/java/io/github/moulberry/notenoughupdates/NEUIO.java
+++ b/src/main/java/io/github/moulberry/notenoughupdates/NEUIO.java
@@ -84,13 +84,6 @@ public class NEUIO {
}
}
}
-
- /*for(GHContent content : repo.getDirectoryContent("items")) {
- String oldSha = oldShas.get(content.getName());
- if(!content.getSha().equals(oldSha)) {
- changedFiles.put(content.getName(), content.getSha());
- }
- }*/
} catch(IOException e) {
return null;
}
diff --git a/src/main/java/io/github/moulberry/notenoughupdates/NEUManager.java b/src/main/java/io/github/moulberry/notenoughupdates/NEUManager.java
index bebd090c..e2c8d928 100644
--- a/src/main/java/io/github/moulberry/notenoughupdates/NEUManager.java
+++ b/src/main/java/io/github/moulberry/notenoughupdates/NEUManager.java
@@ -54,7 +54,7 @@ public class NEUManager {
public String viewItemAttemptID = null;
public long viewItemAttemptTime = 0;
- public String currentProfile = "";
+ public String currentProfile = "Papaya";
public final HypixelApi hypixelApi = new HypixelApi();
private ResourceLocation wkZip = new ResourceLocation("notenoughupdates:wkhtmltox.zip");
@@ -180,6 +180,25 @@ public class NEUManager {
public float craftCost = -1;
}
+ public boolean isVanillaItem(String internalname) {
+ //Removes trailing numbers and underscores, eg. LEAVES_2-3 -> LEAVES
+ String vanillaName = internalname.split("-")[0];
+ int sub = 0;
+ for(int i=vanillaName.length()-1; i>1; i--) {
+ char c = vanillaName.charAt(i);
+ if((int)c >= 48 && (int)c <= 57) { //0-9
+ sub++;
+ } else if(c == '_') {
+ sub++;
+ break;
+ } else {
+ break;
+ }
+ }
+ vanillaName = vanillaName.substring(0, vanillaName.length()-sub).toLowerCase();
+ return Item.itemRegistry.getObject(new ResourceLocation(vanillaName)) != null;
+ }
+
/**
* Recursively calculates the cost of crafting an item from raw materials.
*/
@@ -189,24 +208,7 @@ public class NEUManager {
} else {
CraftInfo ci = new CraftInfo();
- //Removes trailing numbers and underscores, eg. LEAVES_2-3 -> LEAVES
- String vanillaName = internalname.split("-")[0];
- int sub = 0;
- for(int i=vanillaName.length()-1; i>1; i--) {
- char c = vanillaName.charAt(i);
- if((int)c >= 48 && (int)c <= 57) { //0-9
- sub++;
- } else if(c == '_') {
- sub++;
- break;
- } else {
- break;
- }
- }
- vanillaName = vanillaName.substring(0, vanillaName.length()-sub);
- if(Item.itemRegistry.getObject(new ResourceLocation(vanillaName)) != null) {
- ci.vanillaItem = true;
- }
+ ci.vanillaItem = isVanillaItem(internalname);
JsonObject auctionInfo = getItemAuctionInfo(internalname);
JsonObject bazaarInfo = getBazaarInfo(internalname);
@@ -657,9 +659,29 @@ public class NEUManager {
public Set<String> search(String query, boolean multi) {
if(multi) {
Set<String> result = new HashSet<>();
- for(String query2 : query.split("\\|")) {
- result.addAll(search(query2));
+
+ StringBuilder query2 = new StringBuilder();
+ char lastOp = '|';
+ for(char c : query.toCharArray()) {
+ if(c == '|' || c == '&') {
+ if(lastOp == '|') {
+ result.addAll(search(query2.toString()));
+ } else if(lastOp == '&') {
+ result.retainAll(search(query2.toString()));
+ }
+
+ query2 = new StringBuilder();
+ lastOp = c;
+ } else {
+ query2.append(c);
+ }
+ }
+ if(lastOp == '|') {
+ result.addAll(search(query2.toString()));
+ } else if(lastOp == '&') {
+ result.retainAll(search(query2.toString()));
}
+
return result;
} else {
return search(query);
@@ -670,6 +692,10 @@ public class NEUManager {
* Returns the name of items which match a certain search query.
*/
public Set<String> search(String query) {
+ query = query.trim();
+ boolean negate = query.startsWith("!");
+ if(negate) query = query.substring(1);
+
LinkedHashSet<String> results = new LinkedHashSet<>();
if(query.startsWith("title:")) {
query = query.substring(6);
@@ -691,7 +717,16 @@ public class NEUManager {
results.addAll(new TreeSet<>(search(query, titleWordMap)));
results.addAll(new TreeSet<>(search(query, loreWordMap)));
}
- return results;
+ if(!negate) {
+ return results;
+ } else {
+ Set<String> negatedResults = new HashSet<>();
+ for(String internalname : itemMap.keySet()) {
+ negatedResults.add(internalname);
+ }
+ negatedResults.removeAll(results);
+ return negatedResults;
+ }
}
/**
diff --git a/src/main/java/io/github/moulberry/notenoughupdates/NEUOverlay.java b/src/main/java/io/github/moulberry/notenoughupdates/NEUOverlay.java
index 59233882..d96be893 100644
--- a/src/main/java/io/github/moulberry/notenoughupdates/NEUOverlay.java
+++ b/src/main/java/io/github/moulberry/notenoughupdates/NEUOverlay.java
@@ -30,6 +30,7 @@ import net.minecraft.util.EnumFacing;
import net.minecraft.util.Matrix4f;
import net.minecraft.util.ResourceLocation;
import net.minecraft.world.World;
+import net.minecraftforge.client.ClientCommandHandler;
import org.apache.commons.lang3.StringUtils;
import org.lwjgl.input.Keyboard;
import org.lwjgl.input.Mouse;
@@ -62,10 +63,10 @@ public class NEUOverlay extends Gui {
};
private ResourceLocation[] orderIcons = new ResourceLocation[] {
- order_alphabetical, order_rarity
+ order_alphabetical, order_rarity, order_value
};
private ResourceLocation[] orderIconsActive = new ResourceLocation[] {
- order_alphabetical_active, order_rarity_active
+ order_alphabetical_active, order_rarity_active, order_value_active
};
//Various constants used for GUI structure
@@ -74,9 +75,8 @@ public class NEUOverlay extends Gui {
private final int searchBarYSize = 40;
private final int searchBarPadding = 2;
- private static final int BOX_PADDING = 15;
- public static final int ITEM_PADDING = 4;
- public static final int ITEM_SIZE = 16;
+ public static final int ITEM_PADDING = 4;
+ public static final int ITEM_SIZE = 16;
private Color bg = new Color(90, 90, 140, 50);
private Color fg = new Color(100,100,100, 255);
@@ -97,6 +97,9 @@ public class NEUOverlay extends Gui {
private boolean searchMode = false;
private long millisLastLeftClick = 0;
+ private long millisLastMouseMove = 0;
+ private int lastMouseX = 0;
+ private int lastMouseY = 0;
boolean mouseDown = false;
@@ -107,6 +110,7 @@ public class NEUOverlay extends Gui {
private static final int COMPARE_MODE_ALPHABETICAL = 0;
private static final int COMPARE_MODE_RARITY = 1;
+ private static final int COMPARE_MODE_VALUE = 2;
private static final int SORT_MODE_ALL = 0;
private static final int SORT_MODE_MOB = 1;
@@ -177,6 +181,13 @@ public class NEUOverlay extends Gui {
int mouseX = Mouse.getX() / scaledresolution.getScaleFactor();
int mouseY = height - Mouse.getY() / scaledresolution.getScaleFactor();
+ if(lastMouseX != mouseX || lastMouseY != mouseY) {
+ millisLastMouseMove = System.currentTimeMillis();
+ }
+
+ lastMouseX = mouseX;
+ lastMouseY = mouseY;
+
if(Mouse.getEventButtonState()) {
mouseDown = true;
} else if(Mouse.getEventButton() != -1) {
@@ -288,8 +299,8 @@ public class NEUOverlay extends Gui {
}
//Clicking on "close info pane" button
- if(mouseX > width*getInfoPaneOffsetFactor()-22 && mouseX < width*getInfoPaneOffsetFactor()-6) {
- if(mouseY > 7 && mouseY < 23) {
+ if(mouseX > width*getInfoPaneOffsetFactor()-getBoxPadding()-8 && mouseX < width*getInfoPaneOffsetFactor()-getBoxPadding()+8) {
+ if(mouseY > getBoxPadding()-8 && mouseY < getBoxPadding()+8) {
if(Mouse.getEventButtonState() && Mouse.getEventButton() < 2) { //Left or right click up
displayInformationPane(null);
return true;
@@ -322,6 +333,9 @@ public class NEUOverlay extends Gui {
if(command.startsWith("/")) {
NotEnoughUpdates.INSTANCE.sendChatMessage(command);
return true;
+ } else {
+ ClientCommandHandler.instance.executeCommand(Minecraft.getMinecraft().thePlayer, command);
+ return true;
}
}
}
@@ -376,6 +390,8 @@ public class NEUOverlay extends Gui {
if(mouseX < width*getInfoPaneOffsetFactor()) {
activeInfoPane.mouseInput(width, height, mouseX, mouseY, mouseDown);
return true;
+ } else if(Mouse.getEventButton() <= 1 && Mouse.getEventButtonState()) { //Left or right click
+ activeInfoPane.mouseInputOutside();
}
}
@@ -627,6 +643,12 @@ public class NEUOverlay extends Gui {
if(rarity1 < rarity2) return mult;
if(rarity1 > rarity2) return -mult;
+ } else if(getCompareMode() == COMPARE_MODE_VALUE) {
+ float cost1 = manager.getCraftCost(o1.get("internalname").getAsString()).craftCost;
+ float cost2 = manager.getCraftCost(o2.get("internalname").getAsString()).craftCost;
+
+ if(cost1 < cost2) return mult;
+ if(cost1 > cost2) return -mult;
}
String i1 = o1.get("internalname").getAsString();
@@ -776,7 +798,8 @@ public class NEUOverlay extends Gui {
}
public int getBoxPadding() {
- return (BOX_PADDING-5)*2/scaledresolution.getScaleFactor()+5;
+ double panePadding = Math.max(0, Math.min(20, manager.config.panePadding.value));
+ return (int)(panePadding*2/scaledresolution.getScaleFactor()+5);
}
private abstract class ItemSlotConsumer {
@@ -1252,7 +1275,7 @@ public class NEUOverlay extends Gui {
//Atomic reference used so that below lambda doesn't complain about non-effectively-final variable
AtomicReference<JsonObject> tooltipToDisplay = new AtomicReference<>(null);
-
+ List<String> textToDisplay = null;
if(itemPaneOffsetFactor.getValue() < 1) {
renderBlurredBackground(width, height,
leftSide+getBoxPadding()-5, getBoxPadding()-5,
@@ -1290,6 +1313,19 @@ public class NEUOverlay extends Gui {
GlStateManager.color(1f, 1f, 1f, 1f);
Utils.drawTexturedRect(orderIconX, iconTop, scaledITEM_SIZE, scaledITEM_SIZE,0, 1, 0, 1, GL11.GL_NEAREST);
GlStateManager.bindTexture(0);
+
+ if(mouseY > iconTop && mouseY < iconTop+scaledITEM_SIZE) {
+ if(mouseX > orderIconX && mouseX < orderIconX+scaledITEM_SIZE) {
+ if(System.currentTimeMillis() - millisLastMouseMove > 400) {
+ String text = EnumChatFormatting.GRAY+"Order ";
+ if(i == COMPARE_MODE_ALPHABETICAL) text += "Alphabetically";
+ else if(i == COMPARE_MODE_RARITY) text += "by Rarity";
+ else if(i == COMPARE_MODE_VALUE) text += "by Item Worth";
+ else text = null;
+ if(text != null) textToDisplay = Utils.createList(text);
+ }
+ }
+ }
}
for(int i=0; i<sortIcons.length; i++) {
@@ -1299,6 +1335,22 @@ public class NEUOverlay extends Gui {
GlStateManager.color(1f, 1f, 1f, 1f);
Utils.drawTexturedRect(sortIconX, iconTop, scaledITEM_SIZE, scaledITEM_SIZE, 0, 1, 0, 1, GL11.GL_NEAREST);
GlStateManager.bindTexture(0);
+
+ if(mouseY > iconTop && mouseY < iconTop+scaledITEM_SIZE) {
+ if(mouseX >