Added a clientside config to keep or clear the search filter when opening. (#3154)
Closes #3153.
This commit is contained in:
parent
ab7f35a9ee
commit
905dd6c888
|
@ -26,5 +26,5 @@ package appeng.api.config;
|
|||
|
||||
public enum SearchBoxMode
|
||||
{
|
||||
AUTOSEARCH, MANUAL_SEARCH, JEI_AUTOSEARCH, JEI_MANUAL_SEARCH
|
||||
AUTOSEARCH, AUTOSEARCH_KEEP, MANUAL_SEARCH, MANUAL_SEARCH_KEEP, JEI_AUTOSEARCH, JEI_AUTOSEARCH_KEEP, JEI_MANUAL_SEARCH, JEI_MANUAL_SEARCH_KEEP
|
||||
}
|
||||
|
|
|
@ -33,29 +33,53 @@ public enum Settings
|
|||
{
|
||||
LEVEL_EMITTER_MODE( EnumSet.allOf( LevelEmitterMode.class ) ),
|
||||
|
||||
REDSTONE_EMITTER( EnumSet.of( RedstoneMode.HIGH_SIGNAL, RedstoneMode.LOW_SIGNAL ) ), REDSTONE_CONTROLLED( EnumSet.allOf( RedstoneMode.class ) ),
|
||||
REDSTONE_EMITTER( EnumSet.of( RedstoneMode.HIGH_SIGNAL, RedstoneMode.LOW_SIGNAL ) ),
|
||||
|
||||
REDSTONE_CONTROLLED( EnumSet.allOf( RedstoneMode.class ) ),
|
||||
|
||||
CONDENSER_OUTPUT( EnumSet.allOf( CondenserOutput.class ) ),
|
||||
|
||||
POWER_UNITS( EnumSet.allOf( PowerUnits.class ) ), ACCESS( EnumSet.of( AccessRestriction.READ_WRITE, AccessRestriction.READ, AccessRestriction.WRITE ) ),
|
||||
POWER_UNITS( EnumSet.allOf( PowerUnits.class ) ),
|
||||
|
||||
SORT_DIRECTION( EnumSet.allOf( SortDir.class ) ), SORT_BY( EnumSet.allOf( SortOrder.class ) ),
|
||||
ACCESS( EnumSet.of( AccessRestriction.READ_WRITE, AccessRestriction.READ, AccessRestriction.WRITE ) ),
|
||||
|
||||
SEARCH_TOOLTIPS( EnumSet.of( YesNo.YES, YesNo.NO ) ), VIEW_MODE( EnumSet.allOf( ViewItems.class ) ), SEARCH_MODE( EnumSet.allOf( SearchBoxMode.class ) ),
|
||||
SORT_DIRECTION( EnumSet.allOf( SortDir.class ) ),
|
||||
|
||||
ACTIONS( EnumSet.allOf( ActionItems.class ) ), IO_DIRECTION( EnumSet.of( RelativeDirection.LEFT, RelativeDirection.RIGHT ) ),
|
||||
SORT_BY( EnumSet.allOf( SortOrder.class ) ),
|
||||
|
||||
BLOCK( EnumSet.of( YesNo.YES, YesNo.NO ) ), OPERATION_MODE( EnumSet.allOf( OperationMode.class ) ),
|
||||
SEARCH_TOOLTIPS( EnumSet.of( YesNo.YES, YesNo.NO ) ),
|
||||
|
||||
FULLNESS_MODE( EnumSet.allOf( FullnessMode.class ) ), CRAFT_ONLY( EnumSet.of( YesNo.YES, YesNo.NO ) ),
|
||||
VIEW_MODE( EnumSet.allOf( ViewItems.class ) ),
|
||||
|
||||
FUZZY_MODE( EnumSet.allOf( FuzzyMode.class ) ), LEVEL_TYPE( EnumSet.allOf( LevelType.class ) ),
|
||||
SEARCH_MODE( EnumSet.allOf( SearchBoxMode.class ) ),
|
||||
|
||||
TERMINAL_STYLE( EnumSet.of( TerminalStyle.TALL, TerminalStyle.SMALL ) ), COPY_MODE( EnumSet.allOf( CopyMode.class ) ),
|
||||
ACTIONS( EnumSet.allOf( ActionItems.class ) ),
|
||||
|
||||
INTERFACE_TERMINAL( EnumSet.of( YesNo.YES, YesNo.NO ) ), CRAFT_VIA_REDSTONE( EnumSet.of( YesNo.YES, YesNo.NO ) ),
|
||||
IO_DIRECTION( EnumSet.of( RelativeDirection.LEFT, RelativeDirection.RIGHT ) ),
|
||||
|
||||
STORAGE_FILTER( EnumSet.allOf( StorageFilter.class ) ), PLACE_BLOCK( EnumSet.of( YesNo.YES, YesNo.NO ) ),
|
||||
BLOCK( EnumSet.of( YesNo.YES, YesNo.NO ) ),
|
||||
|
||||
OPERATION_MODE( EnumSet.allOf( OperationMode.class ) ),
|
||||
|
||||
FULLNESS_MODE( EnumSet.allOf( FullnessMode.class ) ),
|
||||
|
||||
CRAFT_ONLY( EnumSet.of( YesNo.YES, YesNo.NO ) ),
|
||||
|
||||
FUZZY_MODE( EnumSet.allOf( FuzzyMode.class ) ),
|
||||
|
||||
LEVEL_TYPE( EnumSet.allOf( LevelType.class ) ),
|
||||
|
||||
TERMINAL_STYLE( EnumSet.of( TerminalStyle.TALL, TerminalStyle.SMALL ) ),
|
||||
|
||||
COPY_MODE( EnumSet.allOf( CopyMode.class ) ),
|
||||
|
||||
INTERFACE_TERMINAL( EnumSet.of( YesNo.YES, YesNo.NO ) ),
|
||||
|
||||
CRAFT_VIA_REDSTONE( EnumSet.of( YesNo.YES, YesNo.NO ) ),
|
||||
|
||||
STORAGE_FILTER( EnumSet.allOf( StorageFilter.class ) ),
|
||||
|
||||
PLACE_BLOCK( EnumSet.of( YesNo.YES, YesNo.NO ) ),
|
||||
|
||||
SCHEDULING_MODE( EnumSet.allOf( SchedulingMode.class ) );
|
||||
|
||||
|
|
|
@ -292,6 +292,7 @@ public class GuiMEMonitorable extends AEBaseMEGui implements ISortSource, IConfi
|
|||
this.buttonList.add(
|
||||
this.searchBoxSettings = new GuiImgButton( this.guiLeft - 18, offset, Settings.SEARCH_MODE, AEConfig.instance().getConfigManager().getSetting(
|
||||
Settings.SEARCH_MODE ) ) );
|
||||
|
||||
offset += 20;
|
||||
|
||||
if( !( this instanceof GuiMEPortableCell ) || this instanceof GuiWirelessTerm )
|
||||
|
@ -315,16 +316,22 @@ public class GuiMEMonitorable extends AEBaseMEGui implements ISortSource, IConfi
|
|||
this.craftingStatusBtn.setHideEdge( 13 );
|
||||
}
|
||||
|
||||
final Enum setting = AEConfig.instance().getConfigManager().getSetting( Settings.SEARCH_MODE );
|
||||
this.searchField.setFocused( SearchBoxMode.AUTOSEARCH == setting || SearchBoxMode.JEI_AUTOSEARCH == setting );
|
||||
this.searchField.setCanLoseFocus( SearchBoxMode.MANUAL_SEARCH == setting || SearchBoxMode.JEI_MANUAL_SEARCH == setting );
|
||||
final Enum searchModeSetting = AEConfig.instance().getConfigManager().getSetting( Settings.SEARCH_MODE );
|
||||
|
||||
if( setting == SearchBoxMode.JEI_AUTOSEARCH || setting == SearchBoxMode.JEI_MANUAL_SEARCH )
|
||||
final boolean isAutoFocus = SearchBoxMode.AUTOSEARCH == searchModeSetting || SearchBoxMode.JEI_AUTOSEARCH == searchModeSetting || SearchBoxMode.AUTOSEARCH_KEEP == searchModeSetting || SearchBoxMode.JEI_AUTOSEARCH_KEEP == searchModeSetting;
|
||||
final boolean isManualFocus = SearchBoxMode.MANUAL_SEARCH == searchModeSetting || SearchBoxMode.JEI_MANUAL_SEARCH == searchModeSetting || SearchBoxMode.MANUAL_SEARCH_KEEP == searchModeSetting || SearchBoxMode.JEI_MANUAL_SEARCH_KEEP == searchModeSetting;
|
||||
final boolean isKeepFilter = SearchBoxMode.AUTOSEARCH_KEEP == searchModeSetting || SearchBoxMode.JEI_AUTOSEARCH_KEEP == searchModeSetting || SearchBoxMode.MANUAL_SEARCH_KEEP == searchModeSetting || SearchBoxMode.JEI_MANUAL_SEARCH_KEEP == searchModeSetting;
|
||||
final boolean isJEIEnabled = SearchBoxMode.JEI_AUTOSEARCH == searchModeSetting || SearchBoxMode.JEI_MANUAL_SEARCH == searchModeSetting;
|
||||
|
||||
this.searchField.setFocused( isAutoFocus );
|
||||
this.searchField.setCanLoseFocus( isManualFocus );
|
||||
|
||||
if( isJEIEnabled )
|
||||
{
|
||||
memoryText = Integrations.jei().getSearchText();
|
||||
}
|
||||
|
||||
if( memoryText != null && !memoryText.isEmpty() )
|
||||
if( isKeepFilter && memoryText != null && !memoryText.isEmpty() )
|
||||
{
|
||||
this.searchField.setText( memoryText );
|
||||
this.searchField.selectAll();
|
||||
|
@ -359,6 +366,7 @@ public class GuiMEMonitorable extends AEBaseMEGui implements ISortSource, IConfi
|
|||
|
||||
craftingGridOffsetX -= 25;
|
||||
craftingGridOffsetY -= 6;
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -110,6 +110,13 @@ public class GuiImgButton extends GuiButton implements ITooltip
|
|||
this.registerApp( 16 * 2 + 5, Settings.SEARCH_MODE, SearchBoxMode.JEI_AUTOSEARCH, ButtonToolTips.SearchMode, ButtonToolTips.SearchMode_JEIAuto );
|
||||
this.registerApp( 16 * 2 + 6, Settings.SEARCH_MODE, SearchBoxMode.JEI_MANUAL_SEARCH, ButtonToolTips.SearchMode,
|
||||
ButtonToolTips.SearchMode_JEIStandard );
|
||||
this.registerApp( 16 * 2 + 7, Settings.SEARCH_MODE, SearchBoxMode.AUTOSEARCH_KEEP, ButtonToolTips.SearchMode, ButtonToolTips.SearchMode_AutoKeep );
|
||||
this.registerApp( 16 * 2 + 8, Settings.SEARCH_MODE, SearchBoxMode.MANUAL_SEARCH_KEEP, ButtonToolTips.SearchMode,
|
||||
ButtonToolTips.SearchMode_StandardKeep );
|
||||
this.registerApp( 16 * 2 + 9, Settings.SEARCH_MODE, SearchBoxMode.JEI_AUTOSEARCH_KEEP, ButtonToolTips.SearchMode,
|
||||
ButtonToolTips.SearchMode_JEIAutoKeep );
|
||||
this.registerApp( 16 * 2 + 10, Settings.SEARCH_MODE, SearchBoxMode.JEI_MANUAL_SEARCH_KEEP, ButtonToolTips.SearchMode,
|
||||
ButtonToolTips.SearchMode_JEIStandardKeep );
|
||||
|
||||
this.registerApp( 16 * 5 + 3, Settings.LEVEL_TYPE, LevelType.ENERGY_LEVEL, ButtonToolTips.LevelType, ButtonToolTips.LevelType_Energy );
|
||||
this.registerApp( 16 * 4 + 3, Settings.LEVEL_TYPE, LevelType.ITEM_LEVEL, ButtonToolTips.LevelType, ButtonToolTips.LevelType_Item );
|
||||
|
|
|
@ -64,11 +64,15 @@ public enum ButtonToolTips
|
|||
|
||||
TransferToStorageCell,
|
||||
ToggleSortDirection,
|
||||
SearchMode_Auto,
|
||||
|
||||
SearchMode_Auto,
|
||||
SearchMode_Standard,
|
||||
SearchMode_JEIAuto,
|
||||
SearchMode_JEIStandard,
|
||||
SearchMode_AutoKeep,
|
||||
SearchMode_StandardKeep,
|
||||
SearchMode_JEIAutoKeep,
|
||||
SearchMode_JEIStandardKeep,
|
||||
|
||||
SearchMode,
|
||||
ItemName,
|
||||
|
@ -137,7 +141,11 @@ public enum ButtonToolTips
|
|||
SchedulingMode,
|
||||
SchedulingModeDefault,
|
||||
SchedulingModeRoundRobin,
|
||||
SchedulingModeRandom;
|
||||
SchedulingModeRandom,
|
||||
|
||||
FilterMode,
|
||||
FilterModeKeep,
|
||||
FilterModeClear;
|
||||
|
||||
private final String root;
|
||||
|
||||
|
|
|
@ -289,6 +289,10 @@ gui.tooltips.appliedenergistics2.SearchMode_Auto=Auto Search
|
|||
gui.tooltips.appliedenergistics2.SearchMode_Standard=Standard Search
|
||||
gui.tooltips.appliedenergistics2.SearchMode_JEIAuto=JEI Synchronized Auto
|
||||
gui.tooltips.appliedenergistics2.SearchMode_JEIStandard=JEI Synchronized Standard
|
||||
gui.tooltips.appliedenergistics2.SearchMode_AutoKeep=Auto Search Keep
|
||||
gui.tooltips.appliedenergistics2.SearchMode_StandardKeep=Standard Search Keep
|
||||
gui.tooltips.appliedenergistics2.SearchMode_JEIAutoKeep=JEI Synchronized Auto Keep
|
||||
gui.tooltips.appliedenergistics2.SearchMode_JEIStandardKeep=JEI Synchronized Standard Keep
|
||||
gui.tooltips.appliedenergistics2.SearchMode=Search Box Mode
|
||||
gui.tooltips.appliedenergistics2.PartitionStorageHint=Configures Partition based on currently stored items.
|
||||
gui.tooltips.appliedenergistics2.ClearSettings=Clear Config/Settings
|
||||
|
@ -326,6 +330,9 @@ gui.tooltips.appliedenergistics2.SchedulingMode=Scheduling Mode
|
|||
gui.tooltips.appliedenergistics2.SchedulingModeDefault=Export the first item until the network is empty, then try the next ones.
|
||||
gui.tooltips.appliedenergistics2.SchedulingModeRoundRobin=Export using round robin mode.
|
||||
gui.tooltips.appliedenergistics2.SchedulingModeRandom=Export items in random mode.
|
||||
gui.tooltips.appliedenergistics2.FilterMode=Search Filter Mode
|
||||
gui.tooltips.appliedenergistics2.FilterModeKeep=Restore previous search filter.
|
||||
gui.tooltips.appliedenergistics2.FilterModeClear=Clear on each opening.
|
||||
gui.tooltips.appliedenergistics2.ItemsStored=Items Stored: %s
|
||||
gui.tooltips.appliedenergistics2.ItemsRequestable=Items Requestable: %s
|
||||
|
||||
|
|
Binary file not shown.
Before Width: | Height: | Size: 12 KiB After Width: | Height: | Size: 12 KiB |
Loading…
Reference in a new issue