Added Sort By Inventory Tweaks.
NEI and Invtweaks options are now hidden without the supporting mod.
This commit is contained in:
@@ -5,6 +5,9 @@ import java.util.List;
|
||||
|
||||
import net.minecraft.client.gui.GuiButton;
|
||||
import net.minecraft.entity.player.InventoryPlayer;
|
||||
|
||||
import org.lwjgl.input.Mouse;
|
||||
|
||||
import appeng.api.config.SearchBoxMode;
|
||||
import appeng.api.config.Settings;
|
||||
import appeng.api.implementations.guiobjects.IPortableCell;
|
||||
@@ -179,11 +182,13 @@ public class GuiMEMonitorable extends AEBaseMEGui implements ISortSource, IConfi
|
||||
{
|
||||
if ( btn instanceof GuiImgButton )
|
||||
{
|
||||
boolean backwards = Mouse.isButtonDown( 1 );
|
||||
|
||||
GuiImgButton iBtn = (GuiImgButton) btn;
|
||||
if ( iBtn.getSetting() != Settings.ACTIONS )
|
||||
{
|
||||
Enum cv = iBtn.getCurrentValue();
|
||||
Enum next = Platform.nextEnum( cv );
|
||||
Enum next = Platform.rotateEnum( cv, backwards, iBtn.getSetting().getPossibleValues() );
|
||||
|
||||
if ( btn == searchBoxSettings )
|
||||
AEConfig.instance.settings.putSetting( iBtn.getSetting(), next );
|
||||
|
||||
@@ -141,6 +141,7 @@ public class GuiImgButton extends GuiButton implements ITooltip
|
||||
|
||||
registerApp( 64, Settings.SORT_BY, SortOrder.NAME, ButtonToolTips.SortBy, ButtonToolTips.ItemName );
|
||||
registerApp( 65, Settings.SORT_BY, SortOrder.AMOUNT, ButtonToolTips.SortBy, ButtonToolTips.NumberOfItems );
|
||||
registerApp( 68, Settings.SORT_BY, SortOrder.INVTWEAKS, ButtonToolTips.SortBy, ButtonToolTips.InventoryTweaks );
|
||||
// registerApp( 66, Settings.SORT_BY, SortOrder.PRIORITY,
|
||||
// "AppEng.GuiITooltip.SortBy",
|
||||
// "AppEng.GuiITooltip.PriorityCellOrder" );
|
||||
|
||||
@@ -132,11 +132,12 @@ public class ItemRepo
|
||||
Enum SortDir = sortSrc.getSortDir();
|
||||
|
||||
ItemSorters.Direction = (appeng.api.config.SortDir) SortDir;
|
||||
ItemSorters.init();
|
||||
|
||||
if ( SortBy == SortOrder.AMOUNT )
|
||||
Collections.sort( view, ItemSorters.ConfigBased_SortBySize );
|
||||
// else if ( SortBy == SortOrder.MOD )
|
||||
// Collections.sort( view, ItemSorters.ConfigBased_SortByMod );
|
||||
else if ( SortBy == SortOrder.INVTWEAKS )
|
||||
Collections.sort( view, ItemSorters.ConfigBased_SortByInvTweaks );
|
||||
else
|
||||
Collections.sort( view, ItemSorters.ConfigBased_SortByName );
|
||||
|
||||
|
||||
Reference in New Issue
Block a user