From e89451ed3663b01676398fd4bfb5795831b282c0 Mon Sep 17 00:00:00 2001 From: Arcaratus Date: Sat, 27 Feb 2016 11:38:40 -0500 Subject: [PATCH] Routing node cleanup --- .../client/gui/GuiItemRoutingNode.java | 34 ++++++++---------- .../container/ContainerItemRoutingNode.java | 6 ++-- .../tile/container/ContainerSoulForge.java | 4 +-- .../bloodmagic/textures/gui/routingNode.png | Bin 1843 -> 1856 bytes 4 files changed, 20 insertions(+), 24 deletions(-) diff --git a/src/main/java/WayofTime/bloodmagic/client/gui/GuiItemRoutingNode.java b/src/main/java/WayofTime/bloodmagic/client/gui/GuiItemRoutingNode.java index 49fd34b3..7a9da696 100644 --- a/src/main/java/WayofTime/bloodmagic/client/gui/GuiItemRoutingNode.java +++ b/src/main/java/WayofTime/bloodmagic/client/gui/GuiItemRoutingNode.java @@ -20,17 +20,12 @@ import WayofTime.bloodmagic.tile.routing.TileFilteredRoutingNode; @SideOnly(Side.CLIENT) public class GuiItemRoutingNode extends GuiContainer { - private GuiButton downButton; - private GuiButton upButton; - private GuiButton northButton; - private GuiButton southButton; - private GuiButton westButton; - private GuiButton eastButton; - private GuiButton incrementButton; - private GuiButton decrementButton; + private GuiButton downButton, upButton, northButton, southButton, westButton, eastButton, incrementButton, decrementButton; private TileFilteredRoutingNode inventory; + private int left, top; + public GuiItemRoutingNode(InventoryPlayer playerInventory, IInventory tileRoutingNode) { super(new ContainerItemRoutingNode(playerInventory, tileRoutingNode)); @@ -54,15 +49,18 @@ public class GuiItemRoutingNode extends GuiContainer public void initGui() { super.initGui(); + left = (this.width - this.xSize) / 2; + top = (this.height - this.ySize)/ 2; + this.buttonList.clear(); - this.buttonList.add(this.downButton = new GuiButton(0, (this.width - this.xSize) / 2 + 133, (this.height - this.ySize) / 2 + 50, 18, 18, "D")); - this.buttonList.add(this.upButton = new GuiButton(1, (this.width - this.xSize) / 2 + 133, (this.height - this.ySize) / 2 + 14, 18, 18, "U")); - this.buttonList.add(this.northButton = new GuiButton(2, (this.width - this.xSize) / 2 + 151, (this.height - this.ySize) / 2 + 14, 18, 18, "N")); - this.buttonList.add(this.southButton = new GuiButton(3, (this.width - this.xSize) / 2 + 151, (this.height - this.ySize) / 2 + 50, 18, 18, "S")); - this.buttonList.add(this.westButton = new GuiButton(4, (this.width - this.xSize) / 2 + 133, (this.height - this.ySize) / 2 + 32, 18, 18, "W")); - this.buttonList.add(this.eastButton = new GuiButton(5, (this.width - this.xSize) / 2 + 151, (this.height - this.ySize) / 2 + 32, 18, 18, "E")); - this.buttonList.add(this.incrementButton = new GuiButton(6, (this.width - this.xSize) / 2 + 97, (this.height - this.ySize) / 2 + 14, 18, 17, "^")); - this.buttonList.add(this.decrementButton = new GuiButton(7, (this.width - this.xSize) / 2 + 97, (this.height - this.ySize) / 2 + 50, 18, 17, "v")); + this.buttonList.add(this.downButton = new GuiButton(0, left + 133, top + 50, 18, 17, "D")); + this.buttonList.add(this.upButton = new GuiButton(1, left + 133, top + 14, 18, 18, "U")); + this.buttonList.add(this.northButton = new GuiButton(2, left + 150, top + 14, 18, 18, "N")); + this.buttonList.add(this.southButton = new GuiButton(3, left + 150, top + 50, 18, 17, "S")); + this.buttonList.add(this.westButton = new GuiButton(4, left + 133, top + 32, 18, 18, "W")); + this.buttonList.add(this.eastButton = new GuiButton(5, left + 150, top + 32, 18, 18, "E")); + this.buttonList.add(this.incrementButton = new GuiButton(6, left + 97, top + 14, 18, 17, "^")); + this.buttonList.add(this.decrementButton = new GuiButton(7, left + 97, top + 50, 18, 17, "v")); disableDirectionalButton(inventory.currentActiveSlot); } @@ -109,8 +107,6 @@ public class GuiItemRoutingNode extends GuiContainer GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F); ResourceLocation soulForgeGuiTextures = new ResourceLocation(Constants.Mod.MODID + ":textures/gui/routingNode.png"); this.mc.getTextureManager().bindTexture(soulForgeGuiTextures); - int i = (this.width - this.xSize) / 2; - int j = (this.height - this.ySize) / 2; - this.drawTexturedModalRect(i, j, 0, 0, this.xSize, this.ySize); + this.drawTexturedModalRect(left, top, 0, 0, this.xSize, this.ySize); } } diff --git a/src/main/java/WayofTime/bloodmagic/tile/container/ContainerItemRoutingNode.java b/src/main/java/WayofTime/bloodmagic/tile/container/ContainerItemRoutingNode.java index d34d9177..e90c2370 100644 --- a/src/main/java/WayofTime/bloodmagic/tile/container/ContainerItemRoutingNode.java +++ b/src/main/java/WayofTime/bloodmagic/tile/container/ContainerItemRoutingNode.java @@ -65,7 +65,7 @@ public class ContainerItemRoutingNode extends Container { if (slotId >= 0) { - Slot slot = (Slot) this.inventorySlots.get(slotId); + Slot slot = this.inventorySlots.get(slotId); if (slot instanceof SlotGhostItem) //TODO: make the slot clicking work! { @@ -152,7 +152,7 @@ public class ContainerItemRoutingNode extends Container public ItemStack transferStackInSlot(EntityPlayer playerIn, int index) { ItemStack itemstack = null; - Slot slot = (Slot) this.inventorySlots.get(index); + Slot slot = this.inventorySlots.get(index); if (slot != null && slot.getHasStack()) { @@ -184,7 +184,7 @@ public class ContainerItemRoutingNode extends Container if (itemstack1.stackSize == 0) { - slot.putStack((ItemStack) null); + slot.putStack(null); } else { slot.onSlotChanged(); diff --git a/src/main/java/WayofTime/bloodmagic/tile/container/ContainerSoulForge.java b/src/main/java/WayofTime/bloodmagic/tile/container/ContainerSoulForge.java index 439cfa50..4fe6411d 100644 --- a/src/main/java/WayofTime/bloodmagic/tile/container/ContainerSoulForge.java +++ b/src/main/java/WayofTime/bloodmagic/tile/container/ContainerSoulForge.java @@ -42,7 +42,7 @@ public class ContainerSoulForge extends Container public ItemStack transferStackInSlot(EntityPlayer playerIn, int index) { ItemStack itemstack = null; - Slot slot = (Slot) this.inventorySlots.get(index); + Slot slot = this.inventorySlots.get(index); if (slot != null && slot.getHasStack()) { @@ -76,7 +76,7 @@ public class ContainerSoulForge extends Container if (itemstack1.stackSize == 0) { - slot.putStack((ItemStack) null); + slot.putStack(null); } else { slot.onSlotChanged(); diff --git a/src/main/resources/assets/bloodmagic/textures/gui/routingNode.png b/src/main/resources/assets/bloodmagic/textures/gui/routingNode.png index 50dd39e7cc76e454f7e84448c8ab526574c32c87..80fc4bcfad4589e1b8ed786bffa74400a6a5cb15 100644 GIT binary patch literal 1856 zcmb_ceKeDM9REEt49Rv{4Q<(u8)=oqEnBgb?GCrN(i9nbckexUDMJy@ike<(z2pLGlktlm z%hKG|8~|YHA6gl6d~~!3Qce z{^rUTSl7b|p}h2@TZDT8?>wHRcR6f1$6D_#-yN4@cGIlCs!REP*WqFt<_@1b;&9QO zE@$R&p@p|s>*$8dA(r!k*zC~oaGLI|SaW*LT|U2BB02e-9?#jL7c?EHnl&R#a$Y%G zKU_grHK1w1?UFkh5&LOj;-E@%Ub@WxxAv;*5B9(R&>wY#-FPGj*cnSD2?I6tIhVSk za2U*|5znCW?AYe1^yqnH-mQJ3E;>@#QR%%vvwc=m?p7S^a9l=we-sArCt32V7sYsl zg}+CSgn$Owv8V@#?3#f`qb}w3jt?`10CtJvbP^KDt<%8fCAtGh$2tI8IlK+b(kdQ# zK9M6l8qdzTyYyMIdKyPSvVp z2$rX8L+z%dOY3{~C3{7z(|XmC%H4ENbO)4r&Cb1^$e|hO4~=12OI}K$Rj^r+Ey6;O z-!`JxtCnWvT`{r{*l9hctjQV9E=!kLH7L2l9?Dp$Cjy#svDa}2+OS7P{x)@0Z(FoQ z_^A!r)ogAI99SyQq`9ly^DFJ7E`r3#9;C@8^i&b0Xpi4x-j+z*DX053zq8%$Kd!b5 zOdaefZhTlVT2F>4@!AvXSp}37npdN)I5kSsGEhhO_-9J)^PVgP7F!`4b`F8){hmwi z=B%~zhQQlo$9&nsS(l9g5)j8sUjuv5?+xxDl_S0&C_o1Q0jd+;P~oeF@*%7Or}$aE zB6~%agVqNTQTgy@$CYT)gxXe&T8A65PB`f?ctta6Mc^T&UZ{ggT#P!ph?0QJ%{@Xz z#6ER}J(2JvBRY!S3lWjTzW^GMy#t`2oUFo6(82fpVA2Nx$z5YE^#w>64R?N@*|Y?t zfud&{Q*lx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