Add config option to disable highlighting type mismatch patterns (#1414)

This commit is contained in:
Kogepan229 authored and GitHub committed 2026-07-04 18:59:26 +00:00
1 parent 7386d6fe07
commit d38327344d
3 files changed
+18 -11

No files matched your search

@@ -38,6 +38,7 @@ import appeng.client.gui.widgets.GuiSimpleImgButton;
import appeng.client.gui.widgets.GuiTabButton;
import appeng.client.gui.widgets.GuiToggleButton;
import appeng.container.implementations.ContainerInterface;
import appeng.core.AEConfig;
import appeng.core.AELog;
import appeng.core.localization.ButtonToolTips;
import appeng.core.localization.ColorUtils;
@@ -246,12 +247,14 @@ public class GuiInterface extends GuiUpgradeable {
}
}
// highlight pattern slots with unsupported stack types
for (final Object obj : this.cvb.inventorySlots) {
if (obj instanceof Slot slot && hasInvalidTypeStack(slot.getStack())) {
final int sx = offsetX + slot.xDisplayPosition;
final int sy = offsetY + slot.yDisplayPosition;
drawRect(sx, sy, sx + 16, sy + 16, ColorUtils.itemSlotOverlayFluidMismatch.getColor());
if (AEConfig.instance.highlightPatternTypeMismatchInGUI) {
// highlight pattern slots with unsupported stack types
for (final Object obj : this.cvb.inventorySlots) {
if (obj instanceof Slot slot && hasInvalidTypeStack(slot.getStack())) {
final int sx = offsetX + slot.xDisplayPosition;
final int sy = offsetY + slot.yDisplayPosition;
drawRect(sx, sy, sx + 16, sy + 16, ColorUtils.itemSlotOverlayFluidMismatch.getColor());
}
}
}
}
@@ -261,8 +264,7 @@ public class GuiInterface extends GuiUpgradeable {
final NBTTagCompound nbt = stack.getTagCompound();
if (nbt.getBoolean("InvalidPattern")) return false;
IAEStackType<?>[] supportedTypes = ((ContainerInterface) this.cvb).getSupportedStackTypes();
return hasInvalidTypeInTagList(nbt.getTagList("in", NBT.TAG_COMPOUND), supportedTypes)
|| hasInvalidTypeInTagList(nbt.getTagList("out", NBT.TAG_COMPOUND), supportedTypes);
return hasInvalidTypeInTagList(nbt.getTagList("in", NBT.TAG_COMPOUND), supportedTypes);
}
private static boolean hasInvalidTypeInTagList(final NBTTagList tagList, IAEStackType<?>[] supportedTypes) {
@@ -953,7 +953,8 @@ public class GuiInterfaceTerminal extends AEBaseGui
} else if (entry.filteredRecipes[slotIdx]) {
GL11.glTranslatef(0.0f, 0.0f, ITEM_STACK_OVERLAY_Z);
drawRect(0, 0, 16, 16, ColorUtils.itemSlotOverlayUnpowered.getColor());
} else if (hasInvalidTypeStack(stack, entry.supportedStackTypes)) {
} else if (AEConfig.instance.highlightPatternTypeMismatchInGUI
&& hasInvalidTypeStack(stack, entry.supportedStackTypes)) {
GL11.glTranslatef(0.0f, 0.0f, SLOT_Z - ITEM_STACK_OVERLAY_Z);
drawRect(0, 0, 16, 16, ColorUtils.itemSlotOverlayFluidMismatch.getColor());
}
@@ -1371,8 +1372,7 @@ public class GuiInterfaceTerminal extends AEBaseGui
if (stack == null || stack.getTagCompound() == null) return false;
final NBTTagCompound nbt = stack.getTagCompound();
if (nbt.getBoolean("InvalidPattern")) return false;
return hasInvalidTypeInTagList(nbt.getTagList("in", NBT.TAG_COMPOUND), supportedTypes)
|| hasInvalidTypeInTagList(nbt.getTagList("out", NBT.TAG_COMPOUND), supportedTypes);
return hasInvalidTypeInTagList(nbt.getTagList("in", NBT.TAG_COMPOUND), supportedTypes);
}
private static boolean hasInvalidTypeInTagList(final NBTTagList tagList, final IAEStackType<?>[] supportedTypes) {
+5
View File
@@ -95,6 +95,7 @@ public final class AEConfig extends Configuration implements IConfigurableObject
public int MEMonitorableSmallSize = 6;
public int InterfaceTerminalSmallSize = 6;
public boolean highlightWhenSomethingStuckInInterface = true;
public boolean highlightPatternTypeMismatchInGUI = true;
public int screenColor = 0xFFFFFF;
/** Max rows for crafting pins section (1-16). Caps the cycle button options. */
@@ -392,6 +393,10 @@ public final class AEConfig extends Configuration implements IConfigurableObject
.getBoolean(true);
this.highlightWhenSomethingStuckInInterface = this.get("Client", "highlightWhenSomethingStuckInInterface", true)
.getBoolean(true);
final Property highlightPatternTypeMismatchInGUI = this
.get("Client", "highlightPatternTypeMismatchInGUI", true);
highlightPatternTypeMismatchInGUI.comment = "Highlight pattern slots in red when the pattern uses unsupported stack types.";
this.highlightPatternTypeMismatchInGUI = highlightPatternTypeMismatchInGUI.getBoolean(true);
this.MEMonitorableSmallSize = this.get("Client", "MEMonitorableSmallSize", 6).getInt(6);
this.InterfaceTerminalSmallSize = this.get("Client", "InterfaceTerminalSmallSize", 6).getInt(6);
Property screenColorProperty = this.get("Client", "screenColor", this.screenColor);