Added Small Vs Tall Terminal Display Setting.

This commit is contained in:
AlgorithmX2 2014-03-27 00:14:34 -05:00
parent 643768fd9a
commit 95b1572aa1
4 changed files with 35 additions and 9 deletions

View file

@ -11,6 +11,7 @@ import org.lwjgl.input.Mouse;
import appeng.api.config.SearchBoxMode; import appeng.api.config.SearchBoxMode;
import appeng.api.config.Settings; import appeng.api.config.Settings;
import appeng.api.config.TerminalStyle;
import appeng.api.implementations.guiobjects.IPortableCell; import appeng.api.implementations.guiobjects.IPortableCell;
import appeng.api.implementations.tiles.IMEChest; import appeng.api.implementations.tiles.IMEChest;
import appeng.api.implementations.tiles.IViewCellStorage; import appeng.api.implementations.tiles.IViewCellStorage;
@ -55,13 +56,15 @@ public class GuiMEMonitorable extends AEBaseMEGui implements ISortSource, IConfi
int rows = 0; int rows = 0;
int maxRows = Integer.MAX_VALUE; int maxRows = Integer.MAX_VALUE;
int standardSize;
IConfigManager configSrc; IConfigManager configSrc;
GuiImgButton ViewBox; GuiImgButton ViewBox;
GuiImgButton SortByBox; GuiImgButton SortByBox;
GuiImgButton SortDirBox; GuiImgButton SortDirBox;
GuiImgButton searchBoxSettings; GuiImgButton searchBoxSettings, terminalStyleBox;
boolean viewCell; boolean viewCell;
ItemStack myCurrentViewCells[] = new ItemStack[5]; ItemStack myCurrentViewCells[] = new ItemStack[5];
@ -82,6 +85,8 @@ public class GuiMEMonitorable extends AEBaseMEGui implements ISortSource, IConfi
if ( te instanceof IViewCellStorage ) if ( te instanceof IViewCellStorage )
xSize += 33; xSize += 33;
standardSize = xSize;
configSrc = ((IConfigureableObject) inventorySlots).getConfigManager(); configSrc = ((IConfigureableObject) inventorySlots).getConfigManager();
(mecontainer = (ContainerMEMonitorable) inventorySlots).gui = this; (mecontainer = (ContainerMEMonitorable) inventorySlots).gui = this;
@ -123,6 +128,9 @@ public class GuiMEMonitorable extends AEBaseMEGui implements ISortSource, IConfi
@Override @Override
public void initGui() public void initGui()
{ {
maxRows = AEConfig.instance.getConfigManager().getSetting( Settings.TERMINAL_STYLE ) == TerminalStyle.SMALL ? 6 : Integer.MAX_VALUE;
perRow = AEConfig.instance.getConfigManager().getSetting( Settings.TERMINAL_STYLE ) != TerminalStyle.FULL ? 9 : 9 + ((width - standardSize) / 18);
int NEI = 0; int NEI = 0;
int top = 4; int top = 4;
int magicNumber = 114 + 1; int magicNumber = 114 + 1;
@ -144,6 +152,11 @@ public class GuiMEMonitorable extends AEBaseMEGui implements ISortSource, IConfi
} }
} }
if ( AEConfig.instance.getConfigManager().getSetting( Settings.TERMINAL_STYLE ) != TerminalStyle.FULL )
this.xSize = standardSize + ((perRow - 9) * 18);
else
this.xSize = standardSize;
super.initGui(); super.initGui();
// full size : 204 // full size : 204
// extra slots : 72 // extra slots : 72
@ -165,6 +178,10 @@ public class GuiMEMonitorable extends AEBaseMEGui implements ISortSource, IConfi
buttonList.add( searchBoxSettings = new GuiImgButton( this.guiLeft - 18, offset, Settings.SEARCH_MODE, AEConfig.instance.settings buttonList.add( searchBoxSettings = new GuiImgButton( this.guiLeft - 18, offset, Settings.SEARCH_MODE, AEConfig.instance.settings
.getSetting( Settings.SEARCH_MODE ) ) ); .getSetting( Settings.SEARCH_MODE ) ) );
offset += 20;
buttonList.add( terminalStyleBox = new GuiImgButton( this.guiLeft - 18, offset, Settings.TERMINAL_STYLE, AEConfig.instance.settings
.getSetting( Settings.TERMINAL_STYLE ) ) );
searchField = new MEGuiTextField( fontRendererObj, this.guiLeft + Math.max( 82, xoffset ), this.guiTop + 6, 89, fontRendererObj.FONT_HEIGHT ); searchField = new MEGuiTextField( fontRendererObj, this.guiLeft + Math.max( 82, xoffset ), this.guiTop + 6, 89, fontRendererObj.FONT_HEIGHT );
searchField.setEnableBackgroundDrawing( false ); searchField.setEnableBackgroundDrawing( false );
@ -201,7 +218,9 @@ public class GuiMEMonitorable extends AEBaseMEGui implements ISortSource, IConfi
Enum cv = iBtn.getCurrentValue(); Enum cv = iBtn.getCurrentValue();
Enum next = Platform.rotateEnum( cv, backwards, iBtn.getSetting().getPossibleValues() ); Enum next = Platform.rotateEnum( cv, backwards, iBtn.getSetting().getPossibleValues() );
if ( btn == searchBoxSettings ) if ( btn == terminalStyleBox )
AEConfig.instance.settings.putSetting( iBtn.getSetting(), next );
else if ( btn == searchBoxSettings )
AEConfig.instance.settings.putSetting( iBtn.getSetting(), next ); AEConfig.instance.settings.putSetting( iBtn.getSetting(), next );
else else
{ {
@ -217,7 +236,7 @@ public class GuiMEMonitorable extends AEBaseMEGui implements ISortSource, IConfi
iBtn.set( next ); iBtn.set( next );
if ( next.getClass() == SearchBoxMode.class ) if ( next.getClass() == SearchBoxMode.class || next.getClass() == TerminalStyle.class )
re_init(); re_init();
} }
} }

View file

@ -23,6 +23,7 @@ import appeng.api.config.SearchBoxMode;
import appeng.api.config.Settings; import appeng.api.config.Settings;
import appeng.api.config.SortDir; import appeng.api.config.SortDir;
import appeng.api.config.SortOrder; import appeng.api.config.SortOrder;
import appeng.api.config.TerminalStyle;
import appeng.api.config.ViewItems; import appeng.api.config.ViewItems;
import appeng.api.config.YesNo; import appeng.api.config.YesNo;
import appeng.client.texture.ExtraTextures; import appeng.client.texture.ExtraTextures;
@ -140,6 +141,10 @@ public class GuiImgButton extends GuiButton implements ITooltip
registerApp( 16 * 5 + 3, Settings.LEVEL_TYPE, LevelType.ENERGY_LEVEL, ButtonToolTips.LevelType, ButtonToolTips.LevelType_Energy ); registerApp( 16 * 5 + 3, Settings.LEVEL_TYPE, LevelType.ENERGY_LEVEL, ButtonToolTips.LevelType, ButtonToolTips.LevelType_Energy );
registerApp( 16 * 4 + 3, Settings.LEVEL_TYPE, LevelType.ITEM_LEVEL, ButtonToolTips.LevelType, ButtonToolTips.LevelType_Item ); registerApp( 16 * 4 + 3, Settings.LEVEL_TYPE, LevelType.ITEM_LEVEL, ButtonToolTips.LevelType, ButtonToolTips.LevelType_Item );
registerApp( 16 * 13 + 0, Settings.TERMINAL_STYLE, TerminalStyle.TALL, ButtonToolTips.TerminalStyle, ButtonToolTips.TerminalStyle_Tall );
registerApp( 16 * 13 + 1, Settings.TERMINAL_STYLE, TerminalStyle.SMALL, ButtonToolTips.TerminalStyle, ButtonToolTips.TerminalStyle_Small );
registerApp( 16 * 13 + 2, Settings.TERMINAL_STYLE, TerminalStyle.FULL, ButtonToolTips.TerminalStyle, ButtonToolTips.TerminalStyle_Full );
registerApp( 64, Settings.SORT_BY, SortOrder.NAME, ButtonToolTips.SortBy, ButtonToolTips.ItemName ); registerApp( 64, Settings.SORT_BY, SortOrder.NAME, ButtonToolTips.SortBy, ButtonToolTips.ItemName );
registerApp( 65, Settings.SORT_BY, SortOrder.AMOUNT, ButtonToolTips.SortBy, ButtonToolTips.NumberOfItems ); registerApp( 65, Settings.SORT_BY, SortOrder.AMOUNT, ButtonToolTips.SortBy, ButtonToolTips.NumberOfItems );
registerApp( 68, Settings.SORT_BY, SortOrder.INVTWEAKS, ButtonToolTips.SortBy, ButtonToolTips.InventoryTweaks ); registerApp( 68, Settings.SORT_BY, SortOrder.INVTWEAKS, ButtonToolTips.SortBy, ButtonToolTips.InventoryTweaks );

View file

@ -10,6 +10,7 @@ import appeng.api.config.PowerMultiplier;
import appeng.api.config.PowerUnits; import appeng.api.config.PowerUnits;
import appeng.api.config.SearchBoxMode; import appeng.api.config.SearchBoxMode;
import appeng.api.config.Settings; import appeng.api.config.Settings;
import appeng.api.config.TerminalStyle;
import appeng.api.config.YesNo; import appeng.api.config.YesNo;
import appeng.api.util.IConfigManager; import appeng.api.util.IConfigManager;
import appeng.api.util.IConfigureableObject; import appeng.api.util.IConfigureableObject;
@ -121,9 +122,10 @@ public class AEConfig extends Configuration implements IConfigureableObject, ICo
grinderOres = get( "GrindStone", "grinderOres", grinderOres ).getStringList(); grinderOres = get( "GrindStone", "grinderOres", grinderOres ).getStringList();
oreDoublePercentage = get( "GrindStone", "oreDoublePercentage", oreDoublePercentage ).getDouble( oreDoublePercentage ); oreDoublePercentage = get( "GrindStone", "oreDoublePercentage", oreDoublePercentage ).getDouble( oreDoublePercentage );
enableEffects = get( "Client", "enableEffects", true ).getBoolean( true ); enableEffects = get( "Client", "enableEffects", true ).getBoolean( true );
useLargeFonts= get( "Client", "useTerminalUseLargeFont", true ).getBoolean( true ); useLargeFonts = get( "Client", "useTerminalUseLargeFont", false ).getBoolean( false );
settings.registerSetting( Settings.SEARCH_TOOLTIPS, YesNo.YES ); settings.registerSetting( Settings.SEARCH_TOOLTIPS, YesNo.YES );
settings.registerSetting( Settings.TERMINAL_STYLE, TerminalStyle.TALL );
settings.registerSetting( Settings.SEARCH_MODE, SearchBoxMode.AUTOSEARCH ); settings.registerSetting( Settings.SEARCH_MODE, SearchBoxMode.AUTOSEARCH );
spawnChargedChance = (float) (1.0 - get( "worldGen", "spawnChargedChance", 1.0 - spawnChargedChance ).getDouble( 1.0 - spawnChargedChance )); spawnChargedChance = (float) (1.0 - get( "worldGen", "spawnChargedChance", 1.0 - spawnChargedChance ).getDouble( 1.0 - spawnChargedChance ));
@ -176,11 +178,11 @@ public class AEConfig extends Configuration implements IConfigureableObject, ICo
selectedPowerUnit = PowerUnits.AE; selectedPowerUnit = PowerUnits.AE;
} }
for (TickRates tr: TickRates.values() ) for (TickRates tr : TickRates.values())
{ {
tr.Load(this); tr.Load( this );
} }
if ( isFeatureEnabled( AEFeature.SpatialIO ) ) if ( isFeatureEnabled( AEFeature.SpatialIO ) )
{ {
storageBiomeID = get( "spatialio", "storageBiomeID", storageBiomeID ).getInt( storageBiomeID ); storageBiomeID = get( "spatialio", "storageBiomeID", storageBiomeID ).getInt( storageBiomeID );

View file

@ -32,7 +32,7 @@ public enum ButtonToolTips
Blocking, NonBlocking, Craft, DontCraft, Blocking, NonBlocking, Craft, DontCraft,
LevelType, LevelType_Energy, LevelType_Item, InventoryTweaks; LevelType, LevelType_Energy, LevelType_Item, InventoryTweaks, TerminalStyle, TerminalStyle_Full, TerminalStyle_Tall, TerminalStyle_Small;
String root; String root;