diff --git a/resources/assets/enderio/textures/gui/cog.png b/resources/assets/enderio/textures/gui/cog.png new file mode 100644 index 00000000..67de2c6c Binary files /dev/null and b/resources/assets/enderio/textures/gui/cog.png differ diff --git a/resources/assets/enderio/textures/gui/widgets.png b/resources/assets/enderio/textures/gui/widgets.png index dc8d87ff..ae3c6e76 100644 Binary files a/resources/assets/enderio/textures/gui/widgets.png and b/resources/assets/enderio/textures/gui/widgets.png differ diff --git a/src/main/java/crazypants/enderio/gui/IGuiOverlay.java b/src/main/java/crazypants/enderio/gui/IGuiOverlay.java index b434e666..3fc2a03e 100644 --- a/src/main/java/crazypants/enderio/gui/IGuiOverlay.java +++ b/src/main/java/crazypants/enderio/gui/IGuiOverlay.java @@ -28,4 +28,6 @@ public interface IGuiOverlay { boolean handleMouseInput(int x, int y, int b); + boolean isMouseInBounds(int mouseX, int mouseY); + } diff --git a/src/main/java/crazypants/enderio/gui/IconEIO.java b/src/main/java/crazypants/enderio/gui/IconEIO.java index d7c95d5d..4b88d490 100644 --- a/src/main/java/crazypants/enderio/gui/IconEIO.java +++ b/src/main/java/crazypants/enderio/gui/IconEIO.java @@ -70,6 +70,9 @@ public final class IconEIO { public static final IconEIO LOOP = new IconEIO(86, 236, 20, 20); public static final IconEIO LOOP_OFF = new IconEIO(106, 236, 20, 20); + public static final IconEIO IO_CONFIG_UP = new IconEIO(80, 116, 24, 24); + public static final IconEIO IO_CONFIG_DOWN = new IconEIO(104, 116, 24, 24); + private static final int TEX_SIZE = 256; private static final double PIX_SIZE = 1d / TEX_SIZE; diff --git a/src/main/java/crazypants/enderio/gui/IoConfigRenderer.java b/src/main/java/crazypants/enderio/gui/IoConfigRenderer.java index 4d286192..92b77b16 100644 --- a/src/main/java/crazypants/enderio/gui/IoConfigRenderer.java +++ b/src/main/java/crazypants/enderio/gui/IoConfigRenderer.java @@ -277,13 +277,16 @@ public class IoConfigRenderer { private void doRender() { GL11.glEnable(GL11.GL_CULL_FACE); GL11.glEnable(GL12.GL_RESCALE_NORMAL); - + // RenderHelper.disableStandardItemLighting(); - mc.entityRenderer.enableLightmap(0); + //mc.entityRenderer.enableLightmap(0); + mc.entityRenderer.disableLightmap(0); RenderUtil.bindBlockTexture(); + GL11.glDisable(GL11.GL_LIGHTING); + GL11.glEnable(GL11.GL_TEXTURE_2D); Vector3d trans = new Vector3d((-origin.x) + eye.x, (-origin.y) + eye.y, (-origin.z) + eye.z); - for (int pass = 0; pass < 2; pass++) { + for (int pass = 0; pass < 1; pass++) { setGlStateForPass(pass, false); doWorldRenderPass(trans, configurables, pass); setGlStateForPass(pass, true); @@ -303,7 +306,7 @@ public class IoConfigRenderer { doTileEntityRenderPass(configurables, pass); setGlStateForPass(pass, true); //if(pass == 2) { - doTileEntityRenderPass(neighbours, pass); + //doTileEntityRenderPass(neighbours, pass); //} } ForgeHooksClient.setRenderPass(-1); @@ -356,12 +359,14 @@ public class IoConfigRenderer { GL11.glEnable(GL11.GL_BLEND); GL11.glEnable(GL11.GL_CULL_FACE); GL11.glBlendFunc(GL11.GL_CONSTANT_ALPHA, GL11.GL_CONSTANT_ALPHA); - GL14.glBlendColor(1.0f, 1.0f, 1.0f, 0.8f); + //GL14.glBlendColor(1.0f, 1.0f, 1.0f, 0.8f); + GL14.glBlendColor(0.0f, 0.0f, 0.0f, 0.8f); GL11.glDepthMask(true); } else { GL11.glEnable(GL11.GL_BLEND); GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_CONSTANT_ALPHA); - GL14.glBlendColor(1.0f, 1.0f, 1.0f, 0.8f); + //GL14.glBlendColor(1.0f, 1.0f, 1.0f, 0.8f); + GL14.glBlendColor(0.0f, 0.0f, 0.0f, 0.8f); GL11.glDepthMask(false); } return; diff --git a/src/main/java/crazypants/enderio/machine/GuiMachineBase.java b/src/main/java/crazypants/enderio/machine/GuiMachineBase.java index 7a0bdcad..5c05ccc7 100644 --- a/src/main/java/crazypants/enderio/machine/GuiMachineBase.java +++ b/src/main/java/crazypants/enderio/machine/GuiMachineBase.java @@ -52,9 +52,18 @@ public abstract class GuiMachineBase extends GuiContainerBase { redstoneButton = new RedstoneModeButton(this, -1, x, y, tileEntity, new BlockCoord(tileEntity)); y += 20; - configB = new IconButtonEIO(this, CONFIG_ID, x, y, IconEIO.BUTTON_DOWN); + configB = new IconButtonEIO(this, CONFIG_ID, x, y, IconEIO.IO_CONFIG_UP); + configB.setToolTip("Toggles the IO config overlay."); - configOverlay = new GuiOverlayIoConfig(machine); + configOverlay = new GuiOverlayIoConfig(machine) { + + @Override + public void setVisible(boolean visible) { + super.setVisible(visible); + configB.setIcon(visible ? IconEIO.IO_CONFIG_DOWN : IconEIO.IO_CONFIG_UP); + } + + }; addOverlay(configOverlay); } @@ -78,7 +87,8 @@ public abstract class GuiMachineBase extends GuiContainerBase { protected void actionPerformed(GuiButton b) { super.actionPerformed(b); if(b.id == CONFIG_ID) { - configOverlay.setVisible(!configOverlay.isVisible()); + boolean vis = !configOverlay.isVisible(); + configOverlay.setVisible(vis); } } @@ -105,4 +115,6 @@ public abstract class GuiMachineBase extends GuiContainerBase { } + + } diff --git a/src/main/java/crazypants/enderio/machine/GuiOverlayIoConfig.java b/src/main/java/crazypants/enderio/machine/GuiOverlayIoConfig.java index ca9798e9..a15a8524 100644 --- a/src/main/java/crazypants/enderio/machine/GuiOverlayIoConfig.java +++ b/src/main/java/crazypants/enderio/machine/GuiOverlayIoConfig.java @@ -61,7 +61,7 @@ public class GuiOverlayIoConfig implements IGuiOverlay { @Override public boolean handleMouseInput(int x, int y, int b) { - if(!mouseInBounds(x, y)) { + if(!isMouseInBounds(x, y)) { renderer.handleMouseInput(); return false; } @@ -70,7 +70,8 @@ public class GuiOverlayIoConfig implements IGuiOverlay { return true; } - private boolean mouseInBounds(int mouseX, int mouseY) { + @Override + public boolean isMouseInBounds(int mouseX, int mouseY) { int x = mouseX - screen.getGuiLeft(); int y = mouseY - screen.getGuiTop(); if(bounds.contains(x,y)) { diff --git a/src/main/java/crazypants/enderio/machine/PacketIoMode.java b/src/main/java/crazypants/enderio/machine/PacketIoMode.java index bfb0123f..7c057f6d 100644 --- a/src/main/java/crazypants/enderio/machine/PacketIoMode.java +++ b/src/main/java/crazypants/enderio/machine/PacketIoMode.java @@ -56,7 +56,6 @@ public class PacketIoMode implements IPacketEio { } private void handle(EntityPlayer player) { - System.out.println("PacketIoMode.handle: "); TileEntity te = player.worldObj.getTileEntity(x, y, z); if(te instanceof IIoConfigurable) { IIoConfigurable me = (IIoConfigurable) te; diff --git a/src/main/java/crazypants/gui/GuiContainerBase.java b/src/main/java/crazypants/gui/GuiContainerBase.java index 0cbe1991..02cbc936 100644 --- a/src/main/java/crazypants/gui/GuiContainerBase.java +++ b/src/main/java/crazypants/gui/GuiContainerBase.java @@ -56,38 +56,6 @@ public abstract class GuiContainerBase extends GuiContainer implements ToolTipRe ttMan.addToolTip(toolTip); } - // @Override - // protected void mouseClicked(int par1, int par2, int par3) { - // for(IGuiOverlay overlay : overlays) { - // if(overlay != null && overlay.isVisible() && overlay.mouseClicked(par1, par2, par3)) { - // return; - // } - // } - // super.mouseClicked(par1, par2, par3); - // } - // - // @Override - // protected void mouseClickMove(int par1, int par2, int par3, long par4) { - // for(IGuiOverlay overlay : overlays) { - // if(overlay != null && overlay.isVisible() && overlay.mouseClickMove(par1, par2, par3, par4)) { - // return; - // } - // } - // super.mouseClickMove(par1, par2, par3, par4); - // } - // - // @Override - // protected void mouseMovedOrUp(int par1, int par2, int par3) { - // for(IGuiOverlay overlay : overlays) { - // if(overlay != null && overlay.isVisible() && overlay.mouseMovedOrUp(par1, par2, par3)) { - // return; - // } - // } - // super.mouseMovedOrUp(par1, par2, par3); - // } - - - @Override public void handleMouseInput() { int x = Mouse.getEventX() * this.width / this.mc.displayWidth; @@ -101,10 +69,22 @@ public abstract class GuiContainerBase extends GuiContainer implements ToolTipRe super.handleMouseInput(); } + @Override + protected boolean func_146978_c(int p_146978_1_, int p_146978_2_, int p_146978_3_, int p_146978_4_, int p_146978_5_, int p_146978_6_) { + int x = Mouse.getEventX() * this.width / this.mc.displayWidth; + int y = this.height - Mouse.getEventY() * this.height / this.mc.displayHeight - 1; + int b = Mouse.getEventButton(); + for(IGuiOverlay overlay : overlays) { + if(overlay != null && overlay.isVisible() && overlay.isMouseInBounds(x, y)) { + return false; + } + } + return super.func_146978_c(p_146978_1_, p_146978_2_, p_146978_3_, p_146978_4_, p_146978_5_, p_146978_6_); + } + @Override public void handleKeyboardInput() { - // TODO Auto-generated method stub super.handleKeyboardInput(); } @@ -130,8 +110,8 @@ public abstract class GuiContainerBase extends GuiContainer implements ToolTipRe int my = par2; for(IGuiOverlay overlay : overlays) { if(overlay != null && overlay.isVisible() && isMouseInOverlay(par1, par2, overlay)) { - mx = -1; - my = -1; + mx = -5000; + my = -5000; } }