diff options
Diffstat (limited to 'src/main/java/goodgenerator/client/GUI')
4 files changed, 64 insertions, 27 deletions
diff --git a/src/main/java/goodgenerator/client/GUI/LargeFusionComputerGUIClient.java b/src/main/java/goodgenerator/client/GUI/LargeFusionComputerGUIClient.java index 58b0f7bc0d..51899b09cd 100644 --- a/src/main/java/goodgenerator/client/GUI/LargeFusionComputerGUIClient.java +++ b/src/main/java/goodgenerator/client/GUI/LargeFusionComputerGUIClient.java @@ -9,7 +9,8 @@ import net.minecraft.util.StatCollector; public class LargeFusionComputerGUIClient extends GT_GUIContainer_MultiMachineEM { - public LargeFusionComputerGUIClient(InventoryPlayer aInventoryPlayer, IGregTechTileEntity aTileEntity, String aName, String aTextureFile) { + public LargeFusionComputerGUIClient( + InventoryPlayer aInventoryPlayer, IGregTechTileEntity aTileEntity, String aName, String aTextureFile) { super(new YOTTankGUIContainer(aInventoryPlayer, aTileEntity), aName, aTextureFile, true, true, true); } @@ -17,9 +18,18 @@ public class LargeFusionComputerGUIClient extends GT_GUIContainer_MultiMachineEM protected void drawGuiContainerForegroundLayer(int par1, int par2) { super.drawGuiContainerForegroundLayer(par1, par2); if (this.mContainer.mDisplayErrorCode == 0) { - fontRendererObj.drawString(StatCollector.translateToLocal("gui.LargeFusion.0") + " " + GT_Utility.formatNumbers(this.mContainer.mStorage) + " EU", 7, 40, 16448255); - fontRendererObj.drawString(StatCollector.translateToLocal("gui.LargeFusion.1") + " " + GT_Utility.formatNumbers(this.mContainer.mEnergy) + " EU", 7, 48, 16448255); + fontRendererObj.drawString( + StatCollector.translateToLocal("gui.LargeFusion.0") + " " + + GT_Utility.formatNumbers(this.mContainer.mStorage) + " EU", + 7, + 40, + 16448255); + fontRendererObj.drawString( + StatCollector.translateToLocal("gui.LargeFusion.1") + " " + + GT_Utility.formatNumbers(this.mContainer.mEnergy) + " EU", + 7, + 48, + 16448255); } } - } diff --git a/src/main/java/goodgenerator/client/GUI/NeutronActivatorGUIClient.java b/src/main/java/goodgenerator/client/GUI/NeutronActivatorGUIClient.java index c3f7992a17..1bd0b09f99 100644 --- a/src/main/java/goodgenerator/client/GUI/NeutronActivatorGUIClient.java +++ b/src/main/java/goodgenerator/client/GUI/NeutronActivatorGUIClient.java @@ -1,9 +1,9 @@ package goodgenerator.client.GUI; -import goodgenerator.common.container.NeutronActivatorGUIContainer; import com.github.technus.tectech.thing.metaTileEntity.multi.base.GT_GUIContainer_MultiMachineEM; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; +import goodgenerator.common.container.NeutronActivatorGUIContainer; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import net.minecraft.entity.player.InventoryPlayer; import net.minecraft.util.StatCollector; @@ -13,7 +13,8 @@ public class NeutronActivatorGUIClient extends GT_GUIContainer_MultiMachineEM { private final NeutronActivatorGUIContainer containerNeutronActivator; - public NeutronActivatorGUIClient(InventoryPlayer aInventoryPlayer, IGregTechTileEntity aTileEntity, String aName, String aTextureFile) { + public NeutronActivatorGUIClient( + InventoryPlayer aInventoryPlayer, IGregTechTileEntity aTileEntity, String aName, String aTextureFile) { super(new NeutronActivatorGUIContainer(aInventoryPlayer, aTileEntity), aName, aTextureFile, true, true, true); containerNeutronActivator = (NeutronActivatorGUIContainer) this.mContainer; } @@ -39,5 +40,4 @@ public class NeutronActivatorGUIClient extends GT_GUIContainer_MultiMachineEM { num2 /= 1000F; return String.format("%.1fM", num2); } - } diff --git a/src/main/java/goodgenerator/client/GUI/NeutronSensorGUIClient.java b/src/main/java/goodgenerator/client/GUI/NeutronSensorGUIClient.java index 5070d80ead..b2ddd6b04a 100644 --- a/src/main/java/goodgenerator/client/GUI/NeutronSensorGUIClient.java +++ b/src/main/java/goodgenerator/client/GUI/NeutronSensorGUIClient.java @@ -1,10 +1,10 @@ package goodgenerator.client.GUI; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; import goodgenerator.main.GoodGenerator; import goodgenerator.network.MessageSetNeutronSensorData; import goodgenerator.util.CharExchanger; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; import gregtech.api.gui.GT_GUIContainerMetaTile_Machine; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import net.minecraft.client.gui.GuiTextField; @@ -20,15 +20,16 @@ public class NeutronSensorGUIClient extends GT_GUIContainerMetaTile_Machine { private GuiTextField TextBox; private String context; - public NeutronSensorGUIClient(InventoryPlayer aInventoryPlayer, IGregTechTileEntity aTileEntity, String aTexture, String text) { + public NeutronSensorGUIClient( + InventoryPlayer aInventoryPlayer, IGregTechTileEntity aTileEntity, String aTexture, String text) { super(aInventoryPlayer, aTileEntity, aTexture); this.mName = "Neutron Sensor"; this.mContainer.detectAndSendChanges(); if (text == null) this.context = ""; - else this.context = text; + else this.context = text; } - public void initGui(){ + public void initGui() { super.initGui(); this.TextBox = new GuiTextField(this.fontRendererObj, 8, 48, 100, 18); TextBox.setMaxStringLength(20); @@ -44,12 +45,18 @@ public class NeutronSensorGUIClient extends GT_GUIContainerMetaTile_Machine { if (TextBox.getText() != null) { if (isValidSuffix(TextBox.getText())) { if (CharExchanger.isValidCompareExpress(rawProcessExp(TextBox.getText()))) - this.fontRendererObj.drawString(StatCollector.translateToLocal("gui.NeutronSensor.2"), 120, 53, 0x077d02); - else this.fontRendererObj.drawString(StatCollector.translateToLocal("gui.NeutronSensor.3"), 120, 53, 0xff0000); - } - else this.fontRendererObj.drawString(StatCollector.translateToLocal("gui.NeutronSensor.3"), 120, 53, 0xff0000); + this.fontRendererObj.drawString( + StatCollector.translateToLocal("gui.NeutronSensor.2"), 120, 53, 0x077d02); + else + this.fontRendererObj.drawString( + StatCollector.translateToLocal("gui.NeutronSensor.3"), 120, 53, 0xff0000); + } else + this.fontRendererObj.drawString( + StatCollector.translateToLocal("gui.NeutronSensor.3"), 120, 53, 0xff0000); } - this.mc.getTextureManager().bindTexture(new ResourceLocation(GoodGenerator.MOD_ID + ":textures/gui/NeutronSensorGUI.png")); + this.mc + .getTextureManager() + .bindTexture(new ResourceLocation(GoodGenerator.MOD_ID + ":textures/gui/NeutronSensorGUI.png")); } protected void drawGuiContainerBackgroundLayer(float par1, int par2, int par3) { @@ -60,8 +67,7 @@ public class NeutronSensorGUIClient extends GT_GUIContainerMetaTile_Machine { } protected void keyTyped(char par1, int par2) { - if (!this.TextBox.isFocused()) - super.keyTyped(par1, par2); + if (!this.TextBox.isFocused()) super.keyTyped(par1, par2); if (par2 == 1) this.mc.thePlayer.closeScreen(); this.TextBox.textboxKeyTyped(par1, par2); } @@ -79,13 +85,14 @@ public class NeutronSensorGUIClient extends GT_GUIContainerMetaTile_Machine { @Override public void onGuiClosed() { if (CharExchanger.isValidCompareExpress(rawProcessExp(TextBox.getText()))) - GoodGenerator.CHANNEL.sendToServer(new MessageSetNeutronSensorData(mContainer.mTileEntity, TextBox.getText())); + GoodGenerator.CHANNEL.sendToServer( + new MessageSetNeutronSensorData(mContainer.mTileEntity, TextBox.getText())); super.onGuiClosed(); } protected String rawProcessExp(String exp) { StringBuilder ret = new StringBuilder(); - for (char c: exp.toCharArray()) { + for (char c : exp.toCharArray()) { if (exp.length() - ret.length() == 3) { if (Character.isDigit(c)) ret.append(c); break; @@ -105,6 +112,10 @@ public class NeutronSensorGUIClient extends GT_GUIContainerMetaTile_Machine { if (exp.charAt(index) != 'E' && exp.charAt(index) != 'e') return false; index = exp.length() - 3; if (index < 0) return false; - return exp.charAt(index) == 'M' || exp.charAt(index) == 'm' || exp.charAt(index) == 'K' || exp.charAt(index) == 'k' || Character.isDigit(exp.charAt(index)); + return exp.charAt(index) == 'M' + || exp.charAt(index) == 'm' + || exp.charAt(index) == 'K' + || exp.charAt(index) == 'k' + || Character.isDigit(exp.charAt(index)); } } diff --git a/src/main/java/goodgenerator/client/GUI/YOTTankGUIClient.java b/src/main/java/goodgenerator/client/GUI/YOTTankGUIClient.java index 82d8b19e35..e4a93fb6e2 100644 --- a/src/main/java/goodgenerator/client/GUI/YOTTankGUIClient.java +++ b/src/main/java/goodgenerator/client/GUI/YOTTankGUIClient.java @@ -1,8 +1,8 @@ package goodgenerator.client.GUI; +import com.github.technus.tectech.thing.metaTileEntity.multi.base.GT_GUIContainer_MultiMachineEM; import goodgenerator.common.container.YOTTankGUIContainer; import goodgenerator.util.CharExchanger; -import com.github.technus.tectech.thing.metaTileEntity.multi.base.GT_GUIContainer_MultiMachineEM; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import net.minecraft.entity.player.InventoryPlayer; import net.minecraft.util.StatCollector; @@ -11,7 +11,8 @@ public class YOTTankGUIClient extends GT_GUIContainer_MultiMachineEM { private final YOTTankGUIContainer containerYOTTank; - public YOTTankGUIClient(InventoryPlayer aInventoryPlayer, IGregTechTileEntity aTileEntity, String aName, String aTextureFile) { + public YOTTankGUIClient( + InventoryPlayer aInventoryPlayer, IGregTechTileEntity aTileEntity, String aName, String aTextureFile) { super(new YOTTankGUIContainer(aInventoryPlayer, aTileEntity), aName, aTextureFile, true, true, true); containerYOTTank = (YOTTankGUIContainer) this.mContainer; } @@ -20,9 +21,24 @@ public class YOTTankGUIClient extends GT_GUIContainer_MultiMachineEM { protected void drawGuiContainerForegroundLayer(int par1, int par2) { super.drawGuiContainerForegroundLayer(par1, par2); if (this.mContainer.mDisplayErrorCode == 0) { - fontRendererObj.drawString(StatCollector.translateToLocal("gui.YOTTank.0") + " " + CharExchanger.formatNumber(containerYOTTank.getCap()) + " L", 7, 40, 16448255); - fontRendererObj.drawString(StatCollector.translateToLocal("gui.YOTTank.1") + " " + CharExchanger.formatNumber(containerYOTTank.getFluidName()), 7, 48, 16448255); - fontRendererObj.drawString(StatCollector.translateToLocal("gui.YOTTank.2") + " " + CharExchanger.formatNumber(containerYOTTank.getStorage()) + " L", 7, 56, 16448255); + fontRendererObj.drawString( + StatCollector.translateToLocal("gui.YOTTank.0") + " " + + CharExchanger.formatNumber(containerYOTTank.getCap()) + " L", + 7, + 40, + 16448255); + fontRendererObj.drawString( + StatCollector.translateToLocal("gui.YOTTank.1") + " " + + CharExchanger.formatNumber(containerYOTTank.getFluidName()), + 7, + 48, + 16448255); + fontRendererObj.drawString( + StatCollector.translateToLocal("gui.YOTTank.2") + " " + + CharExchanger.formatNumber(containerYOTTank.getStorage()) + " L", + 7, + 56, + 16448255); } } } |
