mirror of
https://github.com/Thorfusion/Mekanism-Community-Edition.git
synced 2026-11-26 14:52:58 +00:00
65 lines
3.2 KiB
Java
65 lines
3.2 KiB
Java
package mekanism.client.gui;
|
|
|
|
import mekanism.client.gui.element.GuiGasGauge;
|
|
import mekanism.client.gui.element.GuiGauge;
|
|
import mekanism.client.gui.element.GuiProgress;
|
|
import mekanism.client.gui.element.GuiProgress.IProgressInfoHandler;
|
|
import mekanism.client.gui.element.GuiProgress.ProgressBar;
|
|
import mekanism.client.gui.element.GuiRedstoneControl;
|
|
import mekanism.client.gui.element.GuiSecurityTab;
|
|
import mekanism.client.gui.element.GuiSlot;
|
|
import mekanism.client.gui.element.GuiSlot.SlotOverlay;
|
|
import mekanism.client.gui.element.GuiSlot.SlotType;
|
|
import mekanism.client.gui.element.GuiUpgradeTab;
|
|
import mekanism.common.inventory.container.ContainerSolarNeutronActivator;
|
|
import mekanism.common.tile.TileEntitySolarNeutronActivator;
|
|
import mekanism.common.util.LangUtils;
|
|
import mekanism.common.util.MekanismUtils;
|
|
import mekanism.common.util.MekanismUtils.ResourceType;
|
|
import net.minecraft.entity.player.InventoryPlayer;
|
|
import net.minecraft.util.ResourceLocation;
|
|
import net.minecraftforge.fml.relauncher.Side;
|
|
import net.minecraftforge.fml.relauncher.SideOnly;
|
|
|
|
@SideOnly(Side.CLIENT)
|
|
public class GuiSolarNeutronActivator extends GuiMekanismTile<TileEntitySolarNeutronActivator> {
|
|
|
|
public GuiSolarNeutronActivator(InventoryPlayer inventory, TileEntitySolarNeutronActivator tile) {
|
|
super(tile, new ContainerSolarNeutronActivator(inventory, tile));
|
|
ResourceLocation resource = getGuiLocation();
|
|
addGuiElement(new GuiSecurityTab(this, tileEntity, resource));
|
|
addGuiElement(new GuiRedstoneControl(this, tileEntity, resource));
|
|
addGuiElement(new GuiUpgradeTab(this, tileEntity, resource));
|
|
addGuiElement(new GuiSlot(SlotType.NORMAL, this, resource, 4, 55).with(SlotOverlay.MINUS));
|
|
addGuiElement(new GuiSlot(SlotType.NORMAL, this, resource, 154, 55).with(SlotOverlay.PLUS));
|
|
addGuiElement(new GuiGasGauge(() -> tileEntity.inputTank, GuiGauge.Type.STANDARD, this, resource, 25, 13));
|
|
addGuiElement(new GuiGasGauge(() -> tileEntity.outputTank, GuiGauge.Type.STANDARD, this, resource, 133, 13));
|
|
addGuiElement(new GuiProgress(new IProgressInfoHandler() {
|
|
@Override
|
|
public double getProgress() {
|
|
return tileEntity.getProgress();
|
|
}
|
|
}, ProgressBar.LARGE_RIGHT, this, resource, 62, 38));
|
|
}
|
|
|
|
@Override
|
|
protected void drawGuiContainerForegroundLayer(int mouseX, int mouseY) {
|
|
fontRenderer.drawString(tileEntity.getName(), 26, 4, 0x404040);
|
|
fontRenderer.drawString(LangUtils.localize("container.inventory"), 8, (ySize - 96) + 4, 0x404040);
|
|
super.drawGuiContainerForegroundLayer(mouseX, mouseY);
|
|
}
|
|
|
|
@Override
|
|
protected void drawGuiContainerBackgroundLayer(float partialTick, int mouseX, int mouseY) {
|
|
mc.renderEngine.bindTexture(getGuiLocation());
|
|
int guiWidth = (width - xSize) / 2;
|
|
int guiHeight = (height - ySize) / 2;
|
|
drawTexturedModalRect(guiWidth, guiHeight, 0, 0, xSize, ySize);
|
|
super.drawGuiContainerBackgroundLayer(partialTick, mouseX, mouseY);
|
|
}
|
|
|
|
@Override
|
|
protected ResourceLocation getGuiLocation() {
|
|
return MekanismUtils.getResource(ResourceType.GUI, "GuiBlank.png");
|
|
}
|
|
} |