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;
|
2014-05-07 04:21:12 +02: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;
|
|
|
|
|
2014-05-07 04:21:12 +02:00
|
|
|
public class GuiMAC extends GuiUpgradeable
|
2014-04-24 08:14:26 +02:00
|
|
|
{
|
|
|
|
|
2014-09-29 09:54:34 +02:00
|
|
|
final ContainerMAC container;
|
2014-05-09 06:09:42 +02:00
|
|
|
GuiProgressBar pb;
|
|
|
|
|
|
|
|
@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
|
|
|
|
public void drawBG(int offsetX, int offsetY, int mouseX, int mouseY)
|
|
|
|
{
|
2014-12-29 15:13:47 +01:00
|
|
|
this.pb.xPosition = 148 + this.guiLeft;
|
|
|
|
this.pb.yPosition = 48 + this.guiTop;
|
2014-05-09 06:09:42 +02:00
|
|
|
super.drawBG( offsetX, offsetY, mouseX, mouseY );
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public void drawFG(int offsetX, int offsetY, int mouseX, int mouseY)
|
|
|
|
{
|
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 );
|
|
|
|
}
|
|
|
|
|
2014-05-07 04:21:12 +02:00
|
|
|
@Override
|
|
|
|
protected void addButtons()
|
|
|
|
{
|
2014-12-29 15:13:47 +01:00
|
|
|
this.redstoneMode = new GuiImgButton( this.guiLeft - 18, this.guiTop + 8, Settings.REDSTONE_CONTROLLED, RedstoneMode.IGNORE );
|
|
|
|
this.buttonList.add( this.redstoneMode );
|
2014-05-07 04:21:12 +02:00
|
|
|
}
|
|
|
|
|
2014-09-28 20:34:00 +02:00
|
|
|
@Override
|
2014-05-07 04:21:12 +02:00
|
|
|
protected String getBackground()
|
|
|
|
{
|
|
|
|
return "guis/mac.png";
|
|
|
|
}
|
|
|
|
|
2014-09-28 20:36:58 +02:00
|
|
|
public GuiMAC(InventoryPlayer inventoryPlayer, TileMolecularAssembler te)
|
|
|
|
{
|
2014-04-24 08:14:26 +02:00
|
|
|
super( new ContainerMAC( inventoryPlayer, te ) );
|
|
|
|
this.ySize = 197;
|
2014-09-28 11:47:17 +02:00
|
|
|
this.container = (ContainerMAC) this.inventorySlots;
|
2014-04-24 08:14:26 +02:00
|
|
|
}
|
|
|
|
|
2014-09-28 20:34:00 +02:00
|
|
|
@Override
|
2014-05-07 04:21:12 +02:00
|
|
|
protected GuiText getName()
|
2014-04-24 08:14:26 +02:00
|
|
|
{
|
2014-05-07 04:21:12 +02:00
|
|
|
return GuiText.MolecularAssembler;
|
2014-04-24 08:14:26 +02:00
|
|
|
}
|
|
|
|
}
|