Puts everywhere brackets

This commit is contained in:
thatsIch
2015-04-29 02:30:53 +02:00
parent 23aa8fd72d
commit 64ed05a1b4
465 changed files with 6726 additions and 14 deletions
@@ -98,9 +98,13 @@ public class GuiCellWorkbench extends GuiUpgradeable
int dx = this.workbench.availableUpgrades() - 8;
this.drawTexturedModalRect( offsetX + 177 + 27, offsetY, 186, 0, 35 - 8, 7 + dx * 18 );
if( dx == 8 )
{
this.drawTexturedModalRect( offsetX + 177 + 27, offsetY + ( 7 + ( dx ) * 18 ), 186, 151, 35 - 8, 7 );
}
else
{
this.drawTexturedModalRect( offsetX + 177 + 27 + 4, offsetY + ( 7 + ( dx ) * 18 ), 186 + 4, 151, 35 - 8, 7 );
}
}
else
{
@@ -113,13 +117,19 @@ public class GuiCellWorkbench extends GuiUpgradeable
int dx = this.workbench.availableUpgrades() - 16;
this.drawTexturedModalRect( offsetX + 177 + 27 + 18, offsetY, 186, 0, 35 - 8, 7 + dx * 18 );
if( dx == 8 )
{
this.drawTexturedModalRect( offsetX + 177 + 27 + 18, offsetY + ( 7 + ( dx ) * 18 ), 186, 151, 35 - 8, 7 );
}
else
{
this.drawTexturedModalRect( offsetX + 177 + 27 + 18 + 4, offsetY + ( 7 + ( dx ) * 18 ), 186 + 4, 151, 35 - 8, 7 );
}
}
}
if( this.hasToolbox() )
{
this.drawTexturedModalRect( offsetX + 178, offsetY + this.ySize - 90, 178, 161, 68, 68 );
}
}
@Override
@@ -135,7 +145,9 @@ public class GuiCellWorkbench extends GuiUpgradeable
if( is != null && is.getItem() instanceof IUpgradeModule )
{
if( ( (IUpgradeModule) is.getItem() ).getType( is ) == Upgrades.FUZZY )
{
hasFuzzy = true;
}
}
}
this.fuzzyMode.setVisibility( hasFuzzy );
@@ -186,7 +198,9 @@ public class GuiCellWorkbench extends GuiUpgradeable
NetworkHandler.instance.sendToServer( new PacketValueConfig( "CellWorkbench.Fuzzy", fz.name() ) );
}
else
{
super.actionPerformed( btn );
}
}
catch( IOException ignored )
{
@@ -197,10 +197,14 @@ public class GuiCraftAmount extends AEBaseGui
}
if( fixed )
{
this.amountToCraft.setText( out );
}
if( out.length() == 0 )
{
out = "0";
}
long result = Long.parseLong( out );
if( result < 0 )
@@ -248,7 +252,9 @@ public class GuiCraftAmount extends AEBaseGui
boolean isMinus = btn == this.minus1 || btn == this.minus10 || btn == this.minus100 || btn == this.minus1000;
if( isPlus || isMinus )
{
this.addQty( this.getQty( btn ) );
}
}
private void addQty( int i )
@@ -265,19 +271,27 @@ public class GuiCraftAmount extends AEBaseGui
}
if( fixed )
{
this.amountToCraft.setText( out );
}
if( out.length() == 0 )
{
out = "0";
}
long result = Integer.parseInt( out );
if( result == 1 && i > 1 )
{
result = 0;
}
result += i;
if( result < 1 )
{
result = 1;
}
out = Long.toString( result );
Integer.parseInt( out );
@@ -84,16 +84,24 @@ public class GuiCraftConfirm extends AEBaseGui
this.ccc = (ContainerCraftConfirm) this.inventorySlots;
if( te instanceof WirelessTerminalGuiObject )
{
this.OriginalGui = GuiBridge.GUI_WIRELESS_TERM;
}
if( te instanceof PartTerminal )
{
this.OriginalGui = GuiBridge.GUI_ME;
}
if( te instanceof PartCraftingTerminal )
{
this.OriginalGui = GuiBridge.GUI_CRAFTING_TERMINAL;
}
if( te instanceof PartPatternTerminal )
{
this.OriginalGui = GuiBridge.GUI_PATTERN_TERMINAL;
}
}
boolean isAutoStart()
@@ -115,7 +123,9 @@ public class GuiCraftConfirm extends AEBaseGui
this.buttonList.add( 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 );
}
@@ -174,11 +184,15 @@ public class GuiCraftConfirm extends AEBaseGui
btnTextText = GuiText.CraftingCPU.getLocal() + ": " + name;
}
else
{
btnTextText = GuiText.CraftingCPU.getLocal() + ": #" + this.ccc.selectedCpu;
}
}
if( this.ccc.noCPU )
{
btnTextText = GuiText.NoCraftingCPUs.getLocal();
}
this.selectCPU.displayString = btnTextText;
}
@@ -199,9 +213,13 @@ public class GuiCraftConfirm extends AEBaseGui
String dsp = null;
if( this.isSimulation() )
{
dsp = GuiText.Simulation.getLocal();
}
else
{
dsp = this.ccc.cpuBytesAvail > 0 ? ( GuiText.Bytes.getLocal() + ": " + this.ccc.cpuBytesAvail + " : " + GuiText.CoProcessors.getLocal() + ": " + this.ccc.cpuCoProcessors ) : GuiText.Bytes.getLocal() + ": N/A : " + GuiText.CoProcessors.getLocal() + ": N/A";
}
int offset = ( 219 - this.fontRendererObj.getStringWidth( dsp ) ) / 2;
this.fontRendererObj.drawString( dsp, offset, 165, 4210752 );
@@ -237,11 +255,17 @@ public class GuiCraftConfirm extends AEBaseGui
int lines = 0;
if( stored != null && stored.getStackSize() > 0 )
{
lines++;
}
if( pendingStack != null && pendingStack.getStackSize() > 0 )
{
lines++;
}
if( pendingStack != null && pendingStack.getStackSize() > 0 )
{
lines++;
}
int negY = ( ( lines - 1 ) * 5 ) / 2;
int downY = 0;
@@ -251,16 +275,22 @@ public class GuiCraftConfirm extends AEBaseGui
{
String str = Long.toString( stored.getStackSize() );
if( stored.getStackSize() >= 10000 )
{
str = Long.toString( stored.getStackSize() / 1000 ) + 'k';
}
if( stored.getStackSize() >= 10000000 )
{
str = Long.toString( stored.getStackSize() / 1000000 ) + 'm';
}
str = GuiText.FromStorage.getLocal() + ": " + str;
int w = 4 + this.fontRendererObj.getStringWidth( str );
this.fontRendererObj.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 )
{
lineList.add( GuiText.FromStorage.getLocal() + ": " + Long.toString( stored.getStackSize() ) );
}
downY += 5;
}
@@ -269,16 +299,22 @@ public class GuiCraftConfirm extends AEBaseGui
{
String str = Long.toString( missingStack.getStackSize() );
if( missingStack.getStackSize() >= 10000 )
{
str = Long.toString( missingStack.getStackSize() / 1000 ) + 'k';
}
if( missingStack.getStackSize() >= 10000000 )
{
str = Long.toString( missingStack.getStackSize() / 1000000 ) + 'm';
}
str = GuiText.Missing.getLocal() + ": " + str;
int w = 4 + this.fontRendererObj.getStringWidth( str );
this.fontRendererObj.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 )
{
lineList.add( GuiText.Missing.getLocal() + ": " + Long.toString( missingStack.getStackSize() ) );
}
red = true;
downY += 5;
@@ -288,16 +324,22 @@ public class GuiCraftConfirm extends AEBaseGui
{
String str = Long.toString( pendingStack.getStackSize() );
if( pendingStack.getStackSize() >= 10000 )
{
str = Long.toString( pendingStack.getStackSize() / 1000 ) + 'k';
}
if( pendingStack.getStackSize() >= 10000000 )
{
str = Long.toString( pendingStack.getStackSize() / 1000000 ) + 'm';
}
str = GuiText.ToCraft.getLocal() + ": " + str;
int w = 4 + this.fontRendererObj.getStringWidth( str );
this.fontRendererObj.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 )
{
lineList.add( GuiText.ToCraft.getLocal() + ": " + Long.toString( pendingStack.getStackSize() ) );
}
}
GL11.glPopMatrix();
@@ -311,7 +353,9 @@ public class GuiCraftConfirm extends AEBaseGui
dspToolTip = Platform.getItemDisplayName( is );
if( lineList.size() > 0 )
{
dspToolTip = dspToolTip + '\n' + Joiner.on( "\n" ).join( lineList );
}
toolPosX = x * ( 1 + sectionLength ) + xo + sectionLength - 8;
toolPosY = y * offY + yo;
@@ -366,17 +410,23 @@ public class GuiCraftConfirm extends AEBaseGui
{
case 0:
for( IAEItemStack l : list )
{
this.handleInput( this.storage, l );
}
break;
case 1:
for( IAEItemStack l : list )
{
this.handleInput( this.pending, l );
}
break;
case 2:
for( IAEItemStack l : list )
{
this.handleInput( this.missing, l );
}
break;
}
@@ -385,7 +435,9 @@ public class GuiCraftConfirm extends AEBaseGui
long amt = this.getTotal( l );
if( amt <= 0 )
{
this.deleteVisualStack( l );
}
else
{
IAEItemStack is = this.findVisualStack( l );
@@ -403,7 +455,9 @@ public class GuiCraftConfirm extends AEBaseGui
if( l.getStackSize() <= 0 )
{
if( a != null )
{
a.reset();
}
}
else
{
@@ -414,7 +468,9 @@ public class GuiCraftConfirm extends AEBaseGui
}
if( a != null )
{
a.setStackSize( l.getStackSize() );
}
}
}
@@ -427,13 +483,19 @@ public class GuiCraftConfirm extends AEBaseGui
long total = 0;
if( a != null )
{
total += a.getStackSize();
}
if( c != null )
{
total += c.getStackSize();
}
if( m != null )
{
total += m.getStackSize();
}
return total;
}
@@ -228,16 +228,22 @@ public class GuiCraftingCPU extends AEBaseGui implements ISortSource
{
String str = Long.toString( stored.getStackSize() );
if( stored.getStackSize() >= 10000 )
{
str = Long.toString( stored.getStackSize() / 1000 ) + 'k';
}
if( stored.getStackSize() >= 10000000 )
{
str = Long.toString( stored.getStackSize() / 1000000 ) + 'm';
}
str = GuiText.Stored.getLocal() + ": " + str;
int w = 4 + this.fontRendererObj.getStringWidth( str );
this.fontRendererObj.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 )
{
lineList.add( GuiText.Stored.getLocal() + ": " + Long.toString( stored.getStackSize() ) );
}
downY += 5;
}
@@ -246,16 +252,22 @@ public class GuiCraftingCPU extends AEBaseGui implements ISortSource
{
String str = Long.toString( activeStack.getStackSize() );
if( activeStack.getStackSize() >= 10000 )
{
str = Long.toString( activeStack.getStackSize() / 1000 ) + 'k';
}
if( activeStack.getStackSize() >= 10000000 )
{
str = Long.toString( activeStack.getStackSize() / 1000000 ) + 'm';
}
str = GuiText.Crafting.getLocal() + ": " + str;
int w = 4 + this.fontRendererObj.getStringWidth( str );
this.fontRendererObj.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 )
{
lineList.add( GuiText.Crafting.getLocal() + ": " + Long.toString( activeStack.getStackSize() ) );
}
downY += 5;
}
@@ -264,16 +276,22 @@ public class GuiCraftingCPU extends AEBaseGui implements ISortSource
{
String str = Long.toString( pendingStack.getStackSize() );
if( pendingStack.getStackSize() >= 10000 )
{
str = Long.toString( pendingStack.getStackSize() / 1000 ) + 'k';
}
if( pendingStack.getStackSize() >= 10000000 )
{
str = Long.toString( pendingStack.getStackSize() / 1000000 ) + 'm';
}
str = GuiText.Scheduled.getLocal() + ": " + str;
int w = 4 + this.fontRendererObj.getStringWidth( str );
this.fontRendererObj.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 )
{
lineList.add( GuiText.Scheduled.getLocal() + ": " + Long.toString( pendingStack.getStackSize() ) );
}
}
GL11.glPopMatrix();
@@ -287,7 +305,9 @@ public class GuiCraftingCPU extends AEBaseGui implements ISortSource
dspToolTip = Platform.getItemDisplayName( is );
if( lineList.size() > 0 )
{
dspToolTip = dspToolTip + '\n' + Joiner.on( "\n" ).join( lineList );
}
toolPosX = x * ( 1 + sectionLength ) + xo + sectionLength - 8;
toolPosY = y * offY + yo;
@@ -326,17 +346,23 @@ public class GuiCraftingCPU extends AEBaseGui implements ISortSource
{
case 0:
for( IAEItemStack l : list )
{
this.handleInput( this.storage, l );
}
break;
case 1:
for( IAEItemStack l : list )
{
this.handleInput( this.active, l );
}
break;
case 2:
for( IAEItemStack l : list )
{
this.handleInput( this.pending, l );
}
break;
}
@@ -345,7 +371,9 @@ public class GuiCraftingCPU extends AEBaseGui implements ISortSource
long amt = this.getTotal( l );
if( amt <= 0 )
{
this.deleteVisualStack( l );
}
else
{
IAEItemStack is = this.findVisualStack( l );
@@ -363,7 +391,9 @@ public class GuiCraftingCPU extends AEBaseGui implements ISortSource
if( l.getStackSize() <= 0 )
{
if( a != null )
{
a.reset();
}
}
else
{
@@ -374,7 +404,9 @@ public class GuiCraftingCPU extends AEBaseGui implements ISortSource
}
if( a != null )
{
a.setStackSize( l.getStackSize() );
}
}
}
@@ -387,13 +419,19 @@ public class GuiCraftingCPU extends AEBaseGui implements ISortSource
long total = 0;
if( a != null )
{
total += a.getStackSize();
}
if( b != null )
{
total += b.getStackSize();
}
if( c != null )
{
total += c.getStackSize();
}
return total;
}
@@ -166,11 +166,15 @@ public class GuiCraftingStatus extends GuiCraftingCPU
btnTextText = GuiText.CPUs.getLocal() + ": " + name;
}
else
{
btnTextText = GuiText.CPUs.getLocal() + ": #" + this.status.selectedCpu;
}
}
if( this.status.noCPU )
{
btnTextText = GuiText.NoCraftingJobs.getLocal();
}
this.selectCPU.displayString = btnTextText;
}
@@ -59,7 +59,9 @@ public class GuiCraftingTerm extends GuiMEMonitorable
for( Object j : c.inventorySlots )
{
if( j instanceof SlotCraftingMatrix )
{
s = (Slot) j;
}
}
if( s != null )
@@ -69,10 +69,14 @@ public class GuiFormationPlane extends GuiUpgradeable
this.fontRendererObj.drawString( GuiText.inventory.getLocal(), 8, this.ySize - 96 + 3, 4210752 );
if( this.fuzzyMode != null )
{
this.fuzzyMode.set( this.cvb.fzMode );
}
if( this.placeMode != null )
{
this.placeMode.set( ( (ContainerFormationPlane) this.cvb ).placeMode );
}
}
@Override
@@ -70,13 +70,19 @@ public class GuiIOPort extends GuiUpgradeable
this.fontRendererObj.drawString( GuiText.inventory.getLocal(), 8, this.ySize - 96 + 3, 4210752 );
if( this.redstoneMode != null )
{
this.redstoneMode.set( this.cvb.rsMode );
}
if( this.operationMode != null )
{
this.operationMode.set( ( (ContainerIOPort) this.cvb ).opMode );
}
if( this.fullMode != null )
{
this.fullMode.set( ( (ContainerIOPort) this.cvb ).fMode );
}
}
@Override
@@ -111,9 +117,13 @@ public class GuiIOPort extends GuiUpgradeable
boolean backwards = Mouse.isButtonDown( 1 );
if( btn == this.fullMode )
{
NetworkHandler.instance.sendToServer( new PacketConfigButton( this.fullMode.getSetting(), backwards ) );
}
if( btn == this.operationMode )
{
NetworkHandler.instance.sendToServer( new PacketConfigButton( this.operationMode.getSetting(), backwards ) );
}
}
}
@@ -77,9 +77,13 @@ public class GuiInscriber extends AEBaseGui
this.drawTexturedModalRect( offsetX, offsetY, 0, 0, 211 - 34, this.ySize );
if( this.drawUpgrades() )
{
this.drawTexturedModalRect( offsetX + 177, offsetY, 177, 0, 35, 14 + this.cvc.availableUpgrades() * 18 );
}
if( this.hasToolbox() )
{
this.drawTexturedModalRect( offsetX + 178, offsetY + this.ySize - 90, 178, this.ySize - 90, 68, 68 );
}
}
protected boolean drawUpgrades()
@@ -68,10 +68,14 @@ public class GuiInterface extends GuiUpgradeable
public void drawFG( int offsetX, int offsetY, int mouseX, int mouseY )
{
if( this.BlockMode != null )
{
this.BlockMode.set( ( (ContainerInterface) this.cvb ).bMode );
}
if( this.interfaceMode != null )
{
this.interfaceMode.setState( ( (ContainerInterface) this.cvb ).iTermMode == YesNo.YES );
}
this.fontRendererObj.drawString( this.getGuiDisplayName( GuiText.Interface.getLocal() ), 8, 6, 4210752 );
@@ -101,9 +105,13 @@ public class GuiInterface extends GuiUpgradeable
}
if( btn == this.interfaceMode )
{
NetworkHandler.instance.sendToServer( new PacketConfigButton( Settings.INTERFACE_TERMINAL, backwards ) );
}
if( btn == this.BlockMode )
{
NetworkHandler.instance.sendToServer( new PacketConfigButton( this.BlockMode.getSetting(), backwards ) );
}
}
}
@@ -105,7 +105,9 @@ public class GuiInterfaceTerminal extends AEBaseGui
while( o.hasNext() )
{
if( o.next() instanceof SlotDisconnected )
{
o.remove();
}
}
for( int x = 0; x < LINES_ON_PAGE && ex + x < this.lines.size(); x++ )
@@ -124,10 +126,14 @@ public class GuiInterfaceTerminal extends AEBaseGui
String name = (String) lineObj;
int rows = this.byName.get( name ).size();
if( rows > 1 )
{
name = name + " (" + rows + ')';
}
while( name.length() > 2 && this.fontRendererObj.getStringWidth( name ) > 155 )
{
name = name.substring( 0, name.length() - 1 );
}
this.fontRendererObj.drawString( name, 10, 6 + offset, 4210752 );
}
@@ -173,7 +179,9 @@ public class GuiInterfaceTerminal extends AEBaseGui
}
if( this.searchField != null )
{
this.searchField.drawTextBox();
}
}
@Override
@@ -182,7 +190,9 @@ public class GuiInterfaceTerminal extends AEBaseGui
if( !this.checkHotbarKeys( key ) )
{
if( character == ' ' && this.searchField.getText().length() == 0 )
{
return;
}
if( this.searchField.textboxKeyTyped( character, key ) )
{
@@ -218,7 +228,9 @@ public class GuiInterfaceTerminal extends AEBaseGui
{
String which = Integer.toString( x );
if( invData.hasKey( which ) )
{
current.inv.setInventorySlotContents( x, ItemStack.loadItemStackFromNBT( invData.getCompoundTag( which ) ) );
}
}
}
catch( NumberFormatException ignored )
@@ -130,10 +130,14 @@ public class GuiLevelEmitter extends GuiUpgradeable
super.drawFG( offsetX, offsetY, mouseX, mouseY );
if( this.craftingMode != null )
{
this.craftingMode.set( ( (ContainerLevelEmitter) this.cvb ).cmType );
}
if( this.levelMode != null )
{
this.levelMode.set( ( (ContainerLevelEmitter) this.cvb ).lvType );
}
}
@Override
@@ -170,16 +174,22 @@ public class GuiLevelEmitter extends GuiUpgradeable
boolean backwards = Mouse.isButtonDown( 1 );
if( btn == this.craftingMode )
{
NetworkHandler.instance.sendToServer( new PacketConfigButton( this.craftingMode.getSetting(), backwards ) );
}
if( btn == this.levelMode )
{
NetworkHandler.instance.sendToServer( new PacketConfigButton( this.levelMode.getSetting(), backwards ) );
}
boolean isPlus = btn == this.plus1 || btn == this.plus10 || btn == this.plus100 || btn == this.plus1000;
boolean isMinus = btn == this.minus1 || btn == this.minus10 || btn == this.minus100 || btn == this.minus1000;
if( isPlus || isMinus )
{
this.addQty( this.getQty( btn ) );
}
}
private void addQty( long i )
@@ -196,15 +206,21 @@ public class GuiLevelEmitter extends GuiUpgradeable
}
if( Fixed )
{
this.level.setText( Out );
}
if( Out.length() == 0 )
{
Out = "0";
}
long result = Long.parseLong( Out );
result += i;
if( result < 0 )
{
result = 0;
}
this.level.setText( Out = Long.toString( result ) );
@@ -240,10 +256,14 @@ public class GuiLevelEmitter extends GuiUpgradeable
}
if( Fixed )
{
this.level.setText( Out );
}
if( Out.length() == 0 )
{
Out = "0";
}
NetworkHandler.instance.sendToServer( new PacketValueConfig( "LevelEmitter.Value", Out ) );
}
@@ -111,7 +111,9 @@ public class GuiMEMonitorable extends AEBaseMEGui implements ISortSource, IConfi
this.ySize = 204;
if( te instanceof IViewCellStorage )
{
this.xSize += 33;
}
this.standardSize = this.xSize;
@@ -121,21 +123,33 @@ public class GuiMEMonitorable extends AEBaseMEGui implements ISortSource, IConfi
this.viewCell = te instanceof IViewCellStorage;
if( te instanceof TileSecurity )
{
this.myName = GuiText.Security;
}
else if( te instanceof WirelessTerminalGuiObject )
{
this.myName = GuiText.WirelessTerminal;
}
else if( te instanceof IPortableCell )
{
this.myName = GuiText.PortableCell;
}
else if( te instanceof IMEChest )
{
this.myName = GuiText.Chest;
}
else if( te instanceof PartTerminal )
{
this.myName = GuiText.Terminal;
}
}
public void postUpdate( List<IAEItemStack> list )
{
for( IAEItemStack is : list )
{
this.repo.postUpdate( is );
}
this.repo.updateView();
this.setScrollBar();
@@ -166,9 +180,13 @@ public class GuiMEMonitorable extends AEBaseMEGui implements ISortSource, IConfi
Enum next = Platform.rotateEnum( cv, backwards, iBtn.getSetting().getPossibleValues() );
if( btn == this.terminalStyleBox )
{
AEConfig.instance.settings.putSetting( iBtn.getSetting(), next );
}
else if( btn == this.searchBoxSettings )
{
AEConfig.instance.settings.putSetting( iBtn.getSetting(), next );
}
else
{
try
@@ -184,7 +202,9 @@ public class GuiMEMonitorable extends AEBaseMEGui implements ISortSource, IConfi
iBtn.set( next );
if( next.getClass() == SearchBoxMode.class || next.getClass() == TerminalStyle.class )
{
this.re_init();
}
}
}
}
@@ -217,10 +237,14 @@ public class GuiMEMonitorable extends AEBaseMEGui implements ISortSource, IConfi
}
if( hasNEI )
{
this.rows--;
}
if( this.rows < 3 )
{
this.rows = 3;
}
this.meSlots.clear();
for( int y = 0; y < this.rows; y++ )
@@ -232,9 +256,13 @@ public class GuiMEMonitorable extends AEBaseMEGui implements ISortSource, IConfi
}
if( AEConfig.instance.getConfigManager().getSetting( Settings.TERMINAL_STYLE ) != TerminalStyle.FULL )
{
this.xSize = this.standardSize + ( ( this.perRow - 9 ) * 18 );
}
else
{
this.xSize = this.standardSize;
}
super.initGui();
// full size : 204
@@ -303,7 +331,9 @@ public class GuiMEMonitorable extends AEBaseMEGui implements ISortSource, IConfi
if( s instanceof AppEngSlot )
{
if( ( (AppEngSlot) s ).xDisplayPosition < 197 )
{
this.repositionSlot( (AppEngSlot) s );
}
}
if( s instanceof SlotCraftingMatrix || s instanceof SlotFakeCraftingMatrix )
@@ -365,10 +395,14 @@ public class GuiMEMonitorable extends AEBaseMEGui implements ISortSource, IConfi
this.drawTexturedModalRect( offsetX, offsetY, 0, 0, x_width, 18 );
if( this.viewCell || ( this instanceof GuiSecurity ) )
{
this.drawTexturedModalRect( offsetX + x_width, offsetY, x_width, 0, 46, 128 );
}
for( int x = 0; x < this.rows; x++ )
{
this.drawTexturedModalRect( offsetX, offsetY + 18 + x * 18, 0, 18, x_width, 18 );
}
this.drawTexturedModalRect( offsetX, offsetY + 16 + this.rows * 18 + this.lowerTextureOffset, 0, 106 - 18 - 18, x_width, 99 + this.reservedSpace - this.lowerTextureOffset );
@@ -386,11 +420,15 @@ public class GuiMEMonitorable extends AEBaseMEGui implements ISortSource, IConfi
}
if( update )
{
this.repo.setViewCell( this.myCurrentViewCells );
}
}
if( this.searchField != null )
{
this.searchField.drawTextBox();
}
}
protected String getBackground()
@@ -420,7 +458,9 @@ public class GuiMEMonitorable extends AEBaseMEGui implements ISortSource, IConfi
if( !this.checkHotbarKeys( key ) )
{
if( character == ' ' && this.searchField.getText().length() == 0 )
{
return;
}
if( this.searchField.textboxKeyTyped( character, key ) )
{
@@ -464,13 +504,19 @@ public class GuiMEMonitorable extends AEBaseMEGui implements ISortSource, IConfi
public void updateSetting( IConfigManager manager, Enum settingName, Enum newValue )
{
if( this.SortByBox != null )
{
this.SortByBox.set( this.configSrc.getSetting( Settings.SORT_BY ) );
}
if( this.SortDirBox != null )
{
this.SortDirBox.set( this.configSrc.getSetting( Settings.SORT_DIRECTION ) );
}
if( this.ViewBox != null )
{
this.ViewBox.set( this.configSrc.getSetting( Settings.VIEW_MODE ) );
}
this.repo.updateView();
}
@@ -161,7 +161,9 @@ public class GuiNetworkStatus extends AEBaseGui implements ISortSource
String str = Long.toString( refStack.getStackSize() );
if( refStack.getStackSize() >= 10000 )
{
str = Long.toString( refStack.getStackSize() / 1000 ) + 'k';
}
int w = this.fontRendererObj.getStringWidth( str );
this.fontRendererObj.drawString( str, (int) ( ( x * sectionLength + xo + sectionLength - 19 - ( w * 0.5 ) ) * 2 ), ( y * 18 + yo + 6 ) * 2, 4210752 );
@@ -176,7 +178,9 @@ public class GuiNetworkStatus extends AEBaseGui implements ISortSource
toolTip += ( '\n' + GuiText.Installed.getLocal() + ": " + ( refStack.getStackSize() ) );
if( refStack.getCountRequestable() > 0 )
{
toolTip += ( '\n' + GuiText.EnergyDrain.getLocal() + ": " + Platform.formatPowerLong( refStack.getCountRequestable(), true ) );
}
toolPosX = x * sectionLength + xo + sectionLength - 8;
toolPosY = y * 18 + yo;
@@ -214,7 +218,9 @@ public class GuiNetworkStatus extends AEBaseGui implements ISortSource
this.repo.clear();
for( IAEItemStack is : list )
{
this.repo.postUpdate( is );
}
this.repo.updateView();
this.setScrollBar();
@@ -249,7 +255,9 @@ public class GuiNetworkStatus extends AEBaseGui implements ISortSource
if( myStack != null )
{
while( currentToolTip.size() > 1 )
{
currentToolTip.remove( 1 );
}
}
}
}
@@ -278,7 +286,9 @@ public class GuiNetworkStatus extends AEBaseGui implements ISortSource
List currentToolTip = stack.getTooltip( this.mc.thePlayer, this.mc.gameSettings.advancedItemTooltips );
while( currentToolTip.size() > 1 )
{
currentToolTip.remove( 1 );
}
currentToolTip.add( GuiText.Installed.getLocal() + ": " + ( myStack.getStackSize() ) );
currentToolTip.add( GuiText.EnergyDrain.getLocal() + ": " + Platform.formatPowerLong( myStack.getCountRequestable(), true ) );
@@ -53,7 +53,9 @@ public class GuiNetworkTool extends AEBaseGui
try
{
if( btn == this.tFacades )
{
NetworkHandler.instance.sendToServer( new PacketValueConfig( "NetworkTool", "Toggle" ) );
}
}
catch( IOException e )
{
@@ -75,7 +77,9 @@ public class GuiNetworkTool extends AEBaseGui
public void drawFG( int offsetX, int offsetY, int mouseX, int mouseY )
{
if( this.tFacades != null )
{
this.tFacades.setState( ( (ContainerNetworkTool) this.inventorySlots ).facadeMode );
}
this.fontRendererObj.drawString( this.getGuiDisplayName( GuiText.NetworkTool.getLocal() ), 8, 6, 4210752 );
this.fontRendererObj.drawString( GuiText.inventory.getLocal(), 8, this.ySize - 96 + 3, 4210752 );
@@ -130,7 +130,9 @@ public class GuiPatternTerm extends GuiMEMonitorable
protected String getBackground()
{
if( this.container.craftingMode )
{
return "guis/pattern.png";
}
return "guis/pattern2.png";
}
@@ -138,8 +140,12 @@ public class GuiPatternTerm extends GuiMEMonitorable
protected void repositionSlot( AppEngSlot s )
{
if( s.isPlayerSide() )
{
s.yDisplayPosition = s.defY + this.ySize - 78 - 5;
}
else
{
s.yDisplayPosition = s.defY + this.ySize - 78 - 3;
}
}
}
@@ -156,7 +156,9 @@ public class GuiPriority extends AEBaseGui
}
if( this.OriginalGui != null && myIcon != null )
{
this.buttonList.add( this.originalGuiBtn = new GuiTabButton( this.guiLeft + 154, this.guiTop, myIcon, myIcon.getDisplayName(), itemRender ) );
}
this.priority = new GuiNumberBox( this.fontRendererObj, this.guiLeft + 62, this.guiTop + 57, 59, this.fontRendererObj.FONT_HEIGHT, Long.class );
this.priority.setEnableBackgroundDrawing( false );
@@ -196,7 +198,9 @@ public class GuiPriority extends AEBaseGui
boolean isMinus = btn == this.minus1 || btn == this.minus10 || btn == this.minus100 || btn == this.minus1000;
if( isPlus || isMinus )
{
this.addQty( this.getQty( btn ) );
}
}
private void addQty( int i )
@@ -213,10 +217,14 @@ public class GuiPriority extends AEBaseGui
}
if( fixed )
{
this.priority.setText( out );
}
if( out.length() == 0 )
{
out = "0";
}
long result = Long.parseLong( out );
result += i;
@@ -255,10 +263,14 @@ public class GuiPriority extends AEBaseGui
}
if( fixed )
{
this.priority.setText( out );
}
if( out.length() == 0 )
{
out = "0";
}
NetworkHandler.instance.sendToServer( new PacketValueConfig( "PriorityHost.Priority", out ) );
}
@@ -62,15 +62,25 @@ public class GuiSecurity extends GuiMEMonitorable
SecurityPermissions toggleSetting = null;
if( btn == this.inject )
{
toggleSetting = SecurityPermissions.INJECT;
}
if( btn == this.extract )
{
toggleSetting = SecurityPermissions.EXTRACT;
}
if( btn == this.craft )
{
toggleSetting = SecurityPermissions.CRAFT;
}
if( btn == this.build )
{
toggleSetting = SecurityPermissions.BUILD;
}
if( btn == this.security )
{
toggleSetting = SecurityPermissions.SECURITY;
}
if( toggleSetting != null )
{
@@ -84,13 +84,19 @@ public class GuiStorageBus extends GuiUpgradeable
this.fontRendererObj.drawString( GuiText.inventory.getLocal(), 8, this.ySize - 96 + 3, 4210752 );
if( this.fuzzyMode != null )
{
this.fuzzyMode.set( this.cvb.fzMode );
}
if( this.storageFilter != null )
{
this.storageFilter.set( ( (ContainerStorageBus) this.cvb ).storageFilter );
}
if( this.rwMode != null )
{
this.rwMode.set( ( (ContainerStorageBus) this.cvb ).rwMode );
}
}
@Override
@@ -109,19 +115,25 @@ public class GuiStorageBus extends GuiUpgradeable
try
{
if( btn == this.partition )
{
NetworkHandler.instance.sendToServer( new PacketValueConfig( "StorageBus.Action", "Partition" ) );
}
else if( btn == this.clear )
{
NetworkHandler.instance.sendToServer( new PacketValueConfig( "StorageBus.Action", "Clear" ) );
}
else if( btn == this.priority )
{
NetworkHandler.instance.sendToServer( new PacketSwitchGuis( GuiBridge.GUI_PRIORITY ) );
}
else if( btn == this.rwMode )
{
NetworkHandler.instance.sendToServer( new PacketConfigButton( this.rwMode.getSetting(), backwards ) );
}
else if( btn == this.storageFilter )
{
NetworkHandler.instance.sendToServer( new PacketConfigButton( this.storageFilter.getSetting(), backwards ) );
}
}
catch( IOException e )
{
@@ -94,13 +94,19 @@ public class GuiUpgradeable extends AEBaseGui
this.fontRendererObj.drawString( GuiText.inventory.getLocal(), 8, this.ySize - 96 + 3, 4210752 );
if( this.redstoneMode != null )
{
this.redstoneMode.set( this.cvb.rsMode );
}
if( this.fuzzyMode != null )
{
this.fuzzyMode.set( this.cvb.fzMode );
}
if( this.craftMode != null )
{
this.craftMode.set( this.cvb.cMode );
}
}
@Override
@@ -111,19 +117,29 @@ public class GuiUpgradeable extends AEBaseGui
this.bindTexture( this.getBackground() );
this.drawTexturedModalRect( offsetX, offsetY, 0, 0, 211 - 34, this.ySize );
if( this.drawUpgrades() )
{
this.drawTexturedModalRect( offsetX + 177, offsetY, 177, 0, 35, 14 + this.cvb.availableUpgrades() * 18 );
}
if( this.hasToolbox() )
{
this.drawTexturedModalRect( offsetX + 178, offsetY + this.ySize - 90, 178, this.ySize - 90, 68, 68 );
}
}
protected void handleButtonVisibility()
{
if( this.redstoneMode != null )
{
this.redstoneMode.setVisibility( this.bc.getInstalledUpgrades( Upgrades.REDSTONE ) > 0 );
}
if( this.fuzzyMode != null )
{
this.fuzzyMode.setVisibility( this.bc.getInstalledUpgrades( Upgrades.FUZZY ) > 0 );
}
if( this.craftMode != null )
{
this.craftMode.setVisibility( this.bc.getInstalledUpgrades( Upgrades.CRAFTING ) > 0 );
}
}
protected String getBackground()
@@ -149,12 +165,18 @@ public class GuiUpgradeable extends AEBaseGui
boolean backwards = Mouse.isButtonDown( 1 );
if( btn == this.redstoneMode )
{
NetworkHandler.instance.sendToServer( new PacketConfigButton( this.redstoneMode.getSetting(), backwards ) );
}
if( btn == this.craftMode )
{
NetworkHandler.instance.sendToServer( new PacketConfigButton( this.craftMode.getSetting(), backwards ) );
}
if( btn == this.fuzzyMode )
{
NetworkHandler.instance.sendToServer( new PacketConfigButton( this.fuzzyMode.getSetting(), backwards ) );
}
}
}