From 175f3e8646b15dbec5bbf05c3bacfcc596e33108 Mon Sep 17 00:00:00 2001 From: Aidan Brady Date: Thu, 16 Jan 2014 21:26:40 -0500 Subject: [PATCH] Got GUIs working with new fanciness --- .../gui/GuiAdvancedElectricMachine.java | 30 ++++++++++++++++-- common/mekanism/client/gui/GuiFactory.java | 24 ++++++++++++-- .../gui/GuiChemicalInjectionChamber.png | Bin 3375 -> 4747 bytes resources/assets/mekanism/lang/en_US.lang | 4 +-- 4 files changed, 50 insertions(+), 8 deletions(-) diff --git a/common/mekanism/client/gui/GuiAdvancedElectricMachine.java b/common/mekanism/client/gui/GuiAdvancedElectricMachine.java index ac8f97903..f9a7504fc 100644 --- a/common/mekanism/client/gui/GuiAdvancedElectricMachine.java +++ b/common/mekanism/client/gui/GuiAdvancedElectricMachine.java @@ -3,7 +3,9 @@ package mekanism.client.gui; import java.util.List; import mekanism.api.ListUtils; +import mekanism.api.gas.GasStack; import mekanism.client.gui.GuiEnergyInfo.IInfoHandler; +import mekanism.client.render.MekanismRenderer; import mekanism.common.inventory.container.ContainerAdvancedElectricMachine; import mekanism.common.tile.TileEntityAdvancedElectricMachine; import mekanism.common.util.MekanismUtils; @@ -46,6 +48,11 @@ public class GuiAdvancedElectricMachine extends GuiMekanism fontRenderer.drawString(tileEntity.getInvName(), (xSize/2)-(fontRenderer.getStringWidth(tileEntity.getInvName())/2), 6, 0x404040); fontRenderer.drawString("Inventory", 8, (ySize - 96) + 2, 0x404040); + + if(xAxis >= 61 && xAxis <= 66 && yAxis >= 37 && yAxis <= 49) + { + drawCreativeTabHoveringText(tileEntity.gasTank.getGas() != null ? tileEntity.gasTank.getGas().getGas().getLocalizedName() + ": " + tileEntity.gasTank.getStored() : MekanismUtils.localize("gui.none"), xAxis, yAxis); + } super.drawGuiContainerForegroundLayer(mouseX, mouseY); } @@ -64,12 +71,29 @@ public class GuiAdvancedElectricMachine extends GuiMekanism int displayInt; - displayInt = tileEntity.getScaledGasLevel(12); - drawTexturedModalRect(guiWidth + 61, guiHeight + 37 + 12 - displayInt, 176, 7 + 12 - displayInt, 5, displayInt); - displayInt = tileEntity.getScaledProgress(24); drawTexturedModalRect(guiWidth + 79, guiHeight + 39, 176, 0, displayInt + 1, 7); + + if(tileEntity.getScaledGasLevel(12) > 0) + { + displayInt = tileEntity.getScaledGasLevel(12); + displayGauge(61, 37 + 12 - displayInt, 5, displayInt, tileEntity.gasTank.getGas()); + } super.drawGuiContainerBackgroundLayer(partialTick, mouseX, mouseY); } + + public void displayGauge(int xPos, int yPos, int sizeX, int sizeY, GasStack gas) + { + if(gas == null) + { + return; + } + + int guiWidth = (width - xSize) / 2; + int guiHeight = (height - ySize) / 2; + + mc.renderEngine.bindTexture(MekanismRenderer.getBlocksTexture()); + drawTexturedModelRectFromIcon(guiWidth + xPos, guiHeight + yPos, gas.getGas().getIcon(), sizeX, sizeY); + } } \ No newline at end of file diff --git a/common/mekanism/client/gui/GuiFactory.java b/common/mekanism/client/gui/GuiFactory.java index ccb69b974..807f5edfb 100644 --- a/common/mekanism/client/gui/GuiFactory.java +++ b/common/mekanism/client/gui/GuiFactory.java @@ -3,7 +3,9 @@ package mekanism.client.gui; import java.util.List; import mekanism.api.ListUtils; +import mekanism.api.gas.GasStack; import mekanism.client.gui.GuiEnergyInfo.IInfoHandler; +import mekanism.client.render.MekanismRenderer; import mekanism.common.IFactory.RecipeType; import mekanism.common.Tier.FactoryTier; import mekanism.common.inventory.container.ContainerFactory; @@ -60,7 +62,7 @@ public class GuiFactory extends GuiMekanism if(xAxis >= 8 && xAxis <= 168 && yAxis >= 78 && yAxis <= 83) { - drawCreativeTabHoveringText(MekanismUtils.localize("gui.factory.secondaryEnergy") + ": " + tileEntity.gasTank.getStored(), xAxis, yAxis); + drawCreativeTabHoveringText(tileEntity.gasTank.getGas() != null ? tileEntity.gasTank.getGas().getGas().getLocalizedName() + ": " + tileEntity.gasTank.getStored() : MekanismUtils.localize("gui.none"), xAxis, yAxis); } super.drawGuiContainerForegroundLayer(mouseX, mouseY); @@ -131,7 +133,23 @@ public class GuiFactory extends GuiMekanism recipeFuelY += 15; } - displayInt = tileEntity.getScaledGasLevel(160); - drawTexturedModalRect(guiWidth + 8, guiHeight + 78, 0, recipeFuelY, displayInt, 5); + if(tileEntity.getScaledGasLevel(160) > 0) + { + displayGauge(8, 78, tileEntity.getScaledGasLevel(160), 5, tileEntity.gasTank.getGas()); + } } + + public void displayGauge(int xPos, int yPos, int sizeX, int sizeY, GasStack gas) + { + if(gas == null) + { + return; + } + + int guiWidth = (width - xSize) / 2; + int guiHeight = (height - ySize) / 2; + + mc.renderEngine.bindTexture(MekanismRenderer.getBlocksTexture()); + drawTexturedModelRectFromIcon(guiWidth + xPos, guiHeight + yPos, gas.getGas().getIcon(), sizeX, sizeY); + } } diff --git a/resources/assets/mekanism/gui/GuiChemicalInjectionChamber.png b/resources/assets/mekanism/gui/GuiChemicalInjectionChamber.png index 7f35ae35150b380dd26eb542450c1ed9d5ed965e..d6dc00a461124c501ddc2f4541590dc9f8a428fc 100644 GIT binary patch literal 4747 zcmeHLS6CC@x19_jgrfA`LN5x4`U9jTD2Ra4K{^Q1qzTd?K*T~dDpEv&h*AWRDkvS5 zBE3rQASILl0qObA|GSU(;Xd8+aG&OUd!N~});j0xb-sx;)Ym>k$3q7Iz!{wzn#KSC zgN85wiGUt9e)%o{02g(?cFj=d+BKA+pO1^Xr!xR3F+Vn&_8B*2Q;+pA{=k7oS!h3v zYc4i3vHr%(Q`CacNy=H*<;YnXkrrK0R*e0~OEbPwSzr)`Q$!rYFr!qAH&lhrARNO+ z_Zlm7OrA;?=-dcf{>dmLzD{j6TNCIgVe->v_psy2^pz!*CA)D=HGB6j>D*>9DTSXi zdPI|x@;F{)-iqrlAJn57EL_o-dC}3uBHP6Nx0^W2ABXH%f3b0@zbDcV8b8q&D{Ro{ z&CZYI-e)lC9Q3HvV{4!}+IO!)OziNH1{C06A()DN%M#qzDxsz?grc?^`8LVU&FnKwh(rwm5p5^UdiiW9-zq zJ=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i0PQk=}Aes;a!a4GRLk;g;r;6a-L4A=w8zDA&RJ)MwS9ZKfD<#WZw_X9BK#z^GNVWZ{8l3#m>mze#L|LIGAhyD`DmB5yyVm4OZchl*3f#aY@I`de; z?59tkjGVVZXLdlvD&OvmQ)ljqz+g@|*VfeZS)?Z_tJ$(3=JHVHGt`(RTH?C=SKs?P zK1hAL8e2d~>>Gdv)N1BhS_h^R+V9wYTuoMkiV4dsztBcEd9X-vi_){o|6TjP$&msW zNoW8m5I9UD?nbkMd#`4^#E$`B(*eSQ7M2SZo^W@~^<<*84;!<~tk3r<{ yHdtmvpP3(!d{kYXW^aG8tds)$zm89G>t?yG;nlgiK5g4MoE_Xwy*wH8<39kZ93GDV diff --git a/resources/assets/mekanism/lang/en_US.lang b/resources/assets/mekanism/lang/en_US.lang index 897cf1fd1..71c6ed605 100644 --- a/resources/assets/mekanism/lang/en_US.lang +++ b/resources/assets/mekanism/lang/en_US.lang @@ -165,6 +165,8 @@ gas.sulfurDioxideGas=Sulfur Dioxide gas.sulfurTrioxideGas=Sulfur Trioxide gas.sulfuricAcid=Sulfuric Acid gas.hydrogenChloride=Hydrogen Chloride +gas.liquidOsmium=Liquid Osmium +gas.liquidStone=Liquid Stone //Fluids fluid.hydrogen=Liquid Hydrogen @@ -175,8 +177,6 @@ fluid.sulfurTrioxideGas=Liquid Sulfur Trioxide fluid.sulfuricAcid=Liquid Sulfuric Acid fluid.hydrogenChloride=Liquid Hydrogen Chloride fluid.brine=Brine -fluid.liquidOsmium=Liquid Osmium -fluid.liquidStone=Liquid Stone //Gui text gui.removeSpeedUpgrade=Remove speed upgrade