diff --git a/src/main/java/codechicken/nei/LayoutManager.java b/src/main/java/codechicken/nei/LayoutManager.java index f9b220770..350924b04 100644 --- a/src/main/java/codechicken/nei/LayoutManager.java +++ b/src/main/java/codechicken/nei/LayoutManager.java @@ -825,9 +825,22 @@ public static void drawButtonBackground(int x, int y, int w, int h, boolean edge drawTexturedModalRect(x2, y2, tx2, ty2, w2, h2); // bottom right } - public static void drawItemPresenceOverlay(int slotX, int slotY, boolean isPresent) { - Image icon = itemPresenceOverlays[isPresent ? 1 : 0]; - drawIcon(slotX + 16 - icon.width, slotY + 16 - icon.height, icon); + public static void drawItemPresenceOverlay(int slotX, int slotY, boolean isPresent, boolean slotHighlight) { + + if (slotHighlight) { + if (isPresent) return; + GL11.glDisable(GL11.GL_LIGHTING); + GL11.glDisable(GL11.GL_DEPTH_TEST); + GL11.glTranslatef(0, 0, -150); + drawRect(slotX, slotY, 16, 16, 0x80AA0000); + GL11.glTranslatef(0, 0, 150); + GL11.glEnable(GL11.GL_LIGHTING); + GL11.glEnable(GL11.GL_DEPTH_TEST); + } else { + Image icon = itemPresenceOverlays[isPresent ? 1 : 0]; + drawIcon(slotX + 16 - icon.width, slotY + 16 - icon.height, icon); + } + } public static LayoutManager instance() { diff --git a/src/main/java/codechicken/nei/NEIClientConfig.java b/src/main/java/codechicken/nei/NEIClientConfig.java index b5cedc258..3a9281b54 100644 --- a/src/main/java/codechicken/nei/NEIClientConfig.java +++ b/src/main/java/codechicken/nei/NEIClientConfig.java @@ -289,6 +289,11 @@ public boolean onClick(int button) { .setComment("Require holding shift to move items when overlaying recipe").getBooleanValue(true); API.addOption(new OptionToggleButton("inventory.shift_overlay_recipe", true)); + tag.getTag("inventory.slotHighlight") + .setComment("Highlight the entire slot instead of just showing an icon for the recipe overlay") + .getBooleanValue(true); + API.addOption(new OptionToggleButton("inventory.slotHighlight", true)); + tag.getTag("tools.handler_load_from_config").setComment("ADVANCED: Load handlers from config") .getBooleanValue(false); API.addOption(new OptionToggleButton("tools.handler_load_from_config", true) { @@ -629,6 +634,10 @@ public static boolean requireShiftForOverlayRecipe() { return getBooleanSetting("inventory.shift_overlay_recipe"); } + public static boolean isSlotHighlightEnabled() { + return getBooleanSetting("inventory.slotHighlight"); + } + public static boolean isEnabled() { return enabledOverride && getBooleanSetting("inventory.widgetsenabled"); } diff --git a/src/main/java/codechicken/nei/recipe/GuiRecipe.java b/src/main/java/codechicken/nei/recipe/GuiRecipe.java index 0e133b080..43c92953a 100644 --- a/src/main/java/codechicken/nei/recipe/GuiRecipe.java +++ b/src/main/java/codechicken/nei/recipe/GuiRecipe.java @@ -1011,6 +1011,7 @@ public void drawGuiContainerForegroundLayer(int mouseX, int mouseY) { } final boolean drawItemPresence = NEIClientConfig.isJEIStyleItemPresenceOverlayVisible(); + final boolean slotHighlight = NEIClientConfig.isSlotHighlightEnabled(); GL11.glPushMatrix(); GL11.glTranslatef(5, 32 - ySkip + yShift, 0); @@ -1036,7 +1037,7 @@ public void drawGuiContainerForegroundLayer(int mouseX, int mouseY) { for (int j = 0; j < ingredients.size(); j++) { PositionedStack stack = ingredients.get(j); boolean isPresent = itemPresenceCacheSlots.get(j); - LayoutManager.drawItemPresenceOverlay(stack.relx, stack.rely, isPresent); + LayoutManager.drawItemPresenceOverlay(stack.relx, stack.rely, isPresent, slotHighlight); } } diff --git a/src/main/resources/assets/nei/lang/en_US.lang b/src/main/resources/assets/nei/lang/en_US.lang index 367e7d4ae..dac2ca5e8 100644 --- a/src/main/resources/assets/nei/lang/en_US.lang +++ b/src/main/resources/assets/nei/lang/en_US.lang @@ -188,6 +188,9 @@ nei.options.inventory.jei_style_cycled_ingredients.false=No nei.options.inventory.shift_overlay_recipe=Require holding shift to move items when overlaying recipe nei.options.inventory.shift_overlay_recipe.true=Yes nei.options.inventory.shift_overlay_recipe.false=No +nei.options.inventory.slotHighlight=Highlight the entire slot instead of just showing an icon for the recipe overlay +nei.options.inventory.slotHighlight.true=Yes +nei.options.inventory.slotHighlight.false=No nei.options.inventory.widgetsenabled.true=NEI Enabled nei.options.inventory.widgetsenabled.false=NEI Disabled nei.options.inventory.cheatmode.0=Recipe Mode