mc.fontRenderer.drawString(s, i / 2 + 33 + x, j - 60, 0xffffff);
x += 16 + mc.fontRenderer.getStringWidth(s);
}
}
//Render secondary gun
PlayerData data = PlayerHandler.getPlayerData(mc.thePlayer, Side.CLIENT);
if(gunType.oneHanded && data.offHandGunSlot != 0)
{
ItemStack offHandStack = mc.thePlayer.inventory.getStackInSlot(data.offHandGunSlot - 1);
if(offHandStack != null && offHandStack.getItem() instanceof ItemGun)
{
GunType offHandGunType = ((ItemGun)offHandStack.getItem()).type;
x = 0;
for(int n = 0; n < offHandGunType.numAmmoItemsInGun; n++)
{
ItemStack bulletStack = ((ItemGun)offHandStack.getItem()).getBulletItemStack(offHandStack, n);
if(bulletStack != null && bulletStack.getItem() != null && bulletStack.getItemDamage() < bulletStack.getMaxDamage())
{
//Find the string we are displaying next to the ammo item
String s = (bulletStack.getMaxDamage() - bulletStack.getItemDamage()) + "/" + bulletStack.getMaxDamage();
if(bulletStack.getMaxDamage() == 1)
s = "";
//Draw the slot and then move leftwards
RenderHelper.enableGUIStandardItemLighting();
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
GL11.glEnable(GL12.GL_RESCALE_NORMAL);
OpenGlHelper.setLightmapTextureCoords(OpenGlHelper.lightmapTexUnit, 240F, 240F);
drawSlotInventory(mc.fontRenderer, bulletStack, i / 2 - 32 - x, j - 65);
x += 16 + mc.fontRenderer.getStringWidth(s);
//Draw the string
GL11.glDisable(GL12.GL_RESCALE_NORMAL);
RenderHelper.disableStandardItemLighting();
mc.fontRenderer.drawString(s, i / 2 - 16 - x, j - 59, 0x000000);
mc.fontRenderer.drawString(s, i / 2 - 17 - x, j - 60, 0xffffff);
}
}
}
}
}
}
PacketTeamInfo teamInfo = FlansModClient.teamInfo;
if(teamInfo != null && FlansModClient.minecraft.thePlayer != null && (teamInfo.numTeams > 0 || !teamInfo.sortedByTeam) && teamInfo.getPlayerScoreData(FlansModClient.minecraft.thePlayer.getCommandSenderName()) != null)
{
GL11.glEnable(3042 /* GL_BLEND */);
GL11.glDisable(2929 /* GL_DEPTH_TEST */);
GL11.glDepthMask(false);
GL11.glBlendFunc(770, 771);
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
GL11.glDisable(3008 /* GL_ALPHA_TEST */);
mc.renderEngine.bindTexture(GuiTeamScores.texture);
tessellator.startDrawingQuads();
tessellator.addVertexWithUV(i / 2 - 43, 27, -90D, 85D / 256D, 27D / 256D);
tessellator.addVertexWithUV(i / 2 + 43, 27, -90D, 171D / 256D, 27D / 256D);
tessellator.addVertexWithUV(i / 2 + 43, 0D, -90D, 171D / 256D, 0D / 256D);
tessellator.addVertexWithUV(i / 2 - 43, 0D, -90D, 85D / 256D, 0D / 256D);
tessellator.draw();
//If we are in a two team gametype, draw the team scores at the top of the screen
if(teamInfo.numTeams == 2 && teamInfo.sortedByTeam)
{
//Draw team 1 colour bit
int colour = teamInfo.teamData[0].team.teamColour;
GL11.glColor4f(((colour >> 16) & 0xff) / 256F, ((colour >> 8) & 0xff) / 256F, (colour & 0xff) / 256F, 1.0F);
tessellator.startDrawingQuads();
tessellator.addVertexWithUV(i / 2 - 43, 27, -90D, 0D / 256D, 125D / 256D);
tessellator.addVertexWithUV(i / 2 - 19, 27, -90D, 24D / 256D, 125D / 256D);
tessellator.addVertexWithUV(i / 2 - 19, 0D, -90D, 24D / 256D, 98D / 256D);
tessellator.addVertexWithUV(i / 2 - 43, 0D, -90D, 0D / 256D, 98D / 256D);
tessellator.draw();
//Draw team 2 colour bit
colour = teamInfo.teamData[1].team.teamColour;
GL11.glColor4f(((colour >> 16) & 0xff) / 256F, ((colour >> 8) & 0xff) / 256F, (colour & 0xff) / 256F, 1.0F);
tessellator.startDrawingQuads();
tessellator.addVertexWithUV(i / 2 + 19, 27, -90D, 62D / 256D, 125D / 256D);
tessellator.addVertexWithUV(i / 2 + 43, 27, -90D, 86D / 256D, 125D / 256D);
tessellator.addVertexWithUV(i / 2 + 43, 0D, -90D, 86D / 256D, 98D / 256D);
tessellator.addVertexWithUV(i / 2 + 19, 0D, -90D, 62D / 256D, 98D / 256D);
tessellator.draw();
GL11.glDepthMask(true);
GL11.glEnable(2929 /* GL_DEPTH_TEST */);
GL11.glEnable(3008 /* GL_ALPHA_TEST */);
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
//Draw the team scores
mc.fontRenderer.drawString(teamInfo.teamData[0].score + "", i / 2 - 35, 9, 0x000000);
mc.fontRenderer.drawString(teamInfo.teamData[0].score + "", i / 2 - 36, 8, 0xffffff);
mc.fontRenderer.drawString(teamInfo.teamData[1].score + "", i / 2 + 35 - mc.fontRenderer.getStringWidth(teamInfo.teamData[1].score + ""), 9, 0x000000);
mc.fontRenderer.drawString(teamInfo.teamData[1].score + "", i / 2 + 34 - mc.fontRenderer.getStringWidth(teamInfo.teamData[1].score + ""), 8, 0xffffff);
}
mc.fontRenderer.drawString(teamInfo.gametype + "", i / 2 + 48, 9, 0x000000);
mc.fontRenderer.drawString(teamInfo.gametype + "", i / 2 + 47, 8, 0xffffff);
mc.fontRenderer.drawString(teamInfo.map + "", i / 2 - 47 - mc.fontRenderer.getStringWidth(teamInfo.map + ""), 9, 0x000000);
mc.fontRenderer.drawString(teamInfo.map + "", i / 2 - 48 - mc.fontRenderer.getStringWidth(teamInfo.map + ""), 8, 0xffffff);
int secondsLeft = teamInfo.timeLeft / 20;
int minutesLeft = secondsLeft / 60;
secondsLeft = secondsLeft % 60;
String timeLeft = minutesLeft + ":" + (secondsLeft < 10 ? "0" + secondsLeft : secondsLeft);
mc.fontRenderer.drawString(timeLeft, i / 2 - mc.fontRenderer.getStringWidth(timeLeft) / 2 - 1, 29, 0x000000);
mc.fontRenderer.drawString(timeLeft, i / 2 - mc.fontRenderer.getStringWidth(timeLeft) / 2, 30, 0xffffff);
GL11.glDepthMask(true);
GL11.glEnable(2929 /* GL_DEPTH_TEST */);
GL11.glEnable(3008 /* GL_ALPHA_TEST */);
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
String playerUsername = FlansModClient.minecraft.thePlayer.getCommandSenderName();
mc.fontRenderer.drawString(teamInfo.getPlayerScoreData(playerUsername).score + "", i / 2 - 7, 1, 0x000000);
mc.fontRenderer.drawString(teamInfo.getPlayerScoreData(playerUsername).kills + "", i / 2 - 7, 9, 0x000000);
mc.fontRenderer.drawString(teamInfo.getPlayerScoreData(playerUsername).deaths + "", i / 2 - 7, 17, 0x000000);
}
for(int n = 0; n < killMessages.size(); n++)
{
KillMessage killMessage = killMessages.get(n);
mc.fontRenderer.drawString("\u00a7" + killMessage.killerName + " " + "\u00a7" + killMessage.killedName, i - mc.fontRenderer.getStringWidth(killMessage.killerName + " " + killMessage.killedName) - 6, j - 32 - killMessage.line * 16, 0xffffff);
}
//Draw icons indicated weapons used
RenderHelper.enableGUIStandardItemLighting();
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
GL11.glEnable(GL12.GL_RESCALE_NORMAL);
OpenGlHelper.setLightmapTextureCoords(OpenGlHelper.lightmapTexUnit, 240F, 240F);
for(int n = 0; n < killMessages.size(); n++)
{
KillMessage killMessage = killMessages.get(n);
drawSlotInventory(mc.fontRenderer, new ItemStack(killMessage.weapon.item), i - mc.fontRenderer.getStringWidth(" " + killMessage.killedName) - 12, j - 36 - killMessage.line * 16);
}
GL11.glDisable(3042 /*GL_BLEND*/);
RenderHelper.disableStandardItemLighting();
//Off-hand weapon graphics
mc.renderEngine.bindTexture(offHand);
ItemStack currentStack = mc.thePlayer.inventory.getCurrentItem();
PlayerData data = PlayerHandler.getPlayerData(mc.thePlayer, Side.CLIENT);
if(currentStack != null && currentStack.getItem() instanceof ItemGun && ((ItemGun)currentStack.getItem()).type.oneHanded)
{
for(int n = 0; n < 9; n++)
{
if(data.offHandGunSlot == n + 1)
{
tessellator.startDrawingQuads();
tessellator.addVertexWithUV(i / 2 - 88 + 20 * n, j - 3, -90D, 16D / 64D, 16D / 32D);
tessellator.addVertexWithUV(i / 2 - 72 + 20 * n, j - 3, -90D, 32D / 64D, 16D / 32D);
tessellator.addVertexWithUV(i / 2 - 72 + 20 * n, j - 19, -90D, 32D / 64D, 0D / 32D);
tessellator.addVertexWithUV(i / 2 - 88 + 20 * n, j - 19, -90D, 16D / 64D, 0D / 32D);
tessellator.draw();
}
else if(data.isValidOffHandWeapon(mc.thePlayer, n + 1))
{
tessellator.startDrawingQuads();
tessellator.addVertexWithUV(i / 2 - 88 + 20 * n, j - 3, -90D, 0D / 64D, 16D / 32D);
tessellator.addVertexWithUV(i / 2 - 72 + 20 * n, j - 3, -90D, 16D / 64D, 16D / 32D);
tessellator.addVertexWithUV(i / 2 - 72 + 20 * n, j - 19, -90D, 16D / 64D, 0D / 32D);