Work on GUIs (specifically to get SkyChest GUI)
This commit is contained in:
@@ -19,50 +19,6 @@
|
||||
package appeng.client.gui;
|
||||
|
||||
|
||||
import java.io.IOException;
|
||||
import java.text.DecimalFormat;
|
||||
import java.text.ParseException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.Collection;
|
||||
import java.util.HashSet;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
import com.google.common.base.Joiner;
|
||||
import com.google.common.base.Stopwatch;
|
||||
import com.google.common.collect.Lists;
|
||||
|
||||
import net.minecraft.client.gui.screen.inventory.ContainerScreen;
|
||||
import net.minecraft.client.gui.widget.button.Button;
|
||||
import net.minecraft.client.renderer.texture.AtlasTexture;
|
||||
import net.minecraft.inventory.container.ClickType;
|
||||
import net.minecraft.inventory.container.Slot;
|
||||
import org.lwjgl.input.Keyboard;
|
||||
import org.lwjgl.input.Mouse;
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.gui.GuiButton;
|
||||
import net.minecraft.client.gui.inventory.GuiContainer;
|
||||
import net.minecraft.client.renderer.BufferBuilder;
|
||||
import net.minecraft.client.renderer.GlStateManager;
|
||||
import net.minecraft.client.renderer.RenderHelper;
|
||||
import net.minecraft.client.renderer.Tessellator;
|
||||
import net.minecraft.client.renderer.texture.TextureAtlasSprite;
|
||||
import net.minecraft.client.renderer.texture.TextureMap;
|
||||
import net.minecraft.client.renderer.vertex.DefaultVertexFormats;
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import net.minecraft.inventory.ClickType;
|
||||
import net.minecraft.inventory.Container;
|
||||
import net.minecraft.inventory.Slot;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraft.util.text.TextFormatting;
|
||||
import net.minecraftforge.fluids.Fluid;
|
||||
|
||||
import appeng.api.storage.data.IAEFluidStack;
|
||||
import appeng.api.storage.data.IAEItemStack;
|
||||
import appeng.client.gui.widgets.GuiCustomSlot;
|
||||
@@ -73,17 +29,8 @@ import appeng.client.me.SlotDisconnected;
|
||||
import appeng.client.me.SlotME;
|
||||
import appeng.client.render.StackSizeRenderer;
|
||||
import appeng.container.AEBaseContainer;
|
||||
import appeng.container.slot.AppEngCraftingSlot;
|
||||
import appeng.container.slot.AppEngSlot;
|
||||
import appeng.container.slot.*;
|
||||
import appeng.container.slot.AppEngSlot.hasCalculatedValidness;
|
||||
import appeng.container.slot.IOptionalSlot;
|
||||
import appeng.container.slot.SlotCraftingTerm;
|
||||
import appeng.container.slot.SlotDisabled;
|
||||
import appeng.container.slot.SlotFake;
|
||||
import appeng.container.slot.SlotInaccessible;
|
||||
import appeng.container.slot.SlotOutput;
|
||||
import appeng.container.slot.SlotPatternTerm;
|
||||
import appeng.container.slot.SlotRestrictedInput;
|
||||
import appeng.core.AELog;
|
||||
import appeng.core.AppEng;
|
||||
import appeng.core.sync.network.NetworkHandler;
|
||||
@@ -92,6 +39,40 @@ import appeng.core.sync.packets.PacketSwapSlots;
|
||||
import appeng.fluids.client.render.FluidStackSizeRenderer;
|
||||
import appeng.fluids.container.slots.IMEFluidSlot;
|
||||
import appeng.helpers.InventoryAction;
|
||||
import com.google.common.base.Joiner;
|
||||
import com.google.common.base.Stopwatch;
|
||||
import com.google.common.collect.Lists;
|
||||
import com.mojang.blaze3d.systems.RenderSystem;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.gui.screen.inventory.ContainerScreen;
|
||||
import net.minecraft.client.gui.widget.Widget;
|
||||
import net.minecraft.client.gui.widget.button.Button;
|
||||
import net.minecraft.client.renderer.BufferBuilder;
|
||||
import net.minecraft.client.renderer.Tessellator;
|
||||
import net.minecraft.client.renderer.texture.AtlasTexture;
|
||||
import net.minecraft.client.renderer.texture.TextureAtlasSprite;
|
||||
import net.minecraft.client.renderer.vertex.DefaultVertexFormats;
|
||||
import net.minecraft.client.util.InputMappings;
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import net.minecraft.entity.player.PlayerInventory;
|
||||
import net.minecraft.fluid.Fluid;
|
||||
import net.minecraft.inventory.container.ClickType;
|
||||
import net.minecraft.inventory.container.Container;
|
||||
import net.minecraft.inventory.container.Slot;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraft.util.text.ITextComponent;
|
||||
import net.minecraft.util.text.TextFormatting;
|
||||
import net.minecraftforge.fluids.FluidAttributes;
|
||||
import net.minecraftforge.fml.client.gui.GuiUtils;
|
||||
import org.lwjgl.glfw.GLFW;
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.text.DecimalFormat;
|
||||
import java.text.ParseException;
|
||||
import java.util.*;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
|
||||
public abstract class AEBaseGui extends ContainerScreen<AEBaseContainer>
|
||||
@@ -108,9 +89,8 @@ public abstract class AEBaseGui extends ContainerScreen<AEBaseContainer>
|
||||
private Slot bl_clicked;
|
||||
protected final List<GuiCustomSlot> guiSlots = new ArrayList<>();
|
||||
|
||||
public AEBaseGui( final Container container )
|
||||
{
|
||||
super( container );
|
||||
public AEBaseGui(AEBaseContainer container, PlayerInventory playerInventory, ITextComponent title) {
|
||||
super(container, playerInventory, title);
|
||||
}
|
||||
|
||||
protected static String join( final Collection<String> toolTip, final String delimiter )
|
||||
@@ -120,12 +100,12 @@ public abstract class AEBaseGui extends ContainerScreen<AEBaseContainer>
|
||||
return joiner.join( toolTip );
|
||||
}
|
||||
|
||||
protected int getQty( final GuiButton btn )
|
||||
protected int getQty( final Button btn )
|
||||
{
|
||||
try
|
||||
{
|
||||
final DecimalFormat df = new DecimalFormat( "+#;-#" );
|
||||
return df.parse( btn.displayString ).intValue();
|
||||
return df.parse( btn.getMessage() ).intValue();
|
||||
}
|
||||
catch( final ParseException e )
|
||||
{
|
||||
@@ -134,9 +114,9 @@ public abstract class AEBaseGui extends ContainerScreen<AEBaseContainer>
|
||||
}
|
||||
|
||||
@Override
|
||||
public void initGui()
|
||||
public void init()
|
||||
{
|
||||
super.initGui();
|
||||
super.init();
|
||||
|
||||
final List<Slot> slots = this.getInventorySlots();
|
||||
final Iterator<Slot> i = slots.iterator();
|
||||
@@ -156,32 +136,32 @@ public abstract class AEBaseGui extends ContainerScreen<AEBaseContainer>
|
||||
|
||||
private List<Slot> getInventorySlots()
|
||||
{
|
||||
return this.inventorySlots.inventorySlots;
|
||||
return this.container.inventorySlots;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void drawScreen( final int mouseX, final int mouseY, final float partialTicks )
|
||||
public void render(final int mouseX, final int mouseY, final float partialTicks )
|
||||
{
|
||||
super.drawDefaultBackground();
|
||||
super.drawScreen( mouseX, mouseY, partialTicks );
|
||||
super.renderBackground();
|
||||
super.render( mouseX, mouseY, partialTicks );
|
||||
|
||||
GlStateManager.pushMatrix();
|
||||
GlStateManager.translate( this.guiLeft, this.guiTop, 0.0F );
|
||||
GlStateManager.enableDepth();
|
||||
RenderSystem.pushMatrix();
|
||||
RenderSystem.translatef( this.guiLeft, this.guiTop, 0.0F );
|
||||
RenderSystem.enableDepthTest();
|
||||
for( final GuiCustomSlot c : this.guiSlots )
|
||||
{
|
||||
this.drawGuiSlot( c, mouseX, mouseY, partialTicks );
|
||||
}
|
||||
GlStateManager.disableDepth();
|
||||
RenderSystem.disableDepthTest();
|
||||
for( final GuiCustomSlot c : this.guiSlots )
|
||||
{
|
||||
this.drawTooltip( c, mouseX - this.guiLeft, mouseY - this.guiTop );
|
||||
}
|
||||
GlStateManager.popMatrix();
|
||||
RenderSystem.popMatrix();
|
||||
|
||||
this.renderHoveredToolTip( mouseX, mouseY );
|
||||
|
||||
for( final Object c : this.buttonList )
|
||||
for( final Object c : this.buttons )
|
||||
{
|
||||
if( c instanceof ITooltip )
|
||||
{
|
||||
@@ -201,13 +181,13 @@ public abstract class AEBaseGui extends ContainerScreen<AEBaseContainer>
|
||||
|
||||
slot.drawContent( this.minecraft, mouseX, mouseY, partialTicks );
|
||||
|
||||
if( this.isPointInRegion( left, top, slot.getWidth(), slot.getHeight(), mouseX, mouseY ) && slot.canClick( this.mc.player ) )
|
||||
if( this.isPointInRegion( left, top, slot.getWidth(), slot.getHeight(), mouseX, mouseY ) && slot.canClick( this.minecraft.player ) )
|
||||
{
|
||||
GlStateManager.disableLighting();
|
||||
GlStateManager.colorMask( true, true, true, false );
|
||||
this.drawGradientRect( left, top, right, bottom, -2130706433, -2130706433 );
|
||||
GlStateManager.colorMask( true, true, true, true );
|
||||
GlStateManager.enableLighting();
|
||||
RenderSystem.disableLighting();
|
||||
RenderSystem.colorMask( true, true, true, false );
|
||||
this.fillGradient( left, top, right, bottom, -2130706433, -2130706433 );
|
||||
RenderSystem.colorMask( true, true, true, true );
|
||||
RenderSystem.enableLighting();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -260,7 +240,7 @@ public abstract class AEBaseGui extends ContainerScreen<AEBaseContainer>
|
||||
lines.set( i, TextFormatting.GRAY + lines.get( i ) );
|
||||
}
|
||||
|
||||
this.drawHoveringText( lines, x, y, this.fontRenderer );
|
||||
this.renderTooltip( lines, x, y, this.font );
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -268,7 +248,7 @@ public abstract class AEBaseGui extends ContainerScreen<AEBaseContainer>
|
||||
{
|
||||
final int ox = this.guiLeft; // (width - xSize) / 2;
|
||||
final int oy = this.guiTop; // (height - ySize) / 2;
|
||||
GlStateManager.color( 1.0F, 1.0F, 1.0F, 1.0F );
|
||||
RenderSystem.color4f( 1.0F, 1.0F, 1.0F, 1.0F );
|
||||
|
||||
if( this.getScrollBar() != null )
|
||||
{
|
||||
@@ -285,7 +265,7 @@ public abstract class AEBaseGui extends ContainerScreen<AEBaseContainer>
|
||||
{
|
||||
final int ox = this.guiLeft; // (width - xSize) / 2;
|
||||
final int oy = this.guiTop; // (height - ySize) / 2;
|
||||
GlStateManager.color( 1.0F, 1.0F, 1.0F, 1.0F );
|
||||
RenderSystem.color4f( 1.0F, 1.0F, 1.0F, 1.0F );
|
||||
this.drawBG( ox, oy, x, y );
|
||||
|
||||
final List<Slot> slots = this.getInventorySlots();
|
||||
@@ -299,18 +279,20 @@ public abstract class AEBaseGui extends ContainerScreen<AEBaseContainer>
|
||||
final AppEngSlot aeSlot = (AppEngSlot) slot;
|
||||
if( aeSlot.isSlotEnabled() )
|
||||
{
|
||||
this.drawTexturedModalRect( ox + aeSlot.xPos - 1, oy + aeSlot.yPos - 1, optionalSlot.getSourceX() - 1, optionalSlot.getSourceY() - 1,
|
||||
GuiUtils.drawTexturedModalRect( ox + aeSlot.xPos - 1, oy + aeSlot.yPos - 1, optionalSlot.getSourceX() - 1, optionalSlot.getSourceY() - 1,
|
||||
18,
|
||||
18 );
|
||||
18,
|
||||
0 /* FIXME: Check, this used this.zLevel before */);
|
||||
}
|
||||
else
|
||||
{
|
||||
GlStateManager.color( 1.0F, 1.0F, 1.0F, 0.4F );
|
||||
GlStateManager.enableBlend();
|
||||
this.drawTexturedModalRect( ox + aeSlot.xPos - 1, oy + aeSlot.yPos - 1, optionalSlot.getSourceX() - 1, optionalSlot.getSourceY() - 1,
|
||||
RenderSystem.color4f( 1.0F, 1.0F, 1.0F, 0.4F );
|
||||
RenderSystem.enableBlend();
|
||||
GuiUtils.drawTexturedModalRect( ox + aeSlot.xPos - 1, oy + aeSlot.yPos - 1, optionalSlot.getSourceX() - 1, optionalSlot.getSourceY() - 1,
|
||||
18,
|
||||
18 );
|
||||
GlStateManager.color( 1.0F, 1.0F, 1.0F, 1.0F );
|
||||
18,
|
||||
0 /* FIXME: Check, this used this.zLevel before */);
|
||||
RenderSystem.color4f( 1.0F, 1.0F, 1.0F, 1.0F );
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -324,48 +306,48 @@ public abstract class AEBaseGui extends ContainerScreen<AEBaseContainer>
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void mouseClicked( final int xCoord, final int yCoord, final int btn ) throws IOException
|
||||
public boolean mouseClicked( final double xCoord, final double yCoord, final int btn )
|
||||
{
|
||||
this.drag_click.clear();
|
||||
|
||||
if( btn == 1 )
|
||||
{
|
||||
for( final Object o : this.buttonList )
|
||||
for( final Object o : this.buttons )
|
||||
{
|
||||
final GuiButton guibutton = (GuiButton) o;
|
||||
if( guibutton.mousePressed( this.mc, xCoord, yCoord ) )
|
||||
final Widget widget = (Widget) o;
|
||||
if( widget.isMouseOver( xCoord, yCoord ) )
|
||||
{
|
||||
super.mouseClicked( xCoord, yCoord, 0 );
|
||||
return;
|
||||
return super.mouseClicked( xCoord, yCoord, 0 );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
for( GuiCustomSlot slot : this.guiSlots )
|
||||
{
|
||||
if( this.isPointInRegion( slot.xPos(), slot.yPos(), slot.getWidth(), slot.getHeight(), xCoord, yCoord ) && slot.canClick( this.mc.player ) )
|
||||
if( this.isPointInRegion( slot.xPos(), slot.yPos(), slot.getWidth(), slot.getHeight(), xCoord, yCoord ) && slot.canClick( this.minecraft.player ) )
|
||||
{
|
||||
slot.slotClicked( this.mc.player.inventory.getItemStack(), btn );
|
||||
slot.slotClicked( this.minecraft.player.inventory.getItemStack(), btn );
|
||||
}
|
||||
}
|
||||
|
||||
if( this.getScrollBar() != null )
|
||||
{
|
||||
this.getScrollBar().click( this, xCoord - this.guiLeft, yCoord - this.guiTop );
|
||||
this.getScrollBar().click(xCoord - this.guiLeft, yCoord - this.guiTop );
|
||||
}
|
||||
|
||||
super.mouseClicked( xCoord, yCoord, btn );
|
||||
return super.mouseClicked( xCoord, yCoord, btn );
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void mouseClickMove( final int x, final int y, final int c, final long d )
|
||||
{
|
||||
final Slot slot = this.getSlot( x, y );
|
||||
final ItemStack itemstack = this.mc.player.inventory.getItemStack();
|
||||
public boolean mouseDragged(double mouseX, double mouseY, int mouseButton, double dragX, double dragY) {
|
||||
|
||||
final Slot slot = this.getSlot( (int) mouseX, (int) mouseY );
|
||||
final ItemStack itemstack = this.minecraft.player.inventory.getItemStack();
|
||||
|
||||
if( this.getScrollBar() != null )
|
||||
{
|
||||
this.getScrollBar().click( this, x - this.guiLeft, y - this.guiTop );
|
||||
// FIXME: Coordinate system of mouseX/mouseY is unclear
|
||||
this.getScrollBar().click((int) mouseX - this.guiLeft, (int) mouseY - this.guiTop );
|
||||
}
|
||||
|
||||
if( slot instanceof SlotFake && !itemstack.isEmpty() )
|
||||
@@ -375,14 +357,16 @@ public abstract class AEBaseGui extends ContainerScreen<AEBaseContainer>
|
||||
{
|
||||
for( final Slot dr : this.drag_click )
|
||||
{
|
||||
final PacketInventoryAction p = new PacketInventoryAction( c == 0 ? InventoryAction.PICKUP_OR_SET_DOWN : InventoryAction.PLACE_SINGLE, dr.slotNumber, 0 );
|
||||
final PacketInventoryAction p = new PacketInventoryAction( mouseButton == 0 ? InventoryAction.PICKUP_OR_SET_DOWN : InventoryAction.PLACE_SINGLE, dr.slotNumber, 0 );
|
||||
NetworkHandler.instance().sendToServer( p );
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
super.mouseClickMove( x, y, c, d );
|
||||
return super.mouseDragged( mouseX, mouseY, mouseButton, dragX, dragY );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -416,7 +400,7 @@ public abstract class AEBaseGui extends ContainerScreen<AEBaseContainer>
|
||||
|
||||
try
|
||||
{
|
||||
NetworkHandler.instance().sendToServer( ( (SlotPatternTerm) slot ).getRequest( isShiftKeyDown() ) );
|
||||
NetworkHandler.instance().sendToServer( ( (SlotPatternTerm) slot ).getRequest( hasShiftDown() ) );
|
||||
}
|
||||
catch( final IOException e )
|
||||
{
|
||||
@@ -431,7 +415,7 @@ public abstract class AEBaseGui extends ContainerScreen<AEBaseContainer>
|
||||
}
|
||||
|
||||
InventoryAction action = null;
|
||||
if( isShiftKeyDown() )
|
||||
if( hasShiftDown() )
|
||||
{
|
||||
action = InventoryAction.CRAFT_SHIFT;
|
||||
}
|
||||
@@ -447,7 +431,7 @@ public abstract class AEBaseGui extends ContainerScreen<AEBaseContainer>
|
||||
return;
|
||||
}
|
||||
|
||||
if( Keyboard.isKeyDown( Keyboard.KEY_SPACE ) )
|
||||
if( InputMappings.isKeyDown(Minecraft.getInstance().getMainWindow().getHandle(), GLFW.GLFW_KEY_SPACE) )
|
||||
{
|
||||
if( this.enableSpaceClicking() )
|
||||
{
|
||||
@@ -464,7 +448,7 @@ public abstract class AEBaseGui extends ContainerScreen<AEBaseContainer>
|
||||
slotNum = slot.slotNumber;
|
||||
}
|
||||
|
||||
( (AEBaseContainer) this.inventorySlots ).setTargetStack( stack );
|
||||
( (AEBaseContainer) this.container ).setTargetStack( stack );
|
||||
final PacketInventoryAction p = new PacketInventoryAction( InventoryAction.MOVE_REGION, slotNum, 0 );
|
||||
NetworkHandler.instance().sendToServer( p );
|
||||
return;
|
||||
@@ -486,7 +470,7 @@ public abstract class AEBaseGui extends ContainerScreen<AEBaseContainer>
|
||||
|
||||
case CLONE: // creative dupe:
|
||||
|
||||
if( player.capabilities.isCreativeMode )
|
||||
if( player.abilities.isCreativeMode )
|
||||
{
|
||||
action = InventoryAction.CREATIVE_DUPLICATE;
|
||||
}
|
||||
@@ -536,7 +520,7 @@ public abstract class AEBaseGui extends ContainerScreen<AEBaseContainer>
|
||||
{
|
||||
action = InventoryAction.AUTO_CRAFT;
|
||||
}
|
||||
else if( player.capabilities.isCreativeMode )
|
||||
else if( player.abilities.isCreativeMode )
|
||||
{
|
||||
final IAEItemStack slotItem = ( (SlotME) slot ).getAEStack();
|
||||
if( slotItem != null )
|
||||
@@ -552,7 +536,7 @@ public abstract class AEBaseGui extends ContainerScreen<AEBaseContainer>
|
||||
|
||||
if( action != null )
|
||||
{
|
||||
( (AEBaseContainer) this.inventorySlots ).setTargetStack( stack );
|
||||
( (AEBaseContainer) this.container ).setTargetStack( stack );
|
||||
final PacketInventoryAction p = new PacketInventoryAction( action, this.getInventorySlots().size(), 0 );
|
||||
NetworkHandler.instance().sendToServer( p );
|
||||
}
|
||||
@@ -560,7 +544,7 @@ public abstract class AEBaseGui extends ContainerScreen<AEBaseContainer>
|
||||
return;
|
||||
}
|
||||
|
||||
if( !this.disableShiftClick && isShiftKeyDown() && mouseButton == 0 )
|
||||
if( !this.disableShiftClick && hasShiftDown() && mouseButton == 0 )
|
||||
{
|
||||
this.disableShiftClick = true;
|
||||
|
||||
@@ -586,7 +570,7 @@ public abstract class AEBaseGui extends ContainerScreen<AEBaseContainer>
|
||||
for( final Slot inventorySlot : slots )
|
||||
{
|
||||
if( inventorySlot != null && inventorySlot.canTakeStack(
|
||||
this.mc.player ) && inventorySlot.getHasStack() && inventorySlot.isSameInventory( slot ) && Container.canAddItemToSlot(
|
||||
this.minecraft.player ) && inventorySlot.getHasStack() && inventorySlot.isSameInventory( slot ) && Container.canAddItemToSlot(
|
||||
inventorySlot, this.dbl_whichItem, true ) )
|
||||
{
|
||||
this.handleMouseClick( inventorySlot, inventorySlot.slotNumber, 0, ClickType.QUICK_MOVE );
|
||||
@@ -601,23 +585,26 @@ public abstract class AEBaseGui extends ContainerScreen<AEBaseContainer>
|
||||
super.handleMouseClick( slot, slotIdx, mouseButton, clickType );
|
||||
}
|
||||
|
||||
@Override
|
||||
protected boolean checkHotbarKeys( final int keyCode )
|
||||
protected boolean func_195363_d(int keyCode, int scanCode) {
|
||||
return checkHotbarKeys(InputMappings.getInputByCode(keyCode, scanCode));
|
||||
}
|
||||
|
||||
protected boolean checkHotbarKeys( final InputMappings.Input input )
|
||||
{
|
||||
final Slot theSlot = this.getSlotUnderMouse();
|
||||
|
||||
if( this.mc.player.inventory.getItemStack().isEmpty() && theSlot != null )
|
||||
if( this.minecraft.player.inventory.getItemStack().isEmpty() && theSlot != null )
|
||||
{
|
||||
for( int j = 0; j < 9; ++j )
|
||||
{
|
||||
if( keyCode == this.mc.gameSettings.keyBindsHotbar[j].getKeyCode() )
|
||||
if( this.minecraft.gameSettings.keyBindsHotbar[j].isActiveAndMatches(input) )
|
||||
{
|
||||
final List<Slot> slots = this.getInventorySlots();
|
||||
for( final Slot s : slots )
|
||||
{
|
||||
if( s.getSlotIndex() == j && s.inventory == ( (AEBaseContainer) this.inventorySlots ).getPlayerInv() )
|
||||
if( s.getSlotIndex() == j && s.inventory == ( (AEBaseContainer) this.container ).getPlayerInv() )
|
||||
{
|
||||
if( !s.canTakeStack( ( (AEBaseContainer) this.inventorySlots ).getPlayerInv().player ) )
|
||||
if( !s.canTakeStack( ( (AEBaseContainer) this.container ).getPlayerInv().player ) )
|
||||
{
|
||||
return false;
|
||||
}
|
||||
@@ -633,7 +620,7 @@ public abstract class AEBaseGui extends ContainerScreen<AEBaseContainer>
|
||||
{
|
||||
for( final Slot s : slots )
|
||||
{
|
||||
if( s.getSlotIndex() == j && s.inventory == ( (AEBaseContainer) this.inventorySlots ).getPlayerInv() )
|
||||
if( s.getSlotIndex() == j && s.inventory == ( (AEBaseContainer) this.container ).getPlayerInv() )
|
||||
{
|
||||
NetworkHandler.instance().sendToServer( new PacketSwapSlots( s.slotNumber, theSlot.slotNumber ) );
|
||||
return true;
|
||||
@@ -648,9 +635,9 @@ public abstract class AEBaseGui extends ContainerScreen<AEBaseContainer>
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onGuiClosed()
|
||||
public void removed()
|
||||
{
|
||||
super.onGuiClosed();
|
||||
super.removed();
|
||||
}
|
||||
|
||||
protected Slot getSlot( final int mouseX, final int mouseY )
|
||||
@@ -671,34 +658,31 @@ public abstract class AEBaseGui extends ContainerScreen<AEBaseContainer>
|
||||
public abstract void drawBG( int offsetX, int offsetY, int mouseX, int mouseY );
|
||||
|
||||
@Override
|
||||
public void handleMouseInput() throws IOException
|
||||
{
|
||||
super.handleMouseInput();
|
||||
|
||||
final int i = Mouse.getEventDWheel();
|
||||
if( i != 0 && isShiftKeyDown() )
|
||||
public boolean mouseScrolled(double x, double y, double wheelDelta) {
|
||||
if( wheelDelta != 0 && hasShiftDown() )
|
||||
{
|
||||
final int x = Mouse.getEventX() * this.width / this.mc.displayWidth;
|
||||
final int y = this.height - Mouse.getEventY() * this.height / this.mc.displayHeight - 1;
|
||||
this.mouseWheelEvent( x, y, i / Math.abs( i ) );
|
||||
this.mouseWheelEvent( x, y, wheelDelta / Math.abs( wheelDelta ) );
|
||||
return true;
|
||||
}
|
||||
else if( i != 0 && this.getScrollBar() != null )
|
||||
else if( wheelDelta != 0 && this.getScrollBar() != null )
|
||||
{
|
||||
this.getScrollBar().wheel( i );
|
||||
this.getScrollBar().wheel( wheelDelta );
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
private void mouseWheelEvent( final int x, final int y, final int wheel )
|
||||
private void mouseWheelEvent( final double x, final double y, final double wheel )
|
||||
{
|
||||
final Slot slot = this.getSlot( x, y );
|
||||
final Slot slot = this.getSlot( (int) x, (int) y );
|
||||
if( slot instanceof SlotME )
|
||||
{
|
||||
final IAEItemStack item = ( (SlotME) slot ).getAEStack();
|
||||
if( item != null )
|
||||
{
|
||||
( (AEBaseContainer) this.inventorySlots ).setTargetStack( item );
|
||||
( (AEBaseContainer) this.container ).setTargetStack( item );
|
||||
final InventoryAction direction = wheel > 0 ? InventoryAction.ROLL_DOWN : InventoryAction.ROLL_UP;
|
||||
final int times = Math.abs( wheel );
|
||||
final int times = (int) Math.abs( wheel );
|
||||
final int inventorySize = this.getInventorySlots().size();
|
||||
for( int h = 0; h < times; h++ )
|
||||
{
|
||||
@@ -717,21 +701,20 @@ public abstract class AEBaseGui extends ContainerScreen<AEBaseContainer>
|
||||
public void bindTexture( final String base, final String file )
|
||||
{
|
||||
final ResourceLocation loc = new ResourceLocation( base, "textures/" + file );
|
||||
this.mc.getTextureManager().bindTexture( loc );
|
||||
this.minecraft.getTextureManager().bindTexture( loc );
|
||||
}
|
||||
|
||||
protected void drawItem( final int x, final int y, final ItemStack is )
|
||||
{
|
||||
this.zLevel = 100.0F;
|
||||
this.itemRender.zLevel = 100.0F;
|
||||
this.itemRenderer.zLevel = 100.0F;
|
||||
|
||||
RenderHelper.enableGUIStandardItemLighting();
|
||||
GlStateManager.enableDepth();
|
||||
this.itemRender.renderItemAndEffectIntoGUI( is, x, y );
|
||||
GlStateManager.disableDepth();
|
||||
// FIXME: Check if this is actually required, vanilla doesnt have it anymore
|
||||
// FIXME RenderHelper.enableGUIStandardItemLighting();
|
||||
RenderSystem.enableDepthTest();
|
||||
this.itemRenderer.renderItemAndEffectIntoGUI( is, x, y );
|
||||
RenderSystem.disableDepthTest();
|
||||
|
||||
this.itemRender.zLevel = 0.0F;
|
||||
this.zLevel = 0.0F;
|
||||
this.itemRenderer.zLevel = 0.0F;
|
||||
}
|
||||
|
||||
protected String getGuiDisplayName( final String in )
|
||||
@@ -741,16 +724,16 @@ public abstract class AEBaseGui extends ContainerScreen<AEBaseContainer>
|
||||
|
||||
private boolean hasCustomInventoryName()
|
||||
{
|
||||
if( this.inventorySlots instanceof AEBaseContainer )
|
||||
if( this.container instanceof AEBaseContainer )
|
||||
{
|
||||
return ( (AEBaseContainer) this.inventorySlots ).getCustomName() != null;
|
||||
return ( (AEBaseContainer) this.container ).getCustomName() != null;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
private String getInventoryName()
|
||||
{
|
||||
return ( (AEBaseContainer) this.inventorySlots ).getCustomName();
|
||||
return ( (AEBaseContainer) this.container ).getCustomName();
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -764,21 +747,21 @@ public abstract class AEBaseGui extends ContainerScreen<AEBaseContainer>
|
||||
|
||||
try
|
||||
{
|
||||
this.zLevel = 100.0F;
|
||||
this.itemRender.zLevel = 100.0F;
|
||||
// FIXME Probably not required this.zLevel = 100.0F;
|
||||
this.itemRenderer.zLevel = 100.0F;
|
||||
|
||||
if( !this.isPowered() )
|
||||
{
|
||||
drawRect( s.xPos, s.yPos, 16 + s.xPos, 16 + s.yPos, 0x66111111 );
|
||||
fill( s.xPos, s.yPos, 16 + s.xPos, 16 + s.yPos, 0x66111111 );
|
||||
}
|
||||
|
||||
this.zLevel = 0.0F;
|
||||
this.itemRender.zLevel = 0.0F;
|
||||
// FIXME Probably not required this.zLevel = 0.0F;
|
||||
this.itemRenderer.zLevel = 0.0F;
|
||||
|
||||
// Annoying but easier than trying to splice into render item
|
||||
super.drawSlot( new Size1Slot( (SlotME) s ) );
|
||||
|
||||
this.stackSizeRenderer.renderStackSize( this.fontRenderer, ( (SlotME) s ).getAEStack(), s.xPos, s.yPos );
|
||||
this.stackSizeRenderer.renderStackSize( this.font, ( (SlotME) s ).getAEStack(), s.xPos, s.yPos );
|
||||
|
||||
}
|
||||
catch( final Exception err )
|
||||
@@ -795,28 +778,30 @@ public abstract class AEBaseGui extends ContainerScreen<AEBaseContainer>
|
||||
|
||||
if( fs != null && this.isPowered() )
|
||||
{
|
||||
GlStateManager.disableLighting();
|
||||
GlStateManager.disableBlend();
|
||||
RenderSystem.disableLighting();
|
||||
RenderSystem.disableBlend();
|
||||
final Fluid fluid = fs.getFluid();
|
||||
Minecraft.getInstance().getTextureManager().bindTexture( TextureMap.LOCATION_BLOCKS_TEXTURE );
|
||||
final TextureAtlasSprite sprite = Minecraft.getInstance().getTextureMapBlocks().getAtlasSprite( fluid.getStill().toString() );
|
||||
FluidAttributes fluidAttributes = fluid.getAttributes();
|
||||
minecraft.getTextureManager().bindTexture( AtlasTexture.LOCATION_BLOCKS_TEXTURE );
|
||||
ResourceLocation fluidStillTexture = fluidAttributes.getStillTexture(fs.getFluidStack());
|
||||
final TextureAtlasSprite sprite = minecraft.getAtlasSpriteGetter(AtlasTexture.LOCATION_BLOCKS_TEXTURE).apply(fluidStillTexture);
|
||||
|
||||
// Set color for dynamic fluids
|
||||
// Convert int color to RGB
|
||||
float red = ( fluid.getColor() >> 16 & 255 ) / 255.0F;
|
||||
float green = ( fluid.getColor() >> 8 & 255 ) / 255.0F;
|
||||
float blue = ( fluid.getColor() & 255 ) / 255.0F;
|
||||
GlStateManager.color( red, green, blue );
|
||||
float red = ( fluidAttributes.getColor() >> 16 & 255 ) / 255.0F;
|
||||
float green = ( fluidAttributes.getColor() >> 8 & 255 ) / 255.0F;
|
||||
float blue = ( fluidAttributes.getColor() & 255 ) / 255.0F;
|
||||
RenderSystem.color3f( red, green, blue );
|
||||
|
||||
this.drawTexturedModalRect( s.xPos, s.yPos, sprite, 16, 16 );
|
||||
GlStateManager.enableLighting();
|
||||
GlStateManager.enableBlend();
|
||||
blit(s.xPos, s.yPos, 0 /* FIXME: Validate this was previous the controls zindex */, 16, 16, sprite);
|
||||
RenderSystem.enableLighting();
|
||||
RenderSystem.enableBlend();
|
||||
|
||||
this.fluidStackSizeRenderer.renderStackSize( this.fontRenderer, fs, s.xPos, s.yPos );
|
||||
this.fluidStackSizeRenderer.renderStackSize( this.font, fs, s.xPos, s.yPos );
|
||||
}
|
||||
else if( !this.isPowered() )
|
||||
{
|
||||
drawRect( s.xPos, s.yPos, 16 + s.xPos, 16 + s.yPos, 0x66111111 );
|
||||
fill( s.xPos, s.yPos, 16 + s.xPos, 16 + s.yPos, 0x66111111 );
|
||||
}
|
||||
|
||||
return;
|
||||
@@ -838,11 +823,11 @@ public abstract class AEBaseGui extends ContainerScreen<AEBaseContainer>
|
||||
final int uv_y = (int) Math.floor( aes.getIcon() / 16 );
|
||||
final int uv_x = aes.getIcon() - uv_y * 16;
|
||||
|
||||
GlStateManager.enableBlend();
|
||||
GlStateManager.disableLighting();
|
||||
GlStateManager.enableTexture2D();
|
||||
GlStateManager.blendFunc( GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA );
|
||||
GlStateManager.color( 1.0f, 1.0f, 1.0f, 1.0f );
|
||||
RenderSystem.enableBlend();
|
||||
RenderSystem.disableLighting();
|
||||
RenderSystem.enableTexture();
|
||||
RenderSystem.blendFunc( GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA );
|
||||
RenderSystem.color4f( 1.0f, 1.0f, 1.0f, 1.0f );
|
||||
final float par1 = aes.xPos;
|
||||
final float par2 = aes.yPos;
|
||||
final float par3 = uv_x * 16;
|
||||
@@ -856,23 +841,24 @@ public abstract class AEBaseGui extends ContainerScreen<AEBaseContainer>
|
||||
final float f1 = 0.00390625F;
|
||||
final float f = 0.00390625F;
|
||||
final float par6 = 16;
|
||||
vb.pos( par1 + 0, par2 + par6, this.zLevel )
|
||||
int zLevel = 0; // FIXME This was previously a field (see FIXMEs above)
|
||||
vb.pos( par1 + 0, par2 + par6, zLevel )
|
||||
.tex( ( par3 + 0 ) * f, ( par4 + par6 ) * f1 )
|
||||
.color( 1.0f, 1.0f, 1.0f,
|
||||
aes.getOpacityOfIcon() )
|
||||
.endVertex();
|
||||
final float par5 = 16;
|
||||
vb.pos( par1 + par5, par2 + par6, this.zLevel )
|
||||
vb.pos( par1 + par5, par2 + par6, zLevel )
|
||||
.tex( ( par3 + par5 ) * f, ( par4 + par6 ) * f1 )
|
||||
.color( 1.0f, 1.0f, 1.0f,
|
||||
aes.getOpacityOfIcon() )
|
||||
.endVertex();
|
||||
vb.pos( par1 + par5, par2 + 0, this.zLevel )
|
||||
vb.pos( par1 + par5, par2 + 0, zLevel )
|
||||
.tex( ( par3 + par5 ) * f, ( par4 + 0 ) * f1 )
|
||||
.color( 1.0f, 1.0f, 1.0f,
|
||||
aes.getOpacityOfIcon() )
|
||||
.endVertex();
|
||||
vb.pos( par1 + 0, par2 + 0, this.zLevel )
|
||||
vb.pos( par1 + 0, par2 + 0, zLevel )
|
||||
.tex( ( par3 + 0 ) * f, ( par4 + 0 ) * f1 )
|
||||
.color( 1.0f, 1.0f, 1.0f,
|
||||
aes.getOpacityOfIcon() )
|
||||
@@ -896,7 +882,7 @@ public abstract class AEBaseGui extends ContainerScreen<AEBaseContainer>
|
||||
{
|
||||
try
|
||||
{
|
||||
isValid = ( (SlotRestrictedInput) s ).isValid( is, this.mc.world );
|
||||
isValid = ( (SlotRestrictedInput) s ).isValid( is, this.minecraft.world );
|
||||
}
|
||||
catch( final Exception err )
|
||||
{
|
||||
@@ -908,15 +894,16 @@ public abstract class AEBaseGui extends ContainerScreen<AEBaseContainer>
|
||||
|
||||
if( ( (AppEngSlot) s ).getIsValid() == hasCalculatedValidness.Invalid )
|
||||
{
|
||||
this.zLevel = 100.0F;
|
||||
this.itemRender.zLevel = 100.0F;
|
||||
// FIXME: Test this, the fill function used below does not support setting Z
|
||||
// FIXME this.zLevel = 100.0F;
|
||||
this.itemRenderer.zLevel = 100.0F;
|
||||
|
||||
GlStateManager.disableLighting();
|
||||
drawRect( s.xPos, s.yPos, 16 + s.xPos, 16 + s.yPos, 0x66ff6666 );
|
||||
GlStateManager.enableLighting();
|
||||
RenderSystem.disableLighting();
|
||||
fill( s.xPos, s.yPos, 16 + s.xPos, 16 + s.yPos, 0x66ff6666 );
|
||||
RenderSystem.enableLighting();
|
||||
|
||||
this.zLevel = 0.0F;
|
||||
this.itemRender.zLevel = 0.0F;
|
||||
// FIXME this.zLevel = 0.0F;
|
||||
this.itemRenderer.zLevel = 0.0F;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -949,7 +936,7 @@ public abstract class AEBaseGui extends ContainerScreen<AEBaseContainer>
|
||||
public void bindTexture( final String file )
|
||||
{
|
||||
final ResourceLocation loc = new ResourceLocation( AppEng.MOD_ID, "textures/" + file );
|
||||
this.mc.getTextureManager().bindTexture( loc );
|
||||
this.minecraft.getTextureManager().bindTexture( loc );
|
||||
}
|
||||
|
||||
protected GuiScrollbar getScrollBar()
|
||||
|
||||
@@ -83,7 +83,7 @@ public abstract class AEBaseMEGui extends AEBaseGui
|
||||
currentToolTip.add( format );
|
||||
}
|
||||
|
||||
this.drawHoveringText( currentToolTip, x, y, this.fontRenderer );
|
||||
this.drawHoveringText( currentToolTip, x, y, this.font );
|
||||
|
||||
return;
|
||||
}
|
||||
@@ -95,7 +95,7 @@ public abstract class AEBaseMEGui extends AEBaseGui
|
||||
|
||||
currentToolTip.add( TextFormatting.GRAY + format );
|
||||
|
||||
this.drawHoveringText( currentToolTip, x, y, this.fontRenderer );
|
||||
this.drawHoveringText( currentToolTip, x, y, this.font );
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -69,10 +69,10 @@ public class GuiCellWorkbench extends GuiUpgradeable
|
||||
.getLocal() );
|
||||
this.fuzzyMode = new GuiImgButton( this.guiLeft - 18, this.guiTop + 68, Settings.FUZZY_MODE, FuzzyMode.IGNORE_ALL );
|
||||
|
||||
this.buttonList.add( this.fuzzyMode );
|
||||
this.buttonList.add( this.partition );
|
||||
this.buttonList.add( this.clear );
|
||||
this.buttonList.add( this.copyMode );
|
||||
this.addButton( this.fuzzyMode );
|
||||
this.addButton( this.partition );
|
||||
this.addButton( this.clear );
|
||||
this.addButton( this.copyMode );
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -57,18 +57,18 @@ public class GuiChest extends AEBaseGui
|
||||
}
|
||||
|
||||
@Override
|
||||
public void initGui()
|
||||
public void init()
|
||||
{
|
||||
super.initGui();
|
||||
super.init();
|
||||
|
||||
this.buttonList.add( this.priority = new GuiTabButton( this.guiLeft + 154, this.guiTop, 2 + 4 * 16, GuiText.Priority.getLocal(), this.itemRender ) );
|
||||
this.addButton( this.priority = new GuiTabButton( this.guiLeft + 154, this.guiTop, 2 + 4 * 16, GuiText.Priority.getLocal(), this.itemRender ) );
|
||||
}
|
||||
|
||||
@Override
|
||||
public void drawFG( final int offsetX, final int offsetY, final int mouseX, final int mouseY )
|
||||
{
|
||||
this.fontRenderer.drawString( this.getGuiDisplayName( GuiText.Chest.getLocal() ), 8, 6, 4210752 );
|
||||
this.fontRenderer.drawString( GuiText.inventory.getLocal(), 8, this.ySize - 96 + 3, 4210752 );
|
||||
this.font.drawString( this.getGuiDisplayName( GuiText.Chest.getLocal() ), 8, 6, 4210752 );
|
||||
this.font.drawString( GuiText.inventory.getLocal(), 8, this.ySize - 96 + 3, 4210752 );
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -66,24 +66,24 @@ public class GuiCondenser extends AEBaseGui
|
||||
}
|
||||
|
||||
@Override
|
||||
public void initGui()
|
||||
public void init()
|
||||
{
|
||||
super.initGui();
|
||||
super.init();
|
||||
|
||||
this.pb = new GuiProgressBar( this.cvc, "guis/condenser.png", 120 + this.guiLeft, 25 + this.guiTop, 178, 25, 6, 18, Direction.VERTICAL, GuiText.StoredEnergy
|
||||
.getLocal() );
|
||||
|
||||
this.mode = new GuiImgButton( 128 + this.guiLeft, 52 + this.guiTop, Settings.CONDENSER_OUTPUT, this.cvc.getOutput() );
|
||||
|
||||
this.buttonList.add( this.pb );
|
||||
this.buttonList.add( this.mode );
|
||||
this.addButton( this.pb );
|
||||
this.addButton( this.mode );
|
||||
}
|
||||
|
||||
@Override
|
||||
public void drawFG( final int offsetX, final int offsetY, final int mouseX, final int mouseY )
|
||||
{
|
||||
this.fontRenderer.drawString( this.getGuiDisplayName( GuiText.Condenser.getLocal() ), 8, 6, 4210752 );
|
||||
this.fontRenderer.drawString( GuiText.inventory.getLocal(), 8, this.ySize - 96 + 3, 4210752 );
|
||||
this.font.drawString( this.getGuiDisplayName( GuiText.Condenser.getLocal() ), 8, 6, 4210752 );
|
||||
this.font.drawString( GuiText.inventory.getLocal(), 8, this.ySize - 96 + 3, 4210752 );
|
||||
|
||||
this.mode.set( this.cvc.getOutput() );
|
||||
this.mode.setFillVar( String.valueOf( this.cvc.getOutput().requiredPower ) );
|
||||
|
||||
@@ -25,7 +25,6 @@ import net.minecraft.client.gui.GuiButton;
|
||||
import net.minecraft.entity.player.PlayerInventory;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
import appeng.api.AEApi;
|
||||
import appeng.api.definitions.IDefinitions;
|
||||
import appeng.api.definitions.IParts;
|
||||
import appeng.api.storage.ITerminalHost;
|
||||
@@ -72,26 +71,26 @@ public class GuiCraftAmount extends AEBaseGui
|
||||
}
|
||||
|
||||
@Override
|
||||
public void initGui()
|
||||
public void init()
|
||||
{
|
||||
super.initGui();
|
||||
super.init();
|
||||
|
||||
final int a = AEConfig.instance().craftItemsByStackAmounts( 0 );
|
||||
final int b = AEConfig.instance().craftItemsByStackAmounts( 1 );
|
||||
final int c = AEConfig.instance().craftItemsByStackAmounts( 2 );
|
||||
final int d = AEConfig.instance().craftItemsByStackAmounts( 3 );
|
||||
|
||||
this.buttonList.add( this.plus1 = new GuiButton( 0, this.guiLeft + 20, this.guiTop + 26, 22, 20, "+" + a ) );
|
||||
this.buttonList.add( this.plus10 = new GuiButton( 0, this.guiLeft + 48, this.guiTop + 26, 28, 20, "+" + b ) );
|
||||
this.buttonList.add( this.plus100 = new GuiButton( 0, this.guiLeft + 82, this.guiTop + 26, 32, 20, "+" + c ) );
|
||||
this.buttonList.add( this.plus1000 = new GuiButton( 0, this.guiLeft + 120, this.guiTop + 26, 38, 20, "+" + d ) );
|
||||
this.addButton( this.plus1 = new GuiButton( 0, this.guiLeft + 20, this.guiTop + 26, 22, 20, "+" + a ) );
|
||||
this.addButton( this.plus10 = new GuiButton( 0, this.guiLeft + 48, this.guiTop + 26, 28, 20, "+" + b ) );
|
||||
this.addButton( this.plus100 = new GuiButton( 0, this.guiLeft + 82, this.guiTop + 26, 32, 20, "+" + c ) );
|
||||
this.addButton( this.plus1000 = new GuiButton( 0, this.guiLeft + 120, this.guiTop + 26, 38, 20, "+" + d ) );
|
||||
|
||||
this.buttonList.add( this.minus1 = new GuiButton( 0, this.guiLeft + 20, this.guiTop + 75, 22, 20, "-" + a ) );
|
||||
this.buttonList.add( this.minus10 = new GuiButton( 0, this.guiLeft + 48, this.guiTop + 75, 28, 20, "-" + b ) );
|
||||
this.buttonList.add( this.minus100 = new GuiButton( 0, this.guiLeft + 82, this.guiTop + 75, 32, 20, "-" + c ) );
|
||||
this.buttonList.add( this.minus1000 = new GuiButton( 0, this.guiLeft + 120, this.guiTop + 75, 38, 20, "-" + d ) );
|
||||
this.addButton( this.minus1 = new GuiButton( 0, this.guiLeft + 20, this.guiTop + 75, 22, 20, "-" + a ) );
|
||||
this.addButton( this.minus10 = new GuiButton( 0, this.guiLeft + 48, this.guiTop + 75, 28, 20, "-" + b ) );
|
||||
this.addButton( this.minus100 = new GuiButton( 0, this.guiLeft + 82, this.guiTop + 75, 32, 20, "-" + c ) );
|
||||
this.addButton( this.minus1000 = new GuiButton( 0, this.guiLeft + 120, this.guiTop + 75, 38, 20, "-" + d ) );
|
||||
|
||||
this.buttonList.add( this.next = new GuiButton( 0, this.guiLeft + 128, this.guiTop + 51, 38, 20, GuiText.Next.getLocal() ) );
|
||||
this.addButton( this.next = new GuiButton( 0, this.guiLeft + 128, this.guiTop + 51, 38, 20, GuiText.Next.getLocal() ) );
|
||||
|
||||
ItemStack myIcon = null;
|
||||
final Object target = ( (AEBaseContainer) this.inventorySlots ).getTarget();
|
||||
@@ -125,10 +124,10 @@ public class GuiCraftAmount extends AEBaseGui
|
||||
|
||||
if( this.originalGui != null && !myIcon.isEmpty() )
|
||||
{
|
||||
this.buttonList.add( this.originalGuiBtn = new GuiTabButton( this.guiLeft + 154, this.guiTop, myIcon, myIcon.getDisplayName(), this.itemRender ) );
|
||||
this.addButton( this.originalGuiBtn = new GuiTabButton( this.guiLeft + 154, this.guiTop, myIcon, myIcon.getDisplayName(), this.itemRender ) );
|
||||
}
|
||||
|
||||
this.amountToCraft = new GuiNumberBox( this.fontRenderer, this.guiLeft + 62, this.guiTop + 57, 59, this.fontRenderer.FONT_HEIGHT, Integer.class );
|
||||
this.amountToCraft = new GuiNumberBox( this.font, this.guiLeft + 62, this.guiTop + 57, 59, this.font.FONT_HEIGHT, Integer.class );
|
||||
this.amountToCraft.setEnableBackgroundDrawing( false );
|
||||
this.amountToCraft.setMaxStringLength( 16 );
|
||||
this.amountToCraft.setTextColor( 0xFFFFFF );
|
||||
@@ -140,13 +139,13 @@ public class GuiCraftAmount extends AEBaseGui
|
||||
@Override
|
||||
public void drawFG( final int offsetX, final int offsetY, final int mouseX, final int mouseY )
|
||||
{
|
||||
this.fontRenderer.drawString( GuiText.SelectAmount.getLocal(), 8, 6, 4210752 );
|
||||
this.font.drawString( GuiText.SelectAmount.getLocal(), 8, 6, 4210752 );
|
||||
}
|
||||
|
||||
@Override
|
||||
public void drawBG( final int offsetX, final int offsetY, final int mouseX, final int mouseY )
|
||||
{
|
||||
this.next.displayString = isShiftKeyDown() ? GuiText.Start.getLocal() : GuiText.Next.getLocal();
|
||||
this.next.displayString = hasShiftDown() ? GuiText.Start.getLocal() : GuiText.Next.getLocal();
|
||||
|
||||
this.bindTexture( "guis/craft_amt.png" );
|
||||
this.drawTexturedModalRect( offsetX, offsetY, 0, 0, this.xSize, this.ySize );
|
||||
@@ -230,7 +229,7 @@ public class GuiCraftAmount extends AEBaseGui
|
||||
|
||||
if( btn == this.next )
|
||||
{
|
||||
NetworkHandler.instance().sendToServer( new PacketCraftRequest( Integer.parseInt( this.amountToCraft.getText() ), isShiftKeyDown() ) );
|
||||
NetworkHandler.instance().sendToServer( new PacketCraftRequest( Integer.parseInt( this.amountToCraft.getText() ), hasShiftDown() ) );
|
||||
}
|
||||
}
|
||||
catch( final NumberFormatException e )
|
||||
|
||||
@@ -34,7 +34,6 @@ import net.minecraft.client.renderer.GlStateManager;
|
||||
import net.minecraft.entity.player.PlayerInventory;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
import appeng.api.AEApi;
|
||||
import appeng.api.storage.ITerminalHost;
|
||||
import appeng.api.storage.channels.IItemStorageChannel;
|
||||
import appeng.api.storage.data.IAEItemStack;
|
||||
@@ -112,29 +111,29 @@ public class GuiCraftConfirm extends AEBaseGui
|
||||
}
|
||||
|
||||
@Override
|
||||
public void initGui()
|
||||
public void init()
|
||||
{
|
||||
super.initGui();
|
||||
super.init();
|
||||
|
||||
this.start = new GuiButton( 0, this.guiLeft + 162, this.guiTop + this.ySize - 25, 50, 20, GuiText.Start.getLocal() );
|
||||
this.start.enabled = false;
|
||||
this.buttonList.add( this.start );
|
||||
this.addButton( this.start );
|
||||
|
||||
this.selectCPU = new GuiButton( 0, this.guiLeft + ( 219 - 180 ) / 2, this.guiTop + this.ySize - 68, 180, 20, GuiText.CraftingCPU
|
||||
.getLocal() + ": " + GuiText.Automatic );
|
||||
this.selectCPU.enabled = false;
|
||||
this.buttonList.add( this.selectCPU );
|
||||
this.addButton( this.selectCPU );
|
||||
|
||||
if( this.OriginalGui != null )
|
||||
{
|
||||
this.cancel = new GuiButton( 0, this.guiLeft + 6, this.guiTop + this.ySize - 25, 50, 20, GuiText.Cancel.getLocal() );
|
||||
}
|
||||
|
||||
this.buttonList.add( this.cancel );
|
||||
this.addButton( this.cancel );
|
||||
}
|
||||
|
||||
@Override
|
||||
public void drawScreen( final int mouseX, final int mouseY, final float btn )
|
||||
public void render(final int mouseX, final int mouseY, final float btn )
|
||||
{
|
||||
this.updateCPUButtonText();
|
||||
|
||||
@@ -172,7 +171,7 @@ public class GuiCraftConfirm extends AEBaseGui
|
||||
}
|
||||
}
|
||||
|
||||
super.drawScreen( mouseX, mouseY, btn );
|
||||
super.render( mouseX, mouseY, btn );
|
||||
}
|
||||
|
||||
private void updateCPUButtonText()
|
||||
@@ -210,7 +209,7 @@ public class GuiCraftConfirm extends AEBaseGui
|
||||
final long BytesUsed = this.ccc.getUsedBytes();
|
||||
final String byteUsed = NumberFormat.getInstance().format( BytesUsed );
|
||||
final String Add = BytesUsed > 0 ? ( byteUsed + ' ' + GuiText.BytesUsed.getLocal() ) : GuiText.CalculatingWait.getLocal();
|
||||
this.fontRenderer.drawString( GuiText.CraftingPlan.getLocal() + " - " + Add, 8, 7, 4210752 );
|
||||
this.font.drawString( GuiText.CraftingPlan.getLocal() + " - " + Add, 8, 7, 4210752 );
|
||||
|
||||
String dsp = null;
|
||||
|
||||
@@ -224,8 +223,8 @@ public class GuiCraftConfirm extends AEBaseGui
|
||||
.getLocal() + ": " + this.ccc.getCpuCoProcessors() ) : GuiText.Bytes.getLocal() + ": N/A : " + GuiText.CoProcessors.getLocal() + ": N/A";
|
||||
}
|
||||
|
||||
final int offset = ( 219 - this.fontRenderer.getStringWidth( dsp ) ) / 2;
|
||||
this.fontRenderer.drawString( dsp, offset, 165, 4210752 );
|
||||
final int offset = ( 219 - this.font.getStringWidth( dsp ) ) / 2;
|
||||
this.font.drawString( dsp, offset, 165, 4210752 );
|
||||
|
||||
final int sectionLength = 67;
|
||||
|
||||
@@ -286,8 +285,8 @@ public class GuiCraftConfirm extends AEBaseGui
|
||||
}
|
||||
|
||||
str = GuiText.FromStorage.getLocal() + ": " + str;
|
||||
final int w = 4 + this.fontRenderer.getStringWidth( str );
|
||||
this.fontRenderer.drawString( str, (int) ( ( x * ( 1 + sectionLength ) + xo + sectionLength - 19 - ( w * 0.5 ) ) * 2 ),
|
||||
final int w = 4 + this.font.getStringWidth( str );
|
||||
this.font.drawString( str, (int) ( ( x * ( 1 + sectionLength ) + xo + sectionLength - 19 - ( w * 0.5 ) ) * 2 ),
|
||||
( y * offY + yo + 6 - negY + downY ) * 2, 4210752 );
|
||||
|
||||
if( this.tooltip == z - viewStart )
|
||||
@@ -312,8 +311,8 @@ public class GuiCraftConfirm extends AEBaseGui
|
||||
}
|
||||
|
||||
str = GuiText.Missing.getLocal() + ": " + str;
|
||||
final int w = 4 + this.fontRenderer.getStringWidth( str );
|
||||
this.fontRenderer.drawString( str, (int) ( ( x * ( 1 + sectionLength ) + xo + sectionLength - 19 - ( w * 0.5 ) ) * 2 ),
|
||||
final int w = 4 + this.font.getStringWidth( str );
|
||||
this.font.drawString( str, (int) ( ( x * ( 1 + sectionLength ) + xo + sectionLength - 19 - ( w * 0.5 ) ) * 2 ),
|
||||
( y * offY + yo + 6 - negY + downY ) * 2, 4210752 );
|
||||
|
||||
if( this.tooltip == z - viewStart )
|
||||
@@ -338,8 +337,8 @@ public class GuiCraftConfirm extends AEBaseGui
|
||||
}
|
||||
|
||||
str = GuiText.ToCraft.getLocal() + ": " + str;
|
||||
final int w = 4 + this.fontRenderer.getStringWidth( str );
|
||||
this.fontRenderer.drawString( str, (int) ( ( x * ( 1 + sectionLength ) + xo + sectionLength - 19 - ( w * 0.5 ) ) * 2 ),
|
||||
final int w = 4 + this.font.getStringWidth( str );
|
||||
this.font.drawString( str, (int) ( ( x * ( 1 + sectionLength ) + xo + sectionLength - 19 - ( w * 0.5 ) ) * 2 ),
|
||||
( y * offY + yo + 6 - negY + downY ) * 2, 4210752 );
|
||||
|
||||
if( this.tooltip == z - viewStart )
|
||||
@@ -373,7 +372,7 @@ public class GuiCraftConfirm extends AEBaseGui
|
||||
{
|
||||
final int startX = x * ( 1 + sectionLength ) + xo;
|
||||
final int startY = posY - 4;
|
||||
drawRect( startX, startY, startX + sectionLength, startY + offY, 0x1AFF0000 );
|
||||
fill( startX, startY, startX + sectionLength, startY + offY, 0x1AFF0000 );
|
||||
}
|
||||
|
||||
x++;
|
||||
|
||||
@@ -34,7 +34,6 @@ import net.minecraft.client.renderer.GlStateManager;
|
||||
import net.minecraft.entity.player.PlayerInventory;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
import appeng.api.AEApi;
|
||||
import appeng.api.config.SortDir;
|
||||
import appeng.api.config.SortOrder;
|
||||
import appeng.api.config.ViewItems;
|
||||
@@ -135,13 +134,13 @@ public class GuiCraftingCPU extends AEBaseGui implements ISortSource
|
||||
}
|
||||
|
||||
@Override
|
||||
public void initGui()
|
||||
public void init()
|
||||
{
|
||||
super.initGui();
|
||||
super.init();
|
||||
this.setScrollBar();
|
||||
this.cancel = new GuiButton( 0, this.guiLeft + CANCEL_LEFT_OFFSET, this.guiTop + this.ySize - CANCEL_TOP_OFFSET, CANCEL_WIDTH, CANCEL_HEIGHT, GuiText.Cancel
|
||||
.getLocal() );
|
||||
this.buttonList.add( this.cancel );
|
||||
this.addButton( this.cancel );
|
||||
}
|
||||
|
||||
private void setScrollBar()
|
||||
@@ -153,7 +152,7 @@ public class GuiCraftingCPU extends AEBaseGui implements ISortSource
|
||||
}
|
||||
|
||||
@Override
|
||||
public void drawScreen( final int mouseX, final int mouseY, final float btn )
|
||||
public void render(final int mouseX, final int mouseY, final float btn )
|
||||
{
|
||||
this.cancel.enabled = !this.visual.isEmpty();
|
||||
|
||||
@@ -188,7 +187,7 @@ public class GuiCraftingCPU extends AEBaseGui implements ISortSource
|
||||
}
|
||||
}
|
||||
|
||||
super.drawScreen( mouseX, mouseY, btn );
|
||||
super.render( mouseX, mouseY, btn );
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -203,7 +202,7 @@ public class GuiCraftingCPU extends AEBaseGui implements ISortSource
|
||||
title += " - " + etaTimeText;
|
||||
}
|
||||
|
||||
this.fontRenderer.drawString( title, TITLE_LEFT_OFFSET, TITLE_TOP_OFFSET, TEXT_COLOR );
|
||||
this.font.drawString( title, TITLE_LEFT_OFFSET, TITLE_TOP_OFFSET, TEXT_COLOR );
|
||||
|
||||
int x = 0;
|
||||
int y = 0;
|
||||
@@ -254,7 +253,7 @@ public class GuiCraftingCPU extends AEBaseGui implements ISortSource
|
||||
final int bgColor = ( active ? AEColor.GREEN.blackVariant : AEColor.YELLOW.blackVariant ) | BACKGROUND_ALPHA;
|
||||
final int startX = ( x * ( 1 + SECTION_LENGTH ) + ITEMSTACK_LEFT_OFFSET ) * 2;
|
||||
final int startY = ( ( y * offY + ITEMSTACK_TOP_OFFSET ) - 3 ) * 2;
|
||||
drawRect( startX, startY, startX + ( SECTION_LENGTH * 2 ), startY + ( offY * 2 ) - 2, bgColor );
|
||||
fill( startX, startY, startX + ( SECTION_LENGTH * 2 ), startY + ( offY * 2 ) - 2, bgColor );
|
||||
}
|
||||
|
||||
final int negY = ( ( lines - 1 ) * 5 ) / 2;
|
||||
@@ -263,8 +262,8 @@ public class GuiCraftingCPU extends AEBaseGui implements ISortSource
|
||||
if( stored != null && stored.getStackSize() > 0 )
|
||||
{
|
||||
final String str = GuiText.Stored.getLocal() + ": " + converter.toWideReadableForm( stored.getStackSize() );
|
||||
final int w = 4 + this.fontRenderer.getStringWidth( str );
|
||||
this.fontRenderer.drawString( str, (int) ( ( x * ( 1 + SECTION_LENGTH ) + ITEMSTACK_LEFT_OFFSET + SECTION_LENGTH - 19 - ( w * 0.5 ) ) * 2 ),
|
||||
final int w = 4 + this.font.getStringWidth( str );
|
||||
this.font.drawString( str, (int) ( ( x * ( 1 + SECTION_LENGTH ) + ITEMSTACK_LEFT_OFFSET + SECTION_LENGTH - 19 - ( w * 0.5 ) ) * 2 ),
|
||||
( y * offY + ITEMSTACK_TOP_OFFSET + 6 - negY + downY ) * 2, TEXT_COLOR );
|
||||
|
||||
if( this.tooltip == z - viewStart )
|
||||
@@ -278,9 +277,9 @@ public class GuiCraftingCPU extends AEBaseGui implements ISortSource
|
||||
if( activeStack != null && activeStack.getStackSize() > 0 )
|
||||
{
|
||||
final String str = GuiText.Crafting.getLocal() + ": " + converter.toWideReadableForm( activeStack.getStackSize() );
|
||||
final int w = 4 + this.fontRenderer.getStringWidth( str );
|
||||
final int w = 4 + this.font.getStringWidth( str );
|
||||
|
||||
this.fontRenderer.drawString( str, (int) ( ( x * ( 1 + SECTION_LENGTH ) + ITEMSTACK_LEFT_OFFSET + SECTION_LENGTH - 19 - ( w * 0.5 ) ) * 2 ),
|
||||
this.font.drawString( str, (int) ( ( x * ( 1 + SECTION_LENGTH ) + ITEMSTACK_LEFT_OFFSET + SECTION_LENGTH - 19 - ( w * 0.5 ) ) * 2 ),
|
||||
( y * offY + ITEMSTACK_TOP_OFFSET + 6 - negY + downY ) * 2, TEXT_COLOR );
|
||||
|
||||
if( this.tooltip == z - viewStart )
|
||||
@@ -294,9 +293,9 @@ public class GuiCraftingCPU extends AEBaseGui implements ISortSource
|
||||
if( pendingStack != null && pendingStack.getStackSize() > 0 )
|
||||
{
|
||||
final String str = GuiText.Scheduled.getLocal() + ": " + converter.toWideReadableForm( pendingStack.getStackSize() );
|
||||
final int w = 4 + this.fontRenderer.getStringWidth( str );
|
||||
final int w = 4 + this.font.getStringWidth( str );
|
||||
|
||||
this.fontRenderer.drawString( str, (int) ( ( x * ( 1 + SECTION_LENGTH ) + ITEMSTACK_LEFT_OFFSET + SECTION_LENGTH - 19 - ( w * 0.5 ) ) * 2 ),
|
||||
this.font.drawString( str, (int) ( ( x * ( 1 + SECTION_LENGTH ) + ITEMSTACK_LEFT_OFFSET + SECTION_LENGTH - 19 - ( w * 0.5 ) ) * 2 ),
|
||||
( y * offY + ITEMSTACK_TOP_OFFSET + 6 - negY + downY ) * 2, TEXT_COLOR );
|
||||
|
||||
if( this.tooltip == z - viewStart )
|
||||
|
||||
@@ -31,7 +31,6 @@ import net.minecraft.client.gui.GuiButton;
|
||||
import net.minecraft.entity.player.PlayerInventory;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
import appeng.api.AEApi;
|
||||
import appeng.api.definitions.IDefinitions;
|
||||
import appeng.api.definitions.IParts;
|
||||
import appeng.api.storage.ITerminalHost;
|
||||
@@ -123,28 +122,28 @@ public class GuiCraftingStatus extends GuiCraftingCPU
|
||||
}
|
||||
|
||||
@Override
|
||||
public void initGui()
|
||||
public void init()
|
||||
{
|
||||
super.initGui();
|
||||
super.init();
|
||||
|
||||
this.selectCPU = new GuiButton( 0, this.guiLeft + 8, this.guiTop + this.ySize - 25, 150, 20, GuiText.CraftingCPU
|
||||
.getLocal() + ": " + GuiText.NoCraftingCPUs );
|
||||
// selectCPU.enabled = false;
|
||||
this.buttonList.add( this.selectCPU );
|
||||
this.addButton( this.selectCPU );
|
||||
|
||||
if( !this.myIcon.isEmpty() )
|
||||
{
|
||||
this.buttonList.add(
|
||||
this.addButton(
|
||||
this.originalGuiBtn = new GuiTabButton( this.guiLeft + 213, this.guiTop - 4, this.myIcon, this.myIcon.getDisplayName(), this.itemRender ) );
|
||||
this.originalGuiBtn.setHideEdge( 13 );
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void drawScreen( final int mouseX, final int mouseY, final float btn )
|
||||
public void render(final int mouseX, final int mouseY, final float btn )
|
||||
{
|
||||
this.updateCPUButtonText();
|
||||
super.drawScreen( mouseX, mouseY, btn );
|
||||
super.render( mouseX, mouseY, btn );
|
||||
}
|
||||
|
||||
private void updateCPUButtonText()
|
||||
|
||||
@@ -73,10 +73,10 @@ public class GuiCraftingTerm extends GuiMEMonitorable
|
||||
}
|
||||
|
||||
@Override
|
||||
public void initGui()
|
||||
public void init()
|
||||
{
|
||||
super.initGui();
|
||||
this.buttonList.add( this.clearBtn = new GuiImgButton( this.guiLeft + 92, this.guiTop + this.ySize - 156, Settings.ACTIONS, ActionItems.STASH ) );
|
||||
super.init();
|
||||
this.addButton( this.clearBtn = new GuiImgButton( this.guiLeft + 92, this.guiTop + this.ySize - 156, Settings.ACTIONS, ActionItems.STASH ) );
|
||||
this.clearBtn.setHalfSize( true );
|
||||
}
|
||||
|
||||
@@ -84,7 +84,7 @@ public class GuiCraftingTerm extends GuiMEMonitorable
|
||||
public void drawFG( final int offsetX, final int offsetY, final int mouseX, final int mouseY )
|
||||
{
|
||||
super.drawFG( offsetX, offsetY, mouseX, mouseY );
|
||||
this.fontRenderer.drawString( GuiText.CraftingTerminal.getLocal(), 8, this.ySize - 96 + 1 - this.getReservedSpace(), 4210752 );
|
||||
this.font.drawString( GuiText.CraftingTerminal.getLocal(), 8, this.ySize - 96 + 1 - this.getReservedSpace(), 4210752 );
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -57,18 +57,18 @@ public class GuiDrive extends AEBaseGui
|
||||
}
|
||||
|
||||
@Override
|
||||
public void initGui()
|
||||
public void init()
|
||||
{
|
||||
super.initGui();
|
||||
super.init();
|
||||
|
||||
this.buttonList.add( this.priority = new GuiTabButton( this.guiLeft + 154, this.guiTop, 2 + 4 * 16, GuiText.Priority.getLocal(), this.itemRender ) );
|
||||
this.addButton( this.priority = new GuiTabButton( this.guiLeft + 154, this.guiTop, 2 + 4 * 16, GuiText.Priority.getLocal(), this.itemRender ) );
|
||||
}
|
||||
|
||||
@Override
|
||||
public void drawFG( final int offsetX, final int offsetY, final int mouseX, final int mouseY )
|
||||
{
|
||||
this.fontRenderer.drawString( this.getGuiDisplayName( GuiText.Drive.getLocal() ), 8, 6, 4210752 );
|
||||
this.fontRenderer.drawString( GuiText.inventory.getLocal(), 8, this.ySize - 96 + 3, 4210752 );
|
||||
this.font.drawString( this.getGuiDisplayName( GuiText.Drive.getLocal() ), 8, 6, 4210752 );
|
||||
this.font.drawString( GuiText.inventory.getLocal(), 8, this.ySize - 96 + 3, 4210752 );
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -58,17 +58,17 @@ public class GuiFormationPlane extends GuiUpgradeable
|
||||
this.placeMode = new GuiImgButton( this.guiLeft - 18, this.guiTop + 28, Settings.PLACE_BLOCK, YesNo.YES );
|
||||
this.fuzzyMode = new GuiImgButton( this.guiLeft - 18, this.guiTop + 48, Settings.FUZZY_MODE, FuzzyMode.IGNORE_ALL );
|
||||
|
||||
this.buttonList.add( this.priority = new GuiTabButton( this.guiLeft + 154, this.guiTop, 2 + 4 * 16, GuiText.Priority.getLocal(), this.itemRender ) );
|
||||
this.addButton( this.priority = new GuiTabButton( this.guiLeft + 154, this.guiTop, 2 + 4 * 16, GuiText.Priority.getLocal(), this.itemRender ) );
|
||||
|
||||
this.buttonList.add( this.placeMode );
|
||||
this.buttonList.add( this.fuzzyMode );
|
||||
this.addButton( this.placeMode );
|
||||
this.addButton( this.fuzzyMode );
|
||||
}
|
||||
|
||||
@Override
|
||||
public void drawFG( final int offsetX, final int offsetY, final int mouseX, final int mouseY )
|
||||
{
|
||||
this.fontRenderer.drawString( this.getGuiDisplayName( GuiText.FormationPlane.getLocal() ), 8, 6, 4210752 );
|
||||
this.fontRenderer.drawString( GuiText.inventory.getLocal(), 8, this.ySize - 96 + 3, 4210752 );
|
||||
this.font.drawString( this.getGuiDisplayName( GuiText.FormationPlane.getLocal() ), 8, 6, 4210752 );
|
||||
this.font.drawString( GuiText.inventory.getLocal(), 8, this.ySize - 96 + 3, 4210752 );
|
||||
|
||||
if( this.fuzzyMode != null )
|
||||
{
|
||||
|
||||
@@ -39,8 +39,8 @@ public class GuiGrinder extends AEBaseGui
|
||||
@Override
|
||||
public void drawFG( final int offsetX, final int offsetY, final int mouseX, final int mouseY )
|
||||
{
|
||||
this.fontRenderer.drawString( this.getGuiDisplayName( GuiText.GrindStone.getLocal() ), 8, 6, 4210752 );
|
||||
this.fontRenderer.drawString( GuiText.inventory.getLocal(), 8, this.ySize - 96 + 3, 4210752 );
|
||||
this.font.drawString( this.getGuiDisplayName( GuiText.GrindStone.getLocal() ), 8, 6, 4210752 );
|
||||
this.font.drawString( GuiText.inventory.getLocal(), 8, this.ySize - 96 + 3, 4210752 );
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -59,16 +59,16 @@ public class GuiIOPort extends GuiUpgradeable
|
||||
this.fullMode = new GuiImgButton( this.guiLeft - 18, this.guiTop + 8, Settings.FULLNESS_MODE, FullnessMode.EMPTY );
|
||||
this.operationMode = new GuiImgButton( this.guiLeft + 80, this.guiTop + 17, Settings.OPERATION_MODE, OperationMode.EMPTY );
|
||||
|
||||
this.buttonList.add( this.operationMode );
|
||||
this.buttonList.add( this.redstoneMode );
|
||||
this.buttonList.add( this.fullMode );
|
||||
this.addButton( this.operationMode );
|
||||
this.addButton( this.redstoneMode );
|
||||
this.addButton( this.fullMode );
|
||||
}
|
||||
|
||||
@Override
|
||||
public void drawFG( final int offsetX, final int offsetY, final int mouseX, final int mouseY )
|
||||
{
|
||||
this.fontRenderer.drawString( this.getGuiDisplayName( GuiText.IOPort.getLocal() ), 8, 6, 4210752 );
|
||||
this.fontRenderer.drawString( GuiText.inventory.getLocal(), 8, this.ySize - 96 + 3, 4210752 );
|
||||
this.font.drawString( this.getGuiDisplayName( GuiText.IOPort.getLocal() ), 8, 6, 4210752 );
|
||||
this.font.drawString( GuiText.inventory.getLocal(), 8, this.ySize - 96 + 3, 4210752 );
|
||||
|
||||
if( this.redstoneMode != null )
|
||||
{
|
||||
|
||||
@@ -50,12 +50,12 @@ public class GuiInscriber extends AEBaseGui
|
||||
}
|
||||
|
||||
@Override
|
||||
public void initGui()
|
||||
public void init()
|
||||
{
|
||||
super.initGui();
|
||||
super.init();
|
||||
|
||||
this.pb = new GuiProgressBar( this.cvc, "guis/inscriber.png", 135, 39, 135, 177, 6, 18, Direction.VERTICAL );
|
||||
this.buttonList.add( this.pb );
|
||||
this.addButton( this.pb );
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -63,8 +63,8 @@ public class GuiInscriber extends AEBaseGui
|
||||
{
|
||||
this.pb.setFullMsg( this.cvc.getCurrentProgress() * 100 / this.cvc.getMaxProgress() + "%" );
|
||||
|
||||
this.fontRenderer.drawString( this.getGuiDisplayName( GuiText.Inscriber.getLocal() ), 8, 6, 4210752 );
|
||||
this.fontRenderer.drawString( GuiText.inventory.getLocal(), 8, this.ySize - 96 + 3, 4210752 );
|
||||
this.font.drawString( this.getGuiDisplayName( GuiText.Inscriber.getLocal() ), 8, 6, 4210752 );
|
||||
this.font.drawString( GuiText.inventory.getLocal(), 8, this.ySize - 96 + 3, 4210752 );
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -57,14 +57,14 @@ public class GuiInterface extends GuiUpgradeable
|
||||
protected void addButtons()
|
||||
{
|
||||
this.priority = new GuiTabButton( this.guiLeft + 154, this.guiTop, 2 + 4 * 16, GuiText.Priority.getLocal(), this.itemRender );
|
||||
this.buttonList.add( this.priority );
|
||||
this.addButton( this.priority );
|
||||
|
||||
this.BlockMode = new GuiImgButton( this.guiLeft - 18, this.guiTop + 8, Settings.BLOCK, YesNo.NO );
|
||||
this.buttonList.add( this.BlockMode );
|
||||
this.addButton( this.BlockMode );
|
||||
|
||||
this.interfaceMode = new GuiToggleButton( this.guiLeft - 18, this.guiTop + 26, 84, 85, GuiText.InterfaceTerminal
|
||||
.getLocal(), GuiText.InterfaceTerminalHint.getLocal() );
|
||||
this.buttonList.add( this.interfaceMode );
|
||||
this.addButton( this.interfaceMode );
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -80,13 +80,13 @@ public class GuiInterface extends GuiUpgradeable
|
||||
this.interfaceMode.setState( ( (ContainerInterface) this.cvb ).getInterfaceTerminalMode() == YesNo.YES );
|
||||
}
|
||||
|
||||
this.fontRenderer.drawString( this.getGuiDisplayName( GuiText.Interface.getLocal() ), 8, 6, 4210752 );
|
||||
this.font.drawString( this.getGuiDisplayName( GuiText.Interface.getLocal() ), 8, 6, 4210752 );
|
||||
|
||||
this.fontRenderer.drawString( GuiText.Config.getLocal(), 8, 6 + 11 + 7, 4210752 );
|
||||
this.fontRenderer.drawString( GuiText.StoredItems.getLocal(), 8, 6 + 60 + 7, 4210752 );
|
||||
this.fontRenderer.drawString( GuiText.Patterns.getLocal(), 8, 6 + 73 + 7, 4210752 );
|
||||
this.font.drawString( GuiText.Config.getLocal(), 8, 6 + 11 + 7, 4210752 );
|
||||
this.font.drawString( GuiText.StoredItems.getLocal(), 8, 6 + 60 + 7, 4210752 );
|
||||
this.font.drawString( GuiText.Patterns.getLocal(), 8, 6 + 73 + 7, 4210752 );
|
||||
|
||||
this.fontRenderer.drawString( GuiText.inventory.getLocal(), 8, this.ySize - 96 + 3, 4210752 );
|
||||
this.font.drawString( GuiText.inventory.getLocal(), 8, this.ySize - 96 + 3, 4210752 );
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -36,9 +36,8 @@ import net.minecraft.entity.player.PlayerInventory;
|
||||
import net.minecraft.inventory.Slot;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.CompoundNBT;
|
||||
import net.minecraft.nbt.NBTTagList;
|
||||
import net.minecraft.nbt.ListNBT;
|
||||
|
||||
import appeng.api.AEApi;
|
||||
import appeng.api.storage.channels.IItemStorageChannel;
|
||||
import appeng.client.gui.AEBaseGui;
|
||||
import appeng.client.gui.widgets.GuiScrollbar;
|
||||
@@ -80,15 +79,15 @@ public class GuiInterfaceTerminal extends AEBaseGui
|
||||
}
|
||||
|
||||
@Override
|
||||
public void initGui()
|
||||
public void init()
|
||||
{
|
||||
super.initGui();
|
||||
super.init();
|
||||
|
||||
this.getScrollBar().setLeft( 175 );
|
||||
this.getScrollBar().setHeight( 106 );
|
||||
this.getScrollBar().setTop( 18 );
|
||||
|
||||
this.searchField = new MEGuiTextField( this.fontRenderer, this.guiLeft + Math.max( 104, this.offsetX ), this.guiTop + 4, 65, 12 );
|
||||
this.searchField = new MEGuiTextField( this.font, this.guiLeft + Math.max( 104, this.offsetX ), this.guiTop + 4, 65, 12 );
|
||||
this.searchField.setEnableBackgroundDrawing( false );
|
||||
this.searchField.setMaxStringLength( 25 );
|
||||
this.searchField.setTextColor( 0xFFFFFF );
|
||||
@@ -99,8 +98,8 @@ public class GuiInterfaceTerminal extends AEBaseGui
|
||||
@Override
|
||||
public void drawFG( final int offsetX, final int offsetY, final int mouseX, final int mouseY )
|
||||
{
|
||||
this.fontRenderer.drawString( this.getGuiDisplayName( GuiText.InterfaceTerminal.getLocal() ), 8, 6, 4210752 );
|
||||
this.fontRenderer.drawString( GuiText.inventory.getLocal(), 8, this.ySize - 96 + 3, 4210752 );
|
||||
this.font.drawString( this.getGuiDisplayName( GuiText.InterfaceTerminal.getLocal() ), 8, 6, 4210752 );
|
||||
this.font.drawString( GuiText.inventory.getLocal(), 8, this.ySize - 96 + 3, 4210752 );
|
||||
|
||||
final int ex = this.getScrollBar().getCurrentScroll();
|
||||
|
||||
@@ -134,12 +133,12 @@ public class GuiInterfaceTerminal extends AEBaseGui
|
||||
name = name + " (" + rows + ')';
|
||||
}
|
||||
|
||||
while( name.length() > 2 && this.fontRenderer.getStringWidth( name ) > 155 )
|
||||
while( name.length() > 2 && this.font.getStringWidth( name ) > 155 )
|
||||
{
|
||||
name = name.substring( 0, name.length() - 1 );
|
||||
}
|
||||
|
||||
this.fontRenderer.drawString( name, 10, 6 + offset, 4210752 );
|
||||
this.font.drawString( name, 10, 6 + offset, 4210752 );
|
||||
}
|
||||
offset += 18;
|
||||
}
|
||||
@@ -175,7 +174,7 @@ public class GuiInterfaceTerminal extends AEBaseGui
|
||||
{
|
||||
final ClientDCInternalInv inv = (ClientDCInternalInv) lineObj;
|
||||
|
||||
GlStateManager.color( 1, 1, 1, 1 );
|
||||
RenderSystem.color4f( 1, 1, 1, 1 );
|
||||
final int width = inv.getInventory().getSlots() * 18;
|
||||
this.drawTexturedModalRect( offsetX + 7, offsetY + offset, 7, 139, width, 18 );
|
||||
}
|
||||
@@ -339,8 +338,8 @@ public class GuiInterfaceTerminal extends AEBaseGui
|
||||
}
|
||||
|
||||
// Potential later use to filter by input
|
||||
// NBTTagList inTag = encodedValue.getTagList( "in", 10 );
|
||||
final NBTTagList outTag = encodedValue.getTagList( "out", 10 );
|
||||
// ListNBT inTag = encodedValue.getTagList( "in", 10 );
|
||||
final ListNBT outTag = encodedValue.getTagList( "out", 10 );
|
||||
|
||||
for( int i = 0; i < outTag.tagCount(); i++ )
|
||||
{
|
||||
|
||||
@@ -67,11 +67,11 @@ public class GuiLevelEmitter extends GuiUpgradeable
|
||||
}
|
||||
|
||||
@Override
|
||||
public void initGui()
|
||||
public void init()
|
||||
{
|
||||
super.initGui();
|
||||
super.init();
|
||||
|
||||
this.level = new GuiNumberBox( this.fontRenderer, this.guiLeft + 24, this.guiTop + 43, 79, this.fontRenderer.FONT_HEIGHT, Long.class );
|
||||
this.level = new GuiNumberBox( this.font, this.guiLeft + 24, this.guiTop + 43, 79, this.font.FONT_HEIGHT, Long.class );
|
||||
this.level.setEnableBackgroundDrawing( false );
|
||||
this.level.setMaxStringLength( 16 );
|
||||
this.level.setTextColor( 0xFFFFFF );
|
||||
@@ -93,20 +93,20 @@ public class GuiLevelEmitter extends GuiUpgradeable
|
||||
final int c = AEConfig.instance().levelByStackAmounts( 2 );
|
||||
final int d = AEConfig.instance().levelByStackAmounts( 3 );
|
||||
|
||||
this.buttonList.add( this.plus1 = new GuiButton( 0, this.guiLeft + 20, this.guiTop + 17, 22, 20, "+" + a ) );
|
||||
this.buttonList.add( this.plus10 = new GuiButton( 0, this.guiLeft + 48, this.guiTop + 17, 28, 20, "+" + b ) );
|
||||
this.buttonList.add( this.plus100 = new GuiButton( 0, this.guiLeft + 82, this.guiTop + 17, 32, 20, "+" + c ) );
|
||||
this.buttonList.add( this.plus1000 = new GuiButton( 0, this.guiLeft + 120, this.guiTop + 17, 38, 20, "+" + d ) );
|
||||
this.addButton( this.plus1 = new GuiButton( 0, this.guiLeft + 20, this.guiTop + 17, 22, 20, "+" + a ) );
|
||||
this.addButton( this.plus10 = new GuiButton( 0, this.guiLeft + 48, this.guiTop + 17, 28, 20, "+" + b ) );
|
||||
this.addButton( this.plus100 = new GuiButton( 0, this.guiLeft + 82, this.guiTop + 17, 32, 20, "+" + c ) );
|
||||
this.addButton( this.plus1000 = new GuiButton( 0, this.guiLeft + 120, this.guiTop + 17, 38, 20, "+" + d ) );
|
||||
|
||||
this.buttonList.add( this.minus1 = new GuiButton( 0, this.guiLeft + 20, this.guiTop + 59, 22, 20, "-" + a ) );
|
||||
this.buttonList.add( this.minus10 = new GuiButton( 0, this.guiLeft + 48, this.guiTop + 59, 28, 20, "-" + b ) );
|
||||
this.buttonList.add( this.minus100 = new GuiButton( 0, this.guiLeft + 82, this.guiTop + 59, 32, 20, "-" + c ) );
|
||||
this.buttonList.add( this.minus1000 = new GuiButton( 0, this.guiLeft + 120, this.guiTop + 59, 38, 20, "-" + d ) );
|
||||
this.addButton( this.minus1 = new GuiButton( 0, this.guiLeft + 20, this.guiTop + 59, 22, 20, "-" + a ) );
|
||||
this.addButton( this.minus10 = new GuiButton( 0, this.guiLeft + 48, this.guiTop + 59, 28, 20, "-" + b ) );
|
||||
this.addButton( this.minus100 = new GuiButton( 0, this.guiLeft + 82, this.guiTop + 59, 32, 20, "-" + c ) );
|
||||
this.addButton( this.minus1000 = new GuiButton( 0, this.guiLeft + 120, this.guiTop + 59, 38, 20, "-" + d ) );
|
||||
|
||||
this.buttonList.add( this.levelMode );
|
||||
this.buttonList.add( this.redstoneMode );
|
||||
this.buttonList.add( this.fuzzyMode );
|
||||
this.buttonList.add( this.craftingMode );
|
||||
this.addButton( this.levelMode );
|
||||
this.addButton( this.redstoneMode );
|
||||
this.addButton( this.fuzzyMode );
|
||||
this.addButton( this.craftingMode );
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -45,19 +45,19 @@ public class GuiMAC extends GuiUpgradeable
|
||||
}
|
||||
|
||||
@Override
|
||||
public void initGui()
|
||||
public void init()
|
||||
{
|
||||
super.initGui();
|
||||
super.init();
|
||||
|
||||
this.pb = new GuiProgressBar( this.container, "guis/mac.png", 139, 36, 148, 201, 6, 18, Direction.VERTICAL );
|
||||
this.buttonList.add( this.pb );
|
||||
this.addButton( this.pb );
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void addButtons()
|
||||
{
|
||||
this.redstoneMode = new GuiImgButton( this.guiLeft - 18, this.guiTop + 8, Settings.REDSTONE_CONTROLLED, RedstoneMode.IGNORE );
|
||||
this.buttonList.add( this.redstoneMode );
|
||||
this.addButton( this.redstoneMode );
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -219,12 +219,12 @@ public class GuiMEMonitorable extends AEBaseMEGui implements ISortSource, IConfi
|
||||
|
||||
private void reinitalize()
|
||||
{
|
||||
this.buttonList.clear();
|
||||
this.initGui();
|
||||
this.buttons.clear();
|
||||
this.init();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void initGui()
|
||||
public void init()
|
||||
{
|
||||
Keyboard.enableRepeatEvents( true );
|
||||
|
||||
@@ -266,7 +266,7 @@ public class GuiMEMonitorable extends AEBaseMEGui implements ISortSource, IConfi
|
||||
this.xSize = this.standardSize;
|
||||
}
|
||||
|
||||
super.initGui();
|
||||
super.init();
|
||||
// full size : 204
|
||||
// extra slots : 72
|
||||
// slot 18
|
||||
@@ -292,11 +292,11 @@ public class GuiMEMonitorable extends AEBaseMEGui implements ISortSource, IConfi
|
||||
offset += 20;
|
||||
}
|
||||
|
||||
this.buttonList.add( this.SortDirBox = new GuiImgButton( this.guiLeft - 18, offset, Settings.SORT_DIRECTION, this.configSrc
|
||||
this.addButton( this.SortDirBox = new GuiImgButton( this.guiLeft - 18, offset, Settings.SORT_DIRECTION, this.configSrc
|
||||
.getSetting( Settings.SORT_DIRECTION ) ) );
|
||||
offset += 20;
|
||||
|
||||
this.buttonList.add(
|
||||
this.addButton(
|
||||
this.searchBoxSettings = new GuiImgButton( this.guiLeft - 18, offset, Settings.SEARCH_MODE, AEConfig.instance()
|
||||
.getConfigManager()
|
||||
.getSetting(
|
||||
@@ -306,12 +306,12 @@ public class GuiMEMonitorable extends AEBaseMEGui implements ISortSource, IConfi
|
||||
|
||||
if( !( this instanceof GuiMEPortableCell ) || this instanceof GuiWirelessTerm )
|
||||
{
|
||||
this.buttonList.add( this.terminalStyleBox = new GuiImgButton( this.guiLeft - 18, offset, Settings.TERMINAL_STYLE, AEConfig.instance()
|
||||
this.addButton( this.terminalStyleBox = new GuiImgButton( this.guiLeft - 18, offset, Settings.TERMINAL_STYLE, AEConfig.instance()
|
||||
.getConfigManager()
|
||||
.getSetting( Settings.TERMINAL_STYLE ) ) );
|
||||
}
|
||||
|
||||
this.searchField = new MEGuiTextField( this.fontRenderer, this.guiLeft + Math.max( 80, this.offsetX ), this.guiTop + 4, 90, 12 );
|
||||
this.searchField = new MEGuiTextField( this.font, this.guiLeft + Math.max( 80, this.offsetX ), this.guiTop + 4, 90, 12 );
|
||||
this.searchField.setEnableBackgroundDrawing( false );
|
||||
this.searchField.setMaxStringLength( 25 );
|
||||
this.searchField.setTextColor( 0xFFFFFF );
|
||||
@@ -320,7 +320,7 @@ public class GuiMEMonitorable extends AEBaseMEGui implements ISortSource, IConfi
|
||||
|
||||
if( this.viewCell || this instanceof GuiWirelessTerm )
|
||||
{
|
||||
this.buttonList.add( this.craftingStatusBtn = new GuiTabButton( this.guiLeft + 170, this.guiTop - 4, 2 + 11 * 16, GuiText.CraftingStatus
|
||||
this.addButton( this.craftingStatusBtn = new GuiTabButton( this.guiLeft + 170, this.guiTop - 4, 2 + 11 * 16, GuiText.CraftingStatus
|
||||
.getLocal(), this.itemRender ) );
|
||||
this.craftingStatusBtn.setHideEdge( 13 );
|
||||
}
|
||||
@@ -379,8 +379,8 @@ public class GuiMEMonitorable extends AEBaseMEGui implements ISortSource, IConfi
|
||||
@Override
|
||||
public void drawFG( final int offsetX, final int offsetY, final int mouseX, final int mouseY )
|
||||
{
|
||||
this.fontRenderer.drawString( this.getGuiDisplayName( this.myName.getLocal() ), 8, 6, 4210752 );
|
||||
this.fontRenderer.drawString( GuiText.inventory.getLocal(), 8, this.ySize - 96 + 3, 4210752 );
|
||||
this.font.drawString( this.getGuiDisplayName( this.myName.getLocal() ), 8, 6, 4210752 );
|
||||
this.font.drawString( GuiText.inventory.getLocal(), 8, this.ySize - 96 + 3, 4210752 );
|
||||
|
||||
this.currentMouseX = mouseX;
|
||||
this.currentMouseY = mouseY;
|
||||
@@ -403,9 +403,9 @@ public class GuiMEMonitorable extends AEBaseMEGui implements ISortSource, IConfi
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onGuiClosed()
|
||||
public void removed()
|
||||
{
|
||||
super.onGuiClosed();
|
||||
super.removed();
|
||||
Keyboard.enableRepeatEvents( false );
|
||||
memoryText = this.searchField.getText();
|
||||
}
|
||||
|
||||
@@ -84,16 +84,16 @@ public class GuiNetworkStatus extends AEBaseGui implements ISortSource
|
||||
}
|
||||
|
||||
@Override
|
||||
public void initGui()
|
||||
public void init()
|
||||
{
|
||||
super.initGui();
|
||||
super.init();
|
||||
|
||||
this.units = new GuiImgButton( this.guiLeft - 18, this.guiTop + 8, Settings.POWER_UNITS, AEConfig.instance().selectedPowerUnit() );
|
||||
this.buttonList.add( this.units );
|
||||
this.addButton( this.units );
|
||||
}
|
||||
|
||||
@Override
|
||||
public void drawScreen( final int mouseX, final int mouseY, final float btn )
|
||||
public void render(final int mouseX, final int mouseY, final float btn )
|
||||
{
|
||||
|
||||
final int gx = ( this.width - this.xSize ) / 2;
|
||||
@@ -126,7 +126,7 @@ public class GuiNetworkStatus extends AEBaseGui implements ISortSource
|
||||
}
|
||||
}
|
||||
|
||||
super.drawScreen( mouseX, mouseY, btn );
|
||||
super.render( mouseX, mouseY, btn );
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -134,14 +134,14 @@ public class GuiNetworkStatus extends AEBaseGui implements ISortSource
|
||||
{
|
||||
final ContainerNetworkStatus ns = (ContainerNetworkStatus) this.inventorySlots;
|
||||
|
||||
this.fontRenderer.drawString( GuiText.NetworkDetails.getLocal(), 8, 6, 4210752 );
|
||||
this.font.drawString( GuiText.NetworkDetails.getLocal(), 8, 6, 4210752 );
|
||||
|
||||
this.fontRenderer.drawString( GuiText.StoredPower.getLocal() + ": " + Platform.formatPowerLong( ns.getCurrentPower(), false ), 13, 16, 4210752 );
|
||||
this.fontRenderer.drawString( GuiText.MaxPower.getLocal() + ": " + Platform.formatPowerLong( ns.getMaxPower(), false ), 13, 26, 4210752 );
|
||||
this.font.drawString( GuiText.StoredPower.getLocal() + ": " + Platform.formatPowerLong( ns.getCurrentPower(), false ), 13, 16, 4210752 );
|
||||
this.font.drawString( GuiText.MaxPower.getLocal() + ": " + Platform.formatPowerLong( ns.getMaxPower(), false ), 13, 26, 4210752 );
|
||||
|
||||
this.fontRenderer.drawString( GuiText.PowerInputRate.getLocal() + ": " + Platform.formatPowerLong( ns.getAverageAddition(), true ), 13, 143 - 10,
|
||||
this.font.drawString( GuiText.PowerInputRate.getLocal() + ": " + Platform.formatPowerLong( ns.getAverageAddition(), true ), 13, 143 - 10,
|
||||
4210752 );
|
||||
this.fontRenderer.drawString( GuiText.PowerUsageRate.getLocal() + ": " + Platform.formatPowerLong( ns.getPowerUsage(), true ), 13, 143 - 20, 4210752 );
|
||||
this.font.drawString( GuiText.PowerUsageRate.getLocal() + ": " + Platform.formatPowerLong( ns.getPowerUsage(), true ), 13, 143 - 20, 4210752 );
|
||||
|
||||
final int sectionLength = 30;
|
||||
|
||||
@@ -170,8 +170,8 @@ public class GuiNetworkStatus extends AEBaseGui implements ISortSource
|
||||
str = Long.toString( refStack.getStackSize() / 1000 ) + 'k';
|
||||
}
|
||||
|
||||
final int w = this.fontRenderer.getStringWidth( str );
|
||||
this.fontRenderer.drawString( str, (int) ( ( x * sectionLength + xo + sectionLength - 19 - ( w * 0.5 ) ) * 2 ), ( y * 18 + yo + 6 ) * 2,
|
||||
final int w = this.font.getStringWidth( str );
|
||||
this.font.drawString( str, (int) ( ( x * sectionLength + xo + sectionLength - 19 - ( w * 0.5 ) ) * 2 ), ( y * 18 + yo + 6 ) * 2,
|
||||
4210752 );
|
||||
|
||||
GlStateManager.popMatrix();
|
||||
@@ -257,8 +257,8 @@ public class GuiNetworkStatus extends AEBaseGui implements ISortSource
|
||||
|
||||
if( myStack != null )
|
||||
{
|
||||
ITooltipFlag.TooltipFlags tooltipFlag = this.mc.gameSettings.advancedItemTooltips ? ITooltipFlag.TooltipFlags.ADVANCED : ITooltipFlag.TooltipFlags.NORMAL;
|
||||
List<String> currentToolTip = stack.getTooltip( this.mc.player, tooltipFlag );
|
||||
ITooltipFlag.TooltipFlags tooltipFlag = this.minecraft.gameSettings.advancedItemTooltips ? ITooltipFlag.TooltipFlags.ADVANCED : ITooltipFlag.TooltipFlags.NORMAL;
|
||||
List<String> currentToolTip = stack.getTooltip( this.minecraft.player, tooltipFlag );
|
||||
|
||||
while( currentToolTip.size() > 1 )
|
||||
{
|
||||
|
||||
@@ -64,14 +64,14 @@ public class GuiNetworkTool extends AEBaseGui
|
||||
}
|
||||
|
||||
@Override
|
||||
public void initGui()
|
||||
public void init()
|
||||
{
|
||||
super.initGui();
|
||||
super.init();
|
||||
|
||||
this.tFacades = new GuiToggleButton( this.guiLeft - 18, this.guiTop + 8, 23, 22, GuiText.TransparentFacades.getLocal(), GuiText.TransparentFacadesHint
|
||||
.getLocal() );
|
||||
|
||||
this.buttonList.add( this.tFacades );
|
||||
this.addButton( this.tFacades );
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -82,8 +82,8 @@ public class GuiNetworkTool extends AEBaseGui
|
||||
this.tFacades.setState( ( (ContainerNetworkTool) this.inventorySlots ).isFacadeMode() );
|
||||
}
|
||||
|
||||
this.fontRenderer.drawString( this.getGuiDisplayName( GuiText.NetworkTool.getLocal() ), 8, 6, 4210752 );
|
||||
this.fontRenderer.drawString( GuiText.inventory.getLocal(), 8, this.ySize - 96 + 3, 4210752 );
|
||||
this.font.drawString( this.getGuiDisplayName( GuiText.NetworkTool.getLocal() ), 8, 6, 4210752 );
|
||||
this.font.drawString( GuiText.inventory.getLocal(), 8, this.ySize - 96 + 3, 4210752 );
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -107,32 +107,32 @@ public class GuiPatternTerm extends GuiMEMonitorable
|
||||
}
|
||||
|
||||
@Override
|
||||
public void initGui()
|
||||
public void init()
|
||||
{
|
||||
super.initGui();
|
||||
super.init();
|
||||
|
||||
this.tabCraftButton = new GuiTabButton( this.guiLeft + 173, this.guiTop + this.ySize - 177, new ItemStack( Blocks.CRAFTING_TABLE ), GuiText.CraftingPattern
|
||||
.getLocal(), this.itemRender );
|
||||
this.buttonList.add( this.tabCraftButton );
|
||||
this.addButton( this.tabCraftButton );
|
||||
|
||||
this.tabProcessButton = new GuiTabButton( this.guiLeft + 173, this.guiTop + this.ySize - 177, new ItemStack( Blocks.FURNACE ), GuiText.ProcessingPattern
|
||||
.getLocal(), this.itemRender );
|
||||
this.buttonList.add( this.tabProcessButton );
|
||||
this.addButton( this.tabProcessButton );
|
||||
|
||||
this.substitutionsEnabledBtn = new GuiImgButton( this.guiLeft + 84, this.guiTop + this.ySize - 163, Settings.ACTIONS, ItemSubstitution.ENABLED );
|
||||
this.substitutionsEnabledBtn.setHalfSize( true );
|
||||
this.buttonList.add( this.substitutionsEnabledBtn );
|
||||
this.addButton( this.substitutionsEnabledBtn );
|
||||
|
||||
this.substitutionsDisabledBtn = new GuiImgButton( this.guiLeft + 84, this.guiTop + this.ySize - 163, Settings.ACTIONS, ItemSubstitution.DISABLED );
|
||||
this.substitutionsDisabledBtn.setHalfSize( true );
|
||||
this.buttonList.add( this.substitutionsDisabledBtn );
|
||||
this.addButton( this.substitutionsDisabledBtn );
|
||||
|
||||
this.clearBtn = new GuiImgButton( this.guiLeft + 74, this.guiTop + this.ySize - 163, Settings.ACTIONS, ActionItems.CLOSE );
|
||||
this.clearBtn.setHalfSize( true );
|
||||
this.buttonList.add( this.clearBtn );
|
||||
this.addButton( this.clearBtn );
|
||||
|
||||
this.encodeBtn = new GuiImgButton( this.guiLeft + 147, this.guiTop + this.ySize - 142, Settings.ACTIONS, ActionItems.ENCODE );
|
||||
this.buttonList.add( this.encodeBtn );
|
||||
this.addButton( this.encodeBtn );
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -163,7 +163,7 @@ public class GuiPatternTerm extends GuiMEMonitorable
|
||||
}
|
||||
|
||||
super.drawFG( offsetX, offsetY, mouseX, mouseY );
|
||||
this.fontRenderer.drawString( GuiText.PatternTerminal.getLocal(), 8, this.ySize - 96 + 2 - this.getReservedSpace(), 4210752 );
|
||||
this.font.drawString( GuiText.PatternTerminal.getLocal(), 8, this.ySize - 96 + 2 - this.getReservedSpace(), 4210752 );
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -62,24 +62,24 @@ public class GuiPriority extends AEBaseGui
|
||||
}
|
||||
|
||||
@Override
|
||||
public void initGui()
|
||||
public void init()
|
||||
{
|
||||
super.initGui();
|
||||
super.init();
|
||||
|
||||
final int a = AEConfig.instance().priorityByStacksAmounts( 0 );
|
||||
final int b = AEConfig.instance().priorityByStacksAmounts( 1 );
|
||||
final int c = AEConfig.instance().priorityByStacksAmounts( 2 );
|
||||
final int d = AEConfig.instance().priorityByStacksAmounts( 3 );
|
||||
|
||||
this.buttonList.add( this.plus1 = new GuiButton( 0, this.guiLeft + 20, this.guiTop + 32, 22, 20, "+" + a ) );
|
||||
this.buttonList.add( this.plus10 = new GuiButton( 0, this.guiLeft + 48, this.guiTop + 32, 28, 20, "+" + b ) );
|
||||
this.buttonList.add( this.plus100 = new GuiButton( 0, this.guiLeft + 82, this.guiTop + 32, 32, 20, "+" + c ) );
|
||||
this.buttonList.add( this.plus1000 = new GuiButton( 0, this.guiLeft + 120, this.guiTop + 32, 38, 20, "+" + d ) );
|
||||
this.addButton( this.plus1 = new GuiButton( 0, this.guiLeft + 20, this.guiTop + 32, 22, 20, "+" + a ) );
|
||||
this.addButton( this.plus10 = new GuiButton( 0, this.guiLeft + 48, this.guiTop + 32, 28, 20, "+" + b ) );
|
||||
this.addButton( this.plus100 = new GuiButton( 0, this.guiLeft + 82, this.guiTop + 32, 32, 20, "+" + c ) );
|
||||
this.addButton( this.plus1000 = new GuiButton( 0, this.guiLeft + 120, this.guiTop + 32, 38, 20, "+" + d ) );
|
||||
|
||||
this.buttonList.add( this.minus1 = new GuiButton( 0, this.guiLeft + 20, this.guiTop + 69, 22, 20, "-" + a ) );
|
||||
this.buttonList.add( this.minus10 = new GuiButton( 0, this.guiLeft + 48, this.guiTop + 69, 28, 20, "-" + b ) );
|
||||
this.buttonList.add( this.minus100 = new GuiButton( 0, this.guiLeft + 82, this.guiTop + 69, 32, 20, "-" + c ) );
|
||||
this.buttonList.add( this.minus1000 = new GuiButton( 0, this.guiLeft + 120, this.guiTop + 69, 38, 20, "-" + d ) );
|
||||
this.addButton( this.minus1 = new GuiButton( 0, this.guiLeft + 20, this.guiTop + 69, 22, 20, "-" + a ) );
|
||||
this.addButton( this.minus10 = new GuiButton( 0, this.guiLeft + 48, this.guiTop + 69, 28, 20, "-" + b ) );
|
||||
this.addButton( this.minus100 = new GuiButton( 0, this.guiLeft + 82, this.guiTop + 69, 32, 20, "-" + c ) );
|
||||
this.addButton( this.minus1000 = new GuiButton( 0, this.guiLeft + 120, this.guiTop + 69, 38, 20, "-" + d ) );
|
||||
|
||||
final ContainerPriority con = ( (ContainerPriority) this.inventorySlots );
|
||||
final ItemStack myIcon = con.getPriorityHost().getItemStackRepresentation();
|
||||
@@ -87,10 +87,10 @@ public class GuiPriority extends AEBaseGui
|
||||
|
||||
if( this.OriginalGui != null && !myIcon.isEmpty() )
|
||||
{
|
||||
this.buttonList.add( this.originalGuiBtn = new GuiTabButton( this.guiLeft + 154, this.guiTop, myIcon, myIcon.getDisplayName(), this.itemRender ) );
|
||||
this.addButton( this.originalGuiBtn = new GuiTabButton( this.guiLeft + 154, this.guiTop, myIcon, myIcon.getDisplayName(), this.itemRender ) );
|
||||
}
|
||||
|
||||
this.priority = new GuiNumberBox( this.fontRenderer, this.guiLeft + 62, this.guiTop + 57, 59, this.fontRenderer.FONT_HEIGHT, Long.class );
|
||||
this.priority = new GuiNumberBox( this.font, this.guiLeft + 62, this.guiTop + 57, 59, this.font.FONT_HEIGHT, Long.class );
|
||||
this.priority.setEnableBackgroundDrawing( false );
|
||||
this.priority.setMaxStringLength( 16 );
|
||||
this.priority.setTextColor( 0xFFFFFF );
|
||||
@@ -102,7 +102,7 @@ public class GuiPriority extends AEBaseGui
|
||||
@Override
|
||||
public void drawFG( final int offsetX, final int offsetY, final int mouseX, final int mouseY )
|
||||
{
|
||||
this.fontRenderer.drawString( GuiText.Priority.getLocal(), 8, 6, 4210752 );
|
||||
this.font.drawString( GuiText.Priority.getLocal(), 8, 6, 4210752 );
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -39,8 +39,8 @@ public class GuiQNB extends AEBaseGui
|
||||
@Override
|
||||
public void drawFG( final int offsetX, final int offsetY, final int mouseX, final int mouseY )
|
||||
{
|
||||
this.fontRenderer.drawString( this.getGuiDisplayName( GuiText.QuantumLinkChamber.getLocal() ), 8, 6, 4210752 );
|
||||
this.fontRenderer.drawString( GuiText.inventory.getLocal(), 8, this.ySize - 96 + 3, 4210752 );
|
||||
this.font.drawString( this.getGuiDisplayName( GuiText.QuantumLinkChamber.getLocal() ), 8, 6, 4210752 );
|
||||
this.font.drawString( GuiText.inventory.getLocal(), 8, this.ySize - 96 + 3, 4210752 );
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -45,11 +45,11 @@ public class GuiQuartzKnife extends AEBaseGui
|
||||
}
|
||||
|
||||
@Override
|
||||
public void initGui()
|
||||
public void init()
|
||||
{
|
||||
super.initGui();
|
||||
super.init();
|
||||
|
||||
this.name = new GuiTextField( 0, this.fontRenderer, this.guiLeft + 24, this.guiTop + 32, 79, this.fontRenderer.FONT_HEIGHT );
|
||||
this.name = new GuiTextField( 0, this.font, this.guiLeft + 24, this.guiTop + 32, 79, this.font.FONT_HEIGHT );
|
||||
this.name.setEnableBackgroundDrawing( false );
|
||||
this.name.setMaxStringLength( 32 );
|
||||
this.name.setTextColor( 0xFFFFFF );
|
||||
@@ -60,8 +60,8 @@ public class GuiQuartzKnife extends AEBaseGui
|
||||
@Override
|
||||
public void drawFG( final int offsetX, final int offsetY, final int mouseX, final int mouseY )
|
||||
{
|
||||
this.fontRenderer.drawString( this.getGuiDisplayName( GuiText.QuartzCuttingKnife.getLocal() ), 8, 6, 4210752 );
|
||||
this.fontRenderer.drawString( GuiText.inventory.getLocal(), 8, this.ySize - 96 + 3, 4210752 );
|
||||
this.font.drawString( this.getGuiDisplayName( GuiText.QuartzCuttingKnife.getLocal() ), 8, 6, 4210752 );
|
||||
this.font.drawString( GuiText.inventory.getLocal(), 8, this.ySize - 96 + 3, 4210752 );
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -96,24 +96,24 @@ public class GuiSecurityStation extends GuiMEMonitorable
|
||||
}
|
||||
|
||||
@Override
|
||||
public void initGui()
|
||||
public void init()
|
||||
{
|
||||
super.initGui();
|
||||
super.init();
|
||||
|
||||
final int top = this.guiTop + this.ySize - 116;
|
||||
this.buttonList.add( this.inject = new GuiToggleButton( this.guiLeft + 56, top, 11 * 16, 12 * 16, SecurityPermissions.INJECT
|
||||
this.addButton( this.inject = new GuiToggleButton( this.guiLeft + 56, top, 11 * 16, 12 * 16, SecurityPermissions.INJECT
|
||||
.getTranslationKey(), SecurityPermissions.INJECT.getUnlocalizedTip() ) );
|
||||
|
||||
this.buttonList.add( this.extract = new GuiToggleButton( this.guiLeft + 56 + 18, top, 11 * 16 + 1, 12 * 16 + 1, SecurityPermissions.EXTRACT
|
||||
this.addButton( this.extract = new GuiToggleButton( this.guiLeft + 56 + 18, top, 11 * 16 + 1, 12 * 16 + 1, SecurityPermissions.EXTRACT
|
||||
.getTranslationKey(), SecurityPermissions.EXTRACT.getUnlocalizedTip() ) );
|
||||
|
||||
this.buttonList.add( this.craft = new GuiToggleButton( this.guiLeft + 56 + 18 * 2, top, 11 * 16 + 2, 12 * 16 + 2, SecurityPermissions.CRAFT
|
||||
this.addButton( this.craft = new GuiToggleButton( this.guiLeft + 56 + 18 * 2, top, 11 * 16 + 2, 12 * 16 + 2, SecurityPermissions.CRAFT
|
||||
.getTranslationKey(), SecurityPermissions.CRAFT.getUnlocalizedTip() ) );
|
||||
|
||||
this.buttonList.add( this.build = new GuiToggleButton( this.guiLeft + 56 + 18 * 3, top, 11 * 16 + 3, 12 * 16 + 3, SecurityPermissions.BUILD
|
||||
this.addButton( this.build = new GuiToggleButton( this.guiLeft + 56 + 18 * 3, top, 11 * 16 + 3, 12 * 16 + 3, SecurityPermissions.BUILD
|
||||
.getTranslationKey(), SecurityPermissions.BUILD.getUnlocalizedTip() ) );
|
||||
|
||||
this.buttonList.add( this.security = new GuiToggleButton( this.guiLeft + 56 + 18 * 4, top, 11 * 16 + 4, 12 * 16 + 4, SecurityPermissions.SECURITY
|
||||
this.addButton( this.security = new GuiToggleButton( this.guiLeft + 56 + 18 * 4, top, 11 * 16 + 4, 12 * 16 + 4, SecurityPermissions.SECURITY
|
||||
.getTranslationKey(), SecurityPermissions.SECURITY.getUnlocalizedTip() ) );
|
||||
}
|
||||
|
||||
@@ -121,7 +121,7 @@ public class GuiSecurityStation extends GuiMEMonitorable
|
||||
public void drawFG( final int offsetX, final int offsetY, final int mouseX, final int mouseY )
|
||||
{
|
||||
super.drawFG( offsetX, offsetY, mouseX, mouseY );
|
||||
this.fontRenderer.drawString( GuiText.SecurityCardEditor.getLocal(), 8, this.ySize - 96 + 1 - this.getReservedSpace(), 4210752 );
|
||||
this.font.drawString( GuiText.SecurityCardEditor.getLocal(), 8, this.ySize - 96 + 1 - this.getReservedSpace(), 4210752 );
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -40,8 +40,8 @@ public class GuiSkyChest extends AEBaseGui
|
||||
@Override
|
||||
public void drawFG( final int offsetX, final int offsetY, final int mouseX, final int mouseY )
|
||||
{
|
||||
this.fontRenderer.drawString( this.getGuiDisplayName( GuiText.SkyChest.getLocal() ), 8, 8, 4210752 );
|
||||
this.fontRenderer.drawString( GuiText.inventory.getLocal(), 8, this.ySize - 96 + 2, 4210752 );
|
||||
this.font.drawString( this.getGuiDisplayName( GuiText.SkyChest.getLocal() ), 8, 8, 4210752 );
|
||||
this.font.drawString( GuiText.inventory.getLocal(), 8, this.ySize - 96 + 2, 4210752 );
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -64,35 +64,35 @@ public class GuiSpatialIOPort extends AEBaseGui
|
||||
}
|
||||
|
||||
@Override
|
||||
public void initGui()
|
||||
public void init()
|
||||
{
|
||||
super.initGui();
|
||||
super.init();
|
||||
|
||||
this.units = new GuiImgButton( this.guiLeft - 18, this.guiTop + 8, Settings.POWER_UNITS, AEConfig.instance().selectedPowerUnit() );
|
||||
this.buttonList.add( this.units );
|
||||
this.addButton( this.units );
|
||||
}
|
||||
|
||||
@Override
|
||||
public void drawFG( final int offsetX, final int offsetY, final int mouseX, final int mouseY )
|
||||
{
|
||||
this.fontRenderer.drawString( GuiText.StoredPower.getLocal() + ": " + Platform.formatPowerLong( this.container.getCurrentPower(), false ), 13, 21,
|
||||
this.font.drawString( GuiText.StoredPower.getLocal() + ": " + Platform.formatPowerLong( this.container.getCurrentPower(), false ), 13, 21,
|
||||
4210752 );
|
||||
this.fontRenderer.drawString( GuiText.MaxPower.getLocal() + ": " + Platform.formatPowerLong( this.container.getMaxPower(), false ), 13, 31, 4210752 );
|
||||
this.fontRenderer.drawString( GuiText.RequiredPower.getLocal() + ": " + Platform.formatPowerLong( this.container.getRequiredPower(), false ), 13, 73,
|
||||
this.font.drawString( GuiText.MaxPower.getLocal() + ": " + Platform.formatPowerLong( this.container.getMaxPower(), false ), 13, 31, 4210752 );
|
||||
this.font.drawString( GuiText.RequiredPower.getLocal() + ": " + Platform.formatPowerLong( this.container.getRequiredPower(), false ), 13, 73,
|
||||
4210752 );
|
||||
this.fontRenderer.drawString( GuiText.Efficiency.getLocal() + ": " + ( ( (float) this.container.getEfficency() ) / 100 ) + '%', 13, 83, 4210752 );
|
||||
this.font.drawString( GuiText.Efficiency.getLocal() + ": " + ( ( (float) this.container.getEfficency() ) / 100 ) + '%', 13, 83, 4210752 );
|
||||
|
||||
this.fontRenderer.drawString( this.getGuiDisplayName( GuiText.SpatialIOPort.getLocal() ), 8, 6, 4210752 );
|
||||
this.fontRenderer.drawString( GuiText.inventory.getLocal(), 8, this.ySize - 96, 4210752 );
|
||||
this.font.drawString( this.getGuiDisplayName( GuiText.SpatialIOPort.getLocal() ), 8, 6, 4210752 );
|
||||
this.font.drawString( GuiText.inventory.getLocal(), 8, this.ySize - 96, 4210752 );
|
||||
|
||||
if( this.container.xSize != 0 && this.container.ySize != 0 && this.container.zSize != 0 )
|
||||
{
|
||||
final String text = GuiText.SCSSize.getLocal() + ": " + this.container.xSize + "x" + this.container.ySize + "x" + this.container.zSize;
|
||||
this.fontRenderer.drawString( text, 13, 93, 4210752 );
|
||||
this.font.drawString( text, 13, 93, 4210752 );
|
||||
}
|
||||
else
|
||||
{
|
||||
this.fontRenderer.drawString( GuiText.SCSSize.getLocal() + ": " + GuiText.SCSInvalid.getLocal(), 13, 93, 4210752 );
|
||||
this.font.drawString( GuiText.SCSSize.getLocal() + ": " + GuiText.SCSInvalid.getLocal(), 13, 93, 4210752 );
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -68,20 +68,20 @@ public class GuiStorageBus extends GuiUpgradeable
|
||||
this.storageFilter = new GuiImgButton( this.guiLeft - 18, this.guiTop + 68, Settings.STORAGE_FILTER, StorageFilter.EXTRACTABLE_ONLY );
|
||||
this.fuzzyMode = new GuiImgButton( this.guiLeft - 18, this.guiTop + 88, Settings.FUZZY_MODE, FuzzyMode.IGNORE_ALL );
|
||||
|
||||
this.buttonList.add( this.priority = new GuiTabButton( this.guiLeft + 154, this.guiTop, 2 + 4 * 16, GuiText.Priority.getLocal(), this.itemRender ) );
|
||||
this.addButton( this.priority = new GuiTabButton( this.guiLeft + 154, this.guiTop, 2 + 4 * 16, GuiText.Priority.getLocal(), this.itemRender ) );
|
||||
|
||||
this.buttonList.add( this.storageFilter );
|
||||
this.buttonList.add( this.fuzzyMode );
|
||||
this.buttonList.add( this.rwMode );
|
||||
this.buttonList.add( this.partition );
|
||||
this.buttonList.add( this.clear );
|
||||
this.addButton( this.storageFilter );
|
||||
this.addButton( this.fuzzyMode );
|
||||
this.addButton( this.rwMode );
|
||||
this.addButton( this.partition );
|
||||
this.addButton( this.clear );
|
||||
}
|
||||
|
||||
@Override
|
||||
public void drawFG( final int offsetX, final int offsetY, final int mouseX, final int mouseY )
|
||||
{
|
||||
this.fontRenderer.drawString( this.getGuiDisplayName( GuiText.StorageBus.getLocal() ), 8, 6, 4210752 );
|
||||
this.fontRenderer.drawString( GuiText.inventory.getLocal(), 8, this.ySize - 96 + 3, 4210752 );
|
||||
this.font.drawString( this.getGuiDisplayName( GuiText.StorageBus.getLocal() ), 8, 6, 4210752 );
|
||||
this.font.drawString( GuiText.inventory.getLocal(), 8, this.ySize - 96 + 3, 4210752 );
|
||||
|
||||
if( this.fuzzyMode != null )
|
||||
{
|
||||
|
||||
@@ -75,9 +75,9 @@ public class GuiUpgradeable extends AEBaseGui
|
||||
}
|
||||
|
||||
@Override
|
||||
public void initGui()
|
||||
public void init()
|
||||
{
|
||||
super.initGui();
|
||||
super.init();
|
||||
this.addButtons();
|
||||
}
|
||||
|
||||
@@ -88,17 +88,17 @@ public class GuiUpgradeable extends AEBaseGui
|
||||
this.craftMode = new GuiImgButton( this.guiLeft - 18, this.guiTop + 48, Settings.CRAFT_ONLY, YesNo.NO );
|
||||
this.schedulingMode = new GuiImgButton( this.guiLeft - 18, this.guiTop + 68, Settings.SCHEDULING_MODE, SchedulingMode.DEFAULT );
|
||||
|
||||
this.buttonList.add( this.craftMode );
|
||||
this.buttonList.add( this.redstoneMode );
|
||||
this.buttonList.add( this.fuzzyMode );
|
||||
this.buttonList.add( this.schedulingMode );
|
||||
this.addButton( this.craftMode );
|
||||
this.addButton( this.redstoneMode );
|
||||
this.addButton( this.fuzzyMode );
|
||||
this.addButton( this.schedulingMode );
|
||||
}
|
||||
|
||||
@Override
|
||||
public void drawFG( final int offsetX, final int offsetY, final int mouseX, final int mouseY )
|
||||
{
|
||||
this.fontRenderer.drawString( this.getGuiDisplayName( this.getName().getLocal() ), 8, 6, 4210752 );
|
||||
this.fontRenderer.drawString( GuiText.inventory.getLocal(), 8, this.ySize - 96 + 3, 4210752 );
|
||||
this.font.drawString( this.getGuiDisplayName( this.getName().getLocal() ), 8, 6, 4210752 );
|
||||
this.font.drawString( GuiText.inventory.getLocal(), 8, this.ySize - 96 + 3, 4210752 );
|
||||
|
||||
if( this.redstoneMode != null )
|
||||
{
|
||||
|
||||
@@ -44,19 +44,19 @@ public class GuiVibrationChamber extends AEBaseGui
|
||||
}
|
||||
|
||||
@Override
|
||||
public void initGui()
|
||||
public void init()
|
||||
{
|
||||
super.initGui();
|
||||
super.init();
|
||||
|
||||
this.pb = new GuiProgressBar( this.cvc, "guis/vibchamber.png", 99, 36, 176, 14, 6, 18, Direction.VERTICAL );
|
||||
this.buttonList.add( this.pb );
|
||||
this.addButton( this.pb );
|
||||
}
|
||||
|
||||
@Override
|
||||
public void drawFG( final int offsetX, final int offsetY, final int mouseX, final int mouseY )
|
||||
{
|
||||
this.fontRenderer.drawString( this.getGuiDisplayName( GuiText.VibrationChamber.getLocal() ), 8, 6, 4210752 );
|
||||
this.fontRenderer.drawString( GuiText.inventory.getLocal(), 8, this.ySize - 96 + 3, 4210752 );
|
||||
this.font.drawString( this.getGuiDisplayName( GuiText.VibrationChamber.getLocal() ), 8, 6, 4210752 );
|
||||
this.font.drawString( GuiText.inventory.getLocal(), 8, this.ySize - 96 + 3, 4210752 );
|
||||
|
||||
this.pb.setFullMsg( TileVibrationChamber.POWER_PER_TICK * this.cvc.getCurrentProgress() / TileVibrationChamber.DILATION_SCALING + " AE/t" );
|
||||
|
||||
@@ -64,7 +64,7 @@ public class GuiVibrationChamber extends AEBaseGui
|
||||
{
|
||||
final int i1 = this.cvc.getRemainingBurnTime() * 12 / 100;
|
||||
this.bindTexture( "guis/vibchamber.png" );
|
||||
GlStateManager.color( 1, 1, 1 );
|
||||
RenderSystem.color4f( 1, 1, 1 );
|
||||
final int l = -15;
|
||||
final int k = 25;
|
||||
this.drawTexturedModalRect( k + 56, l + 36 + 12 - i1, 176, 12 - i1, 14, i1 + 2 );
|
||||
|
||||
@@ -62,19 +62,19 @@ public class GuiWireless extends AEBaseGui
|
||||
}
|
||||
|
||||
@Override
|
||||
public void initGui()
|
||||
public void init()
|
||||
{
|
||||
super.initGui();
|
||||
super.init();
|
||||
|
||||
this.units = new GuiImgButton( this.guiLeft - 18, this.guiTop + 8, Settings.POWER_UNITS, AEConfig.instance().selectedPowerUnit() );
|
||||
this.buttonList.add( this.units );
|
||||
this.addButton( this.units );
|
||||
}
|
||||
|
||||
@Override
|
||||
public void drawFG( final int offsetX, final int offsetY, final int mouseX, final int mouseY )
|
||||
{
|
||||
this.fontRenderer.drawString( this.getGuiDisplayName( GuiText.Wireless.getLocal() ), 8, 6, 4210752 );
|
||||
this.fontRenderer.drawString( GuiText.inventory.getLocal(), 8, this.ySize - 96 + 3, 4210752 );
|
||||
this.font.drawString( this.getGuiDisplayName( GuiText.Wireless.getLocal() ), 8, 6, 4210752 );
|
||||
this.font.drawString( GuiText.inventory.getLocal(), 8, this.ySize - 96 + 3, 4210752 );
|
||||
|
||||
final ContainerWireless cw = (ContainerWireless) this.inventorySlots;
|
||||
|
||||
@@ -83,10 +83,10 @@ public class GuiWireless extends AEBaseGui
|
||||
final String firstMessage = GuiText.Range.getLocal() + ": " + ( cw.getRange() / 10.0 ) + " m";
|
||||
final String secondMessage = GuiText.PowerUsageRate.getLocal() + ": " + Platform.formatPowerLong( cw.getDrain(), true );
|
||||
|
||||
final int strWidth = Math.max( this.fontRenderer.getStringWidth( firstMessage ), this.fontRenderer.getStringWidth( secondMessage ) );
|
||||
final int strWidth = Math.max( this.font.getStringWidth( firstMessage ), this.font.getStringWidth( secondMessage ) );
|
||||
final int cOffset = ( this.xSize / 2 ) - ( strWidth / 2 );
|
||||
this.fontRenderer.drawString( firstMessage, cOffset, 20, 4210752 );
|
||||
this.fontRenderer.drawString( secondMessage, cOffset, 20 + 12, 4210752 );
|
||||
this.font.drawString( firstMessage, cOffset, 20, 4210752 );
|
||||
this.font.drawString( secondMessage, cOffset, 20 + 12, 4210752 );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -3,12 +3,12 @@ package appeng.client.gui.widgets;
|
||||
|
||||
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.gui.Gui;
|
||||
import net.minecraft.client.gui.AbstractGui;
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
|
||||
public abstract class GuiCustomSlot extends Gui implements ITooltip
|
||||
public abstract class GuiCustomSlot extends AbstractGui implements ITooltip
|
||||
{
|
||||
private final int x;
|
||||
private final int y;
|
||||
|
||||
@@ -210,11 +210,11 @@ public class GuiImgButton extends Button implements ITooltip
|
||||
|
||||
if( this.enabled )
|
||||
{
|
||||
GlStateManager.color( 1.0f, 1.0f, 1.0f, 1.0f );
|
||||
RenderSystem.color4f( 1.0f, 1.0f, 1.0f, 1.0f );
|
||||
}
|
||||
else
|
||||
{
|
||||
GlStateManager.color( 0.5f, 0.5f, 0.5f, 1.0f );
|
||||
RenderSystem.color4f( 0.5f, 0.5f, 0.5f, 1.0f );
|
||||
}
|
||||
|
||||
par1Minecraft.renderEngine.bindTexture( new ResourceLocation( "appliedenergistics2", "textures/guis/states.png" ) );
|
||||
@@ -233,11 +233,11 @@ public class GuiImgButton extends Button implements ITooltip
|
||||
{
|
||||
if( this.enabled )
|
||||
{
|
||||
GlStateManager.color( 1.0f, 1.0f, 1.0f, 1.0f );
|
||||
RenderSystem.color4f( 1.0f, 1.0f, 1.0f, 1.0f );
|
||||
}
|
||||
else
|
||||
{
|
||||
GlStateManager.color( 0.5f, 0.5f, 0.5f, 1.0f );
|
||||
RenderSystem.color4f( 0.5f, 0.5f, 0.5f, 1.0f );
|
||||
}
|
||||
|
||||
par1Minecraft.renderEngine.bindTexture( new ResourceLocation( "appliedenergistics2", "textures/guis/states.png" ) );
|
||||
@@ -251,7 +251,7 @@ public class GuiImgButton extends Button implements ITooltip
|
||||
this.mouseDragged( par1Minecraft, par2, par3 );
|
||||
}
|
||||
}
|
||||
GlStateManager.color( 1.0f, 1.0f, 1.0f, 1.0f );
|
||||
RenderSystem.color4f( 1.0f, 1.0f, 1.0f, 1.0f );
|
||||
}
|
||||
|
||||
private int getIconIndex()
|
||||
|
||||
@@ -19,9 +19,10 @@
|
||||
package appeng.client.gui.widgets;
|
||||
|
||||
|
||||
import net.minecraft.client.renderer.GlStateManager;
|
||||
import com.mojang.blaze3d.systems.RenderSystem;
|
||||
|
||||
import appeng.client.gui.AEBaseGui;
|
||||
import net.minecraftforge.fml.client.gui.GuiUtils;
|
||||
|
||||
|
||||
public class GuiScrollbar implements IScrollSource
|
||||
@@ -40,16 +41,16 @@ public class GuiScrollbar implements IScrollSource
|
||||
public void draw( final AEBaseGui g )
|
||||
{
|
||||
g.bindTexture( "minecraft", "gui/container/creative_inventory/tabs.png" );
|
||||
GlStateManager.color( 1.0f, 1.0f, 1.0f, 1.0f );
|
||||
RenderSystem.color4f( 1.0f, 1.0f, 1.0f, 1.0f );
|
||||
|
||||
if( this.getRange() == 0 )
|
||||
{
|
||||
g.drawTexturedModalRect( this.displayX, this.displayY, 232 + this.width, 0, this.width, 15 );
|
||||
GuiUtils.drawTexturedModalRect( this.displayX, this.displayY, 232 + this.width, 0, this.width, 15, 0 /* FIXME: this used the GUI's zIndex before */ );
|
||||
}
|
||||
else
|
||||
{
|
||||
final int offset = ( this.currentScroll - this.minScroll ) * ( this.height - 15 ) / this.getRange();
|
||||
g.drawTexturedModalRect( this.displayX, offset + this.displayY, 232, 0, this.width, 15 );
|
||||
GuiUtils.drawTexturedModalRect( this.displayX, offset + this.displayY, 232, 0, this.width, 15, 0 /* FIXME: this used the GUI's zIndex before */ );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -127,7 +128,7 @@ public class GuiScrollbar implements IScrollSource
|
||||
return this.currentScroll;
|
||||
}
|
||||
|
||||
public void click( final AEBaseGui aeBaseGui, final int x, final int y )
|
||||
public void click(final double x, final double y)
|
||||
{
|
||||
if( this.getRange() == 0 )
|
||||
{
|
||||
@@ -138,7 +139,7 @@ public class GuiScrollbar implements IScrollSource
|
||||
{
|
||||
if( y > this.displayY && y <= this.displayY + this.height )
|
||||
{
|
||||
this.currentScroll = ( y - this.displayY );
|
||||
this.currentScroll = (int) ( y - this.displayY );
|
||||
this.currentScroll = this.minScroll + ( ( this.currentScroll * 2 * this.getRange() / this.height ) );
|
||||
this.currentScroll = ( this.currentScroll + 1 ) >> 1;
|
||||
this.applyRange();
|
||||
@@ -146,7 +147,7 @@ public class GuiScrollbar implements IScrollSource
|
||||
}
|
||||
}
|
||||
|
||||
public void wheel( int delta )
|
||||
public void wheel( double delta )
|
||||
{
|
||||
delta = Math.max( Math.min( -delta, 1 ), -1 );
|
||||
this.currentScroll += delta * this.pageSize;
|
||||
|
||||
@@ -75,7 +75,7 @@ public class GuiTabButton extends Button implements ITooltip
|
||||
{
|
||||
if( this.visible )
|
||||
{
|
||||
GlStateManager.color( 1.0f, 1.0f, 1.0f, 1.0f );
|
||||
RenderSystem.color4f( 1.0f, 1.0f, 1.0f, 1.0f );
|
||||
minecraft.renderEngine.bindTexture( new ResourceLocation( "appliedenergistics2", "textures/guis/states.png" ) );
|
||||
this.hovered = x >= this.x && y >= this.y && x < this.x + this.width && y < this.y + this.height;
|
||||
|
||||
@@ -100,10 +100,10 @@ public class GuiTabButton extends Button implements ITooltip
|
||||
this.zLevel = 100.0F;
|
||||
this.itemRenderer.zLevel = 100.0F;
|
||||
|
||||
GlStateManager.enableDepth();
|
||||
RenderSystem.enableDepthTest();
|
||||
RenderHelper.enableGUIStandardItemLighting();
|
||||
this.itemRenderer.renderItemAndEffectIntoGUI( this.myItem, offsetX + this.x + 3, this.y + 3 );
|
||||
GlStateManager.disableDepth();
|
||||
RenderSystem.disableDepthTest();
|
||||
|
||||
this.itemRenderer.zLevel = 0.0F;
|
||||
this.zLevel = 0.0F;
|
||||
|
||||
@@ -64,7 +64,7 @@ public class GuiToggleButton extends Button implements ITooltip
|
||||
{
|
||||
final int iconIndex = this.getIconIndex();
|
||||
|
||||
GlStateManager.color( 1.0f, 1.0f, 1.0f, 1.0f );
|
||||
RenderSystem.color4f( 1.0f, 1.0f, 1.0f, 1.0f );
|
||||
par1Minecraft.renderEngine.bindTexture( new ResourceLocation( "appliedenergistics2", "textures/guis/states.png" ) );
|
||||
this.hovered = par2 >= this.x && par3 >= this.y && par2 < this.x + this.width && par3 < this.y + this.height;
|
||||
|
||||
|
||||
@@ -115,12 +115,12 @@ public class MEGuiTextField extends TextFieldWidget
|
||||
{
|
||||
if( this.isFocused() )
|
||||
{
|
||||
drawRect( this.x - PADDING + 1, this.y - PADDING + 1, this.x + this.width + this._fontPad + PADDING - 1, this.y + this.height + PADDING - 1,
|
||||
fill( this.x - PADDING + 1, this.y - PADDING + 1, this.x + this.width + this._fontPad + PADDING - 1, this.y + this.height + PADDING - 1,
|
||||
0xFF606060 );
|
||||
}
|
||||
else
|
||||
{
|
||||
drawRect( this.x - PADDING + 1, this.y - PADDING + 1, this.x + this.width + this._fontPad + PADDING - 1, this.y + this.height + PADDING - 1,
|
||||
fill( this.x - PADDING + 1, this.y - PADDING + 1, this.x + this.width + this._fontPad + PADDING - 1, this.y + this.height + PADDING - 1,
|
||||
0xFFA8A8A8 );
|
||||
}
|
||||
super.drawTextBox();
|
||||
@@ -172,7 +172,7 @@ public class MEGuiTextField extends TextFieldWidget
|
||||
float green = ( this.selectionColor & 255 ) / 255.0F;
|
||||
float alpha = ( this.selectionColor >> 24 & 255 ) / 255.0F;
|
||||
|
||||
GlStateManager.color( red, green, blue, alpha );
|
||||
RenderSystem.color4f( red, green, blue, alpha );
|
||||
GlStateManager.disableTexture2D();
|
||||
GlStateManager.enableColorLogic();
|
||||
GlStateManager.colorLogicOp( GlStateManager.LogicOp.OR_REVERSE );
|
||||
@@ -183,7 +183,7 @@ public class MEGuiTextField extends TextFieldWidget
|
||||
bufferbuilder.pos( startX, startY, 0.0D ).endVertex();
|
||||
tessellator.draw();
|
||||
GlStateManager.disableColorLogic();
|
||||
GlStateManager.enableTexture2D();
|
||||
RenderSystem.enableTexture();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user