diff --git a/common/crazypants/enderio/Config.java b/common/crazypants/enderio/Config.java index c5083e5c..020229c4 100644 --- a/common/crazypants/enderio/Config.java +++ b/common/crazypants/enderio/Config.java @@ -59,6 +59,12 @@ public final class Config { public static int fluidConduitMaxIoRate = 200; + public static boolean renderCapBankGauge = true; + + public static boolean renderCapBankGaugeBackground = true; + + public static boolean renderCapBankGaugeLevel = true; + public static void load(FMLPreInitializationEvent event) { configDirectory = new File(event.getModConfigurationDirectory(), "enderio"); if(!configDirectory.exists()) { @@ -173,6 +179,16 @@ public final class Config { useSneakMouseWheelYetaWrench = true; } + //TODO: Debug + renderCapBankGauge = config.get("Debug", "renderCapBankGauge", renderCapBankGauge, "If not true capacitor banks will not render the level gauge at all.") + .getBoolean(renderCapBankGauge); + renderCapBankGaugeBackground = config.get("Debug", "renderCapBankGaugeBackground", renderCapBankGaugeBackground, + "If not true capacitor banks will not render the level gauge background.") + .getBoolean(renderCapBankGaugeBackground); + renderCapBankGaugeLevel = config.get("Debug", "renderCapBankGaugeLevel", renderCapBankGaugeLevel, + "If not true capacitor banks will not render the level on the gauge.") + .getBoolean(renderCapBankGaugeLevel); + } private Config() { diff --git a/common/crazypants/enderio/machine/power/CapBankRenderer2.java b/common/crazypants/enderio/machine/power/CapBankRenderer2.java index 982162e0..7b0d3552 100644 --- a/common/crazypants/enderio/machine/power/CapBankRenderer2.java +++ b/common/crazypants/enderio/machine/power/CapBankRenderer2.java @@ -11,6 +11,7 @@ import net.minecraft.util.Icon; import net.minecraft.world.IBlockAccess; import net.minecraftforge.common.ForgeDirection; import cpw.mods.fml.client.registry.ISimpleBlockRenderingHandler; +import crazypants.enderio.Config; import crazypants.enderio.EnderIO; import crazypants.enderio.machine.power.GaugeBounds.VPos; import crazypants.render.ConnectedTextureRenderer; @@ -41,7 +42,9 @@ public class CapBankRenderer2 implements ISimpleBlockRenderingHandler { GaugueRenderer gaugeRenderer = new GaugueRenderer(); renderers.add(connectedTexRenderer); - renderers.add(gaugeRenderer); + if(Config.renderCapBankGauge) { + renderers.add(gaugeRenderer); + } } @Override @@ -107,8 +110,12 @@ public class CapBankRenderer2 implements ISimpleBlockRenderingHandler { col.scale(0.25); tes.setColorRGBA_F(col.x, col.y, col.z, col.w); } - renderGaugeOnFace(gb, EnderIO.blockCapacitorBank.overlayIcon, refVertices, x, y, z); - renderFillBarOnFace(gb, EnderIO.blockCapacitorBank.fillBarIcon, ((TileCapacitorBank) te).getEnergyStoredRatio(), refVertices, x, y, z); + if(Config.renderCapBankGaugeBackground) { + renderGaugeOnFace(gb, EnderIO.blockCapacitorBank.overlayIcon, refVertices, x, y, z); + } + if(Config.renderCapBankGaugeLevel) { + renderFillBarOnFace(gb, EnderIO.blockCapacitorBank.fillBarIcon, ((TileCapacitorBank) te).getEnergyStoredRatio(), refVertices, x, y, z); + } tes.addTranslation((float) -x, (float) -y, (float) -z); return; }