Search in sources :

Example 1 with IConfigElement

use of net.minecraftforge.fml.client.config.IConfigElement in project MinecraftForge by MinecraftForge.

the class ConfigElement method getChildElements.

@Override
public List<IConfigElement> getChildElements() {
    if (!isProperty) {
        List<IConfigElement> elements = new ArrayList<IConfigElement>();
        Iterator<ConfigCategory> ccI = category.getChildren().iterator();
        Iterator<Property> pI = category.getOrderedValues().iterator();
        @SuppressWarnings("unused") int index = 0;
        if (categoriesFirst)
            while (ccI.hasNext()) {
                ConfigElement temp = new ConfigElement(ccI.next());
                if (// don't bother adding elements that shouldn't show
                temp.showInGui())
                    elements.add(temp);
            }
        while (pI.hasNext()) {
            ConfigElement temp = new ConfigElement(pI.next());
            if (temp.showInGui())
                elements.add(temp);
        }
        if (!categoriesFirst)
            while (ccI.hasNext()) {
                ConfigElement temp = new ConfigElement(ccI.next());
                if (temp.showInGui())
                    elements.add(temp);
            }
        return elements;
    }
    return null;
}
Also used : IConfigElement(net.minecraftforge.fml.client.config.IConfigElement) ArrayList(java.util.ArrayList) IConfigElement(net.minecraftforge.fml.client.config.IConfigElement)

Example 2 with IConfigElement

use of net.minecraftforge.fml.client.config.IConfigElement in project AgriCraft by AgriCraft.

the class AgriCraftGuiConfig method getConfigElements.

private static List<IConfigElement> getConfigElements() {
    List<IConfigElement> configElements = new ArrayList<>();
    for (AgriConfigCategory e : AgriConfigCategory.values()) {
        String descr = "AgriCraft " + e.getDisplayName() + " Settings";
        String name = "agricraft.configgui.ctgy." + e.name();
        configElements.add(new DummyConfigElement.DummyCategoryElement(descr, name, new ConfigElement(CoreHandler.getConfig().getCategory(e.name().toLowerCase())).getChildElements()));
    }
    return configElements;
}
Also used : IConfigElement(net.minecraftforge.fml.client.config.IConfigElement) ConfigElement(net.minecraftforge.common.config.ConfigElement) DummyConfigElement(net.minecraftforge.fml.client.config.DummyConfigElement) AgriConfigCategory(com.agricraft.agricore.config.AgriConfigCategory) ArrayList(java.util.ArrayList) DummyConfigElement(net.minecraftforge.fml.client.config.DummyConfigElement) IConfigElement(net.minecraftforge.fml.client.config.IConfigElement)

Example 3 with IConfigElement

use of net.minecraftforge.fml.client.config.IConfigElement in project VoodooCraft by Mod-DevCafeTeam.

the class VoodooConfig method getEntries.

public static List<IConfigElement> getEntries() {
    List<IConfigElement> entries = new ArrayList<IConfigElement>();
    Set<String> categories = config.getCategoryNames();
    Iterator<String> i = categories.iterator();
    while (i.hasNext()) {
        String categoryName = i.next();
        ConfigCategory category = config.getCategory(categoryName);
        entries.addAll(new ConfigElement(category).getChildElements());
    }
    return entries;
}
Also used : ConfigCategory(net.minecraftforge.common.config.ConfigCategory) IConfigElement(net.minecraftforge.fml.client.config.IConfigElement) ConfigElement(net.minecraftforge.common.config.ConfigElement) ArrayList(java.util.ArrayList) IConfigElement(net.minecraftforge.fml.client.config.IConfigElement)

Example 4 with IConfigElement

use of net.minecraftforge.fml.client.config.IConfigElement in project Charset by CharsetMC.

the class ConfigGui method getConfigElements.

private static List<IConfigElement> getConfigElements() {
    Configuration config = ModCharset.configModules;
    List<IConfigElement> list = Lists.newArrayList(new ConfigElement(config.getCategory("general").get("profile")), new DummyConfigElement.DummyCategoryElement("categories", "config.charset.categories.name", getSubConfigElements(config, "categories", ConfigElement::new)), new DummyConfigElement.DummyCategoryElement("overrides", "config.charset.overrides.name", getSubConfigElements(config, "overrides", ConfigElement::new)));
    List<String> modulesWithConfigs = Lists.newArrayList(ModuleLoader.moduleConfigs.keySet());
    Collections.sort(modulesWithConfigs);
    for (String s : modulesWithConfigs) {
        List<IConfigElement> clist = null;
        String clsName = ModuleLoader.moduleGuiClasses.get(s);
        if (clsName != null && clsName.length() > 0) {
            try {
                clist = ((ICharsetModuleConfigGui) Class.forName(clsName).newInstance()).createConfigElements();
            } catch (Exception e) {
                e.printStackTrace();
            }
        }
        if (clist == null) {
            clist = generateList(ModuleLoader.moduleConfigs.get(s));
        }
        list.add(new DummyConfigElement.DummyCategoryElement(s, "config.charset." + s + ".name", clist));
    }
    return list;
}
Also used : Configuration(net.minecraftforge.common.config.Configuration) IConfigElement(net.minecraftforge.fml.client.config.IConfigElement) ConfigElement(net.minecraftforge.common.config.ConfigElement) DummyConfigElement(net.minecraftforge.fml.client.config.DummyConfigElement) DummyConfigElement(net.minecraftforge.fml.client.config.DummyConfigElement) IConfigElement(net.minecraftforge.fml.client.config.IConfigElement)

Example 5 with IConfigElement

use of net.minecraftforge.fml.client.config.IConfigElement in project TUMAT by canitzp.

the class GuiConf method getConfigElements.

private static List<IConfigElement> getConfigElements() {
    List<IConfigElement> list = new ArrayList<>();
    for (int i = 0; i < ConfigCats.values().length; i++) {
        ConfigCats cat = ConfigCats.values()[i];
        ConfigHandler.config.setCategoryComment(cat.name, cat.desc);
        list.add(new ConfigElement(ConfigHandler.config.getCategory(cat.name)));
    }
    return list;
}
Also used : ConfigElement(net.minecraftforge.common.config.ConfigElement) IConfigElement(net.minecraftforge.fml.client.config.IConfigElement) ConfigCats(de.canitzp.tumat.configuration.cats.ConfigCats) ArrayList(java.util.ArrayList) IConfigElement(net.minecraftforge.fml.client.config.IConfigElement)

Aggregations

IConfigElement (net.minecraftforge.fml.client.config.IConfigElement)24 ArrayList (java.util.ArrayList)14 ConfigElement (net.minecraftforge.common.config.ConfigElement)11 DummyCategoryElement (net.minecraftforge.fml.client.config.DummyConfigElement.DummyCategoryElement)10 ConfigCategory (net.minecraftforge.common.config.ConfigCategory)7 DummyConfigElement (net.minecraftforge.fml.client.config.DummyConfigElement)5 Configuration (net.minecraftforge.common.config.Configuration)2 Property (net.minecraftforge.common.config.Property)2 DisplayConfigEntry (cavern.client.config.common.DisplayConfigEntry)1 GeneralConfigEntry (cavern.client.config.common.GeneralConfigEntry)1 MiningAssistConfigEntry (cavern.client.config.common.MiningAssistConfigEntry)1 DimensionConfigEntry (cavern.client.config.dimension.DimensionConfigEntry)1 AgriConfigCategory (com.agricraft.agricore.config.AgriConfigCategory)1 IEnderIOAddon (crazypants.enderio.api.addon.IEnderIOAddon)1 ConfigCats (de.canitzp.tumat.configuration.cats.ConfigCats)1 ResourceLocation (net.minecraft.util.ResourceLocation)1 IConfigEntry (net.minecraftforge.fml.client.config.GuiConfigEntries.IConfigEntry)1 ModContainer (net.minecraftforge.fml.common.ModContainer)1