ActuallyAdditions/src/main/java/ellpeck/actuallyadditions/config/GuiConfiguration.java

39 lines
1.5 KiB
Java
Raw Normal View History

2015-08-29 14:33:25 +02:00
/*
* This file ("GuiConfiguration.java") is part of the Actually Additions Mod for Minecraft.
* It is created and owned by Ellpeck and distributed
* under the Actually Additions License to be found at
* http://github.com/Ellpeck/ActuallyAdditions/blob/master/README.md
* View the source code at https://github.com/Ellpeck/ActuallyAdditions
*
2015-11-02 20:55:19 +01:00
* © 2015 Ellpeck
2015-08-29 14:33:25 +02:00
*/
2015-07-17 11:17:55 +02:00
package ellpeck.actuallyadditions.config;
import cpw.mods.fml.client.config.GuiConfig;
import cpw.mods.fml.client.config.IConfigElement;
import ellpeck.actuallyadditions.util.ModUtil;
import net.minecraft.client.gui.GuiScreen;
import net.minecraftforge.common.config.ConfigCategory;
import net.minecraftforge.common.config.ConfigElement;
import java.util.ArrayList;
import java.util.List;
public class GuiConfiguration extends GuiConfig{
public GuiConfiguration(GuiScreen parentScreen){
super(parentScreen, getConfigElements(), ModUtil.MOD_ID, false, false, GuiConfig.getAbridgedConfigPath(ConfigurationHandler.config.toString()));
2015-07-17 11:17:55 +02:00
}
private static List<IConfigElement> getConfigElements(){
2015-07-17 23:22:10 +02:00
List<IConfigElement> list = new ArrayList<IConfigElement>();
2015-07-17 11:17:55 +02:00
for(int i = 0; i < ConfigCategories.values().length; i++){
2015-08-31 11:48:15 +02:00
ConfigCategories cat = ConfigCategories.values()[i];
ConfigurationHandler.config.setCategoryComment(cat.name, cat.comment);
list.add(new ConfigElement<ConfigCategory>(ConfigurationHandler.config.getCategory(cat.name)));
2015-07-17 11:17:55 +02:00
}
return list;
}
}