More work on ChargeHud now shows current charge

Added Color enum from Talismans 2 will be used for hud soonTM
This commit is contained in:
Gig 2015-06-14 12:34:47 +01:00
parent 63fa58eb24
commit e2ae947e2c
2 changed files with 54 additions and 2 deletions

View file

@ -1,5 +1,8 @@
package techreborn.client.hud;
import org.lwjgl.opengl.GL11;
import ic2.api.item.ElectricItem;
import ic2.api.item.IElectricItem;
import ic2.api.item.IElectricItemManager;
import ic2.core.item.ElectricItemManager;
@ -9,6 +12,7 @@ import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.ScaledResolution;
import net.minecraft.client.renderer.RenderHelper;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
@ -40,8 +44,11 @@ public class ChargeHud
if((stack.getItem() instanceof IElectricItem))
{
double MaxCharge = ((IElectricItem) stack.getItem()).getMaxCharge(stack);
//TODO find a way to get current charge
double CurrentCharge = ((IElectricItem) stack.getItem()).getMaxCharge(stack);
double CurrentCharge = ElectricItem.manager.getCharge(stack);
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
GL11.glEnable(32826);
RenderHelper.enableStandardItemLighting();
RenderHelper.enableGUIStandardItemLighting();
mc.fontRenderer.drawString(Double.toString(CurrentCharge) + "/" + Double.toString(MaxCharge), 0, 0, 0);
}
}