package codechicken.nei.config; import java.util.ArrayList; import java.util.HashMap; import net.minecraft.client.Minecraft; import net.minecraft.client.gui.GuiScreen; import codechicken.nei.NEIClientConfig; import codechicken.nei.config.GuiOptionList.OptionScrollSlot; public class OptionList extends OptionButton { public static final OptionList root = new RootOptionList(); private static class RootOptionList extends OptionList { public RootOptionList() { super(null); } @Override public ConfigSet globalConfigSet() { return null; } @Override public ConfigSet worldConfigSet() { return null; } @Override public OptionList configBase() { return null; } @Override public GuiOptionList getGui(GuiScreen parent, OptionList list, boolean world) { return new GuiOptionList(parent, list, world); } } public static OptionList getOptionList(String fullName) { Option o = root.getOption(fullName); if (o == null) root.addOption(o = new OptionList(fullName)); return (OptionList) o; } public static void setOptionList(OptionList list) { OptionList prev = (OptionList) root.getOption(list.fullName()); if (prev == null) root.addOption(list); else { list.parent = prev.parent; list.options = prev.options; list.optionList = prev.optionList; for (Option o : list.optionList) o.parent = list; list.parent.options.put(list.fullName(), list); list.parent.optionList.remove(prev); list.parent.addSorted(list); } } public static String parent(String fullName) { int i = fullName.indexOf('.'); if (i < 0) return fullName; return fullName.substring(0, i); } public static String child(String fullName) { int i = fullName.indexOf('.'); return fullName.substring(i + 1); } public ArrayList