}
private void renderOverlay(int mx, int my) {
Rectangle vp = camera.getViewport();
ScaledResolution scaledresolution = new ScaledResolution(mc, mc.displayWidth, mc.displayHeight);
int vpx = vp.x / scaledresolution.getScaleFactor();
int vph = vp.height / scaledresolution.getScaleFactor();
int vpw = vp.width/ scaledresolution.getScaleFactor();
int vpy = (int)((float)(vp.y + vp.height - 4)/(float)scaledresolution.getScaleFactor());
GL11.glViewport(0, 0, mc.displayWidth, mc.displayHeight);
GL11.glMatrixMode(GL11.GL_PROJECTION);
GL11.glLoadIdentity();
GL11.glOrtho(0.0D, scaledresolution.getScaledWidth_double(), scaledresolution.getScaledHeight_double(), 0.0D, 1000.0D, 3000.0D);
GL11.glMatrixMode(GL11.GL_MODELVIEW);
GL11.glLoadIdentity();
GL11.glTranslatef(vpx, vpy, -2000.0F);
GL11.glDisable(GL11.GL_LIGHTING);
int x = vpw - 16;
int y = vph - 16;
mx -= vpx;
my -= vpy;
if(mx >= x && mx <= x + IconEIO.IO_WHATSIT.width &&
my >= y && my <= y + IconEIO.IO_WHATSIT.height) {
RenderUtil.renderQuad2D(x, y, 0, IconEIO.IO_WHATSIT.width, IconEIO.IO_WHATSIT.height, new Vector4f(0.4f,0.4f,0.4f,0.6f));
inNeigButBounds = true;
} else {
inNeigButBounds = false;
}
GL11.glColor3f(1, 1, 1);
IconEIO.IO_WHATSIT.renderIcon(x, y, true);
if(selection != null) {
IconEIO ioIcon = null;
// INPUT
IoMode mode = selection.config.getIoMode(selection.face);
if(mode == IoMode.PULL) {
ioIcon = IconEIO.INPUT_SMALL_INV;
} else if(mode == IoMode.PUSH) {
ioIcon = IconEIO.OUTPUT_SMALL_INV;
} else if(mode == IoMode.PUSH_PULL) {
ioIcon = IconEIO.INPUT_OUTPUT;
} else if(mode == IoMode.DISABLED) {
ioIcon = IconEIO.DISABLED;
}
y = vph - mc.fontRenderer.FONT_HEIGHT - 2;
mc.fontRenderer.drawString(getLabelForMode(mode), 4, y, ColorUtil.getRGB(Color.white));
if(ioIcon != null) {
int w = mc.fontRenderer.getStringWidth(mode.getLocalisedName());
double xd = (w - ioIcon.width)/2;
xd = Math.max(0, w);
xd /=2;
xd += 4;
xd /= scaledresolution.getScaleFactor();
ioIcon.renderIcon(xd, y - mc.fontRenderer.FONT_HEIGHT - 2,true);
}
}
}