mirror of
https://github.com/GTNewHorizons/TinkersConstruct.git
synced 2026-11-20 20:22:36 +00:00
Format cleanup
This commit is contained in:
1 parent
c6ef343106
commit
fdcb651ef4
130 files changed
+4066
-3266
No files matched your search
@@ -16,10 +16,10 @@ import tconstruct.inventory.AdvancedDrawbridgeContainer;
|
||||
public class AdvDrawbridgeGui extends GuiContainer
|
||||
{
|
||||
public AdvancedDrawbridgeLogic logic;
|
||||
|
||||
|
||||
public boolean isGuiExpanded = false;
|
||||
public boolean containerNeglectMouse = false;
|
||||
|
||||
|
||||
public AdvDrawbridgeGui(EntityPlayer player, AdvancedDrawbridgeLogic frypan, World world, int x, int y, int z)
|
||||
{
|
||||
super(frypan.getGuiContainer(player.inventory, world, x, y, z));
|
||||
@@ -43,18 +43,24 @@ public class AdvDrawbridgeGui extends GuiContainer
|
||||
int cornerX = (width - xSize) / 2;
|
||||
int cornerY = (height - ySize) / 2;
|
||||
drawTexturedModalRect(cornerX, cornerY, 0, 0, xSize, ySize);
|
||||
if(!isGuiExpanded){
|
||||
drawTexturedModalRect(cornerX + 34, cornerY + 35, 238, 0, 18, 18);
|
||||
}else{
|
||||
for(int index = 0; index < 16; index++){
|
||||
drawTexturedModalRect(index < 8 ? cornerX + 9 + 20 * index : cornerX + 9 + 20 * (index - 8), cornerY + 34 + (int) Math.floor(index / 8) * 18 + (index < 8 ? 0 : 1), 238, 0, 18, 18);
|
||||
if(index != 15){
|
||||
drawTexturedModalRect(index < 8 ? cornerX + 26 + 20 * index : cornerX + 26 + 20 * (index - 8), cornerY + 34 + (int) Math.floor(index / 8) * 18 + (index < 8 ? 0 : 1) + 6, 253, 18, 3, 5);
|
||||
}
|
||||
}
|
||||
// drawTexturedModalRect(cornerX - 7, cornerY + 29, 0, 167, 10, 40);
|
||||
// drawTexturedModalRect(cornerX - 7, cornerY + 29, 0, 167, 10, 40);
|
||||
// drawTexturedModalRect(cornerX + 173, cornerY + 29, 10, 167, 10, 40);
|
||||
if (!isGuiExpanded)
|
||||
{
|
||||
drawTexturedModalRect(cornerX + 34, cornerY + 35, 238, 0, 18, 18);
|
||||
}
|
||||
else
|
||||
{
|
||||
for (int index = 0; index < 16; index++)
|
||||
{
|
||||
drawTexturedModalRect(index < 8 ? cornerX + 9 + 20 * index : cornerX + 9 + 20 * (index - 8), cornerY + 34 + (int) Math.floor(index / 8) * 18 + (index < 8 ? 0 : 1), 238, 0, 18, 18);
|
||||
if (index != 15)
|
||||
{
|
||||
drawTexturedModalRect(index < 8 ? cornerX + 26 + 20 * index : cornerX + 26 + 20 * (index - 8), cornerY + 34 + (int) Math.floor(index / 8) * 18 + (index < 8 ? 0 : 1) + 6, 253, 18,
|
||||
3, 5);
|
||||
}
|
||||
}
|
||||
// drawTexturedModalRect(cornerX - 7, cornerY + 29, 0, 167, 10, 40);
|
||||
// drawTexturedModalRect(cornerX - 7, cornerY + 29, 0, 167, 10, 40);
|
||||
// drawTexturedModalRect(cornerX + 173, cornerY + 29, 10, 167, 10, 40);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -86,32 +92,38 @@ public class AdvDrawbridgeGui extends GuiContainer
|
||||
if (logic.getPlacementDirection() == 4)
|
||||
button.enabled = false;
|
||||
this.buttonList.add(button);
|
||||
|
||||
|
||||
this.buttonList.add(new AdvDrawbridgeButton(5, this.width / 2 - 13, this.height / 2 - 52, this.width / 2 + 58, this.height / 2 - 79, 26, 26, "Inv"));
|
||||
}
|
||||
|
||||
public void setExpanded(boolean flag){
|
||||
this.isGuiExpanded = flag;
|
||||
this.containerNeglectMouse = true;
|
||||
Iterator<GuiButton> i1 = this.buttonList.iterator();
|
||||
while(i1.hasNext()){
|
||||
GuiButton b = i1.next();
|
||||
if(b instanceof AdvDrawbridgeButton){
|
||||
((AdvDrawbridgeButton)b).isGuiExpanded = flag;
|
||||
} else {
|
||||
b.drawButton = !flag;
|
||||
}
|
||||
}
|
||||
((AdvancedDrawbridgeContainer)this.inventorySlots).updateContainerSlots();
|
||||
public void setExpanded (boolean flag)
|
||||
{
|
||||
this.isGuiExpanded = flag;
|
||||
this.containerNeglectMouse = true;
|
||||
Iterator<GuiButton> i1 = this.buttonList.iterator();
|
||||
while (i1.hasNext())
|
||||
{
|
||||
GuiButton b = i1.next();
|
||||
if (b instanceof AdvDrawbridgeButton)
|
||||
{
|
||||
((AdvDrawbridgeButton) b).isGuiExpanded = flag;
|
||||
}
|
||||
else
|
||||
{
|
||||
b.drawButton = !flag;
|
||||
}
|
||||
}
|
||||
((AdvancedDrawbridgeContainer) this.inventorySlots).updateContainerSlots();
|
||||
}
|
||||
|
||||
|
||||
protected void actionPerformed (GuiButton button)
|
||||
{
|
||||
if(button.id == 5){
|
||||
setExpanded(!isGuiExpanded);
|
||||
return;
|
||||
}
|
||||
|
||||
if (button.id == 5)
|
||||
{
|
||||
setExpanded(!isGuiExpanded);
|
||||
return;
|
||||
}
|
||||
|
||||
for (Object o : buttonList)
|
||||
{
|
||||
GuiButton b = (GuiButton) o;
|
||||
@@ -148,10 +160,11 @@ public class AdvDrawbridgeGui extends GuiContainer
|
||||
|
||||
PacketDispatcher.sendPacketToServer(packet);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void updateScreen(){
|
||||
super.updateScreen();
|
||||
this.containerNeglectMouse = false;
|
||||
public void updateScreen ()
|
||||
{
|
||||
super.updateScreen();
|
||||
this.containerNeglectMouse = false;
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user