From 9f372b3f8b5f07b3dbc6c010e064924d5b4820a4 Mon Sep 17 00:00:00 2001 From: Lulonaut <67191924+Lulonaut@users.noreply.github.com> Date: Sun, 15 May 2022 11:55:11 +0200 Subject: More Keyboard fixes (#130) * Allow holding down keys in StorageOverlay and Item list searchbar * don't sleep on the render thread * Remove most calls to Keyboard#enableRepeatEvents Also remove my flawless implementation in the render methods since it's not needed anymore * remove autoclicker --- .../notenoughupdates/miscgui/GuiInvButtonEditor.java | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) (limited to 'src/main/java/io/github/moulberry/notenoughupdates/miscgui/GuiInvButtonEditor.java') diff --git a/src/main/java/io/github/moulberry/notenoughupdates/miscgui/GuiInvButtonEditor.java b/src/main/java/io/github/moulberry/notenoughupdates/miscgui/GuiInvButtonEditor.java index 7c74c6e2..850d8328 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/miscgui/GuiInvButtonEditor.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/miscgui/GuiInvButtonEditor.java @@ -1,6 +1,11 @@ package io.github.moulberry.notenoughupdates.miscgui; -import com.google.gson.*; +import com.google.gson.JsonArray; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.JsonParser; +import com.google.gson.JsonPrimitive; import io.github.moulberry.notenoughupdates.NotEnoughUpdates; import io.github.moulberry.notenoughupdates.core.GlScissorStack; import io.github.moulberry.notenoughupdates.core.GuiElementTextField; @@ -17,7 +22,6 @@ import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.nbt.NBTTagList; import net.minecraft.util.ResourceLocation; -import org.lwjgl.input.Keyboard; import org.lwjgl.input.Mouse; import org.lwjgl.opengl.GL11; @@ -29,8 +33,15 @@ import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.nio.charset.StandardCharsets; +import java.util.ArrayList; +import java.util.Base64; +import java.util.Comparator; +import java.util.HashMap; +import java.util.HashSet; +import java.util.LinkedHashMap; import java.util.List; -import java.util.*; +import java.util.Map; +import java.util.UUID; import java.util.concurrent.ExecutorService; import java.util.concurrent.Executors; import java.util.concurrent.atomic.AtomicInteger; @@ -130,7 +141,6 @@ public class GuiInvButtonEditor extends GuiScreen { super(); reloadExtraIcons(); reloadPresets(); - Keyboard.enableRepeatEvents(true); } private static void reloadExtraIcons() { -- cgit From 1076a433bb6bb57c4d9ab73342d8f8b21c9749fc Mon Sep 17 00:00:00 2001 From: jani270 <69345714+jani270@users.noreply.github.com> Date: Tue, 17 May 2022 17:08:21 +0200 Subject: I cannot believe this (#140) --- .../notenoughupdates/miscgui/GuiInvButtonEditor.java | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) (limited to 'src/main/java/io/github/moulberry/notenoughupdates/miscgui/GuiInvButtonEditor.java') diff --git a/src/main/java/io/github/moulberry/notenoughupdates/miscgui/GuiInvButtonEditor.java b/src/main/java/io/github/moulberry/notenoughupdates/miscgui/GuiInvButtonEditor.java index 850d8328..83880846 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/miscgui/GuiInvButtonEditor.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/miscgui/GuiInvButtonEditor.java @@ -118,8 +118,6 @@ public class GuiInvButtonEditor extends GuiScreen { put("crypts", "skull:25d2f31ba162fe6272e831aed17f53213db6fa1c4cbe4fc827f3963cc98b9"); put("spiders den", "skull:c754318a3376f470e481dfcd6c83a59aa690ad4b4dd7577fdad1c2ef08d8aee6"); put("top of the nest", "skull:9d7e3b19ac4f3dee9c5677c135333b9d35a7f568b63d1ef4ada4b068b5a25"); - put("blazing fortress", "skull:c3687e25c632bce8aa61e0d64c24e694c3eea629ea944f4cf30dcfb4fbce071"); - put("blazing fortress magma boss", "skull:38957d5023c937c4c41aa2412d43410bda23cf79a9f6ab36b76fef2d7c429"); put("the end", "skull:7840b87d52271d2a755dedc82877e0ed3df67dcc42ea479ec146176b02779a5"); put("the end dragons nest", "skull:a1cd6d2d03f135e7c6b5d6cdae1b3a68743db4eb749faf7341e9fb347aa283b"); put("the park", "skull:a221f813dacee0fef8c59f76894dbb26415478d9ddfc44c2e708a6d3b7549b"); @@ -128,11 +126,18 @@ public class GuiInvButtonEditor extends GuiScreen { put("gold mines", "skull:73bc965d579c3c6039f0a17eb7c2e6faf538c7a5de8e60ec7a719360d0a857a9"); put("deep caverns", "skull:569a1f114151b4521373f34bc14c2963a5011cdc25a6554c48c708cd96ebfc"); put("the barn", "skull:4d3a6bd98ac1833c664c4909ff8d2dc62ce887bdcf3cc5b3848651ae5af6b"); - put("mushroom desert", "skull:2116b9d8df346a25edd05f842e7a9345beaf16dca4118abf5a68c75bcaae10"); + put("mushroom desert", "skull:6b20b23c1aa2be0270f016b4c90d6ee6b8330a17cfef87869d6ad60b2ffbf3b5"); put("dungeon hub", "skull:9b56895b9659896ad647f58599238af532d46db9c1b0389b8bbeb70999dab33d"); - put("dwarven mines", "skull:569a1f114151b4521373f34bc14c2963a5011cdc25a6554c48c708cd96ebfc"); + put("dwarven mines", "skull:51539dddf9ed255ece6348193cd75012c82c93aec381f05572cecf7379711b3b"); put("hotm heart of the mountain", "skull:86f06eaa3004aeed09b3d5b45d976de584e691c0e9cade133635de93d23b9edb"); put("bazaar dude", "skull:c232e3820897429157619b0ee099fec0628f602fff12b695de54aef11d923ad7"); + put("museum", "skull:438cf3f8e54afc3b3f91d20a49f324dca1486007fe545399055524c17941f4dc"); + put("crystal hollows", "skull:21dbe30b027acbceb612563bd877cd7ebb719ea6ed1399027dcee58bb9049d4a"); + put("dwarven forge", "skull:5cbd9f5ec1ed007259996491e69ff649a3106cf920227b1bb3a71ee7a89863f"); + put("forgotton skull", "skull:6becc645f129c8bc2faa4d8145481fab11ad2ee75749d628dcd999aa94e7"); + put("crystal nucleus", "skull:34d42f9c461cee1997b67bf3610c6411bf852b9e5db607bbf626527cfb42912c"); + put("void sepulture", "skull:eb07594e2df273921a77c101d0bfdfa1115abed5b9b2029eb496ceba9bdbb4b3"); + put("crimson isle", "skull:c3687e25c632bce8aa61e0d64c24e694c3eea629ea944f4cf30dcfb4fbce071"); }}; private static LinkedHashMap> presets = null; -- cgit From a6546a1abe954b394c40be58d73d6fb03d93709e Mon Sep 17 00:00:00 2001 From: NopoTheGamer <40329022+NopoTheGamer@users.noreply.github.com> Date: Sat, 28 May 2022 15:53:16 +0000 Subject: added config saving (#149) * i am unsure why this was here but it doesnt seem needed * saving config when closing menus with configs * Chatting --- .../moulberry/notenoughupdates/miscgui/GuiInvButtonEditor.java | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src/main/java/io/github/moulberry/notenoughupdates/miscgui/GuiInvButtonEditor.java') diff --git a/src/main/java/io/github/moulberry/notenoughupdates/miscgui/GuiInvButtonEditor.java b/src/main/java/io/github/moulberry/notenoughupdates/miscgui/GuiInvButtonEditor.java index 83880846..d65a18b0 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/miscgui/GuiInvButtonEditor.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/miscgui/GuiInvButtonEditor.java @@ -22,6 +22,7 @@ import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.nbt.NBTTagList; import net.minecraft.util.ResourceLocation; +import org.lwjgl.input.Keyboard; import org.lwjgl.input.Mouse; import org.lwjgl.opengl.GL11; @@ -841,6 +842,11 @@ public class GuiInvButtonEditor extends GuiScreen { private final ExecutorService searchES = Executors.newSingleThreadExecutor(); private final AtomicInteger searchId = new AtomicInteger(0); + @Override + public void onGuiClosed() { + NotEnoughUpdates.INSTANCE.saveConfig(); + } + public void search() { final int thisSearchId = searchId.incrementAndGet(); final String searchString = iconTextField.getText(); -- cgit From 50dc2122462642a0c3a00b3a3ae6389825dc04df Mon Sep 17 00:00:00 2001 From: IRONM00N <64110067+IRONM00N@users.noreply.github.com> Date: Thu, 9 Jun 2022 18:04:22 -0400 Subject: Re-license project as LGPL (#157) * add licence files & a few misc chores * add license notices & run auto formatter --- .../notenoughupdates/miscgui/GuiInvButtonEditor.java | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) (limited to 'src/main/java/io/github/moulberry/notenoughupdates/miscgui/GuiInvButtonEditor.java') diff --git a/src/main/java/io/github/moulberry/notenoughupdates/miscgui/GuiInvButtonEditor.java b/src/main/java/io/github/moulberry/notenoughupdates/miscgui/GuiInvButtonEditor.java index d65a18b0..40e12e35 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/miscgui/GuiInvButtonEditor.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/miscgui/GuiInvButtonEditor.java @@ -1,3 +1,22 @@ +/* + * Copyright (C) 2022 NotEnoughUpdates contributors + * + * This file is part of NotEnoughUpdates. + * + * NotEnoughUpdates is free software: you can redistribute it + * and/or modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation, either + * version 3 of the License, or (at your option) any later version. + * + * NotEnoughUpdates is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with NotEnoughUpdates. If not, see . + */ + package io.github.moulberry.notenoughupdates.miscgui; import com.google.gson.JsonArray; @@ -22,7 +41,6 @@ import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.nbt.NBTTagList; import net.minecraft.util.ResourceLocation; -import org.lwjgl.input.Keyboard; import org.lwjgl.input.Mouse; import org.lwjgl.opengl.GL11; -- cgit From 765b569dd667d6a7e86b26d5ef1e7c5a5bade8f7 Mon Sep 17 00:00:00 2001 From: Ascynx <78341107+Ascynx@users.noreply.github.com> Date: Mon, 12 Sep 2022 10:41:12 +0200 Subject: Bug fixes (aka #249 but less of a mess) (#251) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * made equipment overlay own class lmk if there's any bugs * fix infer (i think) * fuck infer * First refactoringering * Fix more stuff * itemlisting * NEU 3.0 release notes * The changes of #249 (https://github.com/NotEnoughUpdates/NotEnoughUpdates/pull/249) * fixed nea bug https://imgur.com/a/Sg3iw74 * whitespace * fixed equipment overlay not working ? and caching * nopoing idk what im doing * FHJNX GHD trwsmokürtsew tze jiozterdgjjiüzetr jipztr * reverted "janky pet expended bugfix" * Revert "FHJNX GHD" This reverts commit 24eceba3db5e500be296f5a96412bd8b95647a22. * Revert "nopoing" This reverts commit bee07cb98f8b9672c2e1bc192c6c3e5ae8b02b95. * Revert "fixed equipment overlay" This reverts commit b15376f934a738900e2dd98efdb0d4a7ec131dfa. * idk i think this works maybe * ??? ????????? * Update to the catacombs base floor exp. Based on the hypixel wiki's calculator (see: https://canary.discord.com/channels/516977525906341928/1016050994557222912) * no more black lines * equipment cache * Fix lag with optifine and removal of unused field. Removed onMouseClick as it was triggered more than once per tick when optifine is installed. Removed tooltipsToDisplay field (as it was replaced by a local variable). * this should be true by default to keep old behaviour * itemList now doesn't close when clicking the searchbar itemList will now only close when searchMode is triggered. * Infer moment hoping this doesn't trigger it. * I forgot to push that change when I created the pr. * Fixed json resetting if an item has no nbt Co-authored-by: efefury <69400149+efefury@users.noreply.github.com> Co-authored-by: nea Co-authored-by: Lulonaut Co-authored-by: nopo Co-authored-by: Roman / Linnea Gräf Co-authored-by: Lorenz --- .../miscgui/GuiInvButtonEditor.java | 56 +++++++++++++++++++--- 1 file changed, 49 insertions(+), 7 deletions(-) (limited to 'src/main/java/io/github/moulberry/notenoughupdates/miscgui/GuiInvButtonEditor.java') diff --git a/src/main/java/io/github/moulberry/notenoughupdates/miscgui/GuiInvButtonEditor.java b/src/main/java/io/github/moulberry/notenoughupdates/miscgui/GuiInvButtonEditor.java index 40e12e35..4d18ea18 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/miscgui/GuiInvButtonEditor.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/miscgui/GuiInvButtonEditor.java @@ -25,11 +25,13 @@ import com.google.gson.JsonObject; import com.google.gson.JsonParseException; import com.google.gson.JsonParser; import com.google.gson.JsonPrimitive; +import io.github.moulberry.notenoughupdates.NEUOverlay; import io.github.moulberry.notenoughupdates.NotEnoughUpdates; import io.github.moulberry.notenoughupdates.core.GlScissorStack; import io.github.moulberry.notenoughupdates.core.GuiElementTextField; import io.github.moulberry.notenoughupdates.core.util.lerp.LerpingInteger; import io.github.moulberry.notenoughupdates.options.NEUConfig; +import io.github.moulberry.notenoughupdates.overlays.EquipmentOverlay; import io.github.moulberry.notenoughupdates.util.Utils; import net.minecraft.client.Minecraft; import net.minecraft.client.gui.Gui; @@ -316,6 +318,13 @@ public class GuiInvButtonEditor extends GuiScreen { GlStateManager.color(1, 1, 1, 1); Utils.drawTexturedRect(guiLeft, guiTop, xSize, ySize, 0, xSize / 256f, 0, ySize / 256f, GL11.GL_NEAREST); + if (NotEnoughUpdates.INSTANCE.config.customArmour.enableArmourHud) { + EquipmentOverlay.INSTANCE.renderPreviewArmorHud(); + } + if (NotEnoughUpdates.INSTANCE.config.petOverlay.petInvDisplay) { + EquipmentOverlay.INSTANCE.renderPreviewPetInvHud(); + } + for (NEUConfig.InventoryButton button : NotEnoughUpdates.INSTANCE.config.hidden.inventoryButtons) { int x = guiLeft + button.x; int y = guiTop + button.y; @@ -326,6 +335,17 @@ public class GuiInvButtonEditor extends GuiScreen { y += ySize; } + if (NotEnoughUpdates.INSTANCE.config.customArmour.enableArmourHud) { + if (x < guiLeft + xSize - 150 && x > guiLeft + xSize - 200 && y > guiTop && y < guiTop + 84) { + x -= 25; + } + } + if (NotEnoughUpdates.INSTANCE.config.petOverlay.petInvDisplay) { + if (x < guiLeft + xSize - 150 && x > guiLeft + xSize - 200 && y > guiTop + 60 && y < guiTop + 120) { + x -= 25; + } + } + if (button.isActive()) { GlStateManager.color(1, 1, 1, 1f); } else { @@ -358,7 +378,7 @@ public class GuiInvButtonEditor extends GuiScreen { Minecraft.getMinecraft().getTextureManager().bindTexture(custom_ench_colour); GlStateManager.color(1, 1, 1, 1); Utils.drawTexturedRect( - guiLeft - 88 - 2 - 22, + guiLeft - 88 - 2 - 22 - (NotEnoughUpdates.INSTANCE.config.customArmour.enableArmourHud ? 25 : 0), guiTop + 2, 88, 20, @@ -369,7 +389,7 @@ public class GuiInvButtonEditor extends GuiScreen { GL11.GL_NEAREST ); Utils.drawTexturedRect( - guiLeft - 88 - 2 - 22, + guiLeft - 88 - 2 - 22 - (NotEnoughUpdates.INSTANCE.config.customArmour.enableArmourHud ? 25 : 0), guiTop + 2 + 24, 88, 20, @@ -382,7 +402,7 @@ public class GuiInvButtonEditor extends GuiScreen { Utils.drawStringCenteredScaledMaxWidth( "Load preset", fontRendererObj, - guiLeft - 44 - 2 - 22, + guiLeft - 44 - 2 - 22 - (NotEnoughUpdates.INSTANCE.config.customArmour.enableArmourHud ? 25 : 0), guiTop + 8, false, 86, @@ -391,7 +411,7 @@ public class GuiInvButtonEditor extends GuiScreen { Utils.drawStringCenteredScaledMaxWidth( "from Clipboard", fontRendererObj, - guiLeft - 44 - 2 - 22, + guiLeft - 44 - 2 - 22 - (NotEnoughUpdates.INSTANCE.config.customArmour.enableArmourHud ? 25 : 0), guiTop + 16, false, 86, @@ -400,7 +420,7 @@ public class GuiInvButtonEditor extends GuiScreen { Utils.drawStringCenteredScaledMaxWidth( "Save preset", fontRendererObj, - guiLeft - 44 - 2 - 22, + guiLeft - 44 - 2 - 22 - (NotEnoughUpdates.INSTANCE.config.customArmour.enableArmourHud ? 25 : 0), guiTop + 8 + 24, false, 86, @@ -409,7 +429,7 @@ public class GuiInvButtonEditor extends GuiScreen { Utils.drawStringCenteredScaledMaxWidth( "to Clipboard", fontRendererObj, - guiLeft - 44 - 2 - 22, + guiLeft - 44 - 2 - 22 - (NotEnoughUpdates.INSTANCE.config.customArmour.enableArmourHud ? 25 : 0), guiTop + 16 + 24, false, 86, @@ -417,7 +437,7 @@ public class GuiInvButtonEditor extends GuiScreen { ); if (!validShareContents()) { - Gui.drawRect(guiLeft - 88 - 2 - 22, guiTop + 2, guiLeft - 2 - 22, guiTop + 2 + 20, 0x80000000); + Gui.drawRect(guiLeft - 88 - 2 - 22 - (NotEnoughUpdates.INSTANCE.config.customArmour.enableArmourHud ? 25 : 0), guiTop + 2, guiLeft - 2 - 22 - (NotEnoughUpdates.INSTANCE.config.customArmour.enableArmourHud ? 25 : 0), guiTop + 2 + 20, 0x80000000); } GlStateManager.color(1, 1, 1, 1); @@ -461,6 +481,17 @@ public class GuiInvButtonEditor extends GuiScreen { y += ySize; } + if (NotEnoughUpdates.INSTANCE.config.customArmour.enableArmourHud) { + if (x < guiLeft + xSize - 150 && x > guiLeft + xSize - 200 && y > guiTop && y < guiTop + 84) { + x -= 25; + } + } + if (NotEnoughUpdates.INSTANCE.config.petOverlay.petInvDisplay) { + if (x < guiLeft + xSize - 150 && x > guiLeft + xSize - 200 && y > guiTop + 60 && y < guiTop + 120) { + x -= 25; + } + } + GlStateManager.translate(0, 0, 300); editorLeft = x + 8 - editorXSize / 2; editorTop = y + 18 + 2; @@ -741,6 +772,17 @@ public class GuiInvButtonEditor extends GuiScreen { y += ySize; } + if (NotEnoughUpdates.INSTANCE.config.customArmour.enableArmourHud) { + if (x < guiLeft + xSize - 150 && x > guiLeft + xSize - 200 && y > guiTop && y < guiTop + 84) { + x -= 25; + } + } + if (NotEnoughUpdates.INSTANCE.config.petOverlay.petInvDisplay) { + if (x < guiLeft + xSize - 150 && x > guiLeft + xSize - 200 && y > guiTop + 60 && y < guiTop + 120) { + x -= 25; + } + } + if (mouseX >= x && mouseY >= y && mouseX <= x + 18 && mouseY <= y + 18) { if (editingButton == button) { -- cgit From 53cc06e8badfc34ee5c54062ed24639fb4c88886 Mon Sep 17 00:00:00 2001 From: Ascynx <78341107+Ascynx@users.noreply.github.com> Date: Fri, 16 Sep 2022 17:25:28 +0200 Subject: petHud/EquipmentHud preview render fix (#293) --- .../moulberry/notenoughupdates/miscgui/GuiInvButtonEditor.java | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'src/main/java/io/github/moulberry/notenoughupdates/miscgui/GuiInvButtonEditor.java') diff --git a/src/main/java/io/github/moulberry/notenoughupdates/miscgui/GuiInvButtonEditor.java b/src/main/java/io/github/moulberry/notenoughupdates/miscgui/GuiInvButtonEditor.java index 4d18ea18..7aa0d2ec 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/miscgui/GuiInvButtonEditor.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/miscgui/GuiInvButtonEditor.java @@ -85,6 +85,15 @@ public class GuiInvButtonEditor extends GuiScreen { private int guiLeft; private int guiTop; + //region getGuiCoordinates + public int getGuiLeft() { + return this.guiLeft; + } + public int getGuiTop() { + return this.guiTop; + } + //endregion + private static final int BACKGROUND_TYPES = 5; private static final int ICON_TYPES = 3; private int iconTypeIndex = 0; -- cgit