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

90 lines
2.6 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;
2014-04-24 08:14:26 +02:00
import net.minecraft.entity.player.InventoryPlayer;
2014-12-29 21:59:05 +01:00
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;
public GuiMAC( final InventoryPlayer inventoryPlayer, final TileMolecularAssembler te )
{
super( new ContainerMAC( inventoryPlayer, te ) );
this.ySize = 197;
this.container = (ContainerMAC) this.inventorySlots;
}
2014-05-09 06:09:42 +02:00
@Override
public void initGui()
{
super.initGui();
2014-12-29 15:13:47 +01:00
this.pb = new GuiProgressBar( this.container, "guis/mac.png", 139, 36, 148, 201, 6, 18, Direction.VERTICAL );
this.buttonList.add( this.pb );
2014-05-09 06:09:42 +02:00
}
@Override
protected void addButtons()
2014-05-09 06:09:42 +02:00
{
this.redstoneMode = new GuiImgButton( this.guiLeft - 18, this.guiTop + 8, Settings.REDSTONE_CONTROLLED, RedstoneMode.IGNORE );
this.buttonList.add( this.redstoneMode );
2014-05-09 06:09:42 +02:00
}
@Override
public void drawFG( final int offsetX, final int offsetY, final int mouseX, final int mouseY )
2014-05-09 06:09:42 +02:00
{
2014-12-29 15:13:47 +01:00
this.pb.setFullMsg( this.container.getCurrentProgress() + "%" );
2014-05-09 06:09:42 +02:00
super.drawFG( offsetX, offsetY, mouseX, mouseY );
}
@Override
public void drawBG( final int offsetX, final int offsetY, final int mouseX, final int mouseY )
{
this.pb.xPosition = 148 + this.guiLeft;
this.pb.yPosition = 48 + this.guiTop;
super.drawBG( offsetX, offsetY, mouseX, mouseY );
}
@Override
protected String getBackground()
{
return "guis/mac.png";
}
@Override
protected GuiText getName()
2014-04-24 08:14:26 +02:00
{
return GuiText.MolecularAssembler;
2014-04-24 08:14:26 +02:00
}
}