diff --git a/graphics/workbench-gui.xcf b/graphics/workbench-gui.xcf index ac2b8f2..a3ada5c 100644 Binary files a/graphics/workbench-gui.xcf and b/graphics/workbench-gui.xcf differ diff --git a/src/java/mmm/tech/base/workbench/TBWBContainer.java b/src/java/mmm/tech/base/workbench/TBWBContainer.java index 86e5554..fb4ff6a 100644 --- a/src/java/mmm/tech/base/workbench/TBWBContainer.java +++ b/src/java/mmm/tech/base/workbench/TBWBContainer.java @@ -25,9 +25,9 @@ public class TBWBContainer this.world = tileEntity.getWorld( ); this.position = tileEntity.getPos( ); - this.addPlayerInventory( Slot::new , playerInv , 28 , 112 ); + this.addPlayerInventory( Slot::new , playerInv , 28 , 119 ); this.slotGroups.nextGroup( ); - this.addGrid( Slot::new , tileEntity.storage , 8 , 13 ); + this.addGrid( Slot::new , tileEntity.storage , 8 , 15 ); this.slotGroups.endGroups( ); } diff --git a/src/java/mmm/tech/base/workbench/TBWBGui.java b/src/java/mmm/tech/base/workbench/TBWBGui.java index ac5b91d..3f2856b 100644 --- a/src/java/mmm/tech/base/workbench/TBWBGui.java +++ b/src/java/mmm/tech/base/workbench/TBWBGui.java @@ -1,9 +1,15 @@ package mmm.tech.base.workbench; +import java.io.IOException; + import mmm.Mmm; import mmm.utils.gui.A_UGContainerScreen; +import mmm.utils.gui.UGArrowButton; +import net.minecraft.client.gui.GuiButton; +import net.minecraft.client.gui.GuiTextField; import net.minecraft.client.renderer.GlStateManager; +import net.minecraft.client.resources.I18n; import net.minecraft.entity.player.InventoryPlayer; import net.minecraft.util.ResourceLocation; import net.minecraftforge.fml.relauncher.Side; @@ -16,6 +22,10 @@ public class TBWBGui extends A_UGContainerScreen< TBWBContainer > { private static final ResourceLocation BACKGROUND = new ResourceLocation( Mmm.ID , "textures/gui/workbench.png" ); + private GuiTextField tfSearch; + private UGArrowButton bPrevious; + private UGArrowButton bNext; + private GuiButton bSetDefault; public TBWBGui( final InventoryPlayer inventoryPlayer , final TBWBTileEntity tileEntity ) @@ -23,7 +33,33 @@ public class TBWBGui super( new TBWBContainer( inventoryPlayer , tileEntity ) ); this.container.slotGroups.showAll( ); this.xSize = 216; - this.ySize = 194; + this.ySize = 200; + } + + + @Override + public void initGui( ) + { + super.initGui( ); + + final int x = ( this.width - this.xSize ) / 2; + final int y = ( this.height - this.ySize ) / 2; + + this.tfSearch = new GuiTextField( 0 , this.getFontRenderer( ) , 71 + x , 7 + y , 138 , 20 ); + this.tfSearch.setTextColor( 0xffffff ); + this.tfSearch.setDisabledTextColour( 0x7f7f7f ); + this.tfSearch.setEnableBackgroundDrawing( true ); + this.tfSearch.setMaxStringLength( 30 ); + this.tfSearch.setVisible( true ); + + this.bPrevious = new UGArrowButton( 1 , 71 + x , 50 + y , false ); + this.bNext = new UGArrowButton( 2 , 199 + x , 50 + y , true ); + this.bSetDefault = new GuiButton( 3 , 71 + x , 89 + y , 138 , 20 , + I18n.format( "container.mmm.workbench.default" ) ); + + this.buttonList.add( this.bPrevious ); + this.buttonList.add( this.bNext ); + this.buttonList.add( this.bSetDefault ); } @@ -35,6 +71,36 @@ public class TBWBGui GlStateManager.disableLighting( ); this.mc.getTextureManager( ).bindTexture( TBWBGui.BACKGROUND ); this.drawTexturedModalRect( this.guiLeft , this.guiTop , 0 , 0 , this.xSize , this.ySize ); + + GlStateManager.disableBlend( ); + this.tfSearch.drawTextBox( ); + } + + + @Override + protected void mouseClicked( final int mouseX , final int mouseY , final int mouseButton ) + throws IOException + { + super.mouseClicked( mouseX , mouseY , mouseButton ); + this.tfSearch.mouseClicked( mouseX , mouseY , mouseButton ); + } + + + @Override + protected void keyTyped( final char typedChar , final int keyCode ) + throws IOException + { + if ( !this.tfSearch.textboxKeyTyped( typedChar , keyCode ) ) { + super.keyTyped( typedChar , keyCode ); + } + } + + + @Override + protected void actionPerformed( final GuiButton button ) + throws IOException + { + // TODO } } diff --git a/src/resources/assets/mmm/lang/en_US.lang b/src/resources/assets/mmm/lang/en_US.lang index 5186c70..010e5f2 100644 --- a/src/resources/assets/mmm/lang/en_US.lang +++ b/src/resources/assets/mmm/lang/en_US.lang @@ -81,6 +81,7 @@ tile.mmm.materials.trap.swamp_pit.name=Silty Quicksand tile.mmm.tech.base.workbench.name=Workbench +container.mmm.workbench.default=Set Default Recipe tile.mmm.tech.base.alloy_furnace.inactive.name=Alloy Furnace container.mmm.alloy_furnace.contents=Furnace Contents diff --git a/src/resources/assets/mmm/textures/gui/workbench.png b/src/resources/assets/mmm/textures/gui/workbench.png index ae128ce..f55f657 100644 Binary files a/src/resources/assets/mmm/textures/gui/workbench.png and b/src/resources/assets/mmm/textures/gui/workbench.png differ