mirror of
https://github.com/Thorfusion/Mekanism-Community-Edition.git
synced 2026-11-23 21:39:40 +00:00
Work on making it work Client-side.
This commit is contained in:
1 parent
16e38fafbe
commit
2e7d3a1945
17 files changed
+638
-12
No files matched your search
@@ -0,0 +1,71 @@
|
||||
package mekanism.generators.client.gui;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import mekanism.api.ListUtils;
|
||||
import mekanism.client.gui.GuiEnergyInfo;
|
||||
import mekanism.client.gui.GuiEnergyInfo.IInfoHandler;
|
||||
import mekanism.client.gui.GuiMekanism;
|
||||
import mekanism.client.gui.GuiPowerBar;
|
||||
import mekanism.client.gui.GuiRedstoneControl;
|
||||
import mekanism.client.gui.GuiSlot;
|
||||
import mekanism.client.gui.GuiSlot.SlotOverlay;
|
||||
import mekanism.client.gui.GuiSlot.SlotType;
|
||||
import mekanism.common.util.MekanismUtils;
|
||||
import mekanism.common.util.MekanismUtils.ResourceType;
|
||||
import mekanism.generators.common.inventory.container.ContainerNeutronCapture;
|
||||
import mekanism.generators.common.inventory.container.ContainerReactorController;
|
||||
import mekanism.generators.common.tile.reactor.TileEntityReactorController;
|
||||
import mekanism.generators.common.tile.reactor.TileEntityReactorNeutronCapture;
|
||||
|
||||
import net.minecraft.entity.player.InventoryPlayer;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public class GuiNeutronCapture extends GuiMekanism
|
||||
{
|
||||
public TileEntityReactorNeutronCapture tileEntity;
|
||||
|
||||
public GuiNeutronCapture(InventoryPlayer inventory, TileEntityReactorNeutronCapture tentity)
|
||||
{
|
||||
super(new ContainerNeutronCapture(inventory, tentity));
|
||||
tileEntity = tentity;
|
||||
guiElements.add(new GuiRedstoneControl(this, tileEntity, MekanismUtils.getResource(ResourceType.GUI, "GuiBlank.png")));
|
||||
guiElements.add(new GuiEnergyInfo(new IInfoHandler()
|
||||
{
|
||||
@Override
|
||||
public List<String> getInfo()
|
||||
{
|
||||
return ListUtils.asList(
|
||||
"Storing: " + MekanismUtils.getEnergyDisplay(tileEntity.getEnergy()),
|
||||
"Max Output: " + MekanismUtils.getEnergyDisplay(tileEntity.getMaxOutput()) + "/t");
|
||||
}
|
||||
}, this, MekanismUtils.getResource(ResourceType.GUI, "GuiBlank.png")));
|
||||
guiElements.add(new GuiPowerBar(this, tileEntity, MekanismUtils.getResource(ResourceType.GUI, "GuiBlank.png"), 164, 15));
|
||||
guiElements.add(new GuiSlot(SlotType.NORMAL, this, MekanismUtils.getResource(ResourceType.GUI, "GuiBlank.png"), 142, 34).with(SlotOverlay.POWER));
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void drawGuiContainerForegroundLayer(int mouseX, int mouseY)
|
||||
{
|
||||
super.drawGuiContainerForegroundLayer(mouseX, mouseY);
|
||||
|
||||
fontRendererObj.drawString(tileEntity.getInventoryName(), 30, 6, 0x404040);
|
||||
fontRendererObj.drawString(MekanismUtils.localize("container.inventory"), 8, (ySize - 96) + 2, 0x404040);
|
||||
fontRendererObj.drawString(MekanismUtils.getEnergyDisplay(tileEntity.getEnergy()), 51, 26, 0x00CD00);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void drawGuiContainerBackgroundLayer(float partialTick, int mouseX, int mouseY)
|
||||
{
|
||||
mc.renderEngine.bindTexture(MekanismUtils.getResource(ResourceType.GUI, "GuiBlank.png"));
|
||||
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
|
||||
int guiWidth = (width - xSize) / 2;
|
||||
int guiHeight = (height - ySize) / 2;
|
||||
drawTexturedModalRect(guiWidth, guiHeight, 0, 0, xSize, ySize);
|
||||
|
||||
super.drawGuiContainerBackgroundLayer(partialTick, mouseX, mouseY);
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user