當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。