From d44f33636eb301ff029bf41d7f1decb3340efb54 Mon Sep 17 00:00:00 2001 From: Lulonaut <67191924+Lulonaut@users.noreply.github.com> Date: Thu, 3 Mar 2022 04:05:45 +0100 Subject: NeuEventListener changes and dead code removal (#88) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * hide Hypixel reforge stats * unused import? * better comments * 2.1.md 🙂 * 2.1.md 🙂 * minor cleanup * api * remove collectionLog and morus and cape.png * remove FancyPortals and panorama dev cmd Co-authored-by: IRONM00N <64110067+IRONM00N@users.noreply.github.com> --- .../io/github/moulberry/notenoughupdates/miscgui/StorageOverlay.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/main/java/io/github/moulberry/notenoughupdates/miscgui/StorageOverlay.java') diff --git a/src/main/java/io/github/moulberry/notenoughupdates/miscgui/StorageOverlay.java b/src/main/java/io/github/moulberry/notenoughupdates/miscgui/StorageOverlay.java index bce5bfbd..2d4d4382 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/miscgui/StorageOverlay.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/miscgui/StorageOverlay.java @@ -1,7 +1,6 @@ package io.github.moulberry.notenoughupdates.miscgui; import com.google.common.collect.Lists; -import io.github.moulberry.notenoughupdates.NEUEventListener; import io.github.moulberry.notenoughupdates.NotEnoughUpdates; import io.github.moulberry.notenoughupdates.core.*; import io.github.moulberry.notenoughupdates.core.config.KeybindHelper; @@ -9,6 +8,7 @@ import io.github.moulberry.notenoughupdates.core.util.lerp.LerpingInteger; import io.github.moulberry.notenoughupdates.miscfeatures.BetterContainers; import io.github.moulberry.notenoughupdates.miscfeatures.SlotLocking; import io.github.moulberry.notenoughupdates.miscfeatures.StorageManager; +import io.github.moulberry.notenoughupdates.util.NotificationHandler; import io.github.moulberry.notenoughupdates.util.SpecialColour; import io.github.moulberry.notenoughupdates.util.Utils; import net.minecraft.client.Minecraft; @@ -2306,7 +2306,7 @@ public class StorageOverlay extends GuiElement { public void fastRenderCheck() { if (!OpenGlHelper.isFramebufferEnabled() && NotEnoughUpdates.INSTANCE.config.storageGUI.enableStorageGUI3) { this.fastRender = true; - NEUEventListener.displayNotification(Lists.newArrayList( + NotificationHandler.displayNotification(Lists.newArrayList( "\u00a74Fast Render Warning", "\u00a77Due to the way fast render works, it's not compatible with NEU.", "\u00a77Please disable fast render in your options under", -- cgit From ff6c85533f00b764cf27f1ad421b084bf3f288ad Mon Sep 17 00:00:00 2001 From: Lulonaut <67191924+Lulonaut@users.noreply.github.com> Date: Sun, 27 Mar 2022 20:18:49 +0200 Subject: oldanimations notification (#98) --- .../io/github/moulberry/notenoughupdates/miscgui/StorageOverlay.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/main/java/io/github/moulberry/notenoughupdates/miscgui/StorageOverlay.java') diff --git a/src/main/java/io/github/moulberry/notenoughupdates/miscgui/StorageOverlay.java b/src/main/java/io/github/moulberry/notenoughupdates/miscgui/StorageOverlay.java index 2d4d4382..0d8cb6ec 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/miscgui/StorageOverlay.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/miscgui/StorageOverlay.java @@ -2313,7 +2313,7 @@ public class StorageOverlay extends GuiElement { "\u00a77ESC > Options > Video Settings > Performance > Fast Render", "\u00a77This can't be fixed.", "\u00a77", - "\u00a77Press X on your keyboard to close this notifcation" + "\u00a77Press X on your keyboard to close this notification" ), true, true); return; } -- cgit 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/StorageOverlay.java | 380 ++++++++++----------- 1 file changed, 185 insertions(+), 195 deletions(-) (limited to 'src/main/java/io/github/moulberry/notenoughupdates/miscgui/StorageOverlay.java') diff --git a/src/main/java/io/github/moulberry/notenoughupdates/miscgui/StorageOverlay.java b/src/main/java/io/github/moulberry/notenoughupdates/miscgui/StorageOverlay.java index 0d8cb6ec..ac3ddfb8 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/miscgui/StorageOverlay.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/miscgui/StorageOverlay.java @@ -2,7 +2,11 @@ package io.github.moulberry.notenoughupdates.miscgui; import com.google.common.collect.Lists; import io.github.moulberry.notenoughupdates.NotEnoughUpdates; -import io.github.moulberry.notenoughupdates.core.*; +import io.github.moulberry.notenoughupdates.core.BackgroundBlur; +import io.github.moulberry.notenoughupdates.core.ChromaColour; +import io.github.moulberry.notenoughupdates.core.GlScissorStack; +import io.github.moulberry.notenoughupdates.core.GuiElement; +import io.github.moulberry.notenoughupdates.core.GuiElementTextField; import io.github.moulberry.notenoughupdates.core.config.KeybindHelper; import io.github.moulberry.notenoughupdates.core.util.lerp.LerpingInteger; import io.github.moulberry.notenoughupdates.miscfeatures.BetterContainers; @@ -38,19 +42,17 @@ import org.lwjgl.util.vector.Vector2f; import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable; import java.awt.*; +import java.util.ArrayList; +import java.util.HashSet; import java.util.List; -import java.util.*; +import java.util.Map; +import java.util.Set; public class StorageOverlay extends GuiElement { + public static final ResourceLocation[] STORAGE_PREVIEW_TEXTURES = new ResourceLocation[4]; private static final int CHEST_TOP_OFFSET = 17; private static final int CHEST_SLOT_SIZE = 18; private static final int CHEST_BOTTOM_OFFSET = 215; - - private Framebuffer framebuffer = null; - - private final Set enchantGlintRenderLocations = new HashSet<>(); - - public static final ResourceLocation[] STORAGE_PREVIEW_TEXTURES = new ResourceLocation[4]; private static final ResourceLocation[] STORAGE_TEXTURES = new ResourceLocation[4]; private static final ResourceLocation STORAGE_ICONS_TEXTURE = new ResourceLocation( "notenoughupdates:storage_gui/storage_icons.png"); @@ -58,6 +60,9 @@ public class StorageOverlay extends GuiElement { "notenoughupdates:storage_gui/storage_gui_pane_ctm.png"); private static final ResourceLocation[] LOAD_CIRCLE_SEQ = new ResourceLocation[11]; private static final ResourceLocation[] NOT_RICKROLL_SEQ = new ResourceLocation[19]; + private static final StorageOverlay INSTANCE = new StorageOverlay(); + private static final String CHROMA_STR = "230:255:255:0:0"; + private static final ResourceLocation RES_ITEM_GLINT = new ResourceLocation("textures/misc/enchanted_item_glint.png"); static { for (int i = 0; i < STORAGE_TEXTURES.length; i++) { @@ -81,52 +86,193 @@ public class StorageOverlay extends GuiElement { LOAD_CIRCLE_SEQ[10] = new ResourceLocation("notenoughupdates:loading_circle_seq/1.png"); } - private static final StorageOverlay INSTANCE = new StorageOverlay(); - - public static StorageOverlay getInstance() { - return INSTANCE; - } - + private final Set enchantGlintRenderLocations = new HashSet<>(); private final GuiElementTextField searchBar = new GuiElementTextField("", 88, 10, GuiElementTextField.SCALE_TEXT | GuiElementTextField.DISABLE_BG ); private final GuiElementTextField renameStorageField = new GuiElementTextField("", 100, 13, GuiElementTextField.COLOUR ); - + private final int[][] isPaneCaches = new int[40][]; + private final int[][] ctmIndexCaches = new int[40][]; + private final LerpingInteger scroll = new LerpingInteger(0, 200); + private Framebuffer framebuffer = null; private int editingNameId = -1; - private int guiLeft; private int guiTop; - private boolean fastRender = false; - private int loadCircleIndex = 0; private int rollIndex = 0; private int loadCircleRotation = 0; - private long millisAccumIndex = 0; private long millisAccumRoll = 0; private long millisAccumRotation = 0; - private long lastMillis = 0; - private int scrollVelocity = 0; private long lastScroll = 0; - - private final int[][] isPaneCaches = new int[40][]; - private final int[][] ctmIndexCaches = new int[40][]; - private int desiredHeightSwitch = -1; private int desiredHeightMX = -1; private int desiredHeightMY = -1; - private boolean dirty = false; private boolean allowTypingInSearchBar = true; - private int scrollGrabOffset = -1; - private final LerpingInteger scroll = new LerpingInteger(0, 200); + public static StorageOverlay getInstance() { + return INSTANCE; + } + + private static boolean shouldConnect(int paneIndex1, int paneIndex2) { + if (paneIndex1 == 16 || paneIndex2 == 16) return false; + if (paneIndex1 < 1 || paneIndex2 < 1) return false; + return paneIndex1 == paneIndex2; + + } + + public static int getCTMIndex(StorageManager.StoragePage page, int index, int[] isPaneCache, int[] ctmIndexCache) { + if (page.items[index] == null) { + ctmIndexCache[index] = -1; + return -1; + } + + int paneType = getPaneType(page.items[index], index, isPaneCache); + + int upIndex = index - 9; + int leftIndex = index % 9 > 0 ? index - 1 : -1; + int rightIndex = index % 9 < 8 ? index + 1 : -1; + int downIndex = index + 9; + int upleftIndex = index % 9 > 0 ? index - 10 : -1; + int uprightIndex = index % 9 < 8 ? index - 8 : -1; + int downleftIndex = index % 9 > 0 ? index + 8 : -1; + int downrightIndex = index % 9 < 8 ? index + 10 : -1; + + boolean up = upIndex >= 0 && upIndex < isPaneCache.length && shouldConnect(getPaneType( + page.items[upIndex], + upIndex, + isPaneCache + ), paneType); + boolean left = leftIndex >= 0 && leftIndex < isPaneCache.length && shouldConnect(getPaneType( + page.items[leftIndex], + leftIndex, + isPaneCache + ), paneType); + boolean down = downIndex >= 0 && downIndex < isPaneCache.length && shouldConnect(getPaneType( + page.items[downIndex], + downIndex, + isPaneCache + ), paneType); + boolean right = rightIndex >= 0 && rightIndex < isPaneCache.length && shouldConnect(getPaneType( + page.items[rightIndex], + rightIndex, + isPaneCache + ), paneType); + boolean upleft = upleftIndex >= 0 && upleftIndex < isPaneCache.length && shouldConnect(getPaneType( + page.items[upleftIndex], + upleftIndex, + isPaneCache + ), paneType); + boolean upright = uprightIndex >= 0 && uprightIndex < isPaneCache.length && shouldConnect(getPaneType( + page.items[uprightIndex], + uprightIndex, + isPaneCache + ), paneType); + boolean downleft = downleftIndex >= 0 && downleftIndex < isPaneCache.length && shouldConnect(getPaneType( + page.items[downleftIndex], + downleftIndex, + isPaneCache + ), paneType); + boolean downright = downrightIndex >= 0 && downrightIndex < isPaneCache.length && + shouldConnect(getPaneType(page.items[downrightIndex], downrightIndex, isPaneCache), paneType); + + int ctmIndex = BetterContainers.getCTMIndex(up, right, down, left, upleft, upright, downright, downleft); + ctmIndexCache[index] = ctmIndex; + return ctmIndex; + } + + public static int getRGBFromPane(int paneType) { + int rgb = -1; + EnumChatFormatting formatting = EnumChatFormatting.WHITE; + switch (paneType) { + case 0: + formatting = EnumChatFormatting.WHITE; + break; + case 1: + formatting = EnumChatFormatting.GOLD; + break; + case 2: + formatting = EnumChatFormatting.LIGHT_PURPLE; + break; + case 3: + formatting = EnumChatFormatting.BLUE; + break; + case 4: + formatting = EnumChatFormatting.YELLOW; + break; + case 5: + formatting = EnumChatFormatting.GREEN; + break; + case 6: + rgb = 0xfff03c96; + break; + case 7: + formatting = EnumChatFormatting.DARK_GRAY; + break; + case 8: + formatting = EnumChatFormatting.GRAY; + break; + case 9: + formatting = EnumChatFormatting.DARK_AQUA; + break; + case 10: + formatting = EnumChatFormatting.DARK_PURPLE; + break; + case 11: + formatting = EnumChatFormatting.DARK_BLUE; + break; + case 12: + rgb = 0xffA0522D; + break; + case 13: + formatting = EnumChatFormatting.DARK_GREEN; + break; + case 14: + formatting = EnumChatFormatting.DARK_RED; + break; + case 15: + rgb = 0x00000000; + break; + case 16: + rgb = SpecialColour.specialToChromaRGB(CHROMA_STR); + break; + } + if (rgb != -1) return rgb; + return 0xff000000 | Minecraft.getMinecraft().fontRendererObj.getColorCode(formatting.toString().charAt(1)); + } + + public static int getPaneType(ItemStack stack, int index, int[] cache) { + if (cache != null && cache[index] != 0) return cache[index]; + + if (NotEnoughUpdates.INSTANCE.config.storageGUI.fancyPanes == 2) { + if (cache != null) cache[index] = -1; + return -1; + } + + if (stack != null && + (stack.getItem() == Item.getItemFromBlock(Blocks.stained_glass_pane) || stack.getItem() == Item.getItemFromBlock( + Blocks.glass_pane))) { + String internalName = NotEnoughUpdates.INSTANCE.manager.getInternalNameForItem(stack); + if (internalName != null) { + if (internalName.startsWith("STAINED_GLASS_PANE")) { + if (cache != null) cache[index] = stack.getItemDamage() + 1; + return stack.getItemDamage() + 1; + } else if (internalName.startsWith("THIN_GLASS")) { + if (cache != null) cache[index] = 17; + return 17; + } + } + } + if (cache != null) cache[index] = -1; + return -1; + } private int getMaximumScroll() { synchronized (StorageManager.getInstance().storageConfig.displayToStorageIdMapRender) { @@ -194,6 +340,7 @@ public class StorageOverlay extends GuiElement { @Override public void render() { if (!(Minecraft.getMinecraft().currentScreen instanceof GuiChest)) return; + GuiChest guiChest = (GuiChest) Minecraft.getMinecraft().currentScreen; ContainerChest containerChest = (ContainerChest) guiChest.inventorySlots; @@ -1537,161 +1684,6 @@ public class StorageOverlay extends GuiElement { GlStateManager.translate(0, 0, -300); } - private static boolean shouldConnect(int paneIndex1, int paneIndex2) { - if (paneIndex1 == 16 || paneIndex2 == 16) return false; - if (paneIndex1 < 1 || paneIndex2 < 1) return false; - return paneIndex1 == paneIndex2; - - } - - public static int getCTMIndex(StorageManager.StoragePage page, int index, int[] isPaneCache, int[] ctmIndexCache) { - if (page.items[index] == null) { - ctmIndexCache[index] = -1; - return -1; - } - - int paneType = getPaneType(page.items[index], index, isPaneCache); - - int upIndex = index - 9; - int leftIndex = index % 9 > 0 ? index - 1 : -1; - int rightIndex = index % 9 < 8 ? index + 1 : -1; - int downIndex = index + 9; - int upleftIndex = index % 9 > 0 ? index - 10 : -1; - int uprightIndex = index % 9 < 8 ? index - 8 : -1; - int downleftIndex = index % 9 > 0 ? index + 8 : -1; - int downrightIndex = index % 9 < 8 ? index + 10 : -1; - - boolean up = upIndex >= 0 && upIndex < isPaneCache.length && shouldConnect(getPaneType( - page.items[upIndex], - upIndex, - isPaneCache - ), paneType); - boolean left = leftIndex >= 0 && leftIndex < isPaneCache.length && shouldConnect(getPaneType( - page.items[leftIndex], - leftIndex, - isPaneCache - ), paneType); - boolean down = downIndex >= 0 && downIndex < isPaneCache.length && shouldConnect(getPaneType( - page.items[downIndex], - downIndex, - isPaneCache - ), paneType); - boolean right = rightIndex >= 0 && rightIndex < isPaneCache.length && shouldConnect(getPaneType( - page.items[rightIndex], - rightIndex, - isPaneCache - ), paneType); - boolean upleft = upleftIndex >= 0 && upleftIndex < isPaneCache.length && shouldConnect(getPaneType( - page.items[upleftIndex], - upleftIndex, - isPaneCache - ), paneType); - boolean upright = uprightIndex >= 0 && uprightIndex < isPaneCache.length && shouldConnect(getPaneType( - page.items[uprightIndex], - uprightIndex, - isPaneCache - ), paneType); - boolean downleft = downleftIndex >= 0 && downleftIndex < isPaneCache.length && shouldConnect(getPaneType( - page.items[downleftIndex], - downleftIndex, - isPaneCache - ), paneType); - boolean downright = downrightIndex >= 0 && downrightIndex < isPaneCache.length && - shouldConnect(getPaneType(page.items[downrightIndex], downrightIndex, isPaneCache), paneType); - - int ctmIndex = BetterContainers.getCTMIndex(up, right, down, left, upleft, upright, downright, downleft); - ctmIndexCache[index] = ctmIndex; - return ctmIndex; - } - - private static final String CHROMA_STR = "230:255:255:0:0"; - - public static int getRGBFromPane(int paneType) { - int rgb = -1; - EnumChatFormatting formatting = EnumChatFormatting.WHITE; - switch (paneType) { - case 0: - formatting = EnumChatFormatting.WHITE; - break; - case 1: - formatting = EnumChatFormatting.GOLD; - break; - case 2: - formatting = EnumChatFormatting.LIGHT_PURPLE; - break; - case 3: - formatting = EnumChatFormatting.BLUE; - break; - case 4: - formatting = EnumChatFormatting.YELLOW; - break; - case 5: - formatting = EnumChatFormatting.GREEN; - break; - case 6: - rgb = 0xfff03c96; - break; - case 7: - formatting = EnumChatFormatting.DARK_GRAY; - break; - case 8: - formatting = EnumChatFormatting.GRAY; - break; - case 9: - formatting = EnumChatFormatting.DARK_AQUA; - break; - case 10: - formatting = EnumChatFormatting.DARK_PURPLE; - break; - case 11: - formatting = EnumChatFormatting.DARK_BLUE; - break; - case 12: - rgb = 0xffA0522D; - break; - case 13: - formatting = EnumChatFormatting.DARK_GREEN; - break; - case 14: - formatting = EnumChatFormatting.DARK_RED; - break; - case 15: - rgb = 0x00000000; - break; - case 16: - rgb = SpecialColour.specialToChromaRGB(CHROMA_STR); - break; - } - if (rgb != -1) return rgb; - return 0xff000000 | Minecraft.getMinecraft().fontRendererObj.getColorCode(formatting.toString().charAt(1)); - } - - public static int getPaneType(ItemStack stack, int index, int[] cache) { - if (cache != null && cache[index] != 0) return cache[index]; - - if (NotEnoughUpdates.INSTANCE.config.storageGUI.fancyPanes == 2) { - if (cache != null) cache[index] = -1; - return -1; - } - - if (stack != null && - (stack.getItem() == Item.getItemFromBlock(Blocks.stained_glass_pane) || stack.getItem() == Item.getItemFromBlock( - Blocks.glass_pane))) { - String internalName = NotEnoughUpdates.INSTANCE.manager.getInternalNameForItem(stack); - if (internalName != null) { - if (internalName.startsWith("STAINED_GLASS_PANE")) { - if (cache != null) cache[index] = stack.getItemDamage() + 1; - return stack.getItemDamage() + 1; - } else if (internalName.startsWith("THIN_GLASS")) { - if (cache != null) cache[index] = 17; - return 17; - } - } - } - if (cache != null) cache[index] = -1; - return -1; - } - private List createTooltip(String title, int selectedOption, String... options) { String selPrefix = EnumChatFormatting.DARK_AQUA + " \u25b6 "; String unselPrefix = EnumChatFormatting.GRAY.toString(); @@ -1710,16 +1702,6 @@ public class StorageOverlay extends GuiElement { return list; } - private static class IntPair { - int x; - int y; - - public IntPair(int x, int y) { - this.x = x; - this.y = y; - } - } - public IntPair getPageCoords(int displayId) { if (displayId < 0) displayId = 0; @@ -2246,8 +2228,6 @@ public class StorageOverlay extends GuiElement { return true; } - private static final ResourceLocation RES_ITEM_GLINT = new ResourceLocation("textures/misc/enchanted_item_glint.png"); - private void renderEnchOverlay(Set locations) { float f = (float) (Minecraft.getSystemTime() % 3000L) / 3000.0F / 8.0F; float f1 = (float) (Minecraft.getSystemTime() % 4873L) / 4873.0F / 8.0F; @@ -2321,4 +2301,14 @@ public class StorageOverlay extends GuiElement { this.fastRender = false; } + private static class IntPair { + int x; + int y; + + public IntPair(int x, int y) { + this.x = x; + this.y = y; + } + } + } -- cgit From 73dbbed409a86328144f2c75f460426e7baa6ae1 Mon Sep 17 00:00:00 2001 From: Roman / Nea Date: Thu, 2 Jun 2022 09:59:07 +0200 Subject: Loomerings (#152) --- .../moulberry/notenoughupdates/miscgui/StorageOverlay.java | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'src/main/java/io/github/moulberry/notenoughupdates/miscgui/StorageOverlay.java') diff --git a/src/main/java/io/github/moulberry/notenoughupdates/miscgui/StorageOverlay.java b/src/main/java/io/github/moulberry/notenoughupdates/miscgui/StorageOverlay.java index ac3ddfb8..cb81589d 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/miscgui/StorageOverlay.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/miscgui/StorageOverlay.java @@ -12,6 +12,7 @@ import io.github.moulberry.notenoughupdates.core.util.lerp.LerpingInteger; import io.github.moulberry.notenoughupdates.miscfeatures.BetterContainers; import io.github.moulberry.notenoughupdates.miscfeatures.SlotLocking; import io.github.moulberry.notenoughupdates.miscfeatures.StorageManager; +import io.github.moulberry.notenoughupdates.mixins.AccessorGuiContainer; import io.github.moulberry.notenoughupdates.util.NotificationHandler; import io.github.moulberry.notenoughupdates.util.SpecialColour; import io.github.moulberry.notenoughupdates.util.Utils; @@ -737,7 +738,7 @@ public class StorageOverlay extends GuiElement { if (storageId == currentPage) { Utils.hasEffectOverride = true; GlStateManager.translate(storageX - 7, storageY - 17 - 18, 0); - guiChest.drawSlot(containerChest.getSlot(k + 9)); + ((AccessorGuiContainer)guiChest).doDrawSlot(containerChest.getSlot(k + 9)); GlStateManager.translate(-storageX + 7, -storageY + 17 + 18, 0); Utils.hasEffectOverride = false; } else { @@ -752,7 +753,7 @@ public class StorageOverlay extends GuiElement { } else if (storageId == currentPage) { Utils.hasEffectOverride = true; GlStateManager.translate(storageX - 7, storageY - 17 - 18, 0); - guiChest.drawSlot(containerChest.getSlot(k + 9)); + ((AccessorGuiContainer)guiChest).doDrawSlot(containerChest.getSlot(k + 9)); GlStateManager.translate(-storageX + 7, -storageY + 17 + 18, 0); Utils.hasEffectOverride = false; } else { @@ -1268,7 +1269,7 @@ public class StorageOverlay extends GuiElement { GlStateManager.pushMatrix(); GlStateManager.translate(181 - 8, storageViewSize + 18 - (inventoryStartIndex / 9 * 18 + 31), 0); - guiChest.drawSlot(containerChest.inventorySlots.get(inventoryStartIndex + i)); + ((AccessorGuiContainer)guiChest).doDrawSlot(containerChest.inventorySlots.get(inventoryStartIndex + i)); GlStateManager.popMatrix(); if (!searchBar.getText().isEmpty()) { @@ -1302,7 +1303,7 @@ public class StorageOverlay extends GuiElement { //Utils.drawItemStack(playerItems[i+9], itemX, itemY); GlStateManager.pushMatrix(); GlStateManager.translate(181 - 8, storageViewSize + 18 - (inventoryStartIndex / 9 * 18 + 31), 0); - guiChest.drawSlot(containerChest.inventorySlots.get(inventoryStartIndex + 9 + i)); + ((AccessorGuiContainer)guiChest).doDrawSlot(containerChest.inventorySlots.get(inventoryStartIndex + 9 + i)); GlStateManager.popMatrix(); if (!searchBar.getText().isEmpty()) { @@ -2183,8 +2184,7 @@ public class StorageOverlay extends GuiElement { for (Slot slot : container.inventorySlots.inventorySlots) { if (slot != null && - slot.inventory == Minecraft.getMinecraft().thePlayer.inventory && - container.isMouseOverSlot(slot, mouseX, mouseY)) { + slot.inventory == Minecraft.getMinecraft().thePlayer.inventory && ((AccessorGuiContainer)container).doIsMouseOverSlot(slot, mouseX, mouseY)) { SlotLocking.getInstance().toggleLock(slot.getSlotIndex()); return true; } -- cgit From fe26e98a591bf2cab0c72117f00c43614d41001b Mon Sep 17 00:00:00 2001 From: Lulonaut <67191924+Lulonaut@users.noreply.github.com> Date: Thu, 9 Jun 2022 08:43:00 +0200 Subject: toggle for fast render warning (#156) --- .../moulberry/notenoughupdates/miscgui/StorageOverlay.java | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) (limited to 'src/main/java/io/github/moulberry/notenoughupdates/miscgui/StorageOverlay.java') diff --git a/src/main/java/io/github/moulberry/notenoughupdates/miscgui/StorageOverlay.java b/src/main/java/io/github/moulberry/notenoughupdates/miscgui/StorageOverlay.java index cb81589d..e5e0ff5c 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/miscgui/StorageOverlay.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/miscgui/StorageOverlay.java @@ -738,7 +738,7 @@ public class StorageOverlay extends GuiElement { if (storageId == currentPage) { Utils.hasEffectOverride = true; GlStateManager.translate(storageX - 7, storageY - 17 - 18, 0); - ((AccessorGuiContainer)guiChest).doDrawSlot(containerChest.getSlot(k + 9)); + ((AccessorGuiContainer) guiChest).doDrawSlot(containerChest.getSlot(k + 9)); GlStateManager.translate(-storageX + 7, -storageY + 17 + 18, 0); Utils.hasEffectOverride = false; } else { @@ -753,7 +753,7 @@ public class StorageOverlay extends GuiElement { } else if (storageId == currentPage) { Utils.hasEffectOverride = true; GlStateManager.translate(storageX - 7, storageY - 17 - 18, 0); - ((AccessorGuiContainer)guiChest).doDrawSlot(containerChest.getSlot(k + 9)); + ((AccessorGuiContainer) guiChest).doDrawSlot(containerChest.getSlot(k + 9)); GlStateManager.translate(-storageX + 7, -storageY + 17 + 18, 0); Utils.hasEffectOverride = false; } else { @@ -1269,7 +1269,7 @@ public class StorageOverlay extends GuiElement { GlStateManager.pushMatrix(); GlStateManager.translate(181 - 8, storageViewSize + 18 - (inventoryStartIndex / 9 * 18 + 31), 0); - ((AccessorGuiContainer)guiChest).doDrawSlot(containerChest.inventorySlots.get(inventoryStartIndex + i)); + ((AccessorGuiContainer) guiChest).doDrawSlot(containerChest.inventorySlots.get(inventoryStartIndex + i)); GlStateManager.popMatrix(); if (!searchBar.getText().isEmpty()) { @@ -1303,7 +1303,7 @@ public class StorageOverlay extends GuiElement { //Utils.drawItemStack(playerItems[i+9], itemX, itemY); GlStateManager.pushMatrix(); GlStateManager.translate(181 - 8, storageViewSize + 18 - (inventoryStartIndex / 9 * 18 + 31), 0); - ((AccessorGuiContainer)guiChest).doDrawSlot(containerChest.inventorySlots.get(inventoryStartIndex + 9 + i)); + ((AccessorGuiContainer) guiChest).doDrawSlot(containerChest.inventorySlots.get(inventoryStartIndex + 9 + i)); GlStateManager.popMatrix(); if (!searchBar.getText().isEmpty()) { @@ -2184,7 +2184,8 @@ public class StorageOverlay extends GuiElement { for (Slot slot : container.inventorySlots.inventorySlots) { if (slot != null && - slot.inventory == Minecraft.getMinecraft().thePlayer.inventory && ((AccessorGuiContainer)container).doIsMouseOverSlot(slot, mouseX, mouseY)) { + slot.inventory == Minecraft.getMinecraft().thePlayer.inventory && + ((AccessorGuiContainer) container).doIsMouseOverSlot(slot, mouseX, mouseY)) { SlotLocking.getInstance().toggleLock(slot.getSlotIndex()); return true; } @@ -2284,7 +2285,8 @@ public class StorageOverlay extends GuiElement { } public void fastRenderCheck() { - if (!OpenGlHelper.isFramebufferEnabled() && NotEnoughUpdates.INSTANCE.config.storageGUI.enableStorageGUI3) { + if (!OpenGlHelper.isFramebufferEnabled() && NotEnoughUpdates.INSTANCE.config.notifications.doFastRenderNotif && + NotEnoughUpdates.INSTANCE.config.storageGUI.enableStorageGUI3) { this.fastRender = true; NotificationHandler.displayNotification(Lists.newArrayList( "\u00a74Fast Render Warning", -- 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/StorageOverlay.java | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'src/main/java/io/github/moulberry/notenoughupdates/miscgui/StorageOverlay.java') diff --git a/src/main/java/io/github/moulberry/notenoughupdates/miscgui/StorageOverlay.java b/src/main/java/io/github/moulberry/notenoughupdates/miscgui/StorageOverlay.java index e5e0ff5c..98efa381 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/miscgui/StorageOverlay.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/miscgui/StorageOverlay.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.common.collect.Lists; -- cgit From 51a8977344343eac1899ed59f63621c7d87d7d00 Mon Sep 17 00:00:00 2001 From: Sam <54697460+Mqisty@users.noreply.github.com> Date: Sun, 14 Aug 2022 08:00:16 -0400 Subject: added antialiasing to the warning (#227) * awesome commit * why did i spend time on this --- .../moulberry/notenoughupdates/miscgui/StorageOverlay.java | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'src/main/java/io/github/moulberry/notenoughupdates/miscgui/StorageOverlay.java') diff --git a/src/main/java/io/github/moulberry/notenoughupdates/miscgui/StorageOverlay.java b/src/main/java/io/github/moulberry/notenoughupdates/miscgui/StorageOverlay.java index 98efa381..7e6b991c 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/miscgui/StorageOverlay.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/miscgui/StorageOverlay.java @@ -1266,8 +1266,8 @@ public class StorageOverlay extends GuiElement { if (fastRender) { fontRendererObj.drawString( - "Fast render does not work with Storage overlay.", - sizeX / 2 - fontRendererObj.getStringWidth("Fast render does not work with Storage overlay.") / 2, + "Fast render and antialiasing do not work with Storage overlay.", + sizeX / 2 - fontRendererObj.getStringWidth("Fast render and antialiasing do not work with Storage overlay.") / 2, -10, 0xFFFF0000 ); @@ -2308,10 +2308,11 @@ public class StorageOverlay extends GuiElement { NotEnoughUpdates.INSTANCE.config.storageGUI.enableStorageGUI3) { this.fastRender = true; NotificationHandler.displayNotification(Lists.newArrayList( - "\u00a74Fast Render Warning", - "\u00a77Due to the way fast render works, it's not compatible with NEU.", - "\u00a77Please disable fast render in your options under", - "\u00a77ESC > Options > Video Settings > Performance > Fast Render", + "\u00a74Warning", + "\u00a77Due to the way fast render and antialiasing work, they're not compatible with NEU.", + "\u00a77Please disable fast render and antialiasing in your options under", + "\u00a77ESC > Options > Video Settings > Performance > \u00A7cFast Render", + "\u00a77ESC > Options > Video Settings > Quality > \u00A7cAntialiasing", "\u00a77This can't be fixed.", "\u00a77", "\u00a77Press X on your keyboard to close this notification" -- cgit From ef557a6f4dff5ed9ce13f26f41b55c60008e8eae Mon Sep 17 00:00:00 2001 From: NopoTheGamer <40329022+NopoTheGamer@users.noreply.github.com> Date: Sun, 11 Sep 2022 22:11:26 +1000 Subject: fixed backpacks when dont have fairy soul req (#264) --- .../io/github/moulberry/notenoughupdates/miscgui/StorageOverlay.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/main/java/io/github/moulberry/notenoughupdates/miscgui/StorageOverlay.java') diff --git a/src/main/java/io/github/moulberry/notenoughupdates/miscgui/StorageOverlay.java b/src/main/java/io/github/moulberry/notenoughupdates/miscgui/StorageOverlay.java index 7e6b991c..27fea377 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/miscgui/StorageOverlay.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/miscgui/StorageOverlay.java @@ -414,7 +414,7 @@ public class StorageOverlay extends GuiElement { if (stackOnMouse != null) { String stackDisplay = Utils.cleanColour(stackOnMouse.getDisplayName()); if (stackDisplay.startsWith("Backpack Slot ") || stackDisplay.startsWith("Empty Backpack Slot ") || - stackDisplay.startsWith("Ender Chest Page ")) { + stackDisplay.startsWith("Ender Chest Page ") || stackDisplay.startsWith("Locked Backpack Slot ")) { stackOnMouse = null; } } -- cgit From 18255a0e473092d0f389507a19944a7ddfc8078d Mon Sep 17 00:00:00 2001 From: NopoTheGamer <40329022+NopoTheGamer@users.noreply.github.com> Date: Wed, 14 Sep 2022 22:30:25 +1000 Subject: Added chat message to let players turn on the storage gui if they accidentally turned it off (#273) * Added a chat message to turn the storage gui back on after turning it off in said storage gui * remove the skyclient mixin * map on by default --- .../moulberry/notenoughupdates/miscgui/StorageOverlay.java | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'src/main/java/io/github/moulberry/notenoughupdates/miscgui/StorageOverlay.java') diff --git a/src/main/java/io/github/moulberry/notenoughupdates/miscgui/StorageOverlay.java b/src/main/java/io/github/moulberry/notenoughupdates/miscgui/StorageOverlay.java index 27fea377..8878c284 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/miscgui/StorageOverlay.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/miscgui/StorageOverlay.java @@ -45,13 +45,17 @@ import net.minecraft.client.renderer.GlStateManager; import net.minecraft.client.renderer.OpenGlHelper; import net.minecraft.client.renderer.entity.RenderItem; import net.minecraft.client.shader.Framebuffer; +import net.minecraft.event.ClickEvent; +import net.minecraft.event.HoverEvent; import net.minecraft.init.Blocks; import net.minecraft.init.Items; import net.minecraft.inventory.ContainerChest; import net.minecraft.inventory.Slot; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; +import net.minecraft.util.ChatComponentText; import net.minecraft.util.EnumChatFormatting; +import net.minecraft.util.IChatComponent; import net.minecraft.util.ResourceLocation; import net.minecraftforge.client.ClientCommandHandler; import org.lwjgl.input.Keyboard; @@ -1966,6 +1970,16 @@ public class StorageOverlay extends GuiElement { switch (buttonIndex) { case 0: NotEnoughUpdates.INSTANCE.config.storageGUI.enableStorageGUI3 = false; + ChatComponentText storageMessage = new ChatComponentText( + EnumChatFormatting.YELLOW + "[NEU] " + EnumChatFormatting.YELLOW + + "You just disabled the custom storage gui, did you mean to do that? If not click this message to turn it back on."); + storageMessage.setChatStyle(Utils.createClickStyle(ClickEvent.Action.RUN_COMMAND, "/neuenablestorage")); + storageMessage.setChatStyle(storageMessage.getChatStyle().setChatHoverEvent( + new HoverEvent(HoverEvent.Action.SHOW_TEXT, + new ChatComponentText(EnumChatFormatting.YELLOW + "Click to enable the custom storage gui.")))); + ChatComponentText storageChatMessage = new ChatComponentText(""); + storageChatMessage.appendSibling(storageMessage); + Minecraft.getMinecraft().thePlayer.addChatMessage(storageChatMessage); break; case 1: int size = -- cgit