aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/gtPlusPlus/xmod/gregtech/api/gui
diff options
context:
space:
mode:
authorAlkalus <3060479+draknyte1@users.noreply.github.com>2022-01-29 19:15:48 +0000
committerAlkalus <3060479+draknyte1@users.noreply.github.com>2022-01-29 19:15:48 +0000
commitc0da5cc4ea19dfb2a05e64ce09d808b4efdc95b1 (patch)
tree2b549b5dfe3f80421ae2d45e041f929ea46d59aa /src/main/java/gtPlusPlus/xmod/gregtech/api/gui
parentb926dfb3bc67b74b53749a3e420a8a6ce0fba6a7 (diff)
parent0de849179b344dfddc68393aaa23b3b75b307670 (diff)
downloadGT5-Unofficial-c0da5cc4ea19dfb2a05e64ce09d808b4efdc95b1.tar.gz
GT5-Unofficial-c0da5cc4ea19dfb2a05e64ce09d808b4efdc95b1.tar.bz2
GT5-Unofficial-c0da5cc4ea19dfb2a05e64ce09d808b4efdc95b1.zip
Merge branch 'master' of https://github.com/GTNewHorizons/GTplusplus into St00f
# Conflicts: # .gitignore # dependencies.gradle # src/main/java/gtPlusPlus/core/config/ConfigHandler.java # src/main/java/gtPlusPlus/core/item/base/BaseItemComponent.java # src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/GregtechMetaWirelessCharger.java # src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMetaTileEntity_MassFabricator.java # src/main/resources/assets/miscutils/lang/en_US.lang
Diffstat (limited to 'src/main/java/gtPlusPlus/xmod/gregtech/api/gui')
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/api/gui/CONTAINER_DataHatch.java82
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/api/gui/CONTAINER_PowerSubStation.java112
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/api/gui/GUI_DataHatch.java41
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/api/gui/GUI_MultiMachine.java34
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/api/gui/GUI_PowerSubStation.java153
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/api/gui/automation/GT_Container_ElectricAutoWorkbench.java141
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/api/gui/automation/GT_Container_ElectricInventoryManager.java267
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/api/gui/automation/GT_GUIContainer_ElectricAutoWorkbench.java62
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/api/gui/automation/GT_GUIContainer_ElectricInventoryManager.java58
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/api/gui/basic/GT_Container_CropHarvestor.java187
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/api/gui/basic/GT_GUIContainer_CropHarvestor.java75
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/api/gui/basic/GUI_PollutionCleaner.java2
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/api/gui/computer/GT_Container_ComputerCube.java409
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/api/gui/computer/GT_Container_RedstoneCircuitBlock.java176
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/api/gui/computer/GT_GUIContainer_ComputerCube.java172
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/api/gui/computer/GT_GUIContainer_RedstoneCircuitBlock.java95
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/api/gui/fluidreactor/GUI_FluidReactor.java3
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/api/gui/hatches/CONTAINER_1by1_Turbine.java15
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/api/gui/workbench/GT_Container_AdvancedWorkbench.java124
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/api/gui/workbench/GT_Container_BronzeWorkbench.java121
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/api/gui/workbench/GT_GUIContainer_AdvancedWorkbench.java86
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/api/gui/workbench/GT_GUIContainer_BronzeWorkbench.java13
22 files changed, 2293 insertions, 135 deletions
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/api/gui/CONTAINER_DataHatch.java b/src/main/java/gtPlusPlus/xmod/gregtech/api/gui/CONTAINER_DataHatch.java
new file mode 100644
index 0000000000..fe100955e0
--- /dev/null
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/api/gui/CONTAINER_DataHatch.java
@@ -0,0 +1,82 @@
+package gtPlusPlus.xmod.gregtech.api.gui;
+
+import gregtech.api.enums.ItemList;
+import gregtech.api.gui.GT_ContainerMetaTile_Machine;
+import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
+import gtPlusPlus.api.objects.Logger;
+import gtPlusPlus.core.slots.SlotIntegratedCircuit;
+import gtPlusPlus.core.util.minecraft.ItemUtils;
+import net.minecraft.entity.player.InventoryPlayer;
+import net.minecraft.inventory.IInventory;
+import net.minecraft.inventory.Slot;
+import net.minecraft.item.ItemStack;
+
+public class CONTAINER_DataHatch extends GT_ContainerMetaTile_Machine {
+
+ public CONTAINER_DataHatch(InventoryPlayer aInventoryPlayer, IGregTechTileEntity aTileEntity) {
+ super(aInventoryPlayer, aTileEntity);
+ }
+
+ @Override
+ public void addSlots(InventoryPlayer aInventoryPlayer) {
+ addSlotToContainer(new GT_Slot_DataOrb(mTileEntity, 0, 53, 8));
+ addSlotToContainer(new GT_Slot_DataOrb(mTileEntity, 1, 71, 8));
+ addSlotToContainer(new GT_Slot_DataOrb(mTileEntity, 2, 89, 8));
+ addSlotToContainer(new GT_Slot_DataOrb(mTileEntity, 3, 107, 8));
+ addSlotToContainer(new GT_Slot_DataOrb(mTileEntity, 4, 53, 26));
+ addSlotToContainer(new GT_Slot_DataOrb(mTileEntity, 5, 71, 26));
+ addSlotToContainer(new GT_Slot_DataOrb(mTileEntity, 6, 89, 26));
+ addSlotToContainer(new GT_Slot_DataOrb(mTileEntity, 7, 107, 26));
+ addSlotToContainer(new GT_Slot_DataOrb(mTileEntity, 8, 53, 44));
+ addSlotToContainer(new GT_Slot_DataOrb(mTileEntity, 9, 71, 44));
+ addSlotToContainer(new GT_Slot_DataOrb(mTileEntity, 10, 89, 44));
+ addSlotToContainer(new GT_Slot_DataOrb(mTileEntity, 11, 107, 44));
+ addSlotToContainer(new GT_Slot_DataOrb(mTileEntity, 12, 53, 62));
+ addSlotToContainer(new GT_Slot_DataOrb(mTileEntity, 13, 71, 62));
+ addSlotToContainer(new GT_Slot_DataOrb(mTileEntity, 14, 89, 62));
+ addSlotToContainer(new GT_Slot_DataOrb(mTileEntity, 15, 107, 62));
+ addSlotToContainer(new SlotIntegratedCircuit(mTileEntity, 16, 19, 35));
+
+ }
+
+ @Override
+ public int getSlotCount() {
+ return 17;
+ }
+
+ @Override
+ public int getShiftClickSlotCount() {
+ return 0;
+ }
+
+ @Override
+ public void putStackInSlot(int par1, ItemStack par2ItemStack) {
+ /*Logger.INFO("Slot: "+par1);
+ if (par1 < 16 && ItemList.Tool_DataOrb.isStackEqual(par2ItemStack)) {
+ super.putStackInSlot(par1, par2ItemStack);
+ }
+ if (par1 == 16 && ItemUtils.isControlCircuit(par2ItemStack)) {
+ super.putStackInSlot(par1, par2ItemStack);
+ }*/
+ super.putStackInSlot(par1, par2ItemStack);
+ }
+
+ @Override
+ public boolean canDragIntoSlot(Slot par1Slot) {
+ return super.canDragIntoSlot(par1Slot);
+ }
+
+ public class GT_Slot_DataOrb extends Slot {
+ public GT_Slot_DataOrb(IInventory par1iInventory, int par2, int par3, int par4) {
+ super(par1iInventory, par2, par3, par4);
+ }
+
+ @Override
+ public boolean isItemValid(ItemStack aStack) {
+ return ItemList.Tool_DataOrb.isStackEqual(aStack, false, true);
+ }
+ }
+
+
+
+}
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/api/gui/CONTAINER_PowerSubStation.java b/src/main/java/gtPlusPlus/xmod/gregtech/api/gui/CONTAINER_PowerSubStation.java
index 937513751b..94cfa5236d 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/api/gui/CONTAINER_PowerSubStation.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/api/gui/CONTAINER_PowerSubStation.java
@@ -1,34 +1,44 @@
package gtPlusPlus.xmod.gregtech.api.gui;
-import net.minecraft.inventory.IInventory;
-import net.minecraft.inventory.Slot;
-
+import cpw.mods.fml.relauncher.Side;
+import cpw.mods.fml.relauncher.SideOnly;
import gregtech.api.gui.GT_Container_MultiMachine;
import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
-
import gtPlusPlus.core.slots.SlotNoInput;
-
+import gtPlusPlus.core.util.math.MathUtils;
+import gtPlusPlus.xmod.gregtech.common.tileentities.machines.multi.storage.GregtechMetaTileEntity_PowerSubStationController;
import net.minecraft.entity.player.InventoryPlayer;
+import net.minecraft.inventory.*;
public class CONTAINER_PowerSubStation extends GT_Container_MultiMachine {
-
+
+ public long mStoredEU;
+ public int mStoredEU1;
+ public int mStoredEU2;
+ public long mMaxStoredEU;
+ public int mMaxStoredEU1;
+ public int mMaxStoredEU2;
+ public long mAverageEuAdded;
+ public int mAverageEuAdded1;
+ public int mAverageEuAdded2;
+ public long mAverageEuConsumed;
+ public int mAverageEuConsumed1;
+ public int mAverageEuConsumed2;
+
public CONTAINER_PowerSubStation(final InventoryPlayer aInventoryPlayer, final IGregTechTileEntity aTileEntity) {
super(aInventoryPlayer, aTileEntity);
}
- public CONTAINER_PowerSubStation(final InventoryPlayer aInventoryPlayer, final IGregTechTileEntity aTileEntity,
- final boolean bindInventory) {
+ public CONTAINER_PowerSubStation(final InventoryPlayer aInventoryPlayer, final IGregTechTileEntity aTileEntity, final boolean bindInventory) {
super(aInventoryPlayer, aTileEntity, bindInventory);
}
public void addSlots(final InventoryPlayer aInventoryPlayer) {
this.addSlotToContainer(new Slot((IInventory) this.mTileEntity, 1, 155, 5));
this.addSlotToContainer(new SlotNoInput((IInventory) this.mTileEntity, 2, 155, 23));
-
- for (int i = 0; i < 9; ++i) {
- this.addSlotToContainer(new Slot((IInventory) aInventoryPlayer, i, 8 + i * 18, 167));
- }
-
+
+ for (int i = 0; i < 9; ++i) { this.addSlotToContainer(new Slot((IInventory) aInventoryPlayer, i, 8 + i * 18, 167)); }
+
}
public int getSlotCount() {
@@ -38,4 +48,78 @@ public class CONTAINER_PowerSubStation extends GT_Container_MultiMachine {
public int getShiftClickSlotCount() {
return 1;
}
-} \ No newline at end of file
+
+ @Override
+ public void detectAndSendChanges() {
+ super.detectAndSendChanges();
+
+ mStoredEU = mTileEntity.getStoredEU();
+ mMaxStoredEU = mTileEntity.getEUCapacity();
+ GregtechMetaTileEntity_PowerSubStationController aPSS = (GregtechMetaTileEntity_PowerSubStationController) mTileEntity.getMetaTileEntity();
+ mAverageEuAdded = aPSS.getAverageEuAdded();
+ mAverageEuConsumed = aPSS.getAverageEuConsumed();
+ int[] aStored = MathUtils.splitLongIntoTwoIntegers(mStoredEU);
+ int[] aMaxStorage = MathUtils.splitLongIntoTwoIntegers(mMaxStoredEU);
+ int[] aAvgIn = MathUtils.splitLongIntoTwoIntegers(mAverageEuAdded);
+ int[] aAvgOut = MathUtils.splitLongIntoTwoIntegers(mAverageEuConsumed);
+ mStoredEU1 = aStored[0];
+ mStoredEU2 = aStored[1];
+ mMaxStoredEU1 = aMaxStorage[0];
+ mMaxStoredEU2 = aMaxStorage[1];
+ mAverageEuAdded1 = aAvgIn[0];
+ mAverageEuAdded2 = aAvgIn[1];
+ mAverageEuConsumed1 = aAvgOut[0];
+ mAverageEuConsumed2 = aAvgOut[1];
+
+ for (Object crafter : this.crafters) {
+ ICrafting var1 = (ICrafting) crafter;
+ if (mTimer % 20 == 0) {
+ var1.sendProgressBarUpdate(this, 21, mStoredEU1);
+ var1.sendProgressBarUpdate(this, 22, mStoredEU2);
+ var1.sendProgressBarUpdate(this, 23, mMaxStoredEU1);
+ var1.sendProgressBarUpdate(this, 24, mMaxStoredEU2);
+ var1.sendProgressBarUpdate(this, 25, mAverageEuAdded1);
+ var1.sendProgressBarUpdate(this, 26, mAverageEuAdded2);
+ var1.sendProgressBarUpdate(this, 27, mAverageEuConsumed1);
+ var1.sendProgressBarUpdate(this, 28, mAverageEuConsumed2);
+ }
+ }
+
+ }
+
+ @SideOnly(Side.CLIENT)
+ @Override
+ public void updateProgressBar(int par1, int par2) {
+ super.updateProgressBar(par1, par2);
+ switch (par1) {
+ case 21 :
+ mStoredEU1 = par2;
+ break;
+ case 22 :
+ mStoredEU2 = par2;
+ mStoredEU = MathUtils.combineTwoIntegersToLong(mStoredEU1, mStoredEU2);
+ break;
+ case 23 :
+ mMaxStoredEU1 = par2;
+ break;
+ case 24 :
+ mMaxStoredEU2 = par2;
+ mMaxStoredEU = MathUtils.combineTwoIntegersToLong(mMaxStoredEU1, mMaxStoredEU2);
+ break;
+ case 25 :
+ mAverageEuAdded1 = par2;
+ break;
+ case 26 :
+ mAverageEuAdded2 = par2;
+ mAverageEuAdded = MathUtils.combineTwoIntegersToLong(mAverageEuAdded1, mAverageEuAdded2);
+ break;
+ case 27 :
+ mAverageEuConsumed1 = par2;
+ break;
+ case 28 :
+ mAverageEuConsumed2 = par2;
+ mAverageEuConsumed = MathUtils.combineTwoIntegersToLong(mAverageEuConsumed1, mAverageEuConsumed2);
+ break;
+ }
+ }
+}
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/api/gui/GUI_DataHatch.java b/src/main/java/gtPlusPlus/xmod/gregtech/api/gui/GUI_DataHatch.java
new file mode 100644
index 0000000000..77cb0d71a2
--- /dev/null
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/api/gui/GUI_DataHatch.java
@@ -0,0 +1,41 @@
+package gtPlusPlus.xmod.gregtech.api.gui;
+
+import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
+import net.minecraft.entity.player.InventoryPlayer;
+
+import static gregtech.api.enums.GT_Values.RES_PATH_GUI;
+
+import gregtech.api.gui.GT_GUIContainerMetaTile_Machine;
+
+public class GUI_DataHatch extends GT_GUIContainerMetaTile_Machine {
+
+ private final String mName;
+
+ public GUI_DataHatch(InventoryPlayer aInventoryPlayer, IGregTechTileEntity aTileEntity, String aName) {
+ super(new CONTAINER_DataHatch(aInventoryPlayer, aTileEntity), RES_PATH_GUI + "HatchDataOrb.png");
+ mName = aName;
+ }
+
+ public GUI_DataHatch(InventoryPlayer aInventoryPlayer, IGregTechTileEntity aTileEntity, String aName, String aBackground) {
+ super(new CONTAINER_DataHatch(aInventoryPlayer, aTileEntity), RES_PATH_GUI + aBackground + "HatchDataOrb.png");
+ mName = aName;
+ }
+
+ @Override
+ protected void drawGuiContainerForegroundLayer(int par1, int par2) {
+ fontRendererObj.drawString(mName, 8, 4, 4210752);
+ /*String[] aName = mName.trim().split("\\s+");
+ int aY = 4;
+ for (String s : aName) {
+ fontRendererObj.drawString(s, 120, (aY += 12), 4210752);
+ }*/
+ }
+
+ @Override
+ protected void drawGuiContainerBackgroundLayer(float par1, int par2, int par3) {
+ super.drawGuiContainerBackgroundLayer(par1, par2, par3);
+ int x = (width - xSize) / 2;
+ int y = (height - ySize) / 2;
+ drawTexturedModalRect(x, y, 0, 0, xSize, ySize);
+ }
+}
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/api/gui/GUI_MultiMachine.java b/src/main/java/gtPlusPlus/xmod/gregtech/api/gui/GUI_MultiMachine.java
index c78e7789b8..61cf59f6c9 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/api/gui/GUI_MultiMachine.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/api/gui/GUI_MultiMachine.java
@@ -112,18 +112,32 @@ public class GUI_MultiMachine extends GT_GUIContainerMetaTile_Machine {
mInfo.add(StatCollector.translateToLocal("GTPP.machines.output")+" "+StatCollector.translateToLocal("GTPP.machines.tier")+": "+ EnumChatFormatting.GREEN +GT_Values.VOLTAGE_NAMES[aOutputTier]);
}
+
+
+
mInfo.add(StatCollector.translateToLocal("GTPP.multiblock.progress")+": "+
EnumChatFormatting.GREEN + Integer.toString(((CONTAINER_MultiMachine) this.mContainer).mProgressTime/20) + EnumChatFormatting.RESET +" s / "+
EnumChatFormatting.YELLOW + Integer.toString(((CONTAINER_MultiMachine) this.mContainer).mMaxProgressTime/20) + EnumChatFormatting.RESET +" s");
- mInfo.add(StatCollector.translateToLocal("GTPP.multiblock.energy")+": "+
- EnumChatFormatting.GREEN + Long.toString(aStoredEnergy) + EnumChatFormatting.RESET +" "+EU+" / "+
- EnumChatFormatting.YELLOW + Long.toString(aMaxEnergy) + EnumChatFormatting.RESET +" "+EU+"");
+
+
+
+
+
+ mInfo.add(StatCollector.translateToLocal("GTPP.multiblock.energy")+":");
+ mInfo.add(StatCollector.translateToLocal(""+EnumChatFormatting.GREEN + Long.toString(aStoredEnergy) + EnumChatFormatting.RESET +" EU / "+
+ EnumChatFormatting.YELLOW + Long.toString(aMaxEnergy) + EnumChatFormatting.RESET +" EU"));
if (aRecipeEU != 0 && aRecipeDuration > 0) {
- mInfo.add(StatCollector.translateToLocal("GTPP.multiblock.usage")+": "+
- EnumChatFormatting.RED + Integer.toString(-aRecipeEU) + EnumChatFormatting.RESET + " "+EU+"/t");
+ if (aRecipeEU > 0) {
+ mInfo.add(StatCollector.translateToLocal("GTPP.multiblock.usage")+":");
+ mInfo.add(StatCollector.translateToLocal(""+EnumChatFormatting.RED + Integer.toString(-aRecipeEU) + EnumChatFormatting.RESET + " EU/t/parallel"));
+ }
+ else {
+ mInfo.add(StatCollector.translateToLocal("GTPP.multiblock.generation")+":");
+ mInfo.add(StatCollector.translateToLocal(""+EnumChatFormatting.GREEN + Integer.toString(aRecipeEU) + EnumChatFormatting.RESET + " EU/t/parallel"));
+ }
mInfo.add(StatCollector.translateToLocal("GTPP.multiblock.duration")+": "+
EnumChatFormatting.RED + Integer.toString(aRecipeDuration) + EnumChatFormatting.RESET + " ticks");
if (aRecipeSpecial > 0) {
@@ -132,18 +146,16 @@ public class GUI_MultiMachine extends GT_GUIContainerMetaTile_Machine {
}
}
- mInfo.add(StatCollector.translateToLocal("GTPP.multiblock.mei")+": "+
- EnumChatFormatting.YELLOW+Long.toString(aMaxInputVoltage)+EnumChatFormatting.RESET+ " "+EU+"/t"+EnumChatFormatting.RESET);
-
- mInfo.add(StatCollector.translateToLocal(StatCollector.translateToLocal("GTPP.machines.tier")+": "+
- EnumChatFormatting.YELLOW+GT_Values.VN[GT_Utility.getTier(aMaxInputVoltage)]+ EnumChatFormatting.RESET));
+ mInfo.add(StatCollector.translateToLocal("GTPP.multiblock.mei")+":");
+ mInfo.add(StatCollector.translateToLocal(""+EnumChatFormatting.YELLOW+Long.toString(aMaxInputVoltage)+EnumChatFormatting.RESET+ " EU/t(*2A) "+StatCollector.translateToLocal("GTPP.machines.tier")+": "+
+ EnumChatFormatting.YELLOW+GT_Values.VN[GT_Utility.getTier(aMaxInputVoltage)]+ EnumChatFormatting.RESET));
mInfo.add(StatCollector.translateToLocal("GTPP.multiblock.efficiency")+": "+ EnumChatFormatting.YELLOW+Float.toString(aEfficiency / 100.0F)+EnumChatFormatting.RESET + " %");
mInfo.add(StatCollector.translateToLocal("GTPP.multiblock.pollution")+": "+ EnumChatFormatting.RED + (aPollutionTick*20)+ EnumChatFormatting.RESET+"/sec");
mInfo.add(StatCollector.translateToLocal("GTPP.multiblock.pollutionreduced")+": "+ EnumChatFormatting.GREEN + aPollutionReduction + EnumChatFormatting.RESET+" %");
- mInfo.add(StatCollector.translateToLocal("GTPP.CC.parallel")+": "+EnumChatFormatting.GREEN+(aMaxParallel)+EnumChatFormatting.RESET);
+ //mInfo.add(StatCollector.translateToLocal("GTPP.CC.parallel")+": "+EnumChatFormatting.GREEN+(aMaxParallel)+EnumChatFormatting.RESET);
mInfo.add("Total Time Since Built: ");
mInfo.add("" + EnumChatFormatting.DARK_GREEN + Integer.toString(weeks)+EnumChatFormatting.RESET+" Weeks,");
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/api/gui/GUI_PowerSubStation.java b/src/main/java/gtPlusPlus/xmod/gregtech/api/gui/GUI_PowerSubStation.java
index 65ba8610dd..f8aaa1792d 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/api/gui/GUI_PowerSubStation.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/api/gui/GUI_PowerSubStation.java
@@ -1,175 +1,126 @@
package gtPlusPlus.xmod.gregtech.api.gui;
+import gregtech.api.gui.GT_GUIContainerMetaTile_Machine;
+import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
import gregtech.api.util.GT_Utility;
-
-import gtPlusPlus.api.objects.Logger;
import gtPlusPlus.core.lib.CORE;
-import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
-import gregtech.api.items.GT_MetaGenerated_Tool;
-
+import gtPlusPlus.core.util.Utils;
+import gtPlusPlus.core.util.math.MathUtils;
import net.minecraft.entity.player.InventoryPlayer;
-import net.minecraft.util.IIcon;
-
-import gregtech.api.enums.Textures;
-import gregtech.api.gui.GT_GUIContainerMetaTile_Machine;
public class GUI_PowerSubStation extends GT_GUIContainerMetaTile_Machine {
public String mNEI;
String mName;
boolean[] mRepairStatus = new boolean[6];
- private static IIcon[] mGregToolIcons = new IIcon[6];
+
+ public final CONTAINER_PowerSubStation mPowerContainer;
public GUI_PowerSubStation(final InventoryPlayer aInventoryPlayer, final IGregTechTileEntity aTileEntity, final String aName, final String aNEI) {
super(new CONTAINER_PowerSubStation(aInventoryPlayer, aTileEntity, false), CORE.RES_PATH_GUI + "PowerSubStation.png");
this.mName = aName;
this.mNEI = aNEI;
+ mPowerContainer = (CONTAINER_PowerSubStation) mContainer;
/** The X size of the inventory window in pixels. */
this.xSize = 196;
/** The Y size of the inventory window in pixels. */
this.ySize = 191;
- for (IIcon g : mGregToolIcons) {
- if (g == null) {
- getToolTextures();
- }
- }
- }
-
- private static final boolean getToolTextures() {
- mGregToolIcons[0] = Textures.ItemIcons.WRENCH.getIcon();
- mGregToolIcons[1] = Textures.ItemIcons.HANDLE_SCREWDRIVER.getIcon();
- mGregToolIcons[2] = Textures.ItemIcons.MORTAR.getIcon();
- mGregToolIcons[3] = Textures.ItemIcons.JACKHAMMER.getIcon();
- mGregToolIcons[4] = Textures.ItemIcons.HANDLE_SOLDERING.getIcon();
- mGregToolIcons[5] = Textures.ItemIcons.CROWBAR.getIcon();
- return true;
}
protected void drawGuiContainerForegroundLayer(final int par1, final int par2) {
this.fontRendererObj.drawString(this.mName, 8, -10, 16448255);
- if (this.mContainer != null) {
+ if (this.mPowerContainer != null) {
+
+ //this.fontRendererObj.drawString("Error Code: " + mPowerContainer.mDisplayErrorCode, 10, 142, 16448255);
- this.fontRendererObj.drawString("Error Code: "+((CONTAINER_PowerSubStation) this.mContainer).mDisplayErrorCode, 10, 142, 16448255);
- this.fontRendererObj.drawString("In", 178, 10, 16448255);
- this.fontRendererObj.drawString("Out", 176, 28, 16448255);
-
if (((this.mContainer).mDisplayErrorCode & 1) != 0) {
- this.fontRendererObj.drawString("Pipe is loose.", 10, 8, 16448255);
mRepairStatus[0] = false;
}
else {
mRepairStatus[0] = true;
- }
- if ((((CONTAINER_PowerSubStation) this.mContainer).mDisplayErrorCode & 2) != 0) {
- this.fontRendererObj.drawString("Screws are missing.", 10, 16, 16448255);
+ }
+ if ((mPowerContainer.mDisplayErrorCode & 2) != 0) {
mRepairStatus[1] = false;
}
else {
mRepairStatus[1] = true;
- }
- if ((((CONTAINER_PowerSubStation) this.mContainer).mDisplayErrorCode & 4) != 0) {
- this.fontRendererObj.drawString("Something is stuck.", 10, 24, 16448255);
+ }
+ if ((mPowerContainer.mDisplayErrorCode & 4) != 0) {
mRepairStatus[2] = false;
}
else {
mRepairStatus[2] = true;
- }
- if ((((CONTAINER_PowerSubStation) this.mContainer).mDisplayErrorCode & 8) != 0) {
- this.fontRendererObj.drawString("Platings are dented.", 10, 32, 16448255);
+ }
+ if ((mPowerContainer.mDisplayErrorCode & 8) != 0) {
mRepairStatus[3] = false;
}
else {
mRepairStatus[3] = true;
- }
- if ((((CONTAINER_PowerSubStation) this.mContainer).mDisplayErrorCode & 16) != 0) {
- this.fontRendererObj.drawString("Circuitry burned out.", 10, 40, 16448255);
+ }
+ if ((mPowerContainer.mDisplayErrorCode & 16) != 0) {
mRepairStatus[4] = false;
}
else {
mRepairStatus[4] = true;
- }
- if ((((CONTAINER_PowerSubStation) this.mContainer).mDisplayErrorCode & 32) != 0) {
- this.fontRendererObj.drawString("That doesn't belong there.", 10, 48, 16448255);
+ }
+ if ((mPowerContainer.mDisplayErrorCode & 32) != 0) {
mRepairStatus[5] = false;
}
else {
mRepairStatus[5] = true;
- }
- if (((CONTAINER_PowerSubStation) this.mContainer).mDisplayErrorCode == 0) {
- if (((CONTAINER_PowerSubStation) this.mContainer).mActive == 0) {
- this.fontRendererObj.drawString(
- "Hit with Soft Hammer to (re-)start the Machine if it doesn't start.", -70, 8, 16448255);
- } else {
- this.fontRendererObj.drawString("Running perfectly.", 10, 8, 16448255);
- }
- }
- if (this.mContainer.mEnergy > 160000000 && this.mContainer.mEnergy < 160010000) {
- this.fontRendererObj.drawString("160,000,000 EU", 50, 155, 16711680);
- } else if (this.mContainer.mEnergy > 320000000 && this.mContainer.mEnergy < 320010000) {
- this.fontRendererObj.drawString("320,000,000 EU", 50, 155, 16711680);
- } else if (this.mContainer.mEnergy > 640000000 && this.mContainer.mEnergy < 640010000) {
- this.fontRendererObj.drawString("640,000,000 EU", 50, 155, 16711680);
- } else {
- this.fontRendererObj.drawString(GT_Utility.formatNumbers((long) this.mContainer.mEnergy) + " EU",
- 50, 155, 16711680);
}
+ if (mPowerContainer.mDisplayErrorCode == 0) {
+ if (mPowerContainer.mActive == 0) {
+ this.fontRendererObj.drawString("Turn on with Mallet", 10, 8, 16448255);
+ }
+ else {
+ this.fontRendererObj.drawString("Running perfectly", 10, 8, 16448255);
+ }
+ }
+
+ this.fontRendererObj.drawString("In", 178, 10, 16448255);
+ this.fontRendererObj.drawString("Out", 176, 28, 16448255);
+ this.fontRendererObj.drawString("Avg In: "+GT_Utility.formatNumbers(this.mPowerContainer.mAverageEuAdded)+" EU", 10, 20, 16448255);
+ this.fontRendererObj.drawString("Avg Out: "+GT_Utility.formatNumbers(this.mPowerContainer.mAverageEuConsumed)+" EU", 10, 30, 16448255);
+
+ final double tScale2 = MathUtils.findPercentage(this.mPowerContainer.mStoredEU, this.mPowerContainer.mMaxStoredEU);
+ final int tScale = (int) (tScale2 * 2.55);
+ this.fontRendererObj.drawString("Stored:", 10, 132, 16448255);
+ this.fontRendererObj.drawString(GT_Utility.formatNumbers(this.mPowerContainer.mStoredEU) + " EU", 10, 142, Utils.rgbtoHexValue((255 - tScale), (0 + tScale), 0));
+ this.fontRendererObj.drawString(GT_Utility.formatNumbers(tScale2)+"%", 70, 155, 16448255);
+
}
}
- protected void drawGuiContainerBackgroundLayer(final float par1, final int par2, final int par3) {
+ protected void drawGuiContainerBackgroundLayer(final float par1, final int par2, final int par3) {
/** The X size of the inventory window in pixels. */
if (this.xSize != 196)
this.xSize = 196;
/** The Y size of the inventory window in pixels. */
if (this.ySize != 191)
- this.ySize = 191;
- super.drawGuiContainerBackgroundLayer(par1, par2, par3);
+ this.ySize = 191;
+ super.drawGuiContainerBackgroundLayer(par1, par2, par3);
final int x = (this.width - this.xSize) / 2;
final int y = (this.height - this.ySize) / 2;
this.drawTexturedModalRect(x, y, 0, 0, this.xSize, this.ySize);
- if (this.mContainer != null) {
- final double tScale = this.mContainer.mEnergy / this.mContainer.mStorage;
+ if (this.mPowerContainer != null) {
+ final double tScale = MathUtils.findPercentage(this.mPowerContainer.mStoredEU, this.mPowerContainer.mMaxStoredEU) / 100;
this.drawTexturedModalRect(x + 5, y + 156, 0, 251, Math.min(147, (int) (tScale * 148.0)), 5);
-
- //A1
+ // A1
this.drawTexturedModalRect(x + 154, y + 76, 238, (!mRepairStatus[0] ? 0 : 18), 18, 18);
- //A2
+ // A2
this.drawTexturedModalRect(x + 154 + 20, y + 76, 238, (!mRepairStatus[1] ? 0 : 18), 18, 18);
- //B1
+ // B1
this.drawTexturedModalRect(x + 154, y + 76 + 18, 238, (!mRepairStatus[2] ? 0 : 18), 18, 18);
- //B2
+ // B2
this.drawTexturedModalRect(x + 154 + 20, y + 76 + 18, 238, (!mRepairStatus[3] ? 0 : 18), 18, 18);
- //C1
+ // C1
this.drawTexturedModalRect(x + 154, y + 76 + 36, 238, (!mRepairStatus[4] ? 0 : 18), 18, 18);
- //C2
+ // C2
this.drawTexturedModalRect(x + 154 + 20, y + 76 + 36, 238, (!mRepairStatus[5] ? 0 : 18), 18, 18);
- if (mGregToolIcons[0] != null) {
- //this.drawTexturedModelRectFromIcon(x + 154, y + 76, mGregToolIcons[0], 18, 18);
- }
- if (mGregToolIcons[1] != null) {
- //this.drawTexturedModelRectFromIcon(x + 154 + 20, y + 76, mGregToolIcons[1], 18, 18);
- }
- if (mGregToolIcons[2] != null) {
- //this.drawTexturedModelRectFromIcon(x + 154, y + 76 + 18, mGregToolIcons[2], 9, 9);
- }
- if (mGregToolIcons[3] != null) {
- //this.drawTexturedModelRectFromIcon(x + 154 + 20, y + 76 + 18, mGregToolIcons[3], 9, 9);
- }
- if (mGregToolIcons[4] != null) {
- //this.drawTexturedModelRectFromIcon(x + 154, y + 76 + 36, mGregToolIcons[4], 9, 9);
- }
- if (mGregToolIcons[5] != null) {
- //this.drawTexturedModelRectFromIcon(x + 154 + 20, y + 76 + 36, mGregToolIcons[5], 9, 9);
- }
-
- /*//Maint Done
- this.drawTexturedModalRect(x + 154, y + 76, 238, 0, 18, 18);
- //Maint Required
- this.drawTexturedModalRect(x + 154 + 20, y + 76, 238, 18, 18, 18);*/
-
}
}
-} \ No newline at end of file
+}
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/api/gui/automation/GT_Container_ElectricAutoWorkbench.java b/src/main/java/gtPlusPlus/xmod/gregtech/api/gui/automation/GT_Container_ElectricAutoWorkbench.java
new file mode 100644
index 0000000000..1af597c05a
--- /dev/null
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/api/gui/automation/GT_Container_ElectricAutoWorkbench.java
@@ -0,0 +1,141 @@
+package gtPlusPlus.xmod.gregtech.api.gui.automation;
+
+import com.google.gson.JsonObject;
+
+import cpw.mods.fml.relauncher.Side;
+import cpw.mods.fml.relauncher.SideOnly;
+import gregtech.api.gui.GT_ContainerMetaTile_Machine;
+import gregtech.api.gui.GT_Slot_Holo;
+import gregtech.api.gui.GT_Slot_Output;
+import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
+import gregtech.api.util.GT_Utility;
+import gtPlusPlus.xmod.gregtech.common.tileentities.automation.GT_MetaTileEntity_ElectricAutoWorkbench;
+import gtPlusPlus.xmod.gregtech.common.tileentities.machines.basic.GT_MetaTileEntity_CropHarvestor;
+import net.minecraft.entity.player.EntityPlayer;
+import net.minecraft.entity.player.InventoryPlayer;
+import net.minecraft.inventory.ICrafting;
+import net.minecraft.inventory.Slot;
+import net.minecraft.item.ItemStack;
+
+public class GT_Container_ElectricAutoWorkbench extends GT_ContainerMetaTile_Machine {
+
+ public int mMode;
+ public int mThroughPut;
+
+ public GT_Container_ElectricAutoWorkbench(InventoryPlayer aInventoryPlayer, IGregTechTileEntity aTileEntity) {
+ super(aInventoryPlayer, aTileEntity);
+ }
+
+ public void addSlots(InventoryPlayer aInventoryPlayer) {
+ addSlotToContainer(new Slot(mTileEntity, 0, 8, 5));
+ addSlotToContainer(new Slot(mTileEntity, 1, 26, 5));
+ addSlotToContainer(new Slot(mTileEntity, 2, 44, 5));
+ addSlotToContainer(new Slot(mTileEntity, 3, 8, 23));
+ addSlotToContainer(new Slot(mTileEntity, 4, 26, 23));
+ addSlotToContainer(new Slot(mTileEntity, 5, 44, 23));
+ addSlotToContainer(new Slot(mTileEntity, 6, 8, 41));
+ addSlotToContainer(new Slot(mTileEntity, 7, 26, 41));
+ addSlotToContainer(new Slot(mTileEntity, 8, 44, 41));
+
+ addSlotToContainer(new GT_Slot_Output(mTileEntity, 9, 8, 60));
+ addSlotToContainer(new GT_Slot_Output(mTileEntity, 10, 26, 60));
+ addSlotToContainer(new GT_Slot_Output(mTileEntity, 11, 44, 60));
+ addSlotToContainer(new GT_Slot_Output(mTileEntity, 12, 62, 60));
+ addSlotToContainer(new GT_Slot_Output(mTileEntity, 13, 80, 60));
+ addSlotToContainer(new GT_Slot_Output(mTileEntity, 14, 98, 60));
+ addSlotToContainer(new GT_Slot_Output(mTileEntity, 15, 116, 60));
+ addSlotToContainer(new GT_Slot_Output(mTileEntity, 16, 134, 60));
+ addSlotToContainer(new GT_Slot_Output(mTileEntity, 17, 152, 60));
+
+ addSlotToContainer(new GT_Slot_Output(mTileEntity, 18, 152, 41));
+
+ addSlotToContainer(new GT_Slot_Holo(mTileEntity, 19, 64, 6, false, false, 1));
+ addSlotToContainer(new GT_Slot_Holo(mTileEntity, 20, 81, 6, false, false, 1));
+ addSlotToContainer(new GT_Slot_Holo(mTileEntity, 21, 98, 6, false, false, 1));
+ addSlotToContainer(new GT_Slot_Holo(mTileEntity, 22, 64, 23, false, false, 1));
+ addSlotToContainer(new GT_Slot_Holo(mTileEntity, 23, 81, 23, false, false, 1));
+ addSlotToContainer(new GT_Slot_Holo(mTileEntity, 24, 98, 23, false, false, 1));
+ addSlotToContainer(new GT_Slot_Holo(mTileEntity, 25, 64, 40, false, false, 1));
+ addSlotToContainer(new GT_Slot_Holo(mTileEntity, 26, 81, 40, false, false, 1));
+ addSlotToContainer(new GT_Slot_Holo(mTileEntity, 27, 98, 40, false, false, 1));
+
+ addSlotToContainer(new GT_Slot_Holo(mTileEntity, 28, 152, 5, false, false, 1));
+ addSlotToContainer(new GT_Slot_Holo(mTileEntity, 29, 121, 41, false, false, 1));
+ addSlotToContainer(new GT_Slot_Holo(mTileEntity, 29, 121, 5, false, false, 1));
+ }
+