ActuallyAdditions/src/main/java/de/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
2016-01-03 16:05:51 +01:00
* http://ellpeck.de/actaddlicense/
2015-08-29 14:33:25 +02:00
* View the source code at https://github.com/Ellpeck/ActuallyAdditions
*
2016-01-03 16:05:51 +01:00
* © 2016 Ellpeck
2015-08-29 14:33:25 +02:00
*/
2015-12-30 22:02:15 +01:00
package de.ellpeck.actuallyadditions.config;
2015-07-17 11:17:55 +02:00
import cpw.mods.fml.client.config.GuiConfig;
import cpw.mods.fml.client.config.IConfigElement;
2015-12-30 22:02:15 +01:00
import de.ellpeck.actuallyadditions.util.ModUtil;
2015-07-17 11:17:55 +02:00
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;
}
}