mirror of
https://github.com/GTNewHorizons/EnderIO.git
synced 2026-11-24 05:54:27 +00:00
43 lines
1.3 KiB
Java
43 lines
1.3 KiB
Java
package crazypants.enderio.config;
|
|
|
|
import static crazypants.enderio.config.Config.config;
|
|
|
|
import java.util.ArrayList;
|
|
import java.util.List;
|
|
|
|
import net.minecraft.client.gui.GuiScreen;
|
|
import net.minecraftforge.common.config.ConfigCategory;
|
|
import net.minecraftforge.common.config.ConfigElement;
|
|
|
|
import cpw.mods.fml.client.config.GuiConfig;
|
|
import cpw.mods.fml.client.config.IConfigElement;
|
|
import crazypants.enderio.EnderIO;
|
|
import crazypants.enderio.config.Config.Section;
|
|
|
|
@SuppressWarnings({ "rawtypes" })
|
|
public class GuiConfigFactoryEIO extends GuiConfig {
|
|
|
|
public GuiConfigFactoryEIO(GuiScreen parentScreen) {
|
|
super(
|
|
parentScreen,
|
|
getConfigElements(parentScreen),
|
|
EnderIO.MODID,
|
|
false,
|
|
false,
|
|
EnderIO.lang.localize("config.title"));
|
|
}
|
|
|
|
private static List<IConfigElement> getConfigElements(GuiScreen parent) {
|
|
List<IConfigElement> list = new ArrayList<>();
|
|
String prefix = EnderIO.lang.addPrefix("config.");
|
|
|
|
for (Section section : Config.sections) {
|
|
list.add(
|
|
new ConfigElement<ConfigCategory>(
|
|
config.getCategory(section.lc()).setLanguageKey(prefix + section.lang)));
|
|
}
|
|
|
|
return list;
|
|
}
|
|
}
|