Basic reformat, hit once, hope never again
This commit is contained in:
@@ -18,6 +18,7 @@
|
||||
|
||||
package appeng.client.gui.implementations;
|
||||
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
import net.minecraft.client.gui.GuiButton;
|
||||
@@ -36,6 +37,7 @@ import appeng.core.localization.GuiText;
|
||||
import appeng.core.sync.network.NetworkHandler;
|
||||
import appeng.core.sync.packets.PacketValueConfig;
|
||||
|
||||
|
||||
public class GuiPatternTerm extends GuiMEMonitorable
|
||||
{
|
||||
|
||||
@@ -47,50 +49,37 @@ public class GuiPatternTerm extends GuiMEMonitorable
|
||||
GuiImgButton encodeBtn;
|
||||
GuiImgButton clearBtn;
|
||||
|
||||
@Override
|
||||
public void initGui()
|
||||
public GuiPatternTerm( InventoryPlayer inventoryPlayer, ITerminalHost te )
|
||||
{
|
||||
super.initGui();
|
||||
this.buttonList.add( this.tabCraftButton = new GuiTabButton( this.guiLeft + 173, this.guiTop + this.ySize - 177, new ItemStack( Blocks.crafting_table ),
|
||||
GuiText.CraftingPattern.getLocal(), itemRender ) );
|
||||
this.buttonList.add( this.tabProcessButton = new GuiTabButton( this.guiLeft + 173, this.guiTop + this.ySize - 177, new ItemStack( Blocks.furnace ),
|
||||
GuiText.ProcessingPattern.getLocal(), itemRender ) );
|
||||
|
||||
// buttonList.add( substitutionsBtn = new GuiImgButton( this.guiLeft + 84, this.guiTop + this.ySize - 163,
|
||||
// Settings.ACTIONS, ActionItems.SUBSTITUTION ) );
|
||||
// substitutionsBtn.halfSize = true;
|
||||
|
||||
this.buttonList.add( this.clearBtn = new GuiImgButton( this.guiLeft + 74, this.guiTop + this.ySize - 163, Settings.ACTIONS, ActionItems.CLOSE ) );
|
||||
this.clearBtn.halfSize = true;
|
||||
|
||||
this.buttonList.add( this.encodeBtn = new GuiImgButton( this.guiLeft + 147, this.guiTop + this.ySize - 142, Settings.ACTIONS, ActionItems.ENCODE ) );
|
||||
super( inventoryPlayer, te, new ContainerPatternTerm( inventoryPlayer, te ) );
|
||||
this.container = (ContainerPatternTerm) this.inventorySlots;
|
||||
this.reservedSpace = 81;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void actionPerformed(GuiButton btn)
|
||||
protected void actionPerformed( GuiButton btn )
|
||||
{
|
||||
super.actionPerformed( btn );
|
||||
|
||||
try
|
||||
{
|
||||
|
||||
if ( this.tabCraftButton == btn || this.tabProcessButton == btn )
|
||||
if( this.tabCraftButton == btn || this.tabProcessButton == btn )
|
||||
{
|
||||
NetworkHandler.instance.sendToServer( new PacketValueConfig( "PatternTerminal.CraftMode", this.tabProcessButton == btn ? "1" : "0" ) );
|
||||
}
|
||||
|
||||
if ( this.encodeBtn == btn )
|
||||
if( this.encodeBtn == btn )
|
||||
{
|
||||
NetworkHandler.instance.sendToServer( new PacketValueConfig( "PatternTerminal.Encode", "1" ) );
|
||||
}
|
||||
|
||||
if ( this.clearBtn == btn )
|
||||
if( this.clearBtn == btn )
|
||||
{
|
||||
NetworkHandler.instance.sendToServer( new PacketValueConfig( "PatternTerminal.Clear", "1" ) );
|
||||
}
|
||||
|
||||
}
|
||||
catch (IOException e)
|
||||
catch( IOException e )
|
||||
{
|
||||
// TODO Auto-generated catch block
|
||||
e.printStackTrace();
|
||||
@@ -103,32 +92,26 @@ public class GuiPatternTerm extends GuiMEMonitorable
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void repositionSlot(AppEngSlot s)
|
||||
public void initGui()
|
||||
{
|
||||
if ( s.isPlayerSide() )
|
||||
s.yDisplayPosition = s.defY + this.ySize - 78 - 5;
|
||||
else
|
||||
s.yDisplayPosition = s.defY + this.ySize - 78 - 3;
|
||||
}
|
||||
super.initGui();
|
||||
this.buttonList.add( this.tabCraftButton = new GuiTabButton( this.guiLeft + 173, this.guiTop + this.ySize - 177, new ItemStack( Blocks.crafting_table ), GuiText.CraftingPattern.getLocal(), itemRender ) );
|
||||
this.buttonList.add( this.tabProcessButton = new GuiTabButton( this.guiLeft + 173, this.guiTop + this.ySize - 177, new ItemStack( Blocks.furnace ), GuiText.ProcessingPattern.getLocal(), itemRender ) );
|
||||
|
||||
public GuiPatternTerm(InventoryPlayer inventoryPlayer, ITerminalHost te) {
|
||||
super( inventoryPlayer, te, new ContainerPatternTerm( inventoryPlayer, te ) );
|
||||
this.container = (ContainerPatternTerm) this.inventorySlots;
|
||||
this.reservedSpace = 81;
|
||||
// buttonList.add( substitutionsBtn = new GuiImgButton( this.guiLeft + 84, this.guiTop + this.ySize - 163,
|
||||
// Settings.ACTIONS, ActionItems.SUBSTITUTION ) );
|
||||
// substitutionsBtn.halfSize = true;
|
||||
|
||||
this.buttonList.add( this.clearBtn = new GuiImgButton( this.guiLeft + 74, this.guiTop + this.ySize - 163, Settings.ACTIONS, ActionItems.CLOSE ) );
|
||||
this.clearBtn.halfSize = true;
|
||||
|
||||
this.buttonList.add( this.encodeBtn = new GuiImgButton( this.guiLeft + 147, this.guiTop + this.ySize - 142, Settings.ACTIONS, ActionItems.ENCODE ) );
|
||||
}
|
||||
|
||||
@Override
|
||||
protected String getBackground()
|
||||
public void drawFG( int offsetX, int offsetY, int mouseX, int mouseY )
|
||||
{
|
||||
if ( this.container.craftingMode )
|
||||
return "guis/pattern.png";
|
||||
return "guis/pattern2.png";
|
||||
}
|
||||
|
||||
@Override
|
||||
public void drawFG(int offsetX, int offsetY, int mouseX, int mouseY)
|
||||
{
|
||||
if ( !this.container.craftingMode )
|
||||
if( !this.container.craftingMode )
|
||||
{
|
||||
this.tabCraftButton.visible = false;
|
||||
this.tabProcessButton.visible = true;
|
||||
@@ -143,4 +126,20 @@ public class GuiPatternTerm extends GuiMEMonitorable
|
||||
this.fontRendererObj.drawString( GuiText.PatternTerminal.getLocal(), 8, this.ySize - 96 + 2 - this.reservedSpace, 4210752 );
|
||||
}
|
||||
|
||||
@Override
|
||||
protected String getBackground()
|
||||
{
|
||||
if( this.container.craftingMode )
|
||||
return "guis/pattern.png";
|
||||
return "guis/pattern2.png";
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void repositionSlot( AppEngSlot s )
|
||||
{
|
||||
if( s.isPlayerSide() )
|
||||
s.yDisplayPosition = s.defY + this.ySize - 78 - 5;
|
||||
else
|
||||
s.yDisplayPosition = s.defY + this.ySize - 78 - 3;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user