mirror of
https://github.com/GTNewHorizons/NotEnoughItems.git
synced 2026-11-16 10:44:45 +00:00
Add option to cache item grid rendering (#250)
* Add option to cache item grid rendering * Fix highlighting for bookmarks * Tweak GL state slightly * Fix focus box being in the wrong place * Fix flickering for one frame when searching * Prevent potion effects from rendering over NEI slots Fixes #231 * Invalidate the buffer if `invalidSlotMap` changes * Clean up imports * Delay blitting until after the buffer is refreshed but still avoid waiting for the next frame * Refactor slot focus logic to handle highlighting multiple slots * Refresh grid when sorting bookmarks * Minor code cleanup, fix some more hovering issues * Remove `slotNeedsOutline`, it is now redundant * Remove focus parameter from drawItem
This commit is contained in:
1 parent
72d44fd711
commit
8f7d698e7d
7 files changed
+192
-41
No files matched your search
@@ -34,6 +34,7 @@ import codechicken.obfuscator.ObfuscationRun;
|
||||
import com.google.common.base.Objects;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.gui.GuiScreen;
|
||||
import net.minecraft.client.renderer.OpenGlHelper;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.world.World;
|
||||
@@ -182,6 +183,9 @@ public class NEIClientConfig {
|
||||
return isMouseScrollTransferEnabled();
|
||||
}
|
||||
});
|
||||
|
||||
tag.getTag("inventory.cacheItemRendering").getBooleanValue(false);
|
||||
API.addOption(new OptionToggleButton("inventory.cacheItemRendering", true));
|
||||
|
||||
tag.getTag("itemLoadingTimeout").getIntValue(500);
|
||||
|
||||
@@ -550,6 +554,10 @@ public class NEIClientConfig {
|
||||
return !getBooleanSetting("inventory.invertMouseScrollTransfer");
|
||||
}
|
||||
|
||||
public static boolean shouldCacheItemRendering() {
|
||||
return getBooleanSetting("inventory.cacheItemRendering") && OpenGlHelper.framebufferSupported;
|
||||
}
|
||||
|
||||
public static boolean getMagnetMode() {
|
||||
return enabledActions.contains("magnet");
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user