Applied-Energistics-2-tiler.../src/main/java/appeng/client/gui/implementations/GuiMAC.java

87 lines
2.5 KiB
Java
Raw Normal View History

2014-11-14 12:02:52 +01:00
/*
* This file is part of Applied Energistics 2.
* Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved.
*
* Applied Energistics 2 is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Applied Energistics 2 is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with Applied Energistics 2. If not, see <http://www.gnu.org/licenses/lgpl>.
*/
2014-04-24 08:14:26 +02:00
package appeng.client.gui.implementations;
import net.minecraft.entity.player.InventoryPlayer;
import appeng.api.config.RedstoneMode;
import appeng.api.config.Settings;
import appeng.client.gui.widgets.GuiImgButton;
2014-05-09 06:09:42 +02:00
import appeng.client.gui.widgets.GuiProgressBar;
import appeng.client.gui.widgets.GuiProgressBar.Direction;
2014-04-24 08:14:26 +02:00
import appeng.container.implementations.ContainerMAC;
import appeng.core.localization.GuiText;
import appeng.tile.crafting.TileMolecularAssembler;
public class GuiMAC extends GuiUpgradeable
2014-04-24 08:14:26 +02:00
{
final ContainerMAC container;
2014-05-09 06:09:42 +02:00
GuiProgressBar pb;
@Override
public void initGui()
{
super.initGui();
pb = new GuiProgressBar( container, "guis/mac.png", 139, 36, 148, 201, 6, 18, Direction.VERTICAL );
2014-05-09 06:09:42 +02:00
this.buttonList.add( pb );
}
@Override
public void drawBG(int offsetX, int offsetY, int mouseX, int mouseY)
{
pb.xPosition = 148 + guiLeft;
pb.yPosition = 48 + guiTop;
super.drawBG( offsetX, offsetY, mouseX, mouseY );
}
@Override
public void drawFG(int offsetX, int offsetY, int mouseX, int mouseY)
{
pb.setFullMsg( container.getCurrentProgress() + "%" );
2014-05-09 06:09:42 +02:00
super.drawFG( offsetX, offsetY, mouseX, mouseY );
}
@Override
protected void addButtons()
{
redstoneMode = new GuiImgButton( this.guiLeft - 18, guiTop + 8, Settings.REDSTONE_CONTROLLED, RedstoneMode.IGNORE );
buttonList.add( redstoneMode );
}
@Override
protected String getBackground()
{
return "guis/mac.png";
}
public GuiMAC(InventoryPlayer inventoryPlayer, TileMolecularAssembler te)
{
2014-04-24 08:14:26 +02:00
super( new ContainerMAC( inventoryPlayer, te ) );
this.ySize = 197;
this.container = (ContainerMAC) this.inventorySlots;
2014-04-24 08:14:26 +02:00
}
@Override
protected GuiText getName()
2014-04-24 08:14:26 +02:00
{
return GuiText.MolecularAssembler;
2014-04-24 08:14:26 +02:00
}
}