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;
}
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;
}
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;
}
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;
}
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;
}
Aggregations