Basic reformat, hit once, hope never again
This commit is contained in:
@@ -18,6 +18,7 @@
|
||||
|
||||
package appeng.client.gui.implementations;
|
||||
|
||||
|
||||
import org.lwjgl.input.Mouse;
|
||||
|
||||
import net.minecraft.client.gui.GuiButton;
|
||||
@@ -32,19 +33,26 @@ import appeng.core.localization.GuiText;
|
||||
import appeng.tile.networking.TileWireless;
|
||||
import appeng.util.Platform;
|
||||
|
||||
|
||||
public class GuiWireless extends AEBaseGui
|
||||
{
|
||||
|
||||
GuiImgButton units;
|
||||
|
||||
public GuiWireless( InventoryPlayer inventoryPlayer, TileWireless te )
|
||||
{
|
||||
super( new ContainerWireless( inventoryPlayer, te ) );
|
||||
this.ySize = 166;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void actionPerformed(GuiButton btn)
|
||||
protected void actionPerformed( GuiButton btn )
|
||||
{
|
||||
super.actionPerformed( btn );
|
||||
|
||||
boolean backwards = Mouse.isButtonDown( 1 );
|
||||
|
||||
if ( btn == this.units )
|
||||
if( btn == this.units )
|
||||
{
|
||||
AEConfig.instance.nextPowerUnit( backwards );
|
||||
this.units.set( AEConfig.instance.selectedPowerUnit() );
|
||||
@@ -60,36 +68,30 @@ public class GuiWireless extends AEBaseGui
|
||||
this.buttonList.add( this.units );
|
||||
}
|
||||
|
||||
public GuiWireless(InventoryPlayer inventoryPlayer, TileWireless te) {
|
||||
super( new ContainerWireless( inventoryPlayer, te ) );
|
||||
this.ySize = 166;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void drawBG(int offsetX, int offsetY, int mouseX, int mouseY)
|
||||
{
|
||||
this.bindTexture( "guis/wireless.png" );
|
||||
this.drawTexturedModalRect( offsetX, offsetY, 0, 0, this.xSize, this.ySize );
|
||||
}
|
||||
|
||||
@Override
|
||||
public void drawFG(int offsetX, int offsetY, int mouseX, int mouseY)
|
||||
public void drawFG( int offsetX, int offsetY, int mouseX, int mouseY )
|
||||
{
|
||||
this.fontRendererObj.drawString( this.getGuiDisplayName( GuiText.Wireless.getLocal() ), 8, 6, 4210752 );
|
||||
this.fontRendererObj.drawString( GuiText.inventory.getLocal(), 8, this.ySize - 96 + 3, 4210752 );
|
||||
|
||||
ContainerWireless cw = (ContainerWireless) this.inventorySlots;
|
||||
|
||||
if ( cw.range > 0 )
|
||||
if( cw.range > 0 )
|
||||
{
|
||||
String firstMessage = GuiText.Range.getLocal() + ": " + (cw.range / 10.0) + " m";
|
||||
String firstMessage = GuiText.Range.getLocal() + ": " + ( cw.range / 10.0 ) + " m";
|
||||
String secondMessage = GuiText.PowerUsageRate.getLocal() + ": " + Platform.formatPowerLong( cw.drain, true );
|
||||
|
||||
int strWidth = Math.max( this.fontRendererObj.getStringWidth( firstMessage ), this.fontRendererObj.getStringWidth( secondMessage ) );
|
||||
int cOffset = (this.xSize / 2) - (strWidth / 2);
|
||||
int cOffset = ( this.xSize / 2 ) - ( strWidth / 2 );
|
||||
this.fontRendererObj.drawString( firstMessage, cOffset, 20, 4210752 );
|
||||
this.fontRendererObj.drawString( secondMessage, cOffset, 20 + 12, 4210752 );
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void drawBG( int offsetX, int offsetY, int mouseX, int mouseY )
|
||||
{
|
||||
this.bindTexture( "guis/wireless.png" );
|
||||
this.drawTexturedModalRect( offsetX, offsetY, 0, 0, this.xSize, this.ySize );
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user