2013-12-27 23:59:59 +01:00
|
|
|
package appeng.client.gui.implementations;
|
|
|
|
|
2014-03-06 06:45:14 +01:00
|
|
|
import net.minecraft.client.gui.GuiButton;
|
2013-12-27 23:59:59 +01:00
|
|
|
import net.minecraft.entity.player.InventoryPlayer;
|
2014-03-06 06:45:14 +01:00
|
|
|
|
|
|
|
import org.lwjgl.input.Mouse;
|
|
|
|
|
|
|
|
import appeng.api.config.Settings;
|
2013-12-27 23:59:59 +01:00
|
|
|
import appeng.client.gui.AEBaseGui;
|
2014-03-06 06:45:14 +01:00
|
|
|
import appeng.client.gui.widgets.GuiImgButton;
|
2013-12-27 23:59:59 +01:00
|
|
|
import appeng.container.implementations.ContainerSpatialIOPort;
|
2014-03-06 06:45:14 +01:00
|
|
|
import appeng.core.AEConfig;
|
2013-12-27 23:59:59 +01:00
|
|
|
import appeng.core.localization.GuiText;
|
|
|
|
import appeng.tile.spatial.TileSpatialIOPort;
|
|
|
|
|
|
|
|
public class GuiSpatialIOPort extends AEBaseGui
|
|
|
|
{
|
|
|
|
|
2014-03-06 06:45:14 +01:00
|
|
|
ContainerSpatialIOPort csiop;
|
|
|
|
GuiImgButton units;
|
|
|
|
|
2013-12-27 23:59:59 +01:00
|
|
|
public GuiSpatialIOPort(InventoryPlayer inventoryPlayer, TileSpatialIOPort te) {
|
|
|
|
super( new ContainerSpatialIOPort( inventoryPlayer, te ) );
|
|
|
|
this.ySize = 199;
|
2014-03-06 06:45:14 +01:00
|
|
|
csiop = (ContainerSpatialIOPort) inventorySlots;
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
protected void actionPerformed(GuiButton btn)
|
|
|
|
{
|
|
|
|
super.actionPerformed( btn );
|
|
|
|
|
|
|
|
boolean backwards = Mouse.isButtonDown( 1 );
|
|
|
|
|
|
|
|
if ( btn == units )
|
|
|
|
{
|
|
|
|
AEConfig.instance.nextPowerUnit( backwards );
|
|
|
|
units.set( AEConfig.instance.selectedPowerUnit() );
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public void initGui()
|
|
|
|
{
|
|
|
|
super.initGui();
|
|
|
|
|
|
|
|
units = new GuiImgButton( this.guiLeft - 18, guiTop + 8, Settings.POWER_UNITS, AEConfig.instance.selectedPowerUnit() );
|
|
|
|
buttonList.add( units );
|
2013-12-27 23:59:59 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public void drawBG(int offsetX, int offsetY, int mouseX, int mouseY)
|
|
|
|
{
|
|
|
|
bindTexture( "guis/spatialio.png" );
|
|
|
|
this.drawTexturedModalRect( offsetX, offsetY, 0, 0, xSize, ySize );
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public void drawFG(int offsetX, int offsetY, int mouseX, int mouseY)
|
|
|
|
{
|
2014-03-06 06:45:14 +01:00
|
|
|
fontRendererObj.drawString( GuiText.StoredPower.getLocal() + ": " + formatPowerLong( csiop.currentPower, false ), 13, 21, 4210752 );
|
|
|
|
fontRendererObj.drawString( GuiText.MaxPower.getLocal() + ": " + formatPowerLong( csiop.maxPower, false ), 13, 31, 4210752 );
|
|
|
|
fontRendererObj.drawString( GuiText.RequiredPower.getLocal() + ": " + formatPowerLong( csiop.reqPower, false ), 13, 78, 4210752 );
|
|
|
|
fontRendererObj.drawString( GuiText.Efficiency.getLocal() + ": " + (((float) csiop.eff) / 100) + "%", 13, 88, 4210752 );
|
|
|
|
|
2014-03-15 07:58:21 +01:00
|
|
|
fontRendererObj.drawString( getGuiDisplayName( GuiText.SpatialIOPort.getLocal() ), 8, 6, 4210752 );
|
2014-03-05 08:27:42 +01:00
|
|
|
fontRendererObj.drawString( GuiText.inventory.getLocal(), 8, ySize - 96, 4210752 );
|
2013-12-27 23:59:59 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
}
|