当前位置: 首页>>代码示例>>Java>>正文


Java ConfigGuiType类代码示例

本文整理汇总了Java中cpw.mods.fml.client.config.ConfigGuiType的典型用法代码示例。如果您正苦于以下问题:Java ConfigGuiType类的具体用法?Java ConfigGuiType怎么用?Java ConfigGuiType使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


ConfigGuiType类属于cpw.mods.fml.client.config包,在下文中一共展示了ConfigGuiType类的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: getTypedElement

import cpw.mods.fml.client.config.ConfigGuiType; //导入依赖的package包/类
public static ConfigElement<?> getTypedElement(String mod_id, String group, String key, Map<String, Object> value, Map<String, Object> def) {
    ConfigGuiType type = getType(value);

    if (type == null) {
        return new ConfigElement<String>(mod_id, key, value, def);
    }

    switch (type) {
        case BOOLEAN:
            return new ConfigElement<Boolean>(mod_id, key, value, def);
        case DOUBLE:
            return new ConfigElement<Double>(mod_id, key, value, def);
        case INTEGER:
            return new ConfigElement<Integer>(mod_id, key, value, def);
        default:
            return new ConfigElement<String>(mod_id, key, value, def);
    }
}
 
开发者ID:EnderWizards,项目名称:libsandstone,代码行数:19,代码来源:ConfigElement.java

示例2: buildChildScreen

import cpw.mods.fml.client.config.ConfigGuiType; //导入依赖的package包/类
@Override
protected GuiScreen buildChildScreen()
{
    List<IConfigElement> list = new ArrayList<IConfigElement>();
    
    list.add(new DummyConfigElement("modID", "", ConfigGuiType.STRING, "forge.configgui.modID").setCustomListEntryClass(ModIDEntry.class));
    list.add(new ConfigElement<Integer>(new Property("maximumTicketCount", "200", Property.Type.INTEGER, "forge.configgui.maximumTicketCount")));
    list.add(new ConfigElement<Integer>(new Property("maximumChunksPerTicket", "25", Property.Type.INTEGER, "forge.configgui.maximumChunksPerTicket")));
    
    return new GuiConfig(this.owningScreen, list, this.owningScreen.modID,
            this.configElement.requiresWorldRestart() || this.owningScreen.allRequireWorldRestart,
            this.configElement.requiresMcRestart() || this.owningScreen.allRequireMcRestart, this.owningScreen.title,
            I18n.func_135052_a("forge.configgui.ctgy.forgeChunkLoadingAddModConfig"));
}
 
开发者ID:SchrodingersSpy,项目名称:TRHS_Club_Mod_2016,代码行数:15,代码来源:ForgeGuiFactory.java

示例3: buildChildScreen

import cpw.mods.fml.client.config.ConfigGuiType; //导入依赖的package包/类
@Override
protected GuiScreen buildChildScreen()
{
    List<IConfigElement> list = new ArrayList<IConfigElement>();
    
    list.add(new DummyConfigElement("modID", "", ConfigGuiType.STRING, "forge.configgui.modID").setCustomListEntryClass(ModIDEntry.class));
    list.add(new ConfigElement<Integer>(new Property("maximumTicketCount", "200", Property.Type.INTEGER, "forge.configgui.maximumTicketCount")));
    list.add(new ConfigElement<Integer>(new Property("maximumChunksPerTicket", "25", Property.Type.INTEGER, "forge.configgui.maximumChunksPerTicket")));
    
    return new GuiConfig(this.owningScreen, list, this.owningScreen.modID,
            this.configElement.requiresWorldRestart() || this.owningScreen.allRequireWorldRestart,
            this.configElement.requiresMcRestart() || this.owningScreen.allRequireMcRestart, this.owningScreen.title,
            I18n.format("forge.configgui.ctgy.forgeChunkLoadingAddModConfig"));
}
 
开发者ID:alexandrage,项目名称:CauldronGit,代码行数:15,代码来源:ForgeGuiFactory.java

示例4: getGuiType

import cpw.mods.fml.client.config.ConfigGuiType; //导入依赖的package包/类
public static <T> ConfigGuiType getGuiType(Setting<T> setting) {
	if (setting instanceof BooleanSetting) return ConfigGuiType.BOOLEAN;
	else if (setting instanceof IntegerSetting) return ConfigGuiType.INTEGER;
	else if (setting instanceof DoubleSetting) return ConfigGuiType.DOUBLE;
	else if ((setting instanceof StringSetting) ||
	         (setting instanceof EnumSetting)) return ConfigGuiType.STRING;
	else throw new UnsupportedOperationException("Setting type '" + setting.getClass().getSimpleName() + "' not supported.");
}
 
开发者ID:copygirl,项目名称:copycore,代码行数:9,代码来源:GuiConfigBase.java

示例5: getType

import cpw.mods.fml.client.config.ConfigGuiType; //导入依赖的package包/类
@Override
public ConfigGuiType getType() {
    if (def.get(group, key) instanceof ConfigReference) {
        ConfigGuiType type = ((ConfigReference) def.get(group, key)).type;
        if (type != null) {
            return type;
        }
    }
    return getType(config.get(group, key));
}
 
开发者ID:EnderWizards,项目名称:libsandstone,代码行数:11,代码来源:ConfigElement.java

示例6: getType

import cpw.mods.fml.client.config.ConfigGuiType; //导入依赖的package包/类
@Override
public ConfigGuiType getType()
{
    ConfigGuiType type = lookup.get(field.getType().toString());
    return type != null ? type : ConfigGuiType.STRING;
}
 
开发者ID:CreeperHost,项目名称:CreeperHostGui,代码行数:7,代码来源:ReflectionConfigElement.java

示例7: getConfigElements

import cpw.mods.fml.client.config.ConfigGuiType; //导入依赖的package包/类
@SuppressWarnings({ "rawtypes", "unchecked" })
private static List<IConfigElement> getConfigElements()
{
    List<IConfigElement> list = new ArrayList<IConfigElement>();
    List<IConfigElement> listsList = new ArrayList<IConfigElement>();
    List<IConfigElement> stringsList = new ArrayList<IConfigElement>();
    List<IConfigElement> numbersList = new ArrayList<IConfigElement>();
    Pattern commaDelimitedPattern = Pattern.compile("([A-Za-z]+((,){1}( )*|$))+?");
    
    // Top Level Settings
    list.add(new DummyConfigElement<Boolean>("imABoolean", true, ConfigGuiType.BOOLEAN, "fml.config.sample.imABoolean").setRequiresMcRestart(true));
    list.add(new DummyConfigElement<Integer>("imAnInteger", 42, ConfigGuiType.INTEGER, "fml.config.sample.imAnInteger", -1, 256).setRequiresMcRestart(true));
    list.add(new DummyConfigElement<Double>("imADouble", 42.4242D, ConfigGuiType.DOUBLE, "fml.config.sample.imADouble", -1.0D, 256.256D).setRequiresMcRestart(true));
    list.add(new DummyConfigElement<String>("imAString", "http://www.montypython.net/scripts/string.php", ConfigGuiType.STRING, "fml.config.sample.imAString").setRequiresMcRestart(true));
    
    // Lists category
    listsList.add(new DummyListElement<Boolean>("booleanList", new Boolean[] {true, false, true, false, true, false, true, false}, ConfigGuiType.BOOLEAN, "fml.config.sample.booleanList"));
    listsList.add(new DummyListElement<Boolean>("booleanListFixed", new Boolean[] {true, false, true, false, true, false, true, false}, ConfigGuiType.BOOLEAN, "fml.config.sample.booleanListFixed", true));
    listsList.add(new DummyListElement<Boolean>("booleanListMax", new Boolean[] {true, false, true, false, true, false, true, false}, ConfigGuiType.BOOLEAN, "fml.config.sample.booleanListMax", 10));
    listsList.add(new DummyListElement<Double>("doubleList", new Double[] {0.0D, 1.1D, 2.2D, 3.3D, 4.4D, 5.5D, 6.6D, 7.7D, 8.8D, 9.9D}, ConfigGuiType.DOUBLE, "fml.config.sample.doubleList"));
    listsList.add(new DummyListElement<Double>("doubleListFixed", new Double[] {0.0D, 1.1D, 2.2D, 3.3D, 4.4D, 5.5D, 6.6D, 7.7D, 8.8D, 9.9D}, ConfigGuiType.DOUBLE, "fml.config.sample.doubleListFixed", true));
    listsList.add(new DummyListElement<Double>("doubleListMax", new Double[] {0.0D, 1.1D, 2.2D, 3.3D, 4.4D, 5.5D, 6.6D, 7.7D, 8.8D, 9.9D}, ConfigGuiType.DOUBLE, "fml.config.sample.doubleListMax", 15));
    listsList.add(new DummyListElement<Double>("doubleListBounded", new Double[] {0.0D, 1.1D, 2.2D, 3.3D, 4.4D, 5.5D, 6.6D, 7.7D, 8.8D, 9.9D}, ConfigGuiType.DOUBLE, "fml.config.sample.doubleListBounded", -1.0D, 10.0D));
    listsList.add(new DummyListElement<Integer>("integerList", new Integer[] {0, 1, 2, 3, 4, 5, 6, 7, 8, 9}, ConfigGuiType.INTEGER, "fml.config.sample.integerList"));
    listsList.add(new DummyListElement<Integer>("integerListFixed", new Integer[] {0, 1, 2, 3, 4, 5, 6, 7, 8, 9}, ConfigGuiType.INTEGER, "fml.config.sample.integerListFixed", true));
    listsList.add(new DummyListElement<Integer>("integerListMax", new Integer[] {0, 1, 2, 3, 4, 5, 6, 7, 8, 9}, ConfigGuiType.INTEGER, "fml.config.sample.integerListMax", 15));
    listsList.add(new DummyListElement<Integer>("integerListBounded", new Integer[] {0, 1, 2, 3, 4, 5, 6, 7, 8, 9}, ConfigGuiType.INTEGER, "fml.config.sample.integerListBounded", -1, 10));
    listsList.add(new DummyListElement<String>("stringList", new String[] {"An", "array", "of", "string", "values"}, ConfigGuiType.STRING, "fml.config.sample.stringList"));
    listsList.add(new DummyListElement<String>("stringListFixed", new String[] {"A", "fixed", "length", "array", "of", "string", "values"}, ConfigGuiType.STRING, "fml.config.sample.stringListFixed", true));
    listsList.add(new DummyListElement<String>("stringListMax", new String[] {"An", "array", "of", "string", "values", "with", "a", "max", "length", "of", "15"}, ConfigGuiType.STRING, "fml.config.sample.stringListMax", 15));
    listsList.add(new DummyListElement<String>("stringListPattern", new String[] {"Valid", "Not Valid", "Is, Valid", "Comma, Separated, Value"}, ConfigGuiType.STRING, "fml.config.sample.stringListPattern", commaDelimitedPattern));
    
    list.add(new DummyCategoryElement("lists", "fml.config.sample.ctgy.lists", listsList));
    
    // Strings category
    stringsList.add(new DummyConfigElement<String>("basicString", "Just a regular String value, anything goes.", ConfigGuiType.STRING, "fml.config.sample.basicString"));
    stringsList.add(new DummyConfigElement<String>("cycleString", "this", ConfigGuiType.STRING, "fml.config.sample.cycleString", new String[] {"this", "property", "cycles", "through", "a", "list", "of", "valid", "choices"}));
    stringsList.add(new DummyConfigElement<String>("patternString", "only, comma, separated, words, can, be, entered, in, this, box", ConfigGuiType.STRING, "fml.config.sample.patternString", commaDelimitedPattern));
    stringsList.add(new DummyConfigElement<String>("chatColorPicker", "c", ConfigGuiType.COLOR, "fml.config.sample.chatColorPicker", new String[] {"0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "a", "b", "c", "d", "e", "f"}));
    stringsList.add(new DummyConfigElement<String>("modIDSelector", "FML", ConfigGuiType.MOD_ID, "fml.config.sample.modIDSelector"));
    
    list.add(new DummyCategoryElement("strings", "fml.config.sample.ctgy.strings", stringsList));
    
    // Numbers category
    numbersList.add((new DummyConfigElement<Integer>("basicInteger", 42, ConfigGuiType.INTEGER, "fml.config.sample.basicInteger")));
    numbersList.add((new DummyConfigElement<Integer>("boundedInteger", 42, ConfigGuiType.INTEGER, "fml.config.sample.boundedInteger", -1, 256)));
    numbersList.add((new DummyConfigElement<Integer>("sliderInteger", 2000, ConfigGuiType.INTEGER, "fml.config.sample.sliderInteger", 100, 10000)).setCustomListEntryClass(NumberSliderEntry.class));
    numbersList.add(new DummyConfigElement<Double>("basicDouble", 42.4242D, ConfigGuiType.DOUBLE, "fml.config.sample.basicDouble"));
    numbersList.add(new DummyConfigElement<Double>("boundedDouble", 42.4242D, ConfigGuiType.DOUBLE, "fml.config.sample.boundedDouble", -1.0D, 256.256D));
    numbersList.add(new DummyConfigElement<Double>("sliderDouble", 42.4242D, ConfigGuiType.DOUBLE, "fml.config.sample.sliderDouble", -1.0D, 256.256D).setCustomListEntryClass(NumberSliderEntry.class));

    list.add(new DummyCategoryElement("numbers", "fml.config.sample.ctgy.numbers", numbersList));
    
    return list;
}
 
开发者ID:SchrodingersSpy,项目名称:TRHS_Club_Mod_2016,代码行数:56,代码来源:FMLConfigGuiFactory.java

示例8: getType

import cpw.mods.fml.client.config.ConfigGuiType; //导入依赖的package包/类
@Override
public ConfigGuiType getType()
{
    return isProperty ? getType(this.prop) : ConfigGuiType.CONFIG_CATEGORY;
}
 
开发者ID:SchrodingersSpy,项目名称:TRHS_Club_Mod_2016,代码行数:6,代码来源:ConfigElement.java

示例9: getConfigElements

import cpw.mods.fml.client.config.ConfigGuiType; //导入依赖的package包/类
private static List<IConfigElement> getConfigElements()
{
    List<IConfigElement> list = new ArrayList<IConfigElement>();
    List<IConfigElement> listsList = new ArrayList<IConfigElement>();
    List<IConfigElement> stringsList = new ArrayList<IConfigElement>();
    List<IConfigElement> numbersList = new ArrayList<IConfigElement>();
    Pattern commaDelimitedPattern = Pattern.compile("([A-Za-z]+((,){1}( )*|$))+?");
    
    // Top Level Settings
    list.add(new DummyConfigElement<Boolean>("imABoolean", true, ConfigGuiType.BOOLEAN, "fml.config.sample.imABoolean").setRequiresMcRestart(true));
    list.add(new DummyConfigElement<Integer>("imAnInteger", 42, ConfigGuiType.INTEGER, "fml.config.sample.imAnInteger", -1, 256).setRequiresMcRestart(true));
    list.add(new DummyConfigElement<Double>("imADouble", 42.4242D, ConfigGuiType.DOUBLE, "fml.config.sample.imADouble", -1.0D, 256.256D).setRequiresMcRestart(true));
    list.add(new DummyConfigElement<String>("imAString", "http://www.montypython.net/scripts/string.php", ConfigGuiType.STRING, "fml.config.sample.imAString").setRequiresMcRestart(true));
    
    // Lists category
    listsList.add(new DummyListElement<Boolean>("booleanList", new Boolean[] {true, false, true, false, true, false, true, false}, ConfigGuiType.BOOLEAN, "fml.config.sample.booleanList"));
    listsList.add(new DummyListElement<Boolean>("booleanListFixed", new Boolean[] {true, false, true, false, true, false, true, false}, ConfigGuiType.BOOLEAN, "fml.config.sample.booleanListFixed", true));
    listsList.add(new DummyListElement<Boolean>("booleanListMax", new Boolean[] {true, false, true, false, true, false, true, false}, ConfigGuiType.BOOLEAN, "fml.config.sample.booleanListMax", 10));
    listsList.add(new DummyListElement<Double>("doubleList", new Double[] {0.0D, 1.1D, 2.2D, 3.3D, 4.4D, 5.5D, 6.6D, 7.7D, 8.8D, 9.9D}, ConfigGuiType.DOUBLE, "fml.config.sample.doubleList"));
    listsList.add(new DummyListElement<Double>("doubleListFixed", new Double[] {0.0D, 1.1D, 2.2D, 3.3D, 4.4D, 5.5D, 6.6D, 7.7D, 8.8D, 9.9D}, ConfigGuiType.DOUBLE, "fml.config.sample.doubleListFixed", true));
    listsList.add(new DummyListElement<Double>("doubleListMax", new Double[] {0.0D, 1.1D, 2.2D, 3.3D, 4.4D, 5.5D, 6.6D, 7.7D, 8.8D, 9.9D}, ConfigGuiType.DOUBLE, "fml.config.sample.doubleListMax", 15));
    listsList.add(new DummyListElement<Double>("doubleListBounded", new Double[] {0.0D, 1.1D, 2.2D, 3.3D, 4.4D, 5.5D, 6.6D, 7.7D, 8.8D, 9.9D}, ConfigGuiType.DOUBLE, "fml.config.sample.doubleListBounded", -1.0D, 10.0D));
    listsList.add(new DummyListElement<Integer>("integerList", new Integer[] {0, 1, 2, 3, 4, 5, 6, 7, 8, 9}, ConfigGuiType.INTEGER, "fml.config.sample.integerList"));
    listsList.add(new DummyListElement<Integer>("integerListFixed", new Integer[] {0, 1, 2, 3, 4, 5, 6, 7, 8, 9}, ConfigGuiType.INTEGER, "fml.config.sample.integerListFixed", true));
    listsList.add(new DummyListElement<Integer>("integerListMax", new Integer[] {0, 1, 2, 3, 4, 5, 6, 7, 8, 9}, ConfigGuiType.INTEGER, "fml.config.sample.integerListMax", 15));
    listsList.add(new DummyListElement<Integer>("integerListBounded", new Integer[] {0, 1, 2, 3, 4, 5, 6, 7, 8, 9}, ConfigGuiType.INTEGER, "fml.config.sample.integerListBounded", -1, 10));
    listsList.add(new DummyListElement<String>("stringList", new String[] {"An", "array", "of", "string", "values"}, ConfigGuiType.STRING, "fml.config.sample.stringList"));
    listsList.add(new DummyListElement<String>("stringListFixed", new String[] {"A", "fixed", "length", "array", "of", "string", "values"}, ConfigGuiType.STRING, "fml.config.sample.stringListFixed", true));
    listsList.add(new DummyListElement<String>("stringListMax", new String[] {"An", "array", "of", "string", "values", "with", "a", "max", "length", "of", "15"}, ConfigGuiType.STRING, "fml.config.sample.stringListMax", 15));
    listsList.add(new DummyListElement<String>("stringListPattern", new String[] {"Valid", "Not Valid", "Is, Valid", "Comma, Separated, Value"}, ConfigGuiType.STRING, "fml.config.sample.stringListPattern", commaDelimitedPattern));
    
    list.add(new DummyCategoryElement("lists", "fml.config.sample.ctgy.lists", listsList));
    
    // Strings category
    stringsList.add(new DummyConfigElement<String>("basicString", "Just a regular String value, anything goes.", ConfigGuiType.STRING, "fml.config.sample.basicString"));
    stringsList.add(new DummyConfigElement<String>("cycleString", "this", ConfigGuiType.STRING, "fml.config.sample.cycleString", new String[] {"this", "property", "cycles", "through", "a", "list", "of", "valid", "choices"}));
    stringsList.add(new DummyConfigElement<String>("patternString", "only, comma, separated, words, can, be, entered, in, this, box", ConfigGuiType.STRING, "fml.config.sample.patternString", commaDelimitedPattern));
    stringsList.add(new DummyConfigElement<String>("chatColorPicker", "c", ConfigGuiType.COLOR, "fml.config.sample.chatColorPicker", new String[] {"0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "a", "b", "c", "d", "e", "f"}));
    stringsList.add(new DummyConfigElement<String>("modIDSelector", "FML", ConfigGuiType.MOD_ID, "fml.config.sample.modIDSelector"));
    
    list.add(new DummyCategoryElement("strings", "fml.config.sample.ctgy.strings", stringsList));
    
    // Numbers category
    numbersList.add((new DummyConfigElement<Integer>("basicInteger", 42, ConfigGuiType.INTEGER, "fml.config.sample.basicInteger")));
    numbersList.add((new DummyConfigElement<Integer>("boundedInteger", 42, ConfigGuiType.INTEGER, "fml.config.sample.boundedInteger", -1, 256)));
    numbersList.add((new DummyConfigElement<Integer>("sliderInteger", 42, ConfigGuiType.INTEGER, "fml.config.sample.sliderInteger", -1, 256)).setCustomListEntryClass(NumberSliderEntry.class));
    numbersList.add(new DummyConfigElement<Double>("basicDouble", 42.4242D, ConfigGuiType.DOUBLE, "fml.config.sample.basicDouble"));
    numbersList.add(new DummyConfigElement<Double>("boundedDouble", 42.4242D, ConfigGuiType.DOUBLE, "fml.config.sample.boundedDouble", -1.0D, 256.256D));
    numbersList.add(new DummyConfigElement<Double>("sliderDouble", 42.4242D, ConfigGuiType.DOUBLE, "fml.config.sample.sliderDouble", -1.0D, 256.256D).setCustomListEntryClass(NumberSliderEntry.class));

    list.add(new DummyCategoryElement("numbers", "fml.config.sample.ctgy.numbers", numbersList));
    
    return list;
}
 
开发者ID:alexandrage,项目名称:CauldronGit,代码行数:55,代码来源:FMLConfigGuiFactory.java

示例10: setType

import cpw.mods.fml.client.config.ConfigGuiType; //导入依赖的package包/类
public ConfigReference setType(ConfigGuiType type) {
    this.type = type;
    return this;
}
 
开发者ID:EnderWizards,项目名称:libsandstone,代码行数:5,代码来源:ConfigReference.java

示例11: getType

import cpw.mods.fml.client.config.ConfigGuiType; //导入依赖的package包/类
@Override
public ConfigGuiType getType() {
	return ConfigGuiType.BOOLEAN;
}
 
开发者ID:OpenMods,项目名称:OpenPeripheral,代码行数:5,代码来源:ConfigGuiFactory.java


注:本文中的cpw.mods.fml.client.config.ConfigGuiType类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。