aboutsummaryrefslogtreecommitdiff
path: root/src/Java/miscutil/xmod/ic2/block/RTGGenerator/gui
diff options
context:
space:
mode:
authorDraknyte1 <Draknyte1@hotmail.com>2016-08-27 04:30:26 +1000
committerDraknyte1 <Draknyte1@hotmail.com>2016-08-27 04:30:26 +1000
commit32e5798729e91f3975e3373ba8332d0fd384d648 (patch)
treee932a1b8f3319702f507f7bef7ded77286a41bb3 /src/Java/miscutil/xmod/ic2/block/RTGGenerator/gui
parentcd8b4a74fcb9cd40e5ba0fd3f86dac0f6fd7f4cd (diff)
downloadGT5-Unofficial-32e5798729e91f3975e3373ba8332d0fd384d648.tar.gz
GT5-Unofficial-32e5798729e91f3975e3373ba8332d0fd384d648.tar.bz2
GT5-Unofficial-32e5798729e91f3975e3373ba8332d0fd384d648.zip
+ New GUI for the Mach II RTG.
- Disabled Generators again for public build.
Diffstat (limited to 'src/Java/miscutil/xmod/ic2/block/RTGGenerator/gui')
-rw-r--r--src/Java/miscutil/xmod/ic2/block/RTGGenerator/gui/CONTAINER_RTG.java37
-rw-r--r--src/Java/miscutil/xmod/ic2/block/RTGGenerator/gui/CONTAINER_RadioThermalGenerator.java98
-rw-r--r--src/Java/miscutil/xmod/ic2/block/RTGGenerator/gui/GUI_RTG.java52
-rw-r--r--src/Java/miscutil/xmod/ic2/block/RTGGenerator/gui/GUI_RadioThermalGenerator.java49
4 files changed, 89 insertions, 147 deletions
diff --git a/src/Java/miscutil/xmod/ic2/block/RTGGenerator/gui/CONTAINER_RTG.java b/src/Java/miscutil/xmod/ic2/block/RTGGenerator/gui/CONTAINER_RTG.java
new file mode 100644
index 0000000000..d3e96ee673
--- /dev/null
+++ b/src/Java/miscutil/xmod/ic2/block/RTGGenerator/gui/CONTAINER_RTG.java
@@ -0,0 +1,37 @@
+package miscutil.xmod.ic2.block.RTGGenerator.gui;
+
+import ic2.core.block.generator.container.ContainerRTGenerator;
+import ic2.core.slot.SlotInvSlot;
+
+import java.util.List;
+
+import miscutil.xmod.ic2.block.RTGGenerator.TileEntityRTG;
+import net.minecraft.entity.player.EntityPlayer;
+
+public class CONTAINER_RTG
+extends ContainerRTGenerator
+{
+ public CONTAINER_RTG(EntityPlayer entityPlayer, TileEntityRTG tileEntity1)
+ {
+ super(entityPlayer, tileEntity1);
+ for (int i = 0; i < 4; i++) {
+ addSlotToContainer(new SlotInvSlot(tileEntity1.fuelSlot, i, 36 + i * 18, 18));
+ }
+ for (int i = 4; i < 8; i++) {
+ addSlotToContainer(new SlotInvSlot(tileEntity1.fuelSlot, i, 36 + (i - 4) * 18, 36));
+ }
+ for (int i = 8; i < 12; i++) {
+ addSlotToContainer(new SlotInvSlot(tileEntity1.fuelSlot, i, 36 + (i - 8) * 18, 54));
+ }
+ }
+
+ @Override
+ public List<String> getNetworkedFields()
+ {
+ List<String> ret = super.getNetworkedFields();
+
+ ret.add("storage");
+
+ return ret;
+ }
+}
diff --git a/src/Java/miscutil/xmod/ic2/block/RTGGenerator/gui/CONTAINER_RadioThermalGenerator.java b/src/Java/miscutil/xmod/ic2/block/RTGGenerator/gui/CONTAINER_RadioThermalGenerator.java
deleted file mode 100644
index b70bb6bd8d..0000000000
--- a/src/Java/miscutil/xmod/ic2/block/RTGGenerator/gui/CONTAINER_RadioThermalGenerator.java
+++ /dev/null
@@ -1,98 +0,0 @@
-package miscutil.xmod.ic2.block.RTGGenerator.gui;
-
-import miscutil.core.lib.CORE;
-import miscutil.core.slots.SlotRTG;
-import miscutil.xmod.ic2.block.RTGGenerator.TileEntityRTG;
-import net.minecraft.entity.player.EntityPlayer;
-import net.minecraft.inventory.Container;
-import net.minecraft.inventory.Slot;
-import net.minecraft.item.ItemStack;
-import net.minecraft.util.ResourceLocation;
-import forestry.api.apiculture.IHiveFrame;
-import forestry.core.gui.tooltips.ToolTip;
-
-public class CONTAINER_RadioThermalGenerator extends Container
-{
- private TileEntityRTG te;
-
- public static final int INPUT_1 = 0;
- private final ResourceLocation beeFrameIcon = new ResourceLocation(CORE.MODID, "textures/items/machine_Charger.png");
- public ToolTip newTip = new ToolTip();
- public final SlotRTG rtgSlot;
-
- private int slotID = 0;
-
- public CONTAINER_RadioThermalGenerator(TileEntityRTG te, EntityPlayer player)
- {
- this.te = te;
- this.rtgSlot = new SlotRTG(te, slotID++, 80, 35);
-
- //Fuel Slot A
- rtgSlot.setBackgroundIconTexture(beeFrameIcon);
-
- addSlotToContainer(rtgSlot);
-
- //Inventory
- for (int i = 0; i < 3; i++)
- {
- for (int j = 0; j < 9; j++)
- {
- addSlotToContainer(new Slot(player.inventory, j + i * 9 + 9, 8 + j * 18, 84 + i * 18));
- }
- }
- // Hotbar
- for (int i = 0; i < 9; i++)
- {
- addSlotToContainer(new Slot(player.inventory, i, 8 + i * 18, 142));
- }
- }
-
- @Override
- public ItemStack transferStackInSlot(EntityPlayer player, int slotRaw)
- {
- ItemStack stack = null;
- Slot slot = (Slot)inventorySlots.get(slotRaw);
-
- if (slot != null && slot.getHasStack())
- {
- ItemStack stackInSlot = slot.getStack();
- stack = stackInSlot.copy();
-
-
- //If your inventory only stores certain instances of Items,
- //you can implement shift-clicking to your inventory like this:
- // Check that the item is the right type
- if (!(stack.getItem() instanceof IHiveFrame)){
- return null;
- }
-
- if (slotRaw < 1)
- {
- if (!mergeItemStack(stackInSlot, 3 * 9, inventorySlots.size(), true))
- {
- return null;
- }
- }
- else if (!mergeItemStack(stackInSlot, 0, 3 * 9, false))
- {
- return null;
- }
-
- if (stackInSlot.stackSize == 0)
- {
- slot.putStack((ItemStack)null);
- }
- else
- {
- slot.onSlotChanged();
- }
- }
- return stack;
- }
-
- @Override
- public boolean canInteractWith(EntityPlayer player)
- {
- return te.isUseableByPlayer(player);
- }
-} \ No newline at end of file
diff --git a/src/Java/miscutil/xmod/ic2/block/RTGGenerator/gui/GUI_RTG.java b/src/Java/miscutil/xmod/ic2/block/RTGGenerator/gui/GUI_RTG.java
new file mode 100644
index 0000000000..1c943d3546
--- /dev/null
+++ b/src/Java/miscutil/xmod/ic2/block/RTGGenerator/gui/GUI_RTG.java
@@ -0,0 +1,52 @@
+package miscutil.xmod.ic2.block.RTGGenerator.gui;
+
+import ic2.core.IC2;
+import ic2.core.block.generator.gui.GuiRTGenerator;
+import ic2.core.util.GuiTooltiphelper;
+import miscutil.xmod.ic2.block.RTGGenerator.TileEntityRTG;
+import net.minecraft.util.ResourceLocation;
+import net.minecraft.util.StatCollector;
+
+import org.lwjgl.opengl.GL11;
+
+import cpw.mods.fml.relauncher.Side;
+import cpw.mods.fml.relauncher.SideOnly;
+
+@SideOnly(Side.CLIENT)
+public class GUI_RTG
+ extends GuiRTGenerator
+{
+ public CONTAINER_RTG container;
+ public String name;
+
+ public GUI_RTG(CONTAINER_RTG container1)
+ {
+ super(container1);
+
+ this.container = container1;
+ this.name = "RTG Mach II";
+ }
+
+ @Override
+protected void drawGuiContainerForegroundLayer(int par1, int par2)
+ {
+ this.fontRendererObj.drawString(this.name, (this.xSize - this.fontRendererObj.getStringWidth(this.name)) / 2, 4, 4210752);
+
+ GuiTooltiphelper.drawAreaTooltip(par1 - this.guiLeft, par2 - this.guiTop, StatCollector.translateToLocalFormatted("ic2.generic.text.bufferEU", new Object[] { Double.valueOf(((TileEntityRTG)this.container.base).storage) }), 117, 38, 150, 48);
+ }
+
+ @Override
+protected void drawGuiContainerBackgroundLayer(float f, int x, int y)
+ {
+ GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
+ this.mc.getTextureManager().bindTexture(background);
+ int j = (this.width - this.xSize) / 2;
+ int k = (this.height - this.ySize) / 2;
+ drawTexturedModalRect(j, k, 0, 0, this.xSize, this.ySize);
+
+ int i1 = ((TileEntityRTG)this.container.base).gaugeStorageScaled(31);
+ drawTexturedModalRect(j + 119, k + 40, 179, 3, i1, 8);
+ }
+
+ private static final ResourceLocation background = new ResourceLocation(IC2.textureDomain, "textures/gui/GUIRTGenerator.png");
+}
diff --git a/src/Java/miscutil/xmod/ic2/block/RTGGenerator/gui/GUI_RadioThermalGenerator.java b/src/Java/miscutil/xmod/ic2/block/RTGGenerator/gui/GUI_RadioThermalGenerator.java
deleted file mode 100644
index 4c9442d56d..0000000000
--- a/src/Java/miscutil/xmod/ic2/block/RTGGenerator/gui/GUI_RadioThermalGenerator.java
+++ /dev/null
@@ -1,49 +0,0 @@
-package miscutil.xmod.ic2.block.RTGGenerator.gui;
-
-import miscutil.core.lib.CORE;
-import miscutil.xmod.ic2.block.RTGGenerator.TileEntityRTG;
-import net.minecraft.client.Minecraft;
-import net.minecraft.client.gui.inventory.GuiContainer;
-import net.minecraft.client.resources.I18n;
-import net.minecraft.entity.player.EntityPlayer;
-import net.minecraft.entity.player.InventoryPlayer;
-import net.minecraft.util.ResourceLocation;
-
-import org.lwjgl.opengl.GL11;
-
-public class GUI_RadioThermalGenerator extends GuiContainer
-{
- private ResourceLocation texture = new ResourceLocation(CORE.MODID, "textures/gui/machine_Charger.png");
-
- private InventoryPlayer inventory;
- private TileEntityRTG te;
-
- public GUI_RadioThermalGenerator(TileEntityRTG te, EntityPlayer player)
- {
- super(new CONTAINER_RadioThermalGenerator(te, player));
- inventory = player.inventory;
- this.te = te;
- }
-
- @Override
- protected void drawGuiContainerBackgroundLayer(float par1, int par2, int par3)
- {
- Minecraft.getMinecraft().renderEngine.bindTexture(texture);
-
- GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
-
- int x = (width - xSize) / 2;
- int y = (height - ySize) / 2;
-
- drawTexturedModalRect(x, y, 0, 0, xSize, ySize);
- }
-
- @Override
- protected void drawGuiContainerForegroundLayer(int par1, int par2)
- {
- fontRendererObj.drawString(I18n.format("Alveary Frame Housing"), (xSize / 2) - (fontRendererObj.getStringWidth(I18n.format("Alveary Frame Housing")) / 2), 6, 4210752, false);
- fontRendererObj.drawString(I18n.format(inventory.getInventoryName()), 8, ySize - 96 + 2, 4210752);
- //fontRendererObj.drawString(I18n.format("Charge:"+te.getCharge()+"~"), 8, ySize - 96 + 2, 4210752);
- //fontRendererObj.drawString(I18n.format("Progress:"+te.getProgress()+"ticks"), 80, ySize - 96 + 2, 4210752);
- }
-} \ No newline at end of file