From 7a320cbba0c35f7ccd6dc8ff8aa5bebe19fe16be Mon Sep 17 00:00:00 2001 From: CovertJaguar Date: Thu, 13 Jun 2013 15:09:55 -0700 Subject: [PATCH] Added progress bar to ACT --- .../gui/assembly_advancedworkbench.png | Bin 2358 -> 2474 bytes .../silicon/TileAdvancedCraftingTable.java | 10 ++++++++-- .../silicon/gui/GuiAdvancedCraftingTable.java | 12 ++++++++---- 3 files changed, 16 insertions(+), 6 deletions(-) diff --git a/buildcraft_resources/gfx/buildcraft/gui/assembly_advancedworkbench.png b/buildcraft_resources/gfx/buildcraft/gui/assembly_advancedworkbench.png index 7ffa3e0b00392b9b0f22be970056a43594dc5e6a..336c0edca2fd91590f8dd3c471e5cdd77adc5a6f 100644 GIT binary patch delta 1343 zcmZ9Me>~H99LGQ3ZPwBVyS6ny+6|eZCUHsejrn;|99bT6DDvBimOA==Th6UhXGpuQ zgdRAeC1y$88Wn{uU5La8(Sz6(w^HNeaev+8`QQ8X$LsNWJ>HL(%-||X{R0EpcX6I!<&yAMJ>d2@CIriHyN9FDA_6Mr0dF~5*JB`vIqJYqYx z+qP&?B4!%-`MHWDZyL)lS4}qdw{K2N>pPO1?AwO&IYTy} zC+0}QC#BN&uir2Kk>fN2cnyan{0Vcg8ppu$Jn5SO7IO%st*vXuc6uB{6y|zB+&9M) zerrbgwe{hl&nKxhxZ-{(uM2H`CU`Kf-!t%Je#; z1ld7jX(NsGwt0>S;iVeyav#-_?%!HJSduaZ6#(A81P*taYtZBaYPyi~iGSi?d3QJ? zsh&+Y1t~ZNhV4c-1K;5yG3*_5CfJ2z0Fm~DM!8=|T%{1gT)?mmzpUqM^lByyhra`c zj#;e-BrjJCyNtsD(Hr#j&|7Brv2;s=Kn#kMEz~8XlnaDYh9y2!x^?#5P|MkGDz#Vi zQMjyDE~<+`-I@6g<1eTXsv#(VT>q76B`GmyMvNNLP<$~I14rYWKb-9h#94H|vq{`` zonS%*``jxG@LR6b-y2mBd1s=pKjN;PS5A{?D&+cLa&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=upc zzY1z?1>oIj$4QAY)I4TW*Dg#_v(ZM?p4xrXZ7UFa5M$*(tmrqCM1oe6dx#6ZZe1V7zdo_{nNScd|E1|VX3$mL1hj87+@3Pyg zk`{NVuK?OeMBBFydD*T{f$?#L*#Y{?qC5-6U39dizV0u46GKYR`0;f+wQaZUM&bs4vh$)-yi7u^(> zkcRt9uzF<41}tt@B$k#}`sukq0zeOM*31MPz5}B1Nh@wxXo9(f#xG>F8#+eiFrpIJ zKU}3sF`<#eGE;QgZMNF=?-}hG7EkfQKCFD3vDtbJ_zzZ9#FpZ$9M*(*!0Pjc?d~N+ zf`(+)Xw8z@v7+Dq;w=SIoC_nO@Z+m5b5x==su+%x#2)sb@j51iiLu;`%?RE1z% zA!Ins5BEByLWCTHTj+SCXYVD>6eY#0=jI%8mof1+d$YG8n3dww!tqSl5+gM)!^`{M zOxMQ36~L}(`CySm87BJ!5db4hFN&#PF4cMLQ=7BN4hb#4#Q|W5BWmEUvY?D49C*a4`#9e{3+e!(@b&M+~uNQZcCc)uS^7R#w}Dq;vQ{8TT|~m!&U)Tj^{jb2hEj;aeUzx` z1N?19Ow=LJVb&nO+KC7xnpFb<)(Wzry)kHg&oC=4Bd>4%tn}&$ChewwEeE_RQ>0C4 z;u&t%e7auwf6i*S3j&z795UP*cSN9|EG#HY1pgX zc~-IjOA|KKa;m9nX5(0rkz~7hSz+9m(ia zW>&QKS$GK=aPBwDKD4m#T5FRQfM8L}W_S1StgVKk=mVc_Y(F`Aw4+WVc-jgvTmi8H M{DOQNMdI9l0Wy>UYXATM diff --git a/common/buildcraft/silicon/TileAdvancedCraftingTable.java b/common/buildcraft/silicon/TileAdvancedCraftingTable.java index 598d0ddb..46e77275 100644 --- a/common/buildcraft/silicon/TileAdvancedCraftingTable.java +++ b/common/buildcraft/silicon/TileAdvancedCraftingTable.java @@ -147,6 +147,7 @@ public class TileAdvancedCraftingTable extends TileEntity implements IInventory, } private static final int[] SLOTS = Utils.createSlotArray(0, 24); private static final EnumSet SEARCH_SIDES = EnumSet.of(DOWN, NORTH, SOUTH, EAST, WEST); + private static final float REQUIRED_POWER = 500F; private final SimpleInventory craftingSlots; private final SimpleInventory storageSlots; private final InventoryMapper invInput; @@ -242,7 +243,11 @@ public class TileAdvancedCraftingTable extends TileEntity implements IInventory, } public float getRequiredEnergy() { - return craftResult.getStackInSlot(0) != null ? 500f : 0f; + return craftResult.getStackInSlot(0) != null ? REQUIRED_POWER : 0f; + } + + public int getProgressScaled(int i) { + return (int) ((storedEnergy * i) / REQUIRED_POWER); } @Override @@ -347,7 +352,8 @@ public class TileAdvancedCraftingTable extends TileEntity implements IInventory, } for (IInvSlot slot : InventoryIterator.getIterable(craftingSlots, ForgeDirection.UP)) { ItemStack ingred = slot.getStackInSlot(); - if(ingred == null) continue; + if (ingred == null) + continue; IStackFilter filter = new CraftingFilter(ingred); if (InvUtils.countItems(invInput, ForgeDirection.UP, filter) < InvUtils.countItems(craftingSlots, ForgeDirection.UP, filter)) { for (ForgeDirection side : SEARCH_SIDES) { diff --git a/common/buildcraft/silicon/gui/GuiAdvancedCraftingTable.java b/common/buildcraft/silicon/gui/GuiAdvancedCraftingTable.java index 741c035c..ba9ec10e 100644 --- a/common/buildcraft/silicon/gui/GuiAdvancedCraftingTable.java +++ b/common/buildcraft/silicon/gui/GuiAdvancedCraftingTable.java @@ -12,7 +12,9 @@ import net.minecraft.inventory.IInventory; import org.lwjgl.opengl.GL11; public class GuiAdvancedCraftingTable extends GuiBuildCraft { + class AssemblyWorkbenchLedger extends Ledger { + int headerColour = 0xe1c92f; int subheaderColour = 0xaaafb8; int textColour = 0x000000; @@ -49,9 +51,7 @@ public class GuiAdvancedCraftingTable extends GuiBuildCraft { public String getTooltip() { return String.format("%3.2f MJ/t", workbench.getRecentEnergyAverage() / 100.0f); } - } - TileAdvancedCraftingTable workbench; public GuiAdvancedCraftingTable(InventoryPlayer playerInventory, TileAdvancedCraftingTable advancedWorkbench) { @@ -70,12 +70,16 @@ public class GuiAdvancedCraftingTable extends GuiBuildCraft { } @Override - protected void drawGuiContainerBackgroundLayer(float f, int x, int y) { - GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); + protected void drawGuiContainerBackgroundLayer(float f, int mouseX, int mouseY) { + GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); mc.renderEngine.bindTexture(DefaultProps.TEXTURE_PATH_GUI + "/assembly_advancedworkbench.png"); int cornerX = (width - xSize) / 2; int cornerY = (height - ySize) / 2; drawTexturedModalRect(cornerX, cornerY, 0, 0, xSize, ySize); + if (workbench.getStoredEnergy() > 0) { + int progress = workbench.getProgressScaled(24); + drawTexturedModalRect(cornerX + 93, cornerY + 32, 176, 0, progress + 1, 18); + } } @Override