From e0c7157a88d59bf0345755541a9e41278ee10a85 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Emmanuel=20Beno=C3=AEt?= Date: Tue, 28 Jun 2016 11:42:00 +0200 Subject: [PATCH] Common GUI code for some stuff + tabbed container screen + tabs + arrow buttons + Rewritten alloy furnace GUI to use the new stuff --- graphics/alloy-furnace-gui-1.xcf | Bin 44111 -> 40582 bytes graphics/alloy-furnace-gui-2.xcf | Bin 31640 -> 28406 bytes graphics/gui-common.xcf | Bin 0 -> 4420 bytes .../mmm/tech/base/TBAlloyFurnaceBlock.java | 2 +- .../tech/base/TBAlloyFurnaceContainer.java | 46 +- src/java/mmm/tech/base/TBAlloyFurnaceGui.java | 483 +++++++----------- .../tech/base/TBAlloyFurnaceTileEntity.java | 3 +- src/java/mmm/tech/base/TechBase.java | 4 +- src/java/mmm/utils/UContainers.java | 44 -- .../mmm/utils/gui/A_UGContainerScreen.java | 54 ++ src/java/mmm/utils/gui/A_UGTab.java | 155 ++++++ .../utils/gui/A_UGTabbedContainerScreen.java | 217 ++++++++ src/java/mmm/utils/gui/GUIUtils.java | 33 ++ src/java/mmm/utils/gui/UGArrowButton.java | 51 ++ src/java/mmm/utils/gui/UGContainer.java | 62 +++ .../USDisplay.java => gui/UGSlotDisplay.java} | 10 +- .../USFuel.java => gui/UGSlotFuel.java} | 6 +- .../UGSlotGroups.java} | 15 +- .../USOutput.java => gui/UGSlotOutput.java} | 8 +- .../mmm/textures/gui/alloy_furnace_1.png | Bin 2397 -> 2277 bytes .../mmm/textures/gui/alloy_furnace_2.png | Bin 2070 -> 1025 bytes .../assets/mmm/textures/gui/gui-common.png | Bin 0 -> 1523 bytes 22 files changed, 796 insertions(+), 397 deletions(-) create mode 100644 graphics/gui-common.xcf delete mode 100644 src/java/mmm/utils/UContainers.java create mode 100644 src/java/mmm/utils/gui/A_UGContainerScreen.java create mode 100644 src/java/mmm/utils/gui/A_UGTab.java create mode 100644 src/java/mmm/utils/gui/A_UGTabbedContainerScreen.java create mode 100644 src/java/mmm/utils/gui/GUIUtils.java create mode 100644 src/java/mmm/utils/gui/UGArrowButton.java create mode 100644 src/java/mmm/utils/gui/UGContainer.java rename src/java/mmm/utils/{slots/USDisplay.java => gui/UGSlotDisplay.java} (57%) rename src/java/mmm/utils/{slots/USFuel.java => gui/UGSlotFuel.java} (72%) rename src/java/mmm/utils/{slots/USVisibilityController.java => gui/UGSlotGroups.java} (82%) rename src/java/mmm/utils/{slots/USOutput.java => gui/UGSlotOutput.java} (88%) create mode 100644 src/resources/assets/mmm/textures/gui/gui-common.png diff --git a/graphics/alloy-furnace-gui-1.xcf b/graphics/alloy-furnace-gui-1.xcf index b1e253c5ffc46b9dd79481ff192297243ab6c80f..96351a860fe369b6fd4e6c7f98a9de5cf5d7376b 100644 GIT binary patch delta 797 zcmX?qgQ;yV(*!%lkd5}%j5f0w7+4G$7}yvY7`WIN7`QJnFz^G}0v{LpV+Z1hd5FQv8~vWowSOp#)+F$Dul|A+Sxue1;>%KqDmZO zmnKlW!J;p{q$zz6qJ&UEp)L(1Pl6WH{IiSw?Yj~+FH`xoqlKT+}*p< z)&K5lCC!Do_sp3yKj&x8%$_^DJ2w96>pgE=zS47Ld}5S{gh_Z1-NzZm96)M%?xW8h z<^=eDqz0smNSy{|x`Uv95YLV=G}|}+>ZP&KzOl*iSAgP{1s%V3{mqHdo@-Yp#$V}8 z9ltVm`Rc^g$)4l-(Kk8v@}-{B{ipR613YeudQtV|n5toU&&mK-edF5emoAULHrDfa z*cXs*#vu)^?}x9AU+)=z?Q&-H8rQ#i<;u0u>%{?b?d7NdQ(l$jU@q}Hi10j7;tWw^ z6H$vpwC^&+`7F_)FNhBRl<2`vh#vZVSOd=vlUUXrFI>8Iee{){kxOrmPWC+VB$J^H zeI;>c{U{`~tzoXyY+yWy^~5xMrI13nB?9k@z^xIu9Wb~1DH30eNMZe`ZRkP_>jwr1 z#}8U3TaI(y;e0QNp%gho;#OgZ5&-hIR8Hjbw}xOm&X9jgsa!*D0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$o)2Y+8`jO}^<= z?OKpkr+TzmrE|?_;R;EZ)`E;tr|FVS3$h7@M0ufXhAK~f|5xxnI!Q7EvSSijyxNIR?F{#N)*ruMQvJ8 z6QvSKxvg3N8d^wB2yWE^@T3Ku-=+o1pC&qN(*p9RraGGz)CACpL~&Lv(7_MU8x&{L zf*Qpb*m zpxMoS0bI(1jIDg0`FYW}0IqyJJGZh;?;o+->Xh!S3gZDgV9?I3173#k)$0FhJXiQf z2)8bMpt3&DxddB|x+Syoyn^F7HGCC?E#dR5tdzVfUvpwwqQ8Ux0cWo{dG+*S this.addSlotToContainer( new Slot( playerInv , i , x , y ) ) , // - 8 , 112 ); + this.addPlayerInventory( Slot::new , playerInv , 8 , 112 ); + this.slotGroups.nextGroup( ); - this.visibilityController.startGroup( ); this.input = tileEntity.input; - UContainers.addGrid( // - ( i , x , y ) -> this.addSlotToContainer( new Slot( this.input , i , x , y ) ) , // + this.addGrid( Slot::new , this.input , // this.input.width , this.input.height , 0 , 12 , 8 ); this.fuel = tileEntity.fuel; - UContainers.addGrid( // - ( i , x , y ) -> this.addSlotToContainer( new USFuel( this.fuel , i , x , y ) ) , // + this.addGrid( UGSlotFuel::new , this.fuel , // this.fuel.width , this.fuel.height , 0 , 80 , 62 ); this.output = tileEntity.output; - UContainers.addGrid( // - ( i , x , y ) -> { - this.addSlotToContainer( new USOutput( playerInv.player , this.output , i , x , y ) ); - } , this.output.width , this.output.height , 0 , 130 , 8 ); + this.addGrid( // + ( inv , i , x , y ) -> new UGSlotOutput( playerInv.player , inv , i , x , y ) , // + this.output , this.output.width , this.output.height , 0 , 130 , 8 ); this.recipe = new UInventoryDisplay( "Recipe" , 7 ); - this.visibilityController.startGroup( ); - UContainers.addGrid( // - ( i , x , y ) -> this.addSlotToContainer( new USDisplay( this.recipe , i , x , y ) ) , // + this.slotGroups.nextGroup( ); + this.addGrid( UGSlotDisplay::new , this.recipe , // 3 , 2 , 0 , 25 , 37 , 8 , 8 ); - this.addSlotToContainer( new USDisplay( this.recipe , 6 , 131 , 49 ) ); + this.addSlotToContainer( new UGSlotDisplay( this.recipe , 6 , 131 , 49 ) ); - this.visibilityController.finalizeGroups( ); - this.visibilityController.hideGroup( 2 ); + this.slotGroups.endGroups( ); + this.slotGroups.showGroup( 0 ); // FIXME remove this + this.slotGroups.showGroup( 1 ); } diff --git a/src/java/mmm/tech/base/TBAlloyFurnaceGui.java b/src/java/mmm/tech/base/TBAlloyFurnaceGui.java index 7705b98..058c9ca 100644 --- a/src/java/mmm/tech/base/TBAlloyFurnaceGui.java +++ b/src/java/mmm/tech/base/TBAlloyFurnaceGui.java @@ -1,25 +1,21 @@ package mmm.tech.base; -import java.io.IOException; import java.util.ArrayList; -import java.util.List; - -import com.google.common.collect.Lists; import mmm.Mmm; import mmm.materials.MAlloyRecipe; import mmm.utils.URegistry; -import net.minecraft.client.Minecraft; +import mmm.utils.gui.A_UGTab; +import mmm.utils.gui.A_UGTabbedContainerScreen; +import mmm.utils.gui.UGArrowButton; import net.minecraft.client.gui.GuiButton; import net.minecraft.client.gui.GuiTextField; -import net.minecraft.client.gui.inventory.GuiContainer; import net.minecraft.client.renderer.GlStateManager; import net.minecraft.client.resources.I18n; import net.minecraft.entity.player.InventoryPlayer; import net.minecraft.tileentity.TileEntity; import net.minecraft.util.ResourceLocation; -import net.minecraft.util.text.TextFormatting; import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.fml.relauncher.SideOnly; @@ -27,94 +23,190 @@ import net.minecraftforge.fml.relauncher.SideOnly; @SideOnly( Side.CLIENT ) public class TBAlloyFurnaceGui - extends GuiContainer + extends A_UGTabbedContainerScreen< TBAlloyFurnaceContainer > { - @SideOnly( Side.CLIENT ) - private static enum Tab { - MAIN( 191 , 0 , 1 , "container.mmm.alloy_furnace.contents" ) , - RECIPE( 207 , 0 , 2 , "container.mmm.alloy_furnace.recipe" ) , - CONFIG( 223 , 0 , 2 , "gui.mmm.configure" ); - - public final int iconX; - public final int iconY; - public final int slotGroup; - public final String tooltip; - - - private Tab( final int iconX , final int iconY , final int slotGroup , final String tooltip ) - { - this.iconX = iconX; - this.iconY = iconY; - this.slotGroup = slotGroup; - this.tooltip = tooltip; - } - } - - @SideOnly( Side.CLIENT ) - private static class ArrowButton - extends GuiButton - { - private final boolean forward; - - - public ArrowButton( final int buttonID , final int x , final int y , final boolean forward ) - { - super( buttonID , x , y , 12 , 19 , "" ); - this.forward = forward; - } - - - @Override - public void drawButton( final Minecraft mc , final int mouseX , final int mouseY ) - { - if ( this.visible ) { - mc.getTextureManager( ).bindTexture( TBAlloyFurnaceGui.TEXTURES[ 1 ] ); - GlStateManager.color( 1f , 1f , 1f , 1f ); - - int texX = 176; - if ( !this.enabled ) { - texX += this.width * 2; - } else if ( mouseX >= this.xPosition && mouseY >= this.yPosition && mouseX < this.xPosition + this.width - && mouseY < this.yPosition + this.height ) { - texX += this.width; - } - - int texY = 0; - if ( !this.forward ) { - texY += this.height; - } - - this.drawTexturedModalRect( this.xPosition , this.yPosition , texX , texY , this.width , this.height ); - } - } - } - private static final ResourceLocation TEXTURES[] = { new ResourceLocation( Mmm.ID , "textures/gui/alloy_furnace_1.png" ) , new ResourceLocation( Mmm.ID , "textures/gui/alloy_furnace_2.png" ) , new ResourceLocation( Mmm.ID , "textures/gui/alloy_furnace_3.png" ) , }; - private static final TBAlloyFurnaceGui.Tab TABS[] = TBAlloyFurnaceGui.Tab.values( ); + @SideOnly( Side.CLIENT ) + private static class MainTab + extends A_UGTab + { - private static final int TAB_WIDTH = 26; - private static final int TAB_HEIGHT = 26; - private static final int TAB_BORDER = 4; - private static final int TABS_TEXTURE_X = 176; - private static final int TABS_TEXTURE_Y = 45; - private static final int TAB_ICON_X = 5; - private static final int TAB_ICON_Y = 5; - private static final int TAB_ICON_WIDTH = 16; - private static final int TAB_ICON_HEIGHT = 16; + private MainTab( ) + { + super( ); + this.setBackground( TBAlloyFurnaceGui.TEXTURES[ 0 ] ) // + .setHeight( 194 ) // + .setIconPosition( 191 , 0 )// + .setSlotGroups( 0 , 1 ) // + .setTooltip( "container.mmm.alloy_furnace.contents" ); + } - private final TBAlloyFurnaceContainer container; - private TBAlloyFurnaceGui.Tab selectedTab = Tab.MAIN; + @Override + public void drawBackground( final float partialTicks , final int mouseX , final int mouseY ) + { + super.drawBackground( partialTicks , mouseX , mouseY ); + + final int x = ( this.parent.width - this.parent.getXSize( ) ) / 2; + final int y = ( this.parent.height - this.height ) / 2; + + final TBAlloyFurnaceContainer container = (TBAlloyFurnaceContainer) this.parent.container; + final TileEntity atPos = container.world.getTileEntity( container.position ); + if ( atPos instanceof TBAlloyFurnaceTileEntity ) { + final TBAlloyFurnaceTileEntity te = (TBAlloyFurnaceTileEntity) atPos; + // Burn + if ( te.isBurning( ) ) { + final int burn = te.getBurnProgress( 13 ); + this.drawTexturedModalRect( x + 89 , y + 38 + 13 - burn , 176 , 28 - burn , 14 , burn + 1 ); + } + + // Alloying progress + if ( te.isAlloying( ) ) { + final int alloy = te.getAlloyingProgress( 47 ); + this.drawTexturedModalRect( x + 73 , y + 17 , 176 , 29 , alloy + 1 , 16 ); + } + } + } + + } + + private static class RecipeTab + extends A_UGTab + { + + private UGArrowButton bPrevious; + private UGArrowButton bNext; + private GuiButton bConfirm; + private GuiTextField tfSearch; + + + private RecipeTab( ) + { + super( ); + this.setBackground( TBAlloyFurnaceGui.TEXTURES[ 1 ] ) // + .setHeight( 194 ) // + .setIconPosition( 207 , 0 )// + .setSlotGroups( 0 , 2 ) // + .setTooltip( "container.mmm.alloy_furnace.recipe" ); + } + + + @Override + public void initGui( final int x , final int y ) + { + super.initGui( x , y ); + + this.bPrevious = new UGArrowButton( 1 , 8 + x , 47 + y , false ); + this.bNext = new UGArrowButton( 2 , 156 + x , 47 + y , true ); + this.bConfirm = new GuiButton( 3 , 24 + x , 84 + y , 128 , 20 , + I18n.format( "container.mmm.alloy_furnace.select" ) ); + + this.tfSearch = new GuiTextField( 4 , this.parent.getFontRenderer( ) , 24 + x , 9 + y , 128 , 20 ); + this.tfSearch.setTextColor( 0xffffff ); + this.tfSearch.setDisabledTextColour( 0x7f7f7f ); + this.tfSearch.setEnableBackgroundDrawing( true ); + this.tfSearch.setMaxStringLength( 30 ); + + this.bPrevious.visible = this.bNext.visible = this.bConfirm.visible = false; + this.tfSearch.setVisible( false ); + + this.buttons.add( this.bNext ); + this.buttons.add( this.bPrevious ); + this.buttons.add( this.bConfirm ); + + this.enableButtons( ); + } + + + @Override + public void drawBackground( final float partialTicks , final int mouseX , final int mouseY ) + { + super.drawBackground( partialTicks , mouseX , mouseY ); + GlStateManager.disableBlend( ); + this.tfSearch.drawTextBox( ); + } + + + @Override + public void onSelected( ) + { + super.onSelected( ); + this.tfSearch.setVisible( true ); + this.enableButtons( ); + } + + + @Override + public void onDeselected( ) + { + super.onDeselected( ); + this.tfSearch.setVisible( false ); + } + + + @Override + public void onMouseClicked( final int mouseX , final int mouseY , final int mouseButton ) + { + this.tfSearch.mouseClicked( mouseX , mouseY , mouseButton ); + } + + + @Override + public boolean onKeyTyped( final char typedChar , final int keyCode ) + { + if ( this.tfSearch.textboxKeyTyped( typedChar , keyCode ) ) { + ( (TBAlloyFurnaceGui) this.parent ).handleFiltering( this.tfSearch.getText( ) ); + return true; + } + return false; + } + + + @Override + public boolean onActionPerformed( final GuiButton button ) + { + final TBAlloyFurnaceGui gui = (TBAlloyFurnaceGui) this.parent; + if ( button == this.bNext ) { + gui.setRecipe( gui.currentRecipe + 1 ); + } else if ( button == this.bPrevious ) { + gui.setRecipe( gui.currentRecipe - 1 ); + } else if ( button == this.bConfirm ) { + final MAlloyRecipe recipe = gui.recipes.get( gui.currentRecipe ); + URegistry.network.sendToServer( // + new TBAlloyFurnaceMessage( gui.container.position , recipe.name , true ) ); + gui.container.tileEntity.recipe = recipe; + } else { + return false; + } + + this.enableButtons( ); + return true; + } + + + private void enableButtons( ) + { + if ( this.bNext == null ) { + return; + } + + final TBAlloyFurnaceGui gui = (TBAlloyFurnaceGui) this.parent; + if ( gui.recipes.isEmpty( ) ) { + this.bNext.enabled = this.bPrevious.enabled = this.bConfirm.enabled = false; + } else { + this.bNext.enabled = gui.currentRecipe < gui.recipes.size( ) - 1; + this.bPrevious.enabled = gui.currentRecipe > 0; + this.bConfirm.enabled = gui.currentRecipe != gui.getRecipeIndex( gui.container.tileEntity.recipe ); + } + } + + } - private ArrowButton bPrevious; - private ArrowButton bNext; - private GuiButton bConfirm; - private GuiTextField tfSearch; private ArrayList< MAlloyRecipe > recipes; private int currentRecipe = 0; private String searchString = ""; @@ -122,86 +214,14 @@ public class TBAlloyFurnaceGui public TBAlloyFurnaceGui( final InventoryPlayer inventoryPlayer , final TBAlloyFurnaceTileEntity tileEntity ) { - super( new TBAlloyFurnaceContainer( inventoryPlayer , tileEntity ) ); + super( new TBAlloyFurnaceContainer( inventoryPlayer , tileEntity ) , TBAlloyFurnaceGui.TEXTURES[ 0 ] , + new MainTab( ) , new RecipeTab( ) ); this.xSize = 176; - this.ySize = 194; - - this.container = (TBAlloyFurnaceContainer) this.inventorySlots; - for ( final TBAlloyFurnaceGui.Tab tab : TBAlloyFurnaceGui.Tab.values( ) ) { - if ( tab != this.selectedTab ) { - this.container.visibilityController.hideGroup( tab.slotGroup ); - } - } - this.recipes = MAlloyRecipe.REGISTRY.getRecipes( ); this.setRecipe( this.getRecipeIndex( tileEntity.recipe ) ); } - @Override - public void initGui( ) - { - super.initGui( ); - - final int x = ( this.width - this.xSize ) / 2; - final int y = ( this.height - this.ySize ) / 2; - - this.bPrevious = new ArrowButton( 1 , 8 + x , 47 + y , false ); - this.bNext = new ArrowButton( 2 , 156 + x , 47 + y , true ); - this.bConfirm = new GuiButton( 3 , 24 + x , 84 + y , 128 , 20 , - I18n.format( "container.mmm.alloy_furnace.select" ) ); - - this.tfSearch = new GuiTextField( 4 , this.fontRendererObj , 24 + x , 9 + y , 128 , 20 ); - this.tfSearch.setTextColor( 0xffffff ); - this.tfSearch.setDisabledTextColour( 0x7f7f7f ); - this.tfSearch.setEnableBackgroundDrawing( true ); - this.tfSearch.setMaxStringLength( 30 ); - - this.bPrevious.visible = this.bNext.visible = this.bConfirm.visible = false; - this.tfSearch.setVisible( false ); - - this.buttonList.add( this.bNext ); - this.buttonList.add( this.bPrevious ); - this.buttonList.add( this.bConfirm ); - - this.enableConfigButtons( ); - } - - - @Override - public void drawScreen( final int mouseX , final int mouseY , final float partialTicks ) - { - super.drawScreen( mouseX , mouseY , partialTicks ); - - for ( final TBAlloyFurnaceGui.Tab tab : TBAlloyFurnaceGui.Tab.values( ) ) { - if ( this.isInTab( tab , mouseX , mouseY ) ) { - final List< String > list = Lists.< String > newArrayList( ); - list.add( TextFormatting.WHITE + I18n.format( tab.tooltip ) ); - this.drawHoveringText( list , mouseX , mouseY ); - break; - } - } - } - - - private void enableConfigButtons( ) - { - if ( this.bNext != null ) { - final boolean visible = this.selectedTab == Tab.RECIPE; - this.bNext.visible = this.bPrevious.visible = this.bConfirm.visible = visible; - this.tfSearch.setVisible( visible ); - - if ( this.recipes.isEmpty( ) ) { - this.bNext.enabled = this.bPrevious.enabled = this.bConfirm.enabled = false; - } else { - this.bNext.enabled = this.currentRecipe < this.recipes.size( ) - 1; - this.bPrevious.enabled = this.currentRecipe > 0; - this.bConfirm.enabled = this.currentRecipe != this.getRecipeIndex( this.container.tileEntity.recipe ); - } - } - } - - private void setRecipe( int index ) { if ( index == -1 && !this.recipes.isEmpty( ) ) { @@ -220,7 +240,7 @@ public class TBAlloyFurnaceGui this.container.setCurrentRecipe( rName , false ); URegistry.network.sendToServer( // new TBAlloyFurnaceMessage( this.container.position , rName , false ) ); - this.enableConfigButtons( ); + ( (RecipeTab) this.tabs[ 1 ] ).enableButtons( ); } @@ -230,101 +250,9 @@ public class TBAlloyFurnaceGui } - @Override - protected void drawGuiContainerBackgroundLayer( final float partialTicks , final int mouseX , final int mouseY ) + private void handleFiltering( final String input ) { - GlStateManager.color( 1f , 1f , 1f , 1f ); - GlStateManager.enableBlend( ); - GlStateManager.disableLighting( ); - - // Inactive tab - this.mc.getTextureManager( ).bindTexture( TBAlloyFurnaceGui.TEXTURES[ 0 ] ); - for ( final TBAlloyFurnaceGui.Tab tab : TBAlloyFurnaceGui.TABS ) { - if ( tab != this.selectedTab ) { - this.drawTab( tab ); - } - } - - // Main panel - this.mc.getTextureManager( ).bindTexture( TBAlloyFurnaceGui.TEXTURES[ this.selectedTab.ordinal( ) ] ); - this.drawTexturedModalRect( this.guiLeft , this.guiTop , 0 , 0 , this.xSize , this.ySize ); - - if ( this.selectedTab == Tab.MAIN ) { - final int x = ( this.width - this.xSize ) / 2; - final int y = ( this.height - this.ySize ) / 2; - - final TileEntity atPos = this.container.world.getTileEntity( this.container.position ); - if ( atPos instanceof TBAlloyFurnaceTileEntity ) { - final TBAlloyFurnaceTileEntity te = (TBAlloyFurnaceTileEntity) atPos; - // Burn - if ( te.isBurning( ) ) { - final int burn = te.getBurnProgress( 13 ); - this.drawTexturedModalRect( x + 89 , y + 38 + 13 - burn , 176 , 28 - burn , 14 , burn + 1 ); - } - - // Alloying progress - if ( te.isAlloying( ) ) { - final int alloy = te.getAlloyingProgress( 47 ); - this.drawTexturedModalRect( x + 73 , y + 17 , 176 , 29 , alloy + 1 , 16 ); - } - } - } else { - GlStateManager.disableBlend( ); - this.tfSearch.drawTextBox( ); - GlStateManager.enableBlend( ); - GlStateManager.color( 1f , 1f , 1f , 1f ); - } - - // Active tab - this.mc.getTextureManager( ).bindTexture( TBAlloyFurnaceGui.TEXTURES[ 0 ] ); - this.drawTab( this.selectedTab ); - } - - - @Override - protected void mouseClicked( final int mouseX , final int mouseY , final int mouseButton ) - throws IOException - { - super.mouseClicked( mouseX , mouseY , mouseButton ); - - for ( final TBAlloyFurnaceGui.Tab tab : TBAlloyFurnaceGui.Tab.values( ) ) { - if ( this.selectedTab != tab && this.isInTab( tab , mouseX , mouseY ) ) { - this.selectTab( tab ); - return; - } - } - - if ( this.selectedTab == Tab.RECIPE ) { - this.tfSearch.mouseClicked( mouseX , mouseY , mouseButton ); - } - } - - - private boolean isInTab( final TBAlloyFurnaceGui.Tab tab , final int mouseX , final int mouseY ) - { - final int tabOffsetX = tab.ordinal( ) * TBAlloyFurnaceGui.TAB_WIDTH; - final int tabX = this.guiLeft + tabOffsetX + TBAlloyFurnaceGui.TAB_BORDER; - final int tabY = this.guiTop - TBAlloyFurnaceGui.TAB_HEIGHT + TBAlloyFurnaceGui.TAB_BORDER; - return mouseX >= tabX && mouseY >= tabY && mouseX <= tabX + TBAlloyFurnaceGui.TAB_WIDTH - && mouseY <= tabY + TBAlloyFurnaceGui.TAB_HEIGHT; - } - - - @Override - protected void keyTyped( final char typedChar , final int keyCode ) - throws IOException - { - if ( this.tfSearch.getVisible( ) && this.tfSearch.textboxKeyTyped( typedChar , keyCode ) ) { - this.handleFiltering( ); - } else { - super.keyTyped( typedChar , keyCode ); - } - } - - - private void handleFiltering( ) - { - final String newText = this.tfSearch.getText( ).trim( ).toLowerCase( ); + final String newText = input.trim( ).toLowerCase( ); if ( this.searchString.equals( newText ) ) { return; } @@ -359,53 +287,4 @@ public class TBAlloyFurnaceGui } } - - @Override - protected void actionPerformed( final GuiButton button ) - throws IOException - { - if ( button == this.bNext ) { - this.setRecipe( this.currentRecipe + 1 ); - } else if ( button == this.bPrevious ) { - this.setRecipe( this.currentRecipe - 1 ); - } else if ( button == this.bConfirm ) { - final MAlloyRecipe recipe = this.recipes.get( this.currentRecipe ); - URegistry.network.sendToServer( - new TBAlloyFurnaceMessage( this.container.tileEntity.getPos( ) , recipe.name , true ) ); - this.container.tileEntity.recipe = recipe; - } - - this.enableConfigButtons( ); - } - - - private void drawTab( final TBAlloyFurnaceGui.Tab tab ) - { - final boolean selected = this.selectedTab == tab; - final int tabOffsetX = tab.ordinal( ) * TBAlloyFurnaceGui.TAB_WIDTH; - final int tabX = this.guiLeft + tabOffsetX + TBAlloyFurnaceGui.TAB_BORDER; - final int tabY = this.guiTop - TBAlloyFurnaceGui.TAB_HEIGHT + TBAlloyFurnaceGui.TAB_BORDER; - - this.drawTexturedModalRect( tabX , tabY , // - TBAlloyFurnaceGui.TABS_TEXTURE_X , - TBAlloyFurnaceGui.TABS_TEXTURE_Y + ( selected ? TBAlloyFurnaceGui.TAB_HEIGHT : 0 ) , // - TBAlloyFurnaceGui.TAB_WIDTH , TBAlloyFurnaceGui.TAB_HEIGHT ); - - this.zLevel = 100f; - this.drawTexturedModalRect( tabX + TBAlloyFurnaceGui.TAB_ICON_X , tabY + TBAlloyFurnaceGui.TAB_ICON_Y , // - tab.iconX , tab.iconY , // - TBAlloyFurnaceGui.TAB_ICON_WIDTH , TBAlloyFurnaceGui.TAB_ICON_HEIGHT ); - - this.zLevel = 0; - } - - - private void selectTab( final TBAlloyFurnaceGui.Tab tab ) - { - this.container.visibilityController // - .hideGroup( this.selectedTab.slotGroup ) // - .showGroup( tab.slotGroup ); - this.selectedTab = tab; - this.enableConfigButtons( ); - } } diff --git a/src/java/mmm/tech/base/TBAlloyFurnaceTileEntity.java b/src/java/mmm/tech/base/TBAlloyFurnaceTileEntity.java index a82ee5e..936b8cf 100644 --- a/src/java/mmm/tech/base/TBAlloyFurnaceTileEntity.java +++ b/src/java/mmm/tech/base/TBAlloyFurnaceTileEntity.java @@ -59,7 +59,8 @@ public class TBAlloyFurnaceTileEntity @Override - public boolean shouldRefresh( World world , BlockPos pos , IBlockState oldState , IBlockState newSate ) + public boolean shouldRefresh( final World world , final BlockPos pos , final IBlockState oldState , + final IBlockState newSate ) { return ! ( newSate.getBlock( ) instanceof TBAlloyFurnaceBlock ); } diff --git a/src/java/mmm/tech/base/TechBase.java b/src/java/mmm/tech/base/TechBase.java index f21a39e..9e480d1 100644 --- a/src/java/mmm/tech/base/TechBase.java +++ b/src/java/mmm/tech/base/TechBase.java @@ -23,8 +23,8 @@ public class TechBase ALLOY_FURNACE_BLOCK_ACTIVE = new TBAlloyFurnaceBlock( true ); ALLOY_FURNACE_ITEM = new ItemBlockSpecial( TechBase.ALLOY_FURNACE_BLOCK_INACTIVE )// .setMaxStackSize( 16 )// - .setCreativeTab( ALLOY_FURNACE_BLOCK_INACTIVE.getCreativeTabToDisplayOn( ) ); - URegistry.setIdentifiers( ALLOY_FURNACE_ITEM , "tech" , "base" , "alloy_furnace" ); + .setCreativeTab( TechBase.ALLOY_FURNACE_BLOCK_INACTIVE.getCreativeTabToDisplayOn( ) ); + URegistry.setIdentifiers( TechBase.ALLOY_FURNACE_ITEM , "tech" , "base" , "alloy_furnace" ); URegistry.addBlock( TechBase.ALLOY_FURNACE_BLOCK_INACTIVE , TechBase.ALLOY_FURNACE_ITEM ); URegistry.addBlock( TechBase.ALLOY_FURNACE_BLOCK_ACTIVE , null ); GameRegistry.registerTileEntity( TBAlloyFurnaceTileEntity.class , "mmm:tech/base/alloy_furnace" ); diff --git a/src/java/mmm/utils/UContainers.java b/src/java/mmm/utils/UContainers.java deleted file mode 100644 index 1117af1..0000000 --- a/src/java/mmm/utils/UContainers.java +++ /dev/null @@ -1,44 +0,0 @@ -package mmm.utils; - - -public class UContainers -{ - - public static interface SlotAdder - { - public void addSlot( int index , int x , int y ); - } - - - public static void addPlayerInventory( final UContainers.SlotAdder slotAdder , final int x , final int y ) - { - UContainers.addPlayerInventory( slotAdder , x , y , 4 ); - } - - - public static void addPlayerInventory( final UContainers.SlotAdder slotAdder , final int x , final int y , - final int spacing ) - { - UContainers.addGrid( slotAdder , 9 , 3 , 9 , x , y ); // Main inventory - UContainers.addGrid( slotAdder , 9 , 1 , 0 , x , y + spacing + 54 ); // Quick bar - } - - - public static void addGrid( final UContainers.SlotAdder slotAdder , final int columns , final int rows , - final int index , final int x , final int y ) - { - addGrid( slotAdder , columns , rows , index , x , y , 2 , 2 ); - } - - - public static void addGrid( final UContainers.SlotAdder slotAdder , final int columns , final int rows , - final int index , final int x , final int y , int xSpacing , int ySpacing ) - { - for ( int row = 0 , i = 0 ; row < rows ; ++row ) { - for ( int column = 0 ; column < columns ; ++column , ++i ) { - slotAdder.addSlot( index + i , x + column * ( 16 + xSpacing ) , y + row * ( 16 + ySpacing ) ); - } - } - } - -} diff --git a/src/java/mmm/utils/gui/A_UGContainerScreen.java b/src/java/mmm/utils/gui/A_UGContainerScreen.java new file mode 100644 index 0000000..1e67c3f --- /dev/null +++ b/src/java/mmm/utils/gui/A_UGContainerScreen.java @@ -0,0 +1,54 @@ +package mmm.utils.gui; + + +import net.minecraft.client.gui.FontRenderer; +import net.minecraft.client.gui.inventory.GuiContainer; +import net.minecraftforge.fml.relauncher.Side; +import net.minecraftforge.fml.relauncher.SideOnly; + + + +@SideOnly( Side.CLIENT ) +public abstract class A_UGContainerScreen< CTYPE extends UGContainer > + extends GuiContainer +{ + public final CTYPE container; + + + public A_UGContainerScreen( final CTYPE inventorySlotsIn ) + { + super( inventorySlotsIn ); + this.container = inventorySlotsIn; + } + + + public int getLeft( ) + { + return this.guiLeft; + } + + + public int getTop( ) + { + return this.guiTop; + } + + + public int getXSize( ) + { + return this.xSize; + } + + + public int getYSize( ) + { + return this.ySize; + } + + + public FontRenderer getFontRenderer( ) + { + return this.fontRendererObj; + } + +} diff --git a/src/java/mmm/utils/gui/A_UGTab.java b/src/java/mmm/utils/gui/A_UGTab.java new file mode 100644 index 0000000..f5dadb8 --- /dev/null +++ b/src/java/mmm/utils/gui/A_UGTab.java @@ -0,0 +1,155 @@ +package mmm.utils.gui; + + +import java.util.List; + +import com.google.common.collect.Lists; + +import net.minecraft.client.gui.Gui; +import net.minecraft.client.gui.GuiButton; +import net.minecraft.client.renderer.GlStateManager; +import net.minecraft.util.ResourceLocation; +import net.minecraftforge.fml.relauncher.Side; +import net.minecraftforge.fml.relauncher.SideOnly; + + + +@SideOnly( Side.CLIENT ) +public abstract class A_UGTab + extends Gui +{ + protected A_UGTabbedContainerScreen< ? > parent; + protected int ordinal; + protected int[] slotGroups; + protected ResourceLocation background; + protected int height; + protected int iconX; + protected int iconY; + protected String tooltip; + protected List< GuiButton > buttons = Lists.< GuiButton > newArrayList( ); + + + A_UGTab setParent( final A_UGTabbedContainerScreen< ? > parent , int ordinal ) + { + this.parent = parent; + this.ordinal = ordinal; + return this; + } + + + public ResourceLocation getBackground( ) + { + return this.background; + } + + + public A_UGTab setBackground( ResourceLocation background ) + { + this.background = background; + return this; + } + + + public int getHeight( ) + { + return this.height; + } + + + public A_UGTab setHeight( int height ) + { + this.height = height; + return this; + } + + + public int getIconX( ) + { + return this.iconX; + } + + + public int getIconY( ) + { + return this.iconY; + } + + + public A_UGTab setIconPosition( int x , int y ) + { + this.iconX = x; + this.iconY = y; + return this; + } + + + public String getTooltip( ) + { + return this.tooltip; + } + + + public A_UGTab setTooltip( String tooltip ) + { + this.tooltip = tooltip; + return this; + } + + + public A_UGTab setSlotGroups( int... slotGroups ) + { + this.slotGroups = slotGroups; + return this; + } + + + public void initGui( int x , int y ) + { + // EMPTY + } + + + public void drawBackground( float partialTicks , int mouseX , int mouseY ) + { + GlStateManager.color( 1f , 1f , 1f , 1f ); + GlStateManager.enableBlend( ); + GlStateManager.disableLighting( ); + this.parent.mc.getTextureManager( ).bindTexture( this.background ); + this.drawTexturedModalRect( this.parent.getLeft( ) , this.parent.getTop( ) , 0 , 0 , this.parent.getXSize( ) , + this.height ); + } + + + public void onSelected( ) + { + for ( int i = 0 ; i < this.buttons.size( ) ; i++ ) { + this.buttons.get( i ).visible = true; + } + } + + + public void onDeselected( ) + { + for ( int i = 0 ; i < this.buttons.size( ) ; i++ ) { + this.buttons.get( i ).visible = false; + } + } + + + public void onMouseClicked( int mouseX , int mouseY , int mouseButton ) + { + // EMPTY + } + + + public boolean onKeyTyped( final char typedChar , final int keyCode ) + { + return false; + } + + + public boolean onActionPerformed( GuiButton button ) + { + return false; + } +} diff --git a/src/java/mmm/utils/gui/A_UGTabbedContainerScreen.java b/src/java/mmm/utils/gui/A_UGTabbedContainerScreen.java new file mode 100644 index 0000000..eaab8c1 --- /dev/null +++ b/src/java/mmm/utils/gui/A_UGTabbedContainerScreen.java @@ -0,0 +1,217 @@ +package mmm.utils.gui; + + +import java.io.IOException; +import java.util.List; + +import com.google.common.collect.Lists; + +import net.minecraft.client.gui.GuiButton; +import net.minecraft.client.renderer.GlStateManager; +import net.minecraft.client.resources.I18n; +import net.minecraft.util.ResourceLocation; +import net.minecraft.util.text.TextFormatting; +import net.minecraftforge.fml.relauncher.Side; +import net.minecraftforge.fml.relauncher.SideOnly; + + + +@SideOnly( Side.CLIENT ) +public abstract class A_UGTabbedContainerScreen< CTYPE extends UGContainer > + extends A_UGContainerScreen< CTYPE > +{ + protected final ResourceLocation mainTexture; + protected final A_UGTab[] tabs; + protected int currentTab; + + + public A_UGTabbedContainerScreen( final CTYPE inventorySlotsIn , final ResourceLocation mainTexture , + final A_UGTab... tabs ) + { + super( inventorySlotsIn ); + + int height = 0; + for ( int i = 0 ; i < tabs.length ; i++ ) { + tabs[ i ].setParent( this , i ); + if ( tabs[ i ].getHeight( ) > height ) { + height = tabs[ i ].getHeight( ); + } + } + + this.tabs = tabs; + this.mainTexture = mainTexture; + this.ySize = height; + this.currentTab = -1; + this.selectTab( 0 ); + } + + + @Override + public void initGui( ) + { + super.initGui( ); + + final int x = ( this.width - this.xSize ) / 2; + final int y = ( this.height - this.ySize ) / 2; + + for ( final A_UGTab tab : this.tabs ) { + tab.buttons.clear( ); + tab.initGui( x , y ); + this.buttonList.addAll( tab.buttons ); + } + } + + + @Override + public void drawScreen( final int mouseX , final int mouseY , final float partialTicks ) + { + super.drawScreen( mouseX , mouseY , partialTicks ); + + for ( int tabIndex = 0 ; tabIndex < this.tabs.length ; tabIndex++ ) { + if ( this.isInTab( tabIndex , mouseX , mouseY ) ) { + final List< String > list = Lists.< String > newArrayList( ); + list.add( TextFormatting.WHITE + I18n.format( this.tabs[ tabIndex ].tooltip ) ); + this.drawHoveringText( list , mouseX , mouseY ); + break; + } + } + } + + + @Override + protected void drawGuiContainerBackgroundLayer( final float partialTicks , final int mouseX , final int mouseY ) + { + // Inactive tabs + GlStateManager.color( 1f , 1f , 1f , 1f ); + GlStateManager.enableBlend( ); + GlStateManager.disableLighting( ); + this.mc.getTextureManager( ).bindTexture( GUIUtils.GUI_TEXTURE ); + for ( int tabIndex = 0 ; tabIndex < this.tabs.length ; tabIndex++ ) { + if ( tabIndex != this.currentTab ) { + this.drawTabBackground( tabIndex ); + } + } + + // Tab panel + this.tabs[ this.currentTab ].drawBackground( partialTicks , mouseX , mouseY ); + GlStateManager.color( 1f , 1f , 1f , 1f ); + GlStateManager.enableBlend( ); + GlStateManager.disableLighting( ); + + // Active tab + this.mc.getTextureManager( ).bindTexture( GUIUtils.GUI_TEXTURE ); + this.drawTabBackground( this.currentTab ); + + // Tab icons + this.mc.getTextureManager( ).bindTexture( this.mainTexture ); + this.zLevel = 100f; + for ( int tabIndex = 0 ; tabIndex < this.tabs.length ; tabIndex++ ) { + this.drawTabIcon( tabIndex ); + } + } + + + @Override + protected void mouseClicked( final int mouseX , final int mouseY , final int mouseButton ) + throws IOException + { + super.mouseClicked( mouseX , mouseY , mouseButton ); + + for ( int i = 0 ; i < this.tabs.length ; i++ ) { + if ( this.currentTab != i && this.isInTab( i , mouseX , mouseY ) ) { + this.selectTab( i ); + return; + } + } + + this.tabs[ this.currentTab ].onMouseClicked( mouseX , mouseY , mouseButton ); + } + + + @Override + protected void keyTyped( final char typedChar , final int keyCode ) + throws IOException + { + if ( !this.tabs[ this.currentTab ].onKeyTyped( typedChar , keyCode ) ) { + super.keyTyped( typedChar , keyCode ); + } + } + + + @Override + protected void actionPerformed( final GuiButton button ) + throws IOException + { + if ( !this.tabs[ this.currentTab ].onActionPerformed( button ) ) { + this.onContainerActionPerformed( button ); + } + } + + + protected void onContainerActionPerformed( final GuiButton button ) + { + // EMPTY + } + + + protected boolean isInTab( final int tab , final int mouseX , final int mouseY ) + { + final int tabOffsetX = tab * GUIUtils.TAB_WIDTH; + final int tabX = this.guiLeft + tabOffsetX + GUIUtils.TAB_BORDER; + final int tabY = this.guiTop - GUIUtils.TAB_HEIGHT + GUIUtils.TAB_BORDER; + return mouseX >= tabX && mouseY >= tabY && mouseX <= tabX + GUIUtils.TAB_WIDTH + && mouseY <= tabY + GUIUtils.TAB_HEIGHT; + } + + + protected void drawTabBackground( final int tab ) + { + final boolean selected = this.currentTab == tab; + final int tabOffsetX = tab * GUIUtils.TAB_WIDTH; + final int tabX = this.guiLeft + tabOffsetX + GUIUtils.TAB_BORDER; + final int tabY = this.guiTop - GUIUtils.TAB_HEIGHT + GUIUtils.TAB_BORDER; + this.drawTexturedModalRect( tabX , tabY , // + GUIUtils.TAB_TEXTURE_X , GUIUtils.TAB_TEXTURE_Y + ( selected ? GUIUtils.TAB_HEIGHT : 0 ) , // + GUIUtils.TAB_WIDTH , GUIUtils.TAB_HEIGHT ); + } + + + protected void drawTabIcon( final int tab ) + { + final int tabOffsetX = tab * GUIUtils.TAB_WIDTH; + final int tabX = this.guiLeft + tabOffsetX + GUIUtils.TAB_BORDER; + final int tabY = this.guiTop - GUIUtils.TAB_HEIGHT + GUIUtils.TAB_BORDER; + this.drawTexturedModalRect( tabX + GUIUtils.TAB_ICON_X , tabY + GUIUtils.TAB_ICON_Y , // + this.tabs[ tab ].getIconX( ) , this.tabs[ tab ].getIconY( ) , // + GUIUtils.TAB_ICON_WIDTH , GUIUtils.TAB_ICON_HEIGHT ); + } + + + protected void selectTab( final int tabIndex ) + { + if ( this.currentTab >= 0 ) { + this.hideCurrentTab( ); + } + + this.currentTab = tabIndex; + final A_UGTab tab = this.tabs[ tabIndex ]; + if ( tab.slotGroups != null ) { + for ( final int sg : tab.slotGroups ) { + this.container.slotGroups.showGroup( sg ); + } + } + tab.onSelected( ); + } + + + private void hideCurrentTab( ) + { + final A_UGTab tab = this.tabs[ this.currentTab ]; + if ( tab.slotGroups != null ) { + for ( final int sg : tab.slotGroups ) { + this.container.slotGroups.hideGroup( sg ); + } + } + tab.onDeselected( ); + } +} diff --git a/src/java/mmm/utils/gui/GUIUtils.java b/src/java/mmm/utils/gui/GUIUtils.java new file mode 100644 index 0000000..fa4f3e3 --- /dev/null +++ b/src/java/mmm/utils/gui/GUIUtils.java @@ -0,0 +1,33 @@ +package mmm.utils.gui; + + +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; + +import net.minecraft.util.ResourceLocation; + + + +public class GUIUtils +{ + static final Logger LOGGER = LogManager.getLogger( ); + + public static final ResourceLocation GUI_TEXTURE = new ResourceLocation( "mmm" , "textures/gui/gui-common.png" ); + + public static final int TAB_TEXTURE_X = 0; + public static final int TAB_TEXTURE_Y = 0; + public static final int TAB_WIDTH = 26; + public static final int TAB_HEIGHT = 26; + + public static final int ABT_TEXTURE_X = 26; + public static final int ABT_TEXTURE_Y = 0; + public static final int ABT_WIDTH = 10; + public static final int ABT_HEIGHT = 15; + + public static final int TAB_BORDER = 4; + public static final int TAB_ICON_X = 5; + public static final int TAB_ICON_Y = 5; + public static final int TAB_ICON_WIDTH = 16; + public static final int TAB_ICON_HEIGHT = 16; + +} diff --git a/src/java/mmm/utils/gui/UGArrowButton.java b/src/java/mmm/utils/gui/UGArrowButton.java new file mode 100644 index 0000000..38693e0 --- /dev/null +++ b/src/java/mmm/utils/gui/UGArrowButton.java @@ -0,0 +1,51 @@ +package mmm.utils.gui; + + +import net.minecraft.client.Minecraft; +import net.minecraft.client.gui.GuiButton; +import net.minecraft.client.renderer.GlStateManager; +import net.minecraftforge.fml.relauncher.Side; +import net.minecraftforge.fml.relauncher.SideOnly; + + + +@SideOnly( Side.CLIENT ) +public class UGArrowButton + extends GuiButton +{ + public final boolean forward; + + + public UGArrowButton( final int buttonID , final int x , final int y , final boolean forward ) + { + super( buttonID , x , y , GUIUtils.ABT_WIDTH , GUIUtils.ABT_HEIGHT , "" ); + this.forward = forward; + } + + + @Override + public void drawButton( final Minecraft mc , final int mouseX , final int mouseY ) + { + if ( !this.visible ) { + return; + } + mc.getTextureManager( ).bindTexture( GUIUtils.GUI_TEXTURE ); + GlStateManager.color( 1f , 1f , 1f , 1f ); + + int texX = GUIUtils.ABT_TEXTURE_X; + if ( !this.enabled ) { + texX += this.width * 2; + } else if ( mouseX >= this.xPosition && mouseY >= this.yPosition && mouseX < this.xPosition + this.width + && mouseY < this.yPosition + this.height ) { + texX += this.width; + } + + int texY = GUIUtils.ABT_TEXTURE_Y; + if ( !this.forward ) { + texY += this.height; + } + + this.drawTexturedModalRect( this.xPosition , this.yPosition , texX , texY , this.width , this.height ); + } + +} diff --git a/src/java/mmm/utils/gui/UGContainer.java b/src/java/mmm/utils/gui/UGContainer.java new file mode 100644 index 0000000..36c3370 --- /dev/null +++ b/src/java/mmm/utils/gui/UGContainer.java @@ -0,0 +1,62 @@ +package mmm.utils.gui; + + +import net.minecraft.inventory.Container; +import net.minecraft.inventory.IInventory; +import net.minecraft.inventory.Slot; + + + +public abstract class UGContainer + extends Container +{ + + public static interface I_SlotFactory + { + public Slot createSlot( IInventory inv , int index , int x , int y ); + } + + public final UGSlotGroups slotGroups; + + + public UGContainer( ) + { + super( ); + this.slotGroups = new UGSlotGroups( this.inventorySlots ); + this.slotGroups.nextGroup( ); + } + + + public void addPlayerInventory( final I_SlotFactory slotAdder , final IInventory inv , final int x , final int y ) + { + this.addPlayerInventory( slotAdder , inv , x , y , 4 ); + } + + + public void addPlayerInventory( final I_SlotFactory slotAdder , final IInventory inv , final int x , final int y , + final int spacing ) + { + this.addGrid( slotAdder , inv , 9 , 3 , 9 , x , y ); // Main inventory + this.addGrid( slotAdder , inv , 9 , 1 , 0 , x , y + spacing + 54 ); // Quick bar + } + + + public void addGrid( final I_SlotFactory slotAdder , final IInventory inv , final int columns , final int rows , + final int index , final int x , final int y ) + { + this.addGrid( slotAdder , inv , columns , rows , index , x , y , 2 , 2 ); + } + + + public void addGrid( final I_SlotFactory slotAdder , final IInventory inv , final int columns , final int rows , + final int index , final int x , final int y , final int xSpacing , final int ySpacing ) + { + for ( int row = 0 , i = 0 ; row < rows ; ++row ) { + for ( int column = 0 ; column < columns ; ++column , ++i ) { + this.addSlotToContainer( slotAdder.createSlot( inv , index + i , // + x + column * ( 16 + xSpacing ) , y + row * ( 16 + ySpacing ) ) ); + } + } + } + +} diff --git a/src/java/mmm/utils/slots/USDisplay.java b/src/java/mmm/utils/gui/UGSlotDisplay.java similarity index 57% rename from src/java/mmm/utils/slots/USDisplay.java rename to src/java/mmm/utils/gui/UGSlotDisplay.java index 9375080..b863447 100644 --- a/src/java/mmm/utils/slots/USDisplay.java +++ b/src/java/mmm/utils/gui/UGSlotDisplay.java @@ -1,4 +1,4 @@ -package mmm.utils.slots; +package mmm.utils.gui; import net.minecraft.entity.player.EntityPlayer; @@ -9,25 +9,25 @@ import net.minecraft.item.ItemStack; /** An inventory slot that cannot be interacted with */ -public class USDisplay +public class UGSlotDisplay extends Slot { - public USDisplay( IInventory inventoryIn , int index , int xPosition , int yPosition ) + public UGSlotDisplay( final IInventory inventoryIn , final int index , final int xPosition , final int yPosition ) { super( inventoryIn , index , xPosition , yPosition ); } @Override - public boolean isItemValid( ItemStack stack ) + public boolean isItemValid( final ItemStack stack ) { return false; } @Override - public boolean canTakeStack( EntityPlayer playerIn ) + public boolean canTakeStack( final EntityPlayer playerIn ) { return false; } diff --git a/src/java/mmm/utils/slots/USFuel.java b/src/java/mmm/utils/gui/UGSlotFuel.java similarity index 72% rename from src/java/mmm/utils/slots/USFuel.java rename to src/java/mmm/utils/gui/UGSlotFuel.java index de1981f..c95c4f5 100644 --- a/src/java/mmm/utils/slots/USFuel.java +++ b/src/java/mmm/utils/gui/UGSlotFuel.java @@ -1,4 +1,4 @@ -package mmm.utils.slots; +package mmm.utils.gui; import javax.annotation.Nullable; @@ -10,11 +10,11 @@ import net.minecraft.tileentity.TileEntityFurnace; -public class USFuel +public class UGSlotFuel extends Slot { - public USFuel( final IInventory inventoryIn , final int slotIndex , final int xPosition , final int yPosition ) + public UGSlotFuel( final IInventory inventoryIn , final int slotIndex , final int xPosition , final int yPosition ) { super( inventoryIn , slotIndex , xPosition , yPosition ); } diff --git a/src/java/mmm/utils/slots/USVisibilityController.java b/src/java/mmm/utils/gui/UGSlotGroups.java similarity index 82% rename from src/java/mmm/utils/slots/USVisibilityController.java rename to src/java/mmm/utils/gui/UGSlotGroups.java index 1ff51d7..eb83d46 100644 --- a/src/java/mmm/utils/slots/USVisibilityController.java +++ b/src/java/mmm/utils/gui/UGSlotGroups.java @@ -1,4 +1,4 @@ -package mmm.utils.slots; +package mmm.utils.gui; import java.util.List; @@ -8,7 +8,7 @@ import net.minecraft.inventory.Slot; -public class USVisibilityController +public class UGSlotGroups { private final List< Slot > slots; private final IntArrayList firstSlots; @@ -16,21 +16,21 @@ public class USVisibilityController private int[] slotY; - public USVisibilityController( final List< Slot > slots ) + public UGSlotGroups( final List< Slot > slots ) { this.slots = slots; this.firstSlots = new IntArrayList( ); } - public int startGroup( ) + public int nextGroup( ) { this.firstSlots.add( this.slots.size( ) ); return this.firstSlots.size( ) - 1; } - public void finalizeGroups( ) + public void endGroups( ) { final int nSlots = this.slots.size( ); this.slotX = new int[ nSlots ]; @@ -39,11 +39,12 @@ public class USVisibilityController final Slot slot = this.slots.get( i ); this.slotX[ i ] = slot.xDisplayPosition; this.slotY[ i ] = slot.yDisplayPosition; + slot.xDisplayPosition = slot.yDisplayPosition = -4000; } } - public USVisibilityController showGroup( final int index ) + public UGSlotGroups showGroup( final int index ) { final int first = this.firstSlots.getInt( index ); final int last; @@ -63,7 +64,7 @@ public class USVisibilityController } - public USVisibilityController hideGroup( final int index ) + public UGSlotGroups hideGroup( final int index ) { final int first = this.firstSlots.getInt( index ); final int last; diff --git a/src/java/mmm/utils/slots/USOutput.java b/src/java/mmm/utils/gui/UGSlotOutput.java similarity index 88% rename from src/java/mmm/utils/slots/USOutput.java rename to src/java/mmm/utils/gui/UGSlotOutput.java index 16359b3..8799cce 100644 --- a/src/java/mmm/utils/slots/USOutput.java +++ b/src/java/mmm/utils/gui/UGSlotOutput.java @@ -1,4 +1,4 @@ -package mmm.utils.slots; +package mmm.utils.gui; import javax.annotation.Nullable; @@ -10,7 +10,7 @@ import net.minecraft.item.ItemStack; -public class USOutput +public class UGSlotOutput extends Slot { public static interface I_OutputHandler @@ -27,14 +27,14 @@ public class USOutput private int removed; - public USOutput( final EntityPlayer player , final IInventory inventoryIn , final int slotIndex , + public UGSlotOutput( final EntityPlayer player , final IInventory inventoryIn , final int slotIndex , final int xPosition , final int yPosition ) { this( player , inventoryIn , slotIndex , xPosition , yPosition , null ); } - public USOutput( final EntityPlayer player , final IInventory inventoryIn , final int slotIndex , + public UGSlotOutput( final EntityPlayer player , final IInventory inventoryIn , final int slotIndex , final int xPosition , final int yPosition , @Nullable final I_OutputHandler handler ) { super( inventoryIn , slotIndex , xPosition , yPosition ); diff --git a/src/resources/assets/mmm/textures/gui/alloy_furnace_1.png b/src/resources/assets/mmm/textures/gui/alloy_furnace_1.png index 377c33ee798e45162c8005740def80d40146d503..38c863144866466749749a6fce3cb3e3c903e056 100644 GIT binary patch delta 2057 zcmZ8id05if8a^Q8&$N^&#RbEq(iXMbFljml*THZbbJVM)xqGw5OtHk2;0LW_xs+v- zWw}k8mL`&!3+6hOg<_UQT4HGmqU4%_3^o7U=YD^k^F8l-zW4pU^PJQF!zWCZB@C6i zlmG31^zC>*F*bOQvF3+4*}Mh{W_w{SMw)3ASFF%7oFJt&=;3@(()BG4UQv?-?W^S` zZd}A|NU~bg;Q}?=8u;pXxrA%wqv!X4M%CLBtIpAG5KYj!e46;FkP|ERp&XRO@)%oUwJX1i)uyV2_E zICs|YL!Shy1ed#YbJ^!qx6cT~c5{6E*SLif;+VJo8!tzhN|I;b!={dXcnhJ_F)wl5 zCPmW%|F@(TPfyQLq0rayxENo3^|kiBo_iF->POYpMpcLU)5gcgD`$*gc?9`grdx@P zX=5^D8#d5F*u>%7j5XiFH6C@pkz}I1BlE^+kKdhqw_wf9?nOm zCsg@plCc`*j$o)(utk98rUed1sZ`z)XL24N`}*bVFZmBw8GbrK0zSQZhWF-8a7*v% zwRZ;vdBhLY8pX!OQm*g}7{l$^RumO6S+*C4!xc}w=kH2&7FGRjy%a4)l-Jkqn8xo7 z4b8~Q%iEjI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=Yu%#}nCLa9t$PH>Ed2J*9hQd@ z>N%hb;m0+l;w!E+4~Gm@0HymkT(-zCEFUW4tzZn-I>c48@L9WSD8Cr}g*m|niUDO(D? zi|uBZy=4S}A73P=0HrE2Rbah)gI`BsyPgCWog#zc|PQQeD4Jb7aK&VB#tLz#M zU_0)BI(Km&AhZMu(4T)2fCa#`2LYcs23Ag3X8YvX`>P(;pFboWt#}k7L47HFI+pqo zt;F-}!=*3)-#HEevR@G3Ap6lXsP~YXRSNDrH$4stZVouVR8+M}G2keBN>C>`*#w=W z03R=Lz|w2$L|hCC;`yL8&MoeZ--(U9MaR;QS)xU{_AAAelPR+|77DgU%t`(2$2O?k?;jra-|Rmf2hSPCWUsg*C3I0xSwQh ziDsSm%IK$K)6>%th_Z?b2a2>lU0zr$(#Kl%v!spbbnM!g`+b|(=~YK@SB9rh?h zUVWLRXZB^Bg&REhOE71RA?ADL;O8a2BwTc^TH?{)ONr%r_y8wQyyj;cs+kJDgT#w? zH^?8(eHH$h+P4~s6cN@5HB8J9|6Zs+Ow8xQtmMTn$aXL0Fb@yOA*@nV{i_HOGZyB) z;LX-nZS-%2UZNoeuAGK#R8$MLvg3(qV61=dOr A)&Kwi diff --git a/src/resources/assets/mmm/textures/gui/alloy_furnace_2.png b/src/resources/assets/mmm/textures/gui/alloy_furnace_2.png index 52eba1a716229844645836897f3e67e67de2baad..a432ff5b28ef28364f6956d47775e72c09477298 100644 GIT binary patch literal 1025 zcmeAS@N?(olHy`uVBq!ia0y~yU<5K5893O0R7}x|GzJFd6P_-PAr-gY-VN-VZ6M-s z(S2%YYi@-OwFFO<#Y$a&Jk{r%jXf(o+dwUj%IKG`I3b}0LW;_ zjnz45nftNkaJbEX1qPEf-+s2OulRRR7wU=wW_jCZyE-tqFt9kVfT(|0-<@Y%GDYcm z&cAM@2M48RaXH-ozT1wc=*v%~1Mch%*YoeYGTdkE=mKgwcZ!c;JA-`P#(!^@@9CDe zW-x60{+{7aY{T`xaeKPwtK~BS*?;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