2013-12-27 23:59:59 +01:00
|
|
|
package appeng.client.gui.implementations;
|
|
|
|
|
2014-02-17 01:50:25 +01:00
|
|
|
import java.io.IOException;
|
2013-12-27 23:59:59 +01:00
|
|
|
import java.util.List;
|
|
|
|
|
|
|
|
import net.minecraft.client.gui.GuiButton;
|
|
|
|
import net.minecraft.entity.player.InventoryPlayer;
|
2014-03-04 08:52:07 +01:00
|
|
|
import net.minecraft.item.ItemStack;
|
2014-02-27 08:10:11 +01:00
|
|
|
|
|
|
|
import org.lwjgl.input.Mouse;
|
|
|
|
|
2014-02-16 10:09:20 +01:00
|
|
|
import appeng.api.config.SearchBoxMode;
|
2013-12-27 23:59:59 +01:00
|
|
|
import appeng.api.config.Settings;
|
2014-03-27 06:14:34 +01:00
|
|
|
import appeng.api.config.TerminalStyle;
|
2014-01-23 20:02:48 +01:00
|
|
|
import appeng.api.implementations.guiobjects.IPortableCell;
|
|
|
|
import appeng.api.implementations.tiles.IMEChest;
|
2014-03-04 08:52:07 +01:00
|
|
|
import appeng.api.implementations.tiles.IViewCellStorage;
|
2014-02-17 01:50:25 +01:00
|
|
|
import appeng.api.storage.ITerminalHost;
|
2013-12-27 23:59:59 +01:00
|
|
|
import appeng.api.storage.data.IAEItemStack;
|
2014-02-17 01:50:25 +01:00
|
|
|
import appeng.api.util.IConfigManager;
|
|
|
|
import appeng.api.util.IConfigureableObject;
|
2013-12-27 23:59:59 +01:00
|
|
|
import appeng.client.gui.AEBaseMEGui;
|
|
|
|
import appeng.client.gui.widgets.GuiImgButton;
|
|
|
|
import appeng.client.gui.widgets.GuiScrollbar;
|
2014-02-06 06:08:05 +01:00
|
|
|
import appeng.client.gui.widgets.ISortSource;
|
2014-02-16 10:09:20 +01:00
|
|
|
import appeng.client.gui.widgets.MEGuiTextField;
|
2013-12-27 23:59:59 +01:00
|
|
|
import appeng.client.me.InternalSlotME;
|
|
|
|
import appeng.client.me.ItemRepo;
|
|
|
|
import appeng.container.implementations.ContainerMEMonitorable;
|
|
|
|
import appeng.container.slot.AppEngSlot;
|
2014-02-09 06:08:27 +01:00
|
|
|
import appeng.core.AEConfig;
|
2014-02-17 01:50:25 +01:00
|
|
|
import appeng.core.AELog;
|
2014-04-20 06:35:13 +02:00
|
|
|
import appeng.core.AppEng;
|
2013-12-27 23:59:59 +01:00
|
|
|
import appeng.core.localization.GuiText;
|
2014-02-17 01:50:25 +01:00
|
|
|
import appeng.core.sync.network.NetworkHandler;
|
|
|
|
import appeng.core.sync.packets.PacketValueConfig;
|
2014-02-03 06:02:54 +01:00
|
|
|
import appeng.helpers.WirelessTerminalGuiObject;
|
2013-12-27 23:59:59 +01:00
|
|
|
import appeng.parts.reporting.PartTerminal;
|
2014-01-31 07:33:31 +01:00
|
|
|
import appeng.tile.misc.TileSecurity;
|
2014-02-17 01:50:25 +01:00
|
|
|
import appeng.util.IConfigManagerHost;
|
2013-12-27 23:59:59 +01:00
|
|
|
import appeng.util.Platform;
|
|
|
|
|
2014-02-17 01:50:25 +01:00
|
|
|
public class GuiMEMonitorable extends AEBaseMEGui implements ISortSource, IConfigManagerHost
|
2013-12-27 23:59:59 +01:00
|
|
|
{
|
|
|
|
|
2014-02-16 10:09:20 +01:00
|
|
|
MEGuiTextField searchField;
|
2013-12-27 23:59:59 +01:00
|
|
|
ItemRepo repo;
|
|
|
|
|
|
|
|
GuiText myName;
|
2014-01-31 07:33:31 +01:00
|
|
|
|
|
|
|
int xoffset = 9;
|
|
|
|
int perRow = 9;
|
2014-02-01 06:37:27 +01:00
|
|
|
int reservedSpace = 0;
|
2014-02-05 03:44:54 +01:00
|
|
|
int lowerTextureOffset = 0;
|
2014-02-06 06:08:05 +01:00
|
|
|
boolean customSortOrder = true;
|
2014-01-31 07:33:31 +01:00
|
|
|
|
2013-12-27 23:59:59 +01:00
|
|
|
int rows = 0;
|
2014-01-20 17:41:37 +01:00
|
|
|
int maxRows = Integer.MAX_VALUE;
|
2013-12-27 23:59:59 +01:00
|
|
|
|
2014-03-27 06:14:34 +01:00
|
|
|
int standardSize;
|
|
|
|
|
2014-02-17 01:50:25 +01:00
|
|
|
IConfigManager configSrc;
|
|
|
|
|
|
|
|
GuiImgButton ViewBox;
|
|
|
|
GuiImgButton SortByBox;
|
|
|
|
GuiImgButton SortDirBox;
|
|
|
|
|
2014-03-27 06:14:34 +01:00
|
|
|
GuiImgButton searchBoxSettings, terminalStyleBox;
|
2014-03-04 08:52:07 +01:00
|
|
|
boolean viewCell;
|
|
|
|
|
2014-03-05 04:12:23 +01:00
|
|
|
ItemStack myCurrentViewCells[] = new ItemStack[5];
|
2014-03-04 08:52:07 +01:00
|
|
|
ContainerMEMonitorable mecontainer;
|
2014-02-17 01:50:25 +01:00
|
|
|
|
|
|
|
public GuiMEMonitorable(InventoryPlayer inventoryPlayer, ITerminalHost te) {
|
2014-03-04 08:52:07 +01:00
|
|
|
this( inventoryPlayer, te, new ContainerMEMonitorable( inventoryPlayer, te ) );
|
2014-02-01 06:37:27 +01:00
|
|
|
}
|
|
|
|
|
2014-02-17 01:50:25 +01:00
|
|
|
public GuiMEMonitorable(InventoryPlayer inventoryPlayer, ITerminalHost te, ContainerMEMonitorable c) {
|
2014-02-01 06:37:27 +01:00
|
|
|
|
|
|
|
super( c );
|
2013-12-27 23:59:59 +01:00
|
|
|
myScrollBar = new GuiScrollbar();
|
2014-02-06 06:08:05 +01:00
|
|
|
repo = new ItemRepo( myScrollBar, this );
|
2014-03-28 05:31:06 +01:00
|
|
|
|
2014-04-16 19:16:21 +02:00
|
|
|
xSize = 185;
|
2013-12-27 23:59:59 +01:00
|
|
|
ySize = 204;
|
|
|
|
|
2014-03-04 08:52:07 +01:00
|
|
|
if ( te instanceof IViewCellStorage )
|
|
|
|
xSize += 33;
|
|
|
|
|
2014-03-27 06:14:34 +01:00
|
|
|
standardSize = xSize;
|
|
|
|
|
2014-02-17 01:50:25 +01:00
|
|
|
configSrc = ((IConfigureableObject) inventorySlots).getConfigManager();
|
2014-03-04 08:52:07 +01:00
|
|
|
(mecontainer = (ContainerMEMonitorable) inventorySlots).gui = this;
|
|
|
|
|
|
|
|
viewCell = te instanceof IViewCellStorage;
|
2014-02-17 01:50:25 +01:00
|
|
|
|
2014-01-31 07:33:31 +01:00
|
|
|
if ( te instanceof TileSecurity )
|
|
|
|
myName = GuiText.Security;
|
2014-02-03 06:02:54 +01:00
|
|
|
else if ( te instanceof WirelessTerminalGuiObject )
|
|
|
|
myName = GuiText.WirelessTerminal;
|
2014-01-31 07:33:31 +01:00
|
|
|
else if ( te instanceof IPortableCell )
|
2014-01-20 17:41:37 +01:00
|
|
|
myName = GuiText.PortableCell;
|
2014-01-31 07:33:31 +01:00
|
|
|
else if ( te instanceof IMEChest )
|
2013-12-27 23:59:59 +01:00
|
|
|
myName = GuiText.Chest;
|
|
|
|
else if ( te instanceof PartTerminal )
|
|
|
|
myName = GuiText.Terminal;
|
|
|
|
}
|
|
|
|
|
|
|
|
public void postUpdate(List<IAEItemStack> list)
|
|
|
|
{
|
|
|
|
for (IAEItemStack is : list)
|
|
|
|
repo.postUpdate( is );
|
|
|
|
|
|
|
|
repo.updateView();
|
|
|
|
setScrollBar();
|
|
|
|
}
|
|
|
|
|
|
|
|
private void setScrollBar()
|
|
|
|
{
|
|
|
|
myScrollBar.setTop( 18 ).setLeft( 175 ).setHeight( rows * 18 - 2 );
|
2014-01-31 07:33:31 +01:00
|
|
|
myScrollBar.setRange( 0, (repo.size() + perRow - 1) / perRow - rows, Math.max( 1, rows / 6 ) );
|
2013-12-27 23:59:59 +01:00
|
|
|
}
|
|
|
|
|
2014-02-16 10:09:20 +01:00
|
|
|
public void re_init()
|
|
|
|
{
|
|
|
|
this.buttonList.clear();
|
|
|
|
this.initGui();
|
|
|
|
}
|
|
|
|
|
2013-12-27 23:59:59 +01:00
|
|
|
@Override
|
|
|
|
public void initGui()
|
|
|
|
{
|
2014-04-16 20:48:03 +02:00
|
|
|
maxRows = getMaxRows();
|
2014-03-27 06:14:34 +01:00
|
|
|
perRow = AEConfig.instance.getConfigManager().getSetting( Settings.TERMINAL_STYLE ) != TerminalStyle.FULL ? 9 : 9 + ((width - standardSize) / 18);
|
|
|
|
|
2014-04-20 06:35:13 +02:00
|
|
|
boolean hasNEI = AppEng.instance.isIntegrationEnabled( "NEI" );
|
|
|
|
|
|
|
|
int NEI = hasNEI ? 4 : 0;
|
|
|
|
int top = hasNEI ? 22 : 4;
|
|
|
|
|
2014-02-05 03:44:54 +01:00
|
|
|
int magicNumber = 114 + 1;
|
|
|
|
int extraSpace = height - magicNumber - NEI - top - reservedSpace;
|
2014-01-20 17:41:37 +01:00
|
|
|
|
2013-12-27 23:59:59 +01:00
|
|
|
rows = (int) Math.floor( extraSpace / 18 );
|
2014-01-20 17:41:37 +01:00
|
|
|
if ( rows > maxRows )
|
|
|
|
{
|
|
|
|
top += (rows - maxRows) * 18 / 2;
|
|
|
|
rows = maxRows;
|
|
|
|
}
|
2013-12-27 23:59:59 +01:00
|
|
|
|
2014-04-20 06:35:13 +02:00
|
|
|
if ( hasNEI )
|
|
|
|
rows--;
|
|
|
|
|
2014-04-27 04:54:08 +02:00
|
|
|
if ( rows < 3 )
|
|
|
|
rows = 3;
|
|
|
|
|
2013-12-27 23:59:59 +01:00
|
|
|
meSlots.clear();
|
|
|
|
for (int y = 0; y < rows; y++)
|
|
|
|
{
|
2014-01-31 07:33:31 +01:00
|
|
|
for (int x = 0; x < perRow; x++)
|
2013-12-27 23:59:59 +01:00
|
|
|
{
|
2014-01-31 07:33:31 +01:00
|
|
|
meSlots.add( new InternalSlotME( repo, x + y * perRow, xoffset + x * 18, 18 + y * 18 ) );
|
2013-12-27 23:59:59 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2014-03-27 06:14:34 +01:00
|
|
|
if ( AEConfig.instance.getConfigManager().getSetting( Settings.TERMINAL_STYLE ) != TerminalStyle.FULL )
|
|
|
|
this.xSize = standardSize + ((perRow - 9) * 18);
|
|
|
|
else
|
|
|
|
this.xSize = standardSize;
|
2014-03-28 05:31:06 +01:00
|
|
|
|
2013-12-27 23:59:59 +01:00
|
|
|
super.initGui();
|
|
|
|
// full size : 204
|
|
|
|
// extra slots : 72
|
|
|
|
// slot 18
|
|
|
|
|
2014-02-05 03:44:54 +01:00
|
|
|
this.ySize = magicNumber + rows * 18 + reservedSpace;
|
2013-12-27 23:59:59 +01:00
|
|
|
this.guiTop = top;
|
|
|
|
|
2014-02-06 06:08:05 +01:00
|
|
|
int offset = guiTop + 8;
|
|
|
|
|
|
|
|
if ( customSortOrder )
|
|
|
|
{
|
2014-02-17 01:50:25 +01:00
|
|
|
buttonList.add( SortByBox = new GuiImgButton( this.guiLeft - 18, offset, Settings.SORT_BY, configSrc.getSetting( Settings.SORT_BY ) ) );
|
2014-02-06 06:08:05 +01:00
|
|
|
offset += 20;
|
|
|
|
}
|
|
|
|
|
2014-02-17 01:50:25 +01:00
|
|
|
buttonList.add( SortDirBox = new GuiImgButton( this.guiLeft - 18, offset, Settings.SORT_DIRECTION, configSrc.getSetting( Settings.SORT_DIRECTION ) ) );
|
2014-02-16 10:09:20 +01:00
|
|
|
offset += 20;
|
|
|
|
|
2014-02-17 01:50:25 +01:00
|
|
|
buttonList.add( searchBoxSettings = new GuiImgButton( this.guiLeft - 18, offset, Settings.SEARCH_MODE, AEConfig.instance.settings
|
|
|
|
.getSetting( Settings.SEARCH_MODE ) ) );
|
2014-03-27 06:14:34 +01:00
|
|
|
offset += 20;
|
|
|
|
|
2014-04-20 06:35:13 +02:00
|
|
|
if ( !(this instanceof GuiMEPortableCell) )
|
2014-04-16 20:48:03 +02:00
|
|
|
{
|
|
|
|
buttonList.add( terminalStyleBox = new GuiImgButton( this.guiLeft - 18, offset, Settings.TERMINAL_STYLE, AEConfig.instance.settings
|
|
|
|
.getSetting( Settings.TERMINAL_STYLE ) ) );
|
|
|
|
}
|
2014-04-20 06:35:13 +02:00
|
|
|
|
2014-02-16 10:09:20 +01:00
|
|
|
searchField = new MEGuiTextField( fontRendererObj, this.guiLeft + Math.max( 82, xoffset ), this.guiTop + 6, 89, fontRendererObj.FONT_HEIGHT );
|
2013-12-27 23:59:59 +01:00
|
|
|
searchField.setEnableBackgroundDrawing( false );
|
|
|
|
searchField.setMaxStringLength( 25 );
|
|
|
|
searchField.setTextColor( 0xFFFFFF );
|
|
|
|
searchField.setVisible( true );
|
2014-02-16 10:09:20 +01:00
|
|
|
|
|
|
|
// Enum setting = AEConfig.instance.getSetting( "Terminal", SearchBoxMode.class, SearchBoxMode.AUTOSEARCH );
|
|
|
|
Enum setting = AEConfig.instance.settings.getSetting( Settings.SEARCH_MODE );
|
|
|
|
searchField.setFocused( SearchBoxMode.AUTOSEARCH == setting || SearchBoxMode.NEI_AUTOSEARCH == setting );
|
2013-12-27 23:59:59 +01:00
|
|
|
|
|
|
|
setScrollBar();
|
|
|
|
|
|
|
|
for (Object s : inventorySlots.inventorySlots)
|
|
|
|
{
|
|
|
|
if ( s instanceof AppEngSlot )
|
|
|
|
{
|
2014-02-02 08:32:10 +01:00
|
|
|
if ( ((AppEngSlot) s).xDisplayPosition < 197 )
|
2014-02-05 03:44:54 +01:00
|
|
|
((AppEngSlot) s).yDisplayPosition = ((AppEngSlot) s).defY + ySize - 78 - 5;
|
2013-12-27 23:59:59 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
protected void actionPerformed(GuiButton btn)
|
|
|
|
{
|
|
|
|
if ( btn instanceof GuiImgButton )
|
|
|
|
{
|
2014-02-27 08:10:11 +01:00
|
|
|
boolean backwards = Mouse.isButtonDown( 1 );
|
|
|
|
|
2013-12-27 23:59:59 +01:00
|
|
|
GuiImgButton iBtn = (GuiImgButton) btn;
|
2014-02-27 05:47:06 +01:00
|
|
|
if ( iBtn.getSetting() != Settings.ACTIONS )
|
2014-02-17 01:50:25 +01:00
|
|
|
{
|
2014-02-27 05:47:06 +01:00
|
|
|
Enum cv = iBtn.getCurrentValue();
|
2014-02-27 08:10:11 +01:00
|
|
|
Enum next = Platform.rotateEnum( cv, backwards, iBtn.getSetting().getPossibleValues() );
|
2014-02-27 05:47:06 +01:00
|
|
|
|
2014-03-27 06:14:34 +01:00
|
|
|
if ( btn == terminalStyleBox )
|
|
|
|
AEConfig.instance.settings.putSetting( iBtn.getSetting(), next );
|
|
|
|
else if ( btn == searchBoxSettings )
|
2014-02-27 05:47:06 +01:00
|
|
|
AEConfig.instance.settings.putSetting( iBtn.getSetting(), next );
|
|
|
|
else
|
2014-02-17 01:50:25 +01:00
|
|
|
{
|
2014-02-27 05:47:06 +01:00
|
|
|
try
|
|
|
|
{
|
|
|
|
NetworkHandler.instance.sendToServer( new PacketValueConfig( iBtn.getSetting().name(), next.name() ) );
|
|
|
|
}
|
|
|
|
catch (IOException e)
|
|
|
|
{
|
|
|
|
AELog.error( e );
|
|
|
|
}
|
2014-02-17 01:50:25 +01:00
|
|
|
}
|
|
|
|
|
2014-02-27 05:47:06 +01:00
|
|
|
iBtn.set( next );
|
2014-02-16 10:09:20 +01:00
|
|
|
|
2014-03-27 06:14:34 +01:00
|
|
|
if ( next.getClass() == SearchBoxMode.class || next.getClass() == TerminalStyle.class )
|
2014-02-27 05:47:06 +01:00
|
|
|
re_init();
|
|
|
|
}
|
2013-12-27 23:59:59 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2014-02-16 10:09:20 +01:00
|
|
|
@Override
|
|
|
|
protected void mouseClicked(int xCoord, int yCoord, int btn)
|
|
|
|
{
|
|
|
|
Enum setting = AEConfig.instance.settings.getSetting( Settings.SEARCH_MODE );
|
|
|
|
if ( !(SearchBoxMode.AUTOSEARCH == setting || SearchBoxMode.NEI_AUTOSEARCH == setting) )
|
|
|
|
searchField.mouseClicked( xCoord, yCoord, btn );
|
|
|
|
|
|
|
|
if ( btn == 1 && searchField.isMouseIn( xCoord, yCoord ) )
|
|
|
|
{
|
|
|
|
searchField.setText( "" );
|
|
|
|
repo.searchString = "";
|
|
|
|
repo.updateView();
|
2014-04-24 09:13:33 +02:00
|
|
|
setScrollBar();
|
2014-02-16 10:09:20 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
super.mouseClicked( xCoord, yCoord, btn );
|
|
|
|
}
|
|
|
|
|
2013-12-27 23:59:59 +01:00
|
|
|
@Override
|
|
|
|
protected void keyTyped(char character, int key)
|
|
|
|
{
|
|
|
|
if ( !this.checkHotbarKeys( key ) )
|
|
|
|
{
|
2014-02-27 04:56:00 +01:00
|
|
|
if ( character == ' ' && this.searchField.getText().length() == 0 )
|
|
|
|
return;
|
|
|
|
|
2013-12-27 23:59:59 +01:00
|
|
|
if ( searchField.textboxKeyTyped( character, key ) )
|
|
|
|
{
|
|
|
|
repo.searchString = this.searchField.getText();
|
|
|
|
repo.updateView();
|
2014-02-06 17:57:01 +01:00
|
|
|
setScrollBar();
|
2013-12-27 23:59:59 +01:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
super.keyTyped( character, key );
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2014-03-28 05:31:06 +01:00
|
|
|
@Override
|
|
|
|
public void updateScreen()
|
|
|
|
{
|
|
|
|
repo.setPower( mecontainer.hasPower );
|
|
|
|
super.updateScreen();
|
|
|
|
}
|
|
|
|
|
2013-12-27 23:59:59 +01:00
|
|
|
@Override
|
|
|
|
public void drawBG(int offsetX, int offsetY, int mouseX, int mouseY)
|
|
|
|
{
|
2014-02-02 08:32:10 +01:00
|
|
|
int x_width = 197;
|
|
|
|
|
2014-01-31 07:33:31 +01:00
|
|
|
bindTexture( getBackground() );
|
2014-02-02 08:32:10 +01:00
|
|
|
this.drawTexturedModalRect( offsetX, offsetY, 0, 0, x_width, 18 );
|
2014-04-16 19:16:21 +02:00
|
|
|
|
2014-04-20 06:35:13 +02:00
|
|
|
if ( viewCell || (this instanceof GuiSecurity) )
|
2014-04-16 19:16:21 +02:00
|
|
|
this.drawTexturedModalRect( offsetX + x_width, offsetY, x_width, 0, 46, 128 );
|
2013-12-27 23:59:59 +01:00
|
|
|
|
|
|
|
for (int x = 0; x < rows; x++)
|
2014-02-02 08:32:10 +01:00
|
|
|
this.drawTexturedModalRect( offsetX, offsetY + 18 + x * 18, 0, 18, x_width, 18 );
|
2013-12-27 23:59:59 +01:00
|
|
|
|
2014-02-05 03:44:54 +01:00
|
|
|
this.drawTexturedModalRect( offsetX, offsetY + 16 + rows * 18 + lowerTextureOffset, 0, 106 - 18 - 18, x_width, 99 + reservedSpace - lowerTextureOffset );
|
2014-03-04 08:52:07 +01:00
|
|
|
|
|
|
|
if ( viewCell )
|
|
|
|
{
|
2014-03-05 04:12:23 +01:00
|
|
|
boolean update = false;
|
|
|
|
|
|
|
|
for (int i = 0; i < 5; i++)
|
2014-03-04 08:52:07 +01:00
|
|
|
{
|
2014-03-05 04:12:23 +01:00
|
|
|
if ( myCurrentViewCells[i] != mecontainer.cellView[i].getStack() )
|
|
|
|
{
|
|
|
|
update = true;
|
|
|
|
myCurrentViewCells[i] = mecontainer.cellView[i].getStack();
|
|
|
|
}
|
2014-03-04 08:52:07 +01:00
|
|
|
}
|
2014-03-05 04:12:23 +01:00
|
|
|
|
|
|
|
if ( update )
|
|
|
|
repo.setViewCell( myCurrentViewCells );
|
2014-03-04 08:52:07 +01:00
|
|
|
}
|
2013-12-27 23:59:59 +01:00
|
|
|
|
2014-02-16 10:09:20 +01:00
|
|
|
if ( searchField != null )
|
|
|
|
searchField.drawTextBox();
|
2013-12-27 23:59:59 +01:00
|
|
|
}
|
|
|
|
|
2014-01-31 07:33:31 +01:00
|
|
|
protected String getBackground()
|
|
|
|
{
|
|
|
|
return "guis/terminal.png";
|
|
|
|
}
|
|
|
|
|
2013-12-27 23:59:59 +01:00
|
|
|
@Override
|
|
|
|
public void drawFG(int offsetX, int offsetY, int mouseX, int mouseY)
|
|
|
|
{
|
2014-03-15 07:58:21 +01:00
|
|
|
fontRendererObj.drawString( getGuiDisplayName( myName.getLocal() ), 8, 6, 4210752 );
|
2014-02-09 02:34:52 +01:00
|
|
|
fontRendererObj.drawString( GuiText.inventory.getLocal(), 8, ySize - 96 + 3, 4210752 );
|
2013-12-27 23:59:59 +01:00
|
|
|
}
|
|
|
|
|
2014-02-06 06:08:05 +01:00
|
|
|
@Override
|
|
|
|
public Enum getSortBy()
|
|
|
|
{
|
2014-02-17 01:50:25 +01:00
|
|
|
return configSrc.getSetting( Settings.SORT_BY );
|
2014-02-06 06:08:05 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public Enum getSortDir()
|
|
|
|
{
|
2014-02-17 01:50:25 +01:00
|
|
|
return configSrc.getSetting( Settings.SORT_DIRECTION );
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public void updateSetting(IConfigManager manager, Enum settingName, Enum newValue)
|
|
|
|
{
|
|
|
|
if ( SortByBox != null )
|
|
|
|
SortByBox.set( configSrc.getSetting( Settings.SORT_BY ) );
|
|
|
|
|
|
|
|
if ( SortDirBox != null )
|
|
|
|
SortDirBox.set( configSrc.getSetting( Settings.SORT_DIRECTION ) );
|
|
|
|
|
|
|
|
if ( ViewBox != null )
|
|
|
|
ViewBox.set( configSrc.getSetting( Settings.VIEW_MODE ) );
|
|
|
|
|
|
|
|
repo.updateView();
|
2014-02-06 06:08:05 +01:00
|
|
|
}
|
|
|
|
|
2014-03-28 05:31:06 +01:00
|
|
|
protected boolean isPowered()
|
|
|
|
{
|
|
|
|
return repo.hasPower();
|
|
|
|
}
|
|
|
|
|
2014-04-16 20:48:03 +02:00
|
|
|
int getMaxRows()
|
|
|
|
{
|
|
|
|
return AEConfig.instance.getConfigManager().getSetting( Settings.TERMINAL_STYLE ) == TerminalStyle.SMALL ? 6 : Integer.MAX_VALUE;
|
|
|
|
}
|
|
|
|
|
2013-12-27 23:59:59 +01:00
|
|
|
}
|