From 2e976a609f9e0c677008f0f7b44302bc7ee097b8 Mon Sep 17 00:00:00 2001 From: NotMyWing Date: Fri, 24 May 2024 23:54:05 +1100 Subject: [PATCH] Make Storage Cell tooltips configurable Closes #427 --- src/main/java/appeng/core/AEConfig.java | 6 ++++++ src/main/java/appeng/core/api/ApiClientHelper.java | 6 +++++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/src/main/java/appeng/core/AEConfig.java b/src/main/java/appeng/core/AEConfig.java index ace9c3913..b6d96086c 100644 --- a/src/main/java/appeng/core/AEConfig.java +++ b/src/main/java/appeng/core/AEConfig.java @@ -84,6 +84,7 @@ public final class AEConfig extends Configuration implements IConfigurableObject private PowerUnits selectedPowerUnit = PowerUnits.AE; private boolean showCraftableTooltip = true; private boolean showPlacementPreview = true; + private boolean showCellContentsPreview = true; // Spatial IO/Dimension private int storageProviderID = -1; @@ -259,6 +260,7 @@ public final class AEConfig extends Configuration implements IConfigurableObject this.useColoredCraftingStatus = this.get("Client", "useColoredCraftingStatus", true).getBoolean(true); this.showCraftableTooltip = this.get("Client", "showCraftableTooltip", true, "Whether to add \"Craftable\" to item tooltips when they can be crafted automatically.").getBoolean(true); this.showPlacementPreview = this.get("Client", "showPlacementPreview", true, "Whether to show a preview of part and facade placement.").getBoolean(true); + this.showCellContentsPreview = this.get("Client", "showCellContentsPreview", true, "Whether to show a preview of cell contents in tooltips.").getBoolean(true); // load buttons.. for (int btnNum = 0; btnNum < 4; btnNum++) { @@ -520,6 +522,10 @@ public final class AEConfig extends Configuration implements IConfigurableObject return this.showPlacementPreview; } + public boolean showCellContentsPreview() { + return showCellContentsPreview; + } + public boolean isDisableColoredCableRecipesInJEI() { return this.disableColoredCableRecipesInJEI; } diff --git a/src/main/java/appeng/core/api/ApiClientHelper.java b/src/main/java/appeng/core/api/ApiClientHelper.java index e59599449..9cbb87203 100644 --- a/src/main/java/appeng/core/api/ApiClientHelper.java +++ b/src/main/java/appeng/core/api/ApiClientHelper.java @@ -11,6 +11,7 @@ import appeng.api.storage.data.IAEItemStack; import appeng.api.storage.data.IAEStack; import appeng.api.storage.data.IItemList; import appeng.api.util.IClientHelper; +import appeng.core.AEConfig; import appeng.core.localization.GuiText; import appeng.fluids.items.FluidDummyItem; import appeng.fluids.util.AEFluidStack; @@ -109,7 +110,10 @@ public class ApiClientHelper implements IClientHelper { } } } else { - if (Minecraft.getMinecraft().gameSettings.advancedItemTooltips || Keyboard.isKeyDown(Keyboard.KEY_LSHIFT) || Keyboard.isKeyDown(Keyboard.KEY_RSHIFT)) { + if (!AEConfig.instance().showCellContentsPreview()) return; + if (Minecraft.getMinecraft().gameSettings.advancedItemTooltips + || Keyboard.isKeyDown(Keyboard.KEY_LSHIFT) || Keyboard.isKeyDown(Keyboard.KEY_RSHIFT) + ) { cellInventory.getAvailableItems((IItemList) itemList); for (IAEStack s : itemList) { if (s instanceof IAEItemStack) {