Draw the cross in the hint grid

This commit is contained in:
Antifluxfield 2017-11-09 15:50:03 +08:00
parent ced4854069
commit 51334d19db
2 changed files with 74 additions and 16 deletions

View file

@ -89,19 +89,19 @@ public class GT_MetaPipeEntity_Fluid extends MetaPipeEntity {
return new GT_MetaPipeEntity_Fluid(mName, mThickNess, mMaterial, mCapacity, mHeatResistance, mGasProof, mPipeAmount);
}
protected static final byte[][] sRestrictionArray = new byte[][]{
{2, 3, 5, 4},
{2, 3, 4, 5},
{1, 0, 4, 5},
{1, 0, 4, 5},
{1, 0, 2, 3},
{1, 0, 2, 3}};
@Override
public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aConnections, byte aColorIndex, boolean aConnected, boolean aRedstone) {
float tThickNess = getThickNess();
if (mDisableInput == 0) return new ITexture[]{aConnected ? getBaseTexture(tThickNess, mPipeAmount, mMaterial, aColorIndex) : new GT_RenderedTexture(mMaterial.mIconSet.mTextures[OrePrefixes.pipe.mTextureIndex], Dyes.getModulation(aColorIndex, mMaterial.mRGBa))};
byte tMask = 0;
byte[][] sRestrictionArray = new byte[][]{
{2, 3, 5, 4},
{2, 3, 4, 5},
{1, 0, 4, 5},
{1, 0, 4, 5},
{1, 0, 2, 3},
{1, 0, 2, 3}
};
if (aSide >= 0 && aSide < 6) for (byte i = 0; i < 4; i++) if ((mDisableInput & (1 << sRestrictionArray[aSide][i])) != 0) tMask |= 1 << i;
return new ITexture[]{aConnected ? getBaseTexture(tThickNess, mPipeAmount, mMaterial, aColorIndex) : new GT_RenderedTexture(mMaterial.mIconSet.mTextures[OrePrefixes.pipe.mTextureIndex], Dyes.getModulation(aColorIndex, mMaterial.mRGBa)), getRestrictorTexture(tMask)};
}

View file

@ -137,14 +137,72 @@ public class GT_Client extends GT_Proxy
GL11.glLineWidth(2.0F);
GL11.glColor4f(0.0F, 0.0F, 0.0F, 0.5F);
GL11.glBegin(1);
GL11.glVertex3d(0.5D, 0.0D, -0.25D);
GL11.glVertex3d(-0.5D, 0.0D, -0.25D);
GL11.glVertex3d(0.5D, 0.0D, 0.25D);
GL11.glVertex3d(-0.5D, 0.0D, 0.25D);
GL11.glVertex3d(0.25D, 0.0D, -0.5D);
GL11.glVertex3d(0.25D, 0.0D, 0.5D);
GL11.glVertex3d(-0.25D, 0.0D, -0.5D);
GL11.glVertex3d(-0.25D, 0.0D, 0.5D);
GL11.glVertex3d(+.50D, .0D, -.25D);
GL11.glVertex3d(-.50D, .0D, -.25D);
GL11.glVertex3d(+.50D, .0D, +.25D);
GL11.glVertex3d(-.50D, .0D, +.25D);
GL11.glVertex3d(+.25D, .0D, -.50D);
GL11.glVertex3d(+.25D, .0D, +.50D);
GL11.glVertex3d(-.25D, .0D, -.50D);
GL11.glVertex3d(-.25D, .0D, +.50D);
int[][] GridSwitchArr = new int[][]{
{0, 5, 3, 1, 2, 4},
{5, 0, 1, 3, 2, 4},
{1, 3, 0, 5, 2, 4},
{3, 1, 5, 0, 2, 4},
{4, 2, 3, 1, 0, 5},
{2, 4, 3, 1, 5, 0},
};
switch (GridSwitchArr[aEvent.target.sideHit][GT_Utility.determineWrenchingSide((byte) aEvent.target.sideHit, (float) aEvent.target.hitVec.xCoord - (float) aEvent.target.blockX, (float) aEvent.target.hitVec.yCoord - (float) aEvent.target.blockY, (float) aEvent.target.hitVec.zCoord - (float) aEvent.target.blockZ)]) {
case 0:
GL11.glVertex3d(+.25D, .0D, +.25D);
GL11.glVertex3d(-.25D, .0D, -.25D);
GL11.glVertex3d(-.25D, .0D, +.25D);
GL11.glVertex3d(+.25D, .0D, -.25D);
break;
case 1:
GL11.glVertex3d(-.25D, .0D, +.50D);
GL11.glVertex3d(+.25D, .0D, +.25D);
GL11.glVertex3d(-.25D, .0D, +.25D);
GL11.glVertex3d(+.25D, .0D, +.50D);
break;
case 2:
GL11.glVertex3d(-.50D, .0D, -.25D);
GL11.glVertex3d(-.25D, .0D, +.25D);
GL11.glVertex3d(-.50D, .0D, +.25D);
GL11.glVertex3d(-.25D, .0D, -.25D);
break;
case 3:
GL11.glVertex3d(-.25D, .0D, -.50D);
GL11.glVertex3d(+.25D, .0D, -.25D);
GL11.glVertex3d(-.25D, .0D, -.25D);
GL11.glVertex3d(+.25D, .0D, -.50D);
break;
case 4:
GL11.glVertex3d(+.50D, .0D, -.25D);
GL11.glVertex3d(+.25D, .0D, +.25D);
GL11.glVertex3d(+.50D, .0D, +.25D);
GL11.glVertex3d(+.25D, .0D, -.25D);
break;
case 5:
GL11.glVertex3d(+.50D, .0D, +.50D);
GL11.glVertex3d(+.25D, .0D, +.25D);
GL11.glVertex3d(+.50D, .0D, +.25D);
GL11.glVertex3d(+.25D, .0D, +.50D);
GL11.glVertex3d(+.50D, .0D, -.50D);
GL11.glVertex3d(+.25D, .0D, -.25D);
GL11.glVertex3d(+.50D, .0D, -.25D);
GL11.glVertex3d(+.25D, .0D, -.50D);
GL11.glVertex3d(-.50D, .0D, +.50D);
GL11.glVertex3d(-.25D, .0D, +.25D);
GL11.glVertex3d(-.50D, .0D, +.25D);
GL11.glVertex3d(-.25D, .0D, +.50D);
GL11.glVertex3d(-.50D, .0D, -.50D);
GL11.glVertex3d(-.25D, .0D, -.25D);
GL11.glVertex3d(-.50D, .0D, -.25D);
GL11.glVertex3d(-.25D, .0D, -.50D);
break;
}
GL11.glEnd();
GL11.glPopMatrix();
}