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


Java ConfigCategory.setLanguageKey方法代码示例

本文整理汇总了Java中net.minecraftforge.common.config.ConfigCategory.setLanguageKey方法的典型用法代码示例。如果您正苦于以下问题:Java ConfigCategory.setLanguageKey方法的具体用法?Java ConfigCategory.setLanguageKey怎么用?Java ConfigCategory.setLanguageKey使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在net.minecraftforge.common.config.ConfigCategory的用法示例。


在下文中一共展示了ConfigCategory.setLanguageKey方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: getConfigElements

import net.minecraftforge.common.config.ConfigCategory; //导入方法依赖的package包/类
private static List<IConfigElement> getConfigElements()
{
    List<IConfigElement> elements = new ArrayList<IConfigElement>();

    for (String name : Blockbuster.proxy.forge.getCategoryNames())
    {
        ConfigCategory category = Blockbuster.proxy.forge.getCategory(name);
        category.setLanguageKey("blockbuster.config." + name + ".title");

        if (name.indexOf(".") == -1)
        {
            elements.add(new ConfigElement(category));
        }
    }

    return elements;
}
 
开发者ID:mchorse,项目名称:blockbuster,代码行数:18,代码来源:GuiConfig.java

示例2: getConfigElements

import net.minecraftforge.common.config.ConfigCategory; //导入方法依赖的package包/类
private static List<IConfigElement> getConfigElements()
{
    List<IConfigElement> elements = new ArrayList<IConfigElement>();

    for (String name : Metamorph.proxy.forge.getCategoryNames())
    {
        ConfigCategory category = Metamorph.proxy.forge.getCategory(name);

        category.setLanguageKey("metamorph.config." + name + ".title");
        elements.add(new ConfigElement(category));
    }

    return elements;
}
 
开发者ID:mchorse,项目名称:metamorph,代码行数:15,代码来源:GuiConfig.java

示例3: createConfigElements

import net.minecraftforge.common.config.ConfigCategory; //导入方法依赖的package包/类
@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);
}
 
开发者ID:OpenMods,项目名称:OpenPeripheral-Integration,代码行数:8,代码来源:ConfigGuiFactory.java

示例4: link

import net.minecraftforge.common.config.ConfigCategory; //导入方法依赖的package包/类
public void link(Configuration config, String name, String langKeyPrefix) {
    String[] parts = StringUtils.split(name, '.');
    String catName = parts[0];
    String propName = parts[1];
    
    // set category language key and description
    String catLangKey = langKeyPrefix + "." + catName;
    String catDesc = WordUtils.wrap(I18n.format(catLangKey + ".tooltip"), 128);

    // configure category and add property
    ConfigCategory cat = config.getCategory(catName);
    cat.setLanguageKey(catLangKey);
    cat.setComment(catDesc);

    // set property language key and description
    String propLangKey = langKeyPrefix + "." + propName;
    String propDesc = WordUtils.wrap(I18n.format(propLangKey + ".tooltip"), 128);

    // create supplier so that later calls don't need all the variables above
    propSupplier = () -> {
        Property prop = config.get(catName, propName, getPropDefault(),
            propDesc, getPropType());
        prop.setLanguageKey(propLangKey);
        return prop;
    };
    
    // initialize prop
    getProp();
    
    // make sure the properties have an insertion order
    List<String> order = new ArrayList<>(cat.getPropertyOrder());
    order.add(name);
    cat.setPropertyOrder(order);
}
 
开发者ID:ata4,项目名称:minema,代码行数:35,代码来源:ConfigValue.java

示例5: link

import net.minecraftforge.common.config.ConfigCategory; //导入方法依赖的package包/类
public void link(Configuration config, String name, String langKeyPrefix) {
    String[] parts = StringUtils.split(name, '.');
    String catName = parts[0];
    String propName = parts[1];
    
    // set category language key and description
    String catLangKey = langKeyPrefix + "." + catName;
    String catDesc = WordUtils.wrap(I18n.format(catLangKey + ".tooltip"), 128);

    // configure category and add property
    ConfigCategory cat = config.getCategory(catName);
    cat.setLanguageKey(catLangKey);
    cat.setComment(catDesc);

    // set property language key and description
    String propLangKey = langKeyPrefix + "." + propName;
    String propDesc = WordUtils.wrap(I18n.format(propLangKey + ".tooltip"), 128);
    
    // make sure the properties have insertion order instead of being
    // randomly ordered
    List<String> order = new ArrayList<>(cat.getPropertyOrder());
    order.add(propName);

    // create supplier so that later calls don't need all the variables above
    propSupplier = () -> {
        Property prop = config.get(catName, propName, getPropDefault(),
            propDesc, getPropType());
        prop.setLanguageKey(propLangKey);
        return prop;
    };
    
    // initialize prop
    getProp();
    
    // update prop order
    cat.setPropertyOrder(order);
}
 
开发者ID:ata4,项目名称:mineshot,代码行数:38,代码来源:ConfigValue.java


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