cpw.mods.fml.client.config.IConfigElement Java Examples

The following examples show how to use cpw.mods.fml.client.config.IConfigElement. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: ConfigGUI.java    From Et-Futurum with The Unlicense 5 votes vote down vote up
@SuppressWarnings({ "rawtypes" })
private static List<IConfigElement> getElements() {
	List<IConfigElement> list = new ArrayList<IConfigElement>();
	for (String category : ConfigurationHandler.INSTANCE.usedCategories)
		list.add(new ConfigElement(ConfigurationHandler.INSTANCE.configFile.getCategory(category)));
	return list;
}
 
Example #2
Source File: ConfigGuiFactory.java    From OpenPeripheral-Integration with MIT License 5 votes vote down vote up
@SuppressWarnings({ "rawtypes" })
private static List<IConfigElement> createConfigElements() {
	ConfigCategory modules = OpenPeripheralIntegration.instance.config().getCategory(OpenPeripheralIntegration.CATEGORY_MODULES);
	modules.setLanguageKey("openperipheralintegration.config.modules");
	final ConfigElement modulesElement = new ConfigElement(modules);
	return Lists.<IConfigElement> newArrayList(modulesElement);
}
 
Example #3
Source File: ConfigGui.java    From NEI-Integration with MIT License 5 votes vote down vote up
private static List<IConfigElement> getConfigElements(GuiScreen parent) {
    List<IConfigElement> list = new ArrayList<IConfigElement>();
    String prefix = "neiintegration.config.";
    
    for (Section configSection : Config.configSections) {
        list.add(new ConfigElement<ConfigCategory>(Config.config.getCategory(configSection.toLowerCase()).setLanguageKey(prefix + configSection.id)));
    }
    
    return list;
}
 
Example #4
Source File: ConfigGui.java    From SimplyJetpacks with MIT License 5 votes vote down vote up
private static List<IConfigElement> getConfigElements(GuiScreen parent) {
    List<IConfigElement> list = new ArrayList<IConfigElement>();
    String prefix = SimplyJetpacks.PREFIX + "config.";
    
    for (Section configSection : Config.configSections) {
        if (configSection.client) {
            list.add(new ConfigElement<ConfigCategory>(Config.configClient.getCategory(configSection.toLowerCase()).setLanguageKey(prefix + configSection.id)));
        } else {
            list.add(new ConfigElement<ConfigCategory>(Config.config.getCategory(configSection.toLowerCase()).setLanguageKey(prefix + configSection.id)));
        }
    }
    
    return list;
}
 
Example #5
Source File: EMTGuiConfig.java    From Electro-Magic-Tools with GNU General Public License v3.0 5 votes vote down vote up
@SuppressWarnings("rawtypes")
private static List<IConfigElement> getConfigElements(GuiScreen parent) {
    List<IConfigElement> list = new ArrayList<IConfigElement>();

    list.add(new ConfigElement<ConfigCategory>(config.getCategory(CATEGORY_RANDOM.toLowerCase())));
    list.add(new ConfigElement<ConfigCategory>(config.getCategory(CATEGORY_VALUES.toLowerCase())));
    list.add(new ConfigElement<ConfigCategory>(config.getCategory(CATEGORY_RESEARCH.toLowerCase())));
    list.add(new ConfigElement<ConfigCategory>(config.getCategory(CATEGORY_OUTPUTS.toLowerCase())));
 list.add(new ConfigElement<ConfigCategory>(config.getCategory(CATEGORY_MODULES.toLowerCase())));

    return list;
}
 
Example #6
Source File: GuiConfigHandler.java    From PneumaticCraft with GNU General Public License v3.0 5 votes vote down vote up
private static List<IConfigElement> getConfigElements(){
    List<IConfigElement> list = new ArrayList<IConfigElement>();
    for(String category : Config.CATEGORIES) {
        list.add(new DummyCategoryElement(category, category, new ConfigElement(Config.config.getCategory(category).setRequiresMcRestart(!Config.NO_MC_RESTART_CATS.contains(category))).getChildElements()));
    }

    return list;
}
 
Example #7
Source File: ConfigGuiFactory.java    From OpenPeripheral with MIT License 5 votes vote down vote up
private static IConfigElement createModConfig() {
	final Configuration config = OpenPeripheralCore.instance.config();
	final List<IConfigElement> result = Lists.newArrayList();

	for (String categoryName : config.getCategoryNames()) {
		if (!categoryName.equalsIgnoreCase(Config.CATEGORY_FEATURE_GROUPS)) {
			ConfigCategory category = config.getCategory(categoryName);
			result.add(new ConfigElement(category));
		}
	}

	return new DummyCategoryElement("modConfig", "openperipheralcore.config.miscConfig", result);
}
 
Example #8
Source File: ConfigGuiFactory.java    From OpenPeripheral with MIT License 5 votes vote down vote up
private static IConfigElement createFeatureGroupConfig() {
	final List<IConfigElement> architecturesConfig = Lists.newArrayList();

	for (String architecture : sorted(ArchitectureChecker.INSTANCE.knownArchitectures()))
		architecturesConfig.add(createArchitectureConfig(architecture));

	return new DummyCategoryElement("featureGroups", "openperipheralcore.config.featureGroupConfig", architecturesConfig);
}
 
Example #9
Source File: ConfigGuiFactory.java    From OpenPeripheral with MIT License 5 votes vote down vote up
private static IConfigElement createArchitectureConfig(final String architecture) {
	final List<IConfigElement> architectureConfig = Lists.newArrayList();

	for (String feature : sorted(FeatureGroupManager.INSTANCE.knownFeatureGroups()))
		architectureConfig.add(new FeatureConfigElement(architecture, feature));

	return new DummyCategoryElement(architecture, "openperipheralcore.config.architectureConfig", architectureConfig);
}
 
Example #10
Source File: ConfigGuiFactory.java    From OpenPeripheral with MIT License 4 votes vote down vote up
@Override
public List<IConfigElement> getChildElements() {
	return null;
}
 
Example #11
Source File: ConfigGuiFactory.java    From OpenPeripheral with MIT License 4 votes vote down vote up
private static List<IConfigElement> createConfigElements() {
	final List<IConfigElement> result = Lists.newArrayList();
	result.add(createFeatureGroupConfig());
	result.add(createModConfig());
	return result;
}