Search in sources :

Example 6 with ConfigElement

use of net.minecraftforge.common.config.ConfigElement in project BuildCraft by BuildCraft.

the class BCConfigElement method getChildElements.

@Override
public List<IConfigElement> getChildElements() {
    if (!isProp) {
        List<IConfigElement> elements = new ArrayList<>();
        Iterator<ConfigCategory> ccI = cat.getChildren().iterator();
        Iterator<Property> pI = cat.getOrderedValues().iterator();
        while (ccI.hasNext()) {
            ConfigCategory child = ccI.next();
            if (!child.parent.getQualifiedName().equals(cat.getQualifiedName())) {
                continue;
            }
            ConfigElement temp = new BCConfigElement(child);
            if (temp.showInGui()) {
                elements.add(temp);
            }
        }
        while (pI.hasNext()) {
            ConfigElement temp = new ConfigElement(pI.next());
            if (temp.showInGui()) {
                elements.add(temp);
            }
        }
        return elements;
    } else {
        return null;
    }
}
Also used : ConfigCategory(net.minecraftforge.common.config.ConfigCategory) ConfigElement(net.minecraftforge.common.config.ConfigElement) IConfigElement(net.minecraftforge.fml.client.config.IConfigElement) ArrayList(java.util.ArrayList) Property(net.minecraftforge.common.config.Property) IConfigElement(net.minecraftforge.fml.client.config.IConfigElement)

Example 7 with ConfigElement

use of net.minecraftforge.common.config.ConfigElement in project BiomesOPlenty by Glitchfiend.

the class GuiBOPFactory method getConfigElements.

private static List<IConfigElement> getConfigElements() {
    List<IConfigElement> list = new ArrayList<IConfigElement>();
    List<IConfigElement> convenience_settings = new ConfigElement(GameplayConfigurationHandler.config.getCategory(CONVENIENCE_SETTINGS.toLowerCase())).getChildElements();
    List<IConfigElement> gui_settings = new ConfigElement(config.getCategory(GUI_SETTINGS.toLowerCase())).getChildElements();
    List<IConfigElement> texture_settings = new ConfigElement(config.getCategory(VISUAL_SETTINGS.toLowerCase())).getChildElements();
    List<IConfigElement> trail_settings = new ConfigElement(config.getCategory(TRAIL_SETTINGS.toLowerCase())).getChildElements();
    list.add(new DummyCategoryElement(I18n.translateToLocal("config.category.convenienceSettings.title"), "config.category.convenienceSettings", convenience_settings));
    list.add(new DummyCategoryElement(I18n.translateToLocal("config.category.guiSettings.title"), "config.category.guiSettings", gui_settings));
    list.add(new DummyCategoryElement(I18n.translateToLocal("config.category.textureSettings.title"), "config.category.textureSettings", texture_settings));
    if (TrailManager.trailsMap.containsKey(PlayerUtil.getClientPlayerUUID())) {
        list.add(new DummyCategoryElement(I18n.translateToLocal("config.category.trailSettings.title"), "config.category.trailSettings", trail_settings));
    }
    return list;
}
Also used : IConfigElement(net.minecraftforge.fml.client.config.IConfigElement) ConfigElement(net.minecraftforge.common.config.ConfigElement) ArrayList(java.util.ArrayList) IConfigElement(net.minecraftforge.fml.client.config.IConfigElement) DummyCategoryElement(net.minecraftforge.fml.client.config.DummyConfigElement.DummyCategoryElement)

Example 8 with ConfigElement

use of net.minecraftforge.common.config.ConfigElement 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)

Example 9 with ConfigElement

use of net.minecraftforge.common.config.ConfigElement in project BluePower by Qmunity.

the class BPGuiConfig method getConfigElements.

@SuppressWarnings({ "rawtypes", "unchecked" })
private static List<IConfigElement> getConfigElements() {
    List<IConfigElement> list = new ArrayList<IConfigElement>();
    List<IConfigElement> listZinc = new ConfigElement(BluePower.config.getCategory(Refs.CONFIG_ZINC)).getChildElements();
    List<IConfigElement> listCopper = new ConfigElement(BluePower.config.getCategory(Refs.CONFIG_COPPER)).getChildElements();
    List<IConfigElement> listSilver = new ConfigElement(BluePower.config.getCategory(Refs.CONFIG_SILVER)).getChildElements();
    List<IConfigElement> listTungsten = new ConfigElement(BluePower.config.getCategory(Refs.CONFIG_TUNGSTEN)).getChildElements();
    List<IConfigElement> listRuby = new ConfigElement(BluePower.config.getCategory(Refs.CONFIG_RUBY)).getChildElements();
    List<IConfigElement> listAmethyst = new ConfigElement(BluePower.config.getCategory(Refs.CONFIG_AMETHYST)).getChildElements();
    List<IConfigElement> listSapphire = new ConfigElement(BluePower.config.getCategory(Refs.CONFIG_SAPPHIRE)).getChildElements();
    List<IConfigElement> listTeslatite = new ConfigElement(BluePower.config.getCategory(Refs.CONFIG_TESLATITE)).getChildElements();
    List<IConfigElement> listWorldGen = new ConfigElement(BluePower.config.getCategory(Refs.CONFIG_WORLDGEN)).getChildElements();
    List<IConfigElement> listSettings = new ConfigElement(BluePower.config.getCategory(Refs.CONFIG_SETTINGS)).getChildElements();
    List<IConfigElement> listRecipes = new ConfigElement(BluePower.config.getCategory(Refs.CONFIG_RECIPES)).getChildElements();
    List<IConfigElement> listEnchants = new ConfigElement(BluePower.config.getCategory(Refs.CONFIG_ENCHANTS)).getChildElements();
    List<IConfigElement> listPneumaticTube = new ConfigElement(BluePower.config.getCategory(Refs.CONFIG_TUBES)).getChildElements();
    List<IConfigElement> listCircuitDatabase = new ConfigElement(BluePower.config.getCategory(Refs.CONFIG_CIRCUIT_DATABASE)).getChildElements();
    list.add(new DummyConfigElement.DummyCategoryElement("World Gen", "config.bluepower:worldgen", listWorldGen));
    list.add(new DummyConfigElement.DummyCategoryElement("Settings", "config.bluepower:settings", listSettings));
    list.add(new DummyConfigElement.DummyCategoryElement("Recipes", "config.bluepower:recipes", listRecipes));
    list.add(new DummyConfigElement.DummyCategoryElement("Enchantments", "config.bluepower:enchantments", listEnchants));
    list.add(new DummyConfigElement.DummyCategoryElement("Pneumatic Tubes", "config.bluepower:tubes", listPneumaticTube));
    list.add(new DummyConfigElement.DummyCategoryElement("Circuit Database", "config.bluepower:circuitDatabase", listCircuitDatabase));
    list.add(new DummyConfigElement.DummyCategoryElement("Copper", "config.bluepower:copper", listCopper));
    list.add(new DummyConfigElement.DummyCategoryElement("Zinc", "config.bluepower:zinc", listZinc));
    list.add(new DummyConfigElement.DummyCategoryElement("Silver", "config.bluepower:silver", listSilver));
    list.add(new DummyConfigElement.DummyCategoryElement("Tungsten", "config.bluepower:tungsten", listTungsten));
    list.add(new DummyConfigElement.DummyCategoryElement("Ruby", "config.bluepower:ruby", listRuby));
    list.add(new DummyConfigElement.DummyCategoryElement("Amethyst", "config.bluepower:amethyst", listAmethyst));
    list.add(new DummyConfigElement.DummyCategoryElement("Sapphire", "config.bluepower:sapphire", listSapphire));
    list.add(new DummyConfigElement.DummyCategoryElement("Teslatite", "config.bluepower:teslatite", listTeslatite));
    return list;
}
Also used : ConfigElement(net.minecraftforge.common.config.ConfigElement) IConfigElement(cpw.mods.fml.client.config.IConfigElement) DummyConfigElement(cpw.mods.fml.client.config.DummyConfigElement) ArrayList(java.util.ArrayList) DummyConfigElement(cpw.mods.fml.client.config.DummyConfigElement) IConfigElement(cpw.mods.fml.client.config.IConfigElement)

Example 10 with ConfigElement

use of net.minecraftforge.common.config.ConfigElement in project Geolosys by oitsjustjose.

the class ConfigGUI method getConfigElements.

private static List<IConfigElement> getConfigElements() {
    ArrayList<IConfigElement> list = new ArrayList<IConfigElement>();
    list.add(new ConfigElement(Config.getInstance().FeatureControl));
    list.add(new ConfigElement(Config.getInstance().Samples));
    list.add(new ConfigElement(Config.getInstance().UserEntries));
    return list;
}
Also used : ConfigElement(net.minecraftforge.common.config.ConfigElement) IConfigElement(net.minecraftforge.fml.client.config.IConfigElement) ArrayList(java.util.ArrayList) IConfigElement(net.minecraftforge.fml.client.config.IConfigElement)

Aggregations

ConfigElement (net.minecraftforge.common.config.ConfigElement)14 IConfigElement (net.minecraftforge.fml.client.config.IConfigElement)13 ArrayList (java.util.ArrayList)11 ConfigCategory (net.minecraftforge.common.config.ConfigCategory)6 Property (net.minecraftforge.common.config.Property)3 DummyConfigElement (net.minecraftforge.fml.client.config.DummyConfigElement)3 AgriConfigCategory (com.agricraft.agricore.config.AgriConfigCategory)1 DummyConfigElement (cpw.mods.fml.client.config.DummyConfigElement)1 IConfigElement (cpw.mods.fml.client.config.IConfigElement)1 ConfigCats (de.canitzp.tumat.configuration.cats.ConfigCats)1 ResourceLocation (net.minecraft.util.ResourceLocation)1 Configuration (net.minecraftforge.common.config.Configuration)1 DummyCategoryElement (net.minecraftforge.fml.client.config.DummyConfigElement.DummyCategoryElement)1