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-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;
|
2017-04-12 16:10:13 +02:00
|
|
|
import net.minecraft.entity.player.InventoryPlayer;
|
2014-04-24 08:14:26 +02:00
|
|
|
|
2022-12-02 17:40:47 +01:00
|
|
|
public class GuiMAC extends GuiUpgradeable {
|
|
|
|
private final ContainerMAC container;
|
|
|
|
private GuiProgressBar pb;
|
2015-04-03 08:54:31 +02:00
|
|
|
|
2022-12-02 17:40:47 +01:00
|
|
|
public GuiMAC(
|
|
|
|
final InventoryPlayer inventoryPlayer, final TileMolecularAssembler te
|
|
|
|
) {
|
|
|
|
super(new ContainerMAC(inventoryPlayer, te));
|
|
|
|
this.ySize = 197;
|
|
|
|
this.container = (ContainerMAC) this.inventorySlots;
|
|
|
|
}
|
2015-04-03 08:54:31 +02:00
|
|
|
|
2022-12-02 17:40:47 +01:00
|
|
|
@Override
|
|
|
|
public void initGui() {
|
|
|
|
super.initGui();
|
2014-05-09 06:09:42 +02:00
|
|
|
|
2022-12-02 17:40: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
|
|
|
|
2022-12-02 17:40:47 +01:00
|
|
|
@Override
|
|
|
|
protected void addButtons() {
|
|
|
|
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
|
|
|
|
2022-12-02 17:40:47 +01:00
|
|
|
@Override
|
|
|
|
public void
|
|
|
|
drawFG(final int offsetX, final int offsetY, final int mouseX, final int mouseY) {
|
|
|
|
this.pb.setFullMsg(this.container.getCurrentProgress() + "%");
|
|
|
|
super.drawFG(offsetX, offsetY, mouseX, mouseY);
|
|
|
|
}
|
2014-05-09 06:09:42 +02:00
|
|
|
|
2022-12-02 17:40:47 +01:00
|
|
|
@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);
|
|
|
|
}
|
2014-05-07 04:21:12 +02:00
|
|
|
|
2022-12-02 17:40:47 +01:00
|
|
|
@Override
|
|
|
|
protected String getBackground() {
|
|
|
|
return "guis/mac.png";
|
|
|
|
}
|
2014-05-07 04:21:12 +02:00
|
|
|
|
2022-12-02 17:40:47 +01:00
|
|
|
@Override
|
|
|
|
protected GuiText getName() {
|
|
|
|
return GuiText.MolecularAssembler;
|
|
|
|
}
|
2014-04-24 08:14:26 +02:00
|
|
|
}
|