Large chunk on the pattern terminal.

This commit is contained in:
AlgorithmX2
2014-04-09 23:51:08 -05:00
parent 01c76a6870
commit d84be03027
11 changed files with 206 additions and 45 deletions
+14 -9
View File
@@ -483,16 +483,21 @@ public abstract class AEBaseGui extends GuiContainer
if ( o instanceof OptionalSlotFake )
{
OptionalSlotFake fs = (OptionalSlotFake) o;
if ( fs.isEnabled() )
this.drawTexturedModalRect( ox + fs.xDisplayPosition - 1, oy + fs.yDisplayPosition - 1, fs.srcX - 1, fs.srcY - 1, 18, 18 );
else
if ( fs.renderDisabled() )
{
GL11.glPushAttrib( GL11.GL_ALL_ATTRIB_BITS );
GL11.glColor4f( 1.0F, 1.0F, 1.0F, 0.4F );
GL11.glEnable( GL11.GL_BLEND );
this.drawTexturedModalRect( ox + fs.xDisplayPosition - 1, oy + fs.yDisplayPosition - 1, fs.srcX - 1, fs.srcY - 1, 18, 18 );
GL11.glColor4f( 1.0F, 1.0F, 1.0F, 1.0F );
GL11.glPopAttrib();
if ( fs.isEnabled() )
{
this.drawTexturedModalRect( ox + fs.xDisplayPosition - 1, oy + fs.yDisplayPosition - 1, fs.srcX - 1, fs.srcY - 1, 18, 18 );
}
else
{
GL11.glPushAttrib( GL11.GL_ALL_ATTRIB_BITS );
GL11.glColor4f( 1.0F, 1.0F, 1.0F, 0.4F );
GL11.glEnable( GL11.GL_BLEND );
this.drawTexturedModalRect( ox + fs.xDisplayPosition - 1, oy + fs.yDisplayPosition - 1, fs.srcX - 1, fs.srcY - 1, 18, 18 );
GL11.glColor4f( 1.0F, 1.0F, 1.0F, 1.0F );
GL11.glPopAttrib();
}
}
}
}
+48 -6
View File
@@ -1,27 +1,42 @@
package appeng.client.gui.implementations;
import java.io.IOException;
import net.minecraft.client.gui.GuiButton;
import net.minecraft.entity.player.InventoryPlayer;
import net.minecraft.init.Blocks;
import net.minecraft.item.ItemStack;
import appeng.api.config.ActionItems;
import appeng.api.config.Settings;
import appeng.api.storage.ITerminalHost;
import appeng.client.gui.widgets.GuiImgButton;
import appeng.client.gui.widgets.GuiTabButton;
import appeng.container.implementations.ContainerPatternTerm;
import appeng.core.localization.GuiText;
import appeng.core.sync.network.NetworkHandler;
import appeng.core.sync.packets.PacketValueConfig;
public class GuiPatternTerm extends GuiMEMonitorable
{
GuiImgButton exttractPatternBtn;
ContainerPatternTerm container;
GuiTabButton tabCraftButton;
GuiTabButton tabProcessButton;
GuiImgButton substitutionsBtn;
GuiImgButton encodeBtn;
@Override
public void initGui()
{
super.initGui();
buttonList.add( exttractPatternBtn = new GuiImgButton( this.guiLeft + 6, this.guiTop + this.ySize - 161, Settings.ACTIONS, ActionItems.PULL ) );
buttonList.add( substitutionsBtn = new GuiImgButton( this.guiLeft + 118, this.guiTop + this.ySize - 161, Settings.ACTIONS, ActionItems.CLOSE ) );
exttractPatternBtn.halfSize = true;
buttonList.add( tabCraftButton = new GuiTabButton( this.guiLeft + 173, this.guiTop + this.ySize - 179, new ItemStack( Blocks.crafting_table ),
GuiText.CraftingPattern.getLocal(), itemRender ) );
buttonList.add( tabProcessButton = new GuiTabButton( this.guiLeft + 173, this.guiTop + this.ySize - 179, new ItemStack( Blocks.furnace ),
GuiText.ProcessingPattern.getLocal(), itemRender ) );
buttonList.add( substitutionsBtn = new GuiImgButton( this.guiLeft + 74, this.guiTop + this.ySize - 163, Settings.ACTIONS, ActionItems.SUBSTITUTION ) );
buttonList.add( encodeBtn = new GuiImgButton( this.guiLeft + 147, this.guiTop + this.ySize - 144, Settings.ACTIONS, ActionItems.ENCODE ) );
substitutionsBtn.halfSize = true;
}
@Override
@@ -29,9 +44,22 @@ public class GuiPatternTerm extends GuiMEMonitorable
{
super.actionPerformed( btn );
if ( exttractPatternBtn == btn )
try
{
if ( tabCraftButton == btn || tabProcessButton == btn )
{
NetworkHandler.instance.sendToServer( new PacketValueConfig( "PatternTerminal.CraftMode", tabProcessButton == btn ? "0" : "1" ) );
}
if ( encodeBtn == btn )
{
NetworkHandler.instance.sendToServer( new PacketValueConfig( "PatternTerminal.Encode", "1" ) );
}
}
catch (IOException e)
{
// TODO Auto-generated catch block
e.printStackTrace();
}
if ( substitutionsBtn == btn )
@@ -42,17 +70,31 @@ public class GuiPatternTerm extends GuiMEMonitorable
public GuiPatternTerm(InventoryPlayer inventoryPlayer, ITerminalHost te) {
super( inventoryPlayer, te, new ContainerPatternTerm( inventoryPlayer, te ) );
container = (ContainerPatternTerm) this.inventorySlots;
reservedSpace = 85;
}
protected String getBackground()
{
return "guis/pattern.png";
if ( container.craftingMode )
return "guis/pattern.png";
return "guis/pattern2.png";
}
@Override
public void drawFG(int offsetX, int offsetY, int mouseX, int mouseY)
{
if ( !container.craftingMode )
{
tabCraftButton.visible = true;
tabProcessButton.visible = false;
}
else
{
tabCraftButton.visible = false;
tabProcessButton.visible = true;
}
super.drawFG( offsetX, offsetY, mouseX, mouseY );
fontRendererObj.drawString( GuiText.PatternTerminal.getLocal(), 8, ySize - 96 + 2 - reservedSpace, 4210752 );
}
+2 -1
View File
@@ -156,7 +156,8 @@ public class GuiImgButton extends GuiButton implements ITooltip
registerApp( 66, Settings.ACTIONS, ActionItems.WRENCH, ButtonToolTips.PartitionStorage, ButtonToolTips.PartitionStorageHint );
registerApp( 6, Settings.ACTIONS, ActionItems.CLOSE, ButtonToolTips.Clear, ButtonToolTips.ClearSettings );
registerApp( 7, Settings.ACTIONS, ActionItems.PULL, ButtonToolTips.Pull, ButtonToolTips.PullDescription );
registerApp( 8, Settings.ACTIONS, ActionItems.ENCODE, ButtonToolTips.Encode, ButtonToolTips.EncodeDescription );
registerApp( 4 + 3 * 16, Settings.ACTIONS, ActionItems.SUBSTITUTION, ButtonToolTips.Substitutions, ButtonToolTips.SubstitutionsDesc );
registerApp( 16, Settings.VIEW_MODE, ViewItems.STORED, ButtonToolTips.View, ButtonToolTips.StoredItems );
registerApp( 18, Settings.VIEW_MODE, ViewItems.ALL, ButtonToolTips.View, ButtonToolTips.StoredCraftable );