Moved Sorting Config Into the World.
This commit is contained in:
+3
-5
@@ -10,8 +10,6 @@ import appeng.api.config.PowerMultiplier;
|
||||
import appeng.api.config.PowerUnits;
|
||||
import appeng.api.config.SearchBoxMode;
|
||||
import appeng.api.config.Settings;
|
||||
import appeng.api.config.SortDir;
|
||||
import appeng.api.config.SortOrder;
|
||||
import appeng.api.config.YesNo;
|
||||
import appeng.api.util.IConfigManager;
|
||||
import appeng.api.util.IConfigureableObject;
|
||||
@@ -115,9 +113,9 @@ public class AEConfig extends Configuration implements IConfigureableObject, ICo
|
||||
|
||||
// settings.registerSetting( Settings.SEARCH_MODS, YesNo.YES );
|
||||
settings.registerSetting( Settings.SEARCH_TOOLTIPS, YesNo.YES );
|
||||
settings.registerSetting( Settings.SORT_BY, SortOrder.NAME );
|
||||
settings.registerSetting( Settings.SORT_DIRECTION, SortDir.ASCENDING );
|
||||
settings.registerSetting( Settings.SEARCH_MODE, SearchBoxMode.AUTOSEARCH );
|
||||
// settings.registerSetting( Settings.SORT_BY, SortOrder.NAME );
|
||||
// settings.registerSetting( Settings.SORT_DIRECTION, SortDir.ASCENDING );
|
||||
|
||||
WirelessBaseCost = get( "wireless", "WirelessBaseCost", WirelessBaseCost ).getDouble( WirelessBaseCost );
|
||||
WirelessCostMultiplier = get( "wireless", "WirelessCostMultiplier", WirelessCostMultiplier ).getDouble( WirelessCostMultiplier );
|
||||
@@ -166,7 +164,7 @@ public class AEConfig extends Configuration implements IConfigureableObject, ICo
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateSetting(Enum setting, Enum newValue)
|
||||
public void updateSetting(IConfigManager manager, Enum setting, Enum newValue)
|
||||
{
|
||||
for (Enum e : settings.getSettings())
|
||||
{
|
||||
|
||||
@@ -23,7 +23,7 @@ import appeng.api.networking.security.IActionHost;
|
||||
import appeng.api.networking.security.ISecurityGrid;
|
||||
import appeng.api.parts.IPart;
|
||||
import appeng.api.parts.IPartHost;
|
||||
import appeng.api.storage.IStorageMonitorable;
|
||||
import appeng.api.storage.ITerminalHost;
|
||||
import appeng.client.gui.GuiNull;
|
||||
import appeng.container.AEBaseContainer;
|
||||
import appeng.container.ContainerNull;
|
||||
@@ -82,7 +82,7 @@ public enum GuiBridge implements IGuiHandler
|
||||
|
||||
GUI_WIRELESS(ContainerWireless.class, TileWireless.class, false, SecurityPermissions.BUILD),
|
||||
|
||||
GUI_ME(ContainerMEMonitorable.class, IStorageMonitorable.class, false, null),
|
||||
GUI_ME(ContainerMEMonitorable.class, ITerminalHost.class, false, null),
|
||||
|
||||
GUI_PORTABLE_CELL(ContainerMEPortableCell.class, IPortableCell.class, true, null),
|
||||
|
||||
|
||||
@@ -12,6 +12,8 @@ import java.io.IOException;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.inventory.Container;
|
||||
import appeng.api.config.FuzzyMode;
|
||||
import appeng.api.util.IConfigManager;
|
||||
import appeng.api.util.IConfigureableObject;
|
||||
import appeng.container.implementations.ContainerCellWorkbench;
|
||||
import appeng.container.implementations.ContainerLevelEmitter;
|
||||
import appeng.container.implementations.ContainerPriority;
|
||||
@@ -75,6 +77,60 @@ public class PacketValueConfig extends AppEngPacket
|
||||
ccw.setFuzzy( FuzzyMode.valueOf( Value ) );
|
||||
}
|
||||
}
|
||||
else if ( c instanceof IConfigureableObject )
|
||||
{
|
||||
IConfigManager cm = ((IConfigureableObject) c).getConfigManager();
|
||||
|
||||
for (Enum e : cm.getSettings())
|
||||
{
|
||||
if ( e.name().equals( Name ) )
|
||||
{
|
||||
Enum def = cm.getSetting( e );
|
||||
|
||||
try
|
||||
{
|
||||
cm.putSetting( e, Enum.valueOf( def.getClass(), Value ) );
|
||||
}
|
||||
catch (IllegalArgumentException err)
|
||||
{
|
||||
// :P
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void clientPacketData(INetworkInfo network, AppEngPacket packet, EntityPlayer player)
|
||||
{
|
||||
Container c = player.openContainer;
|
||||
|
||||
if ( c instanceof IConfigureableObject )
|
||||
{
|
||||
IConfigManager cm = ((IConfigureableObject) c).getConfigManager();
|
||||
|
||||
for (Enum e : cm.getSettings())
|
||||
{
|
||||
if ( e.name().equals( Name ) )
|
||||
{
|
||||
Enum def = cm.getSetting( e );
|
||||
|
||||
try
|
||||
{
|
||||
cm.putSetting( e, Enum.valueOf( def.getClass(), Value ) );
|
||||
}
|
||||
catch (IllegalArgumentException err)
|
||||
{
|
||||
// :P
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user