mirror of
https://github.com/GTNewHorizons/Draconic-Evolution.git
synced 2026-11-26 15:02:56 +00:00
Initial commit
This commit is contained in:
1 parent
7bca2b681b
commit
58a892f6f5
226 files changed
+12362
No files matched your search
@@ -0,0 +1,96 @@
|
||||
package draconicevolution.client.interfaces;
|
||||
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.gui.GuiButton;
|
||||
import net.minecraft.client.gui.inventory.GuiContainer;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.entity.player.InventoryPlayer;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import draconicevolution.common.container.ContainerGrinder;
|
||||
import draconicevolution.common.lib.References;
|
||||
import draconicevolution.common.tileentities.TileGrinder;
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public class GUIGrinder extends GuiContainer {
|
||||
|
||||
public EntityPlayer player;
|
||||
private TileGrinder tile;
|
||||
private int guiUpdateTick;
|
||||
|
||||
public GUIGrinder(InventoryPlayer invPlayer, TileGrinder tile) {
|
||||
super(new ContainerGrinder(invPlayer, tile));
|
||||
|
||||
xSize = 176;
|
||||
ySize = 162;
|
||||
|
||||
this.tile = tile;
|
||||
this.player = invPlayer.player;
|
||||
}
|
||||
|
||||
private static final ResourceLocation texture = new ResourceLocation(References.MODID.toLowerCase(), "textures/gui/Grinder.png");
|
||||
|
||||
@Override
|
||||
protected void drawGuiContainerBackgroundLayer(float f, int x, int y)
|
||||
{
|
||||
GL11.glColor4f(1, 1, 1, 1);
|
||||
|
||||
Minecraft.getMinecraft().getTextureManager().bindTexture(texture);
|
||||
drawTexturedModalRect(guiLeft, guiTop, 0, 0, xSize, ySize);
|
||||
drawTexturedModalRect(guiLeft + 63, guiTop + 34, 0, ySize, 18, 18);//fuel box
|
||||
drawTexturedModalRect(guiLeft + 97, guiTop + 34, 18, ySize, 18, 18);//flame box
|
||||
if (tile.getStackInSlot(0) == null)
|
||||
drawTexturedModalRect(guiLeft + 63, guiTop + 34, 36, ySize, 18, 18);//fuel box
|
||||
|
||||
float power = tile.energy / 5000f * -1 + 1;
|
||||
float fuel = tile.burnTimeRemaining / ((float)tile.burnTime) * -1 + 1;
|
||||
|
||||
drawTexturedModalRect(guiLeft + 83, guiTop + 11 + (int)(power*40), xSize, 0 + (int)(power*40), 12, 40 - (int)(power*40));//Power bar
|
||||
drawTexturedModalRect(guiLeft + 100, guiTop + 37 + (int)(fuel*13), xSize, 40 + (int)(fuel*13), 18, 18 - (int)(fuel*13));//Power bar
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void drawGuiContainerForegroundLayer(int p_146979_1_, int p_146979_2_)
|
||||
{
|
||||
//fontRendererObj.drawString("Charges: " + charges, 90, 25, 0x000000);
|
||||
//drawCenteredString(fontRendererObj, "Charges: " + charges, 117, 25, 0x000000);
|
||||
//drawCenteredString(fontRendererObj, "Weather Controller", xSize/2, -15, 0x2a4ed0);
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void initGui()
|
||||
{
|
||||
super.initGui();
|
||||
|
||||
//ID
|
||||
//buttonList.add(new GuiButton(0, guiLeft + 85, guiTop , 85, 20, text));
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void actionPerformed(GuiButton button)
|
||||
{
|
||||
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateScreen()
|
||||
{
|
||||
guiUpdateTick++;
|
||||
if (guiUpdateTick >= 10){
|
||||
initGui();
|
||||
guiUpdateTick = 0;
|
||||
}
|
||||
super.updateScreen();
|
||||
|
||||
}
|
||||
|
||||
// ####Draw at############ read from size
|
||||
//drawTexturedModalRect(guiLeft + 37, guiTop + 4, 0, 143, 37, 38);
|
||||
}
|
||||
Reference in new issue
Block a user