Moving the handling of progress to GuiProgressBar

Adds an interface providing data for GuiProgressBar
Changed all containers simulating progress to implement the interface
This commit is contained in:
yueh
2014-09-28 20:36:58 +02:00
parent 640d888d13
commit 21a7d815ae
10 changed files with 142 additions and 44 deletions
@@ -21,7 +21,7 @@ public class GuiMAC extends GuiUpgradeable
{
super.initGui();
pb = new GuiProgressBar( "guis/mac.png", 139, 36, 148, 201, 6, 18, Direction.VERTICAL );
pb = new GuiProgressBar( container, "guis/mac.png", 139, 36, 148, 201, 6, 18, Direction.VERTICAL );
this.buttonList.add( pb );
}
@@ -36,10 +36,7 @@ public class GuiMAC extends GuiUpgradeable
@Override
public void drawFG(int offsetX, int offsetY, int mouseX, int mouseY)
{
pb.max = 100;
pb.current = container.craftProgress;
pb.FullMsg = pb.current + "%";
pb.setFullMsg( container.getCurrentProgress() + "%" );
super.drawFG( offsetX, offsetY, mouseX, mouseY );
}
@@ -56,7 +53,8 @@ public class GuiMAC extends GuiUpgradeable
return "guis/mac.png";
}
public GuiMAC(InventoryPlayer inventoryPlayer, TileMolecularAssembler te) {
public GuiMAC(InventoryPlayer inventoryPlayer, TileMolecularAssembler te)
{
super( new ContainerMAC( inventoryPlayer, te ) );
this.ySize = 197;
this.container = (ContainerMAC) this.inventorySlots;