• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java ConfigGuiType类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: ReplaceIntegerEntries

import net.minecraftforge.fml.client.config.ConfigGuiType; //导入依赖的package包/类
private void ReplaceIntegerEntries()
{
	for (int i = 0; i < this.entryList.listEntries.size(); i++)
	{
		IConfigEntry entry = this.entryList.listEntries.get(i);
		IConfigElement element = entry.getConfigElement();

		if (element.getType() == ConfigGuiType.INTEGER)
		{
			TextNumberSliderEntry slider = new TextNumberSliderEntry(this, this.entryList, element);
			slider.updateValueButtonText();
			this.entryList.listEntries.set(i, slider);
			this.initEntries.set(i, slider);
		}
	}
}
 
开发者ID:Brian-Wuest,项目名称:MC-Prefab,代码行数:17,代码来源:GuiPrefab.java


示例2: TextNumberSliderEntry

import net.minecraftforge.fml.client.config.ConfigGuiType; //导入依赖的package包/类
public TextNumberSliderEntry(GuiConfig owningScreen,
		GuiConfigEntries owningEntryList, IConfigElement configElement) 
{
	super(owningScreen, owningEntryList, configElement, new GuiTextSlider(0, owningEntryList.controlX, 0, owningEntryList.controlWidth, 18,
			"", "", Double.valueOf(configElement.getMinValue().toString()), Double.valueOf(configElement.getMaxValue().toString()),
			Double.valueOf(configElement.get().toString()), configElement.getType() == ConfigGuiType.DOUBLE, true));

	((GuiTextSlider)this.btnValue).parentEntry = this;

	if (configElement.getType() == ConfigGuiType.INTEGER)
	{
		this.beforeValue = Integer.valueOf(configElement.get().toString());
	}
	else
	{
		this.beforeValue = Double.valueOf(configElement.get().toString());
	}
}
 
开发者ID:Brian-Wuest,项目名称:MC-Prefab,代码行数:19,代码来源:GuiPrefab.java


示例3: buildChildScreen

import net.minecraftforge.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(new Property("maximumTicketCount", "200", Property.Type.INTEGER, "forge.configgui.maximumTicketCount")));
    list.add(new ConfigElement(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:F1r3w477,项目名称:CustomWorldGen,代码行数:15,代码来源:ForgeGuiFactory.java


示例4: getCurrentValue

import net.minecraftforge.fml.client.config.ConfigGuiType; //导入依赖的package包/类
@Override
public Object getCurrentValue()
{
	if (configElement.getType() == ConfigGuiType.INTEGER)
	{
		return ((GuiSlider) this.btnValue).getValueInt();
	}
	else
	{
		return ((GuiSlider) this.btnValue).getValue();
	}
}
 
开发者ID:Brian-Wuest,项目名称:MC-Prefab,代码行数:13,代码来源:GuiPrefab.java


示例5: isDefault

import net.minecraftforge.fml.client.config.ConfigGuiType; //导入依赖的package包/类
@Override
public boolean isDefault()
{
	if (configElement.getType() == ConfigGuiType.INTEGER)
		return ((GuiSlider) this.btnValue).getValueInt() == Integer.valueOf(configElement.getDefault().toString());
	else
		return ((GuiSlider) this.btnValue).getValue() == Double.valueOf(configElement.getDefault().toString());
}
 
开发者ID:Brian-Wuest,项目名称:MC-Prefab,代码行数:9,代码来源:GuiPrefab.java


示例6: isChanged

import net.minecraftforge.fml.client.config.ConfigGuiType; //导入依赖的package包/类
@Override
public boolean isChanged()
{
	if (configElement.getType() == ConfigGuiType.INTEGER)
		return ((GuiSlider) this.btnValue).getValueInt() != (int) Math.round(beforeValue);
	else
		return ((GuiSlider) this.btnValue).getValue() != beforeValue;
}
 
开发者ID:Brian-Wuest,项目名称:MC-Prefab,代码行数:9,代码来源:GuiPrefab.java


示例7: saveConfigElement

import net.minecraftforge.fml.client.config.ConfigGuiType; //导入依赖的package包/类
@Override
public boolean saveConfigElement()
{
	if (this.enabled() && this.isChanged())
	{
		if (configElement.getType() == ConfigGuiType.INTEGER)
			configElement.set(((GuiSlider) this.btnValue).getValueInt());
		else
			configElement.set(((GuiSlider) this.btnValue).getValue());
		return configElement.requiresMcRestart();
	}
	return false;
}
 
开发者ID:Brian-Wuest,项目名称:MC-Prefab,代码行数:14,代码来源:GuiPrefab.java


示例8: SetSuffix

import net.minecraftforge.fml.client.config.ConfigGuiType; //导入依赖的package包/类
public void SetSuffix()
{
	IConfigElement configElement = this.parentEntry.getConfigElement();

	if (configElement.getType() == ConfigGuiType.INTEGER)
	{
		int currentValue = this.getValueInt();

		this.suffix = HouseConfiguration.GetIntegerOptionStringValue(configElement.getName(), currentValue);
	}
}
 
开发者ID:Brian-Wuest,项目名称:MC-Prefab,代码行数:12,代码来源:GuiPrefab.java


示例9: getType

import net.minecraftforge.fml.client.config.ConfigGuiType; //导入依赖的package包/类
private static ConfigGuiType getType(Class<?> type) {
  if(Integer.class.isAssignableFrom(type)) {
    return ConfigGuiType.INTEGER;
  }
  if(String.class.isAssignableFrom(type)) {
    return ConfigGuiType.STRING;
  }
  if(Double.class.isAssignableFrom(type)) {
    return ConfigGuiType.DOUBLE;
  }
  if(Boolean.class.isAssignableFrom(type)) {
    return ConfigGuiType.BOOLEAN;
  }
  return null;
}
 
开发者ID:SlimeKnights,项目名称:HarvestTweaks,代码行数:16,代码来源:ConfigFieldEntry.java


示例10: TCategoryElement

import net.minecraftforge.fml.client.config.ConfigGuiType; //导入依赖的package包/类
public TCategoryElement(String name, String langKey, List<IConfigElement> childElements, Class<? extends IConfigEntry> customListEntryClass)
{
    super(name, null, ConfigGuiType.CONFIG_CATEGORY, langKey);
    this.childElements = childElements;
    this.configEntryClass = customListEntryClass;
    isProperty = false;
}
 
开发者ID:fabbe50,项目名称:TFICore,代码行数:8,代码来源:TConfigElement.java


示例11: TListElement

import net.minecraftforge.fml.client.config.ConfigGuiType; //导入依赖的package包/类
public TListElement(String name, Object[] defaultValues, ConfigGuiType type, String langKey, boolean isListFixedLength, int maxListLength, Pattern validStringPattern, Object minValue, Object maxValue)
{
    super(name, null, type, langKey, minValue, maxValue);
    this.defaultValues = defaultValues;
    this.values = defaultValues;
    this.isListFixedLength = isListFixedLength;
    this.maxListLength = maxListLength;
    this.validStringPattern = validStringPattern;
    isList = true;
}
 
开发者ID:fabbe50,项目名称:TFICore,代码行数:11,代码来源:TConfigElement.java


示例12: TConfigElement

import net.minecraftforge.fml.client.config.ConfigGuiType; //导入依赖的package包/类
public TConfigElement(String name, Object defaultValue, ConfigGuiType type, String langKey, String[] validValues, Pattern validStringPattern, Object minValue, Object maxValue)
{
    this.name = name;
    this.defaultValue = defaultValue;
    this.value = defaultValue;
    this.type = type;
    this.langKey = langKey;
    this.validValues = validValues;
    this.validStringPattern = validStringPattern;
    if (minValue == null)
    {
        if (type == ConfigGuiType.INTEGER)
            this.minValue = Integer.MIN_VALUE;
        else if (type == ConfigGuiType.DOUBLE)
            this.minValue = -Double.MAX_VALUE;
    }
    else
        this.minValue = minValue;
    if (maxValue == null)
    {
        if (type == ConfigGuiType.INTEGER)
            this.maxValue = Integer.MAX_VALUE;
        else if (type == ConfigGuiType.DOUBLE)
            this.maxValue = Double.MAX_VALUE;
    }
    else
        this.maxValue = maxValue;
}
 
开发者ID:fabbe50,项目名称:TFICore,代码行数:29,代码来源:TConfigElement.java


示例13: getType

import net.minecraftforge.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


示例14: getConfigElements

import net.minecraftforge.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("imABoolean", true, ConfigGuiType.BOOLEAN, "fml.config.sample.imABoolean").setRequiresMcRestart(true));
    list.add(new DummyConfigElement("imAnInteger", 42, ConfigGuiType.INTEGER, "fml.config.sample.imAnInteger", -1, 256).setRequiresMcRestart(true));
    list.add(new DummyConfigElement("imADouble", 42.4242D, ConfigGuiType.DOUBLE, "fml.config.sample.imADouble", -1.0D, 256.256D).setRequiresMcRestart(true));
    list.add(new DummyConfigElement("imAString", "http://www.montypython.net/scripts/string.php", ConfigGuiType.STRING, "fml.config.sample.imAString").setRequiresMcRestart(true));
    
    // Lists category
    listsList.add(new DummyListElement("booleanList", new Boolean[] {true, false, true, false, true, false, true, false}, ConfigGuiType.BOOLEAN, "fml.config.sample.booleanList"));
    listsList.add(new DummyListElement("booleanListFixed", new Boolean[] {true, false, true, false, true, false, true, false}, ConfigGuiType.BOOLEAN, "fml.config.sample.booleanListFixed", true));
    listsList.add(new DummyListElement("booleanListMax", new Boolean[] {true, false, true, false, true, false, true, false}, ConfigGuiType.BOOLEAN, "fml.config.sample.booleanListMax", 10));
    listsList.add(new DummyListElement("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("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("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("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("integerList", new Integer[] {0, 1, 2, 3, 4, 5, 6, 7, 8, 9}, ConfigGuiType.INTEGER, "fml.config.sample.integerList"));
    listsList.add(new DummyListElement("integerListFixed", new Integer[] {0, 1, 2, 3, 4, 5, 6, 7, 8, 9}, ConfigGuiType.INTEGER, "fml.config.sample.integerListFixed", true));
    listsList.add(new DummyListElement("integerListMax", new Integer[] {0, 1, 2, 3, 4, 5, 6, 7, 8, 9}, ConfigGuiType.INTEGER, "fml.config.sample.integerListMax", 15));
    listsList.add(new DummyListElement("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("stringList", new String[] {"An", "array", "of", "string", "values"}, ConfigGuiType.STRING, "fml.config.sample.stringList"));
    listsList.add(new DummyListElement("stringListFixed", new String[] {"A", "fixed", "length", "array", "of", "string", "values"}, ConfigGuiType.STRING, "fml.config.sample.stringListFixed", true));
    listsList.add(new DummyListElement("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("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("basicString", "Just a regular String value, anything goes.", ConfigGuiType.STRING, "fml.config.sample.basicString"));
    stringsList.add(new DummyConfigElement("cycleString", "this", ConfigGuiType.STRING, "fml.config.sample.cycleString", new String[] {"this", "property", "cycles", "through", "a", "list", "of", "valid", "choices"}));
    stringsList.add(new DummyConfigElement("patternString", "only, comma, separated, words, can, be, entered, in, this, box", ConfigGuiType.STRING, "fml.config.sample.patternString", commaDelimitedPattern));
    stringsList.add(new DummyConfigElement("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("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("basicInteger", 42, ConfigGuiType.INTEGER, "fml.config.sample.basicInteger")));
    numbersList.add((new DummyConfigElement("boundedInteger", 42, ConfigGuiType.INTEGER, "fml.config.sample.boundedInteger", -1, 256)));
    numbersList.add((new DummyConfigElement("sliderInteger", 2000, ConfigGuiType.INTEGER, "fml.config.sample.sliderInteger", 100, 10000)).setCustomListEntryClass(NumberSliderEntry.class));
    numbersList.add(new DummyConfigElement("basicDouble", 42.4242D, ConfigGuiType.DOUBLE, "fml.config.sample.basicDouble"));
    numbersList.add(new DummyConfigElement("boundedDouble", 42.4242D, ConfigGuiType.DOUBLE, "fml.config.sample.boundedDouble", -1.0D, 256.256D));
    numbersList.add(new DummyConfigElement("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:F1r3w477,项目名称:CustomWorldGen,代码行数:55,代码来源:FMLConfigGuiFactory.java


示例15: getType

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


示例16: getType

import net.minecraftforge.fml.client.config.ConfigGuiType; //导入依赖的package包/类
@Override
public ConfigGuiType getType() {
	return ConfigGuiType.INTEGER;
}
 
开发者ID:OreCruncher,项目名称:DynamicSurroundings,代码行数:5,代码来源:SoundConfigEntry.java


示例17: getType

import net.minecraftforge.fml.client.config.ConfigGuiType; //导入依赖的package包/类
@Override
public ConfigGuiType getType()
{
    return type;
}
 
开发者ID:fabbe50,项目名称:TFICore,代码行数:6,代码来源:TConfigElement.java


示例18: FlagArrayElement

import net.minecraftforge.fml.client.config.ConfigGuiType; //导入依赖的package包/类
public FlagArrayElement(Property property, TIntSet config, int keyCode, String keyName) {
    super(keyName, config.contains(keyCode), ConfigGuiType.BOOLEAN, "");
    this.property = property;
    this.config = config;
    this.keyCode = keyCode;
}
 
开发者ID:boq,项目名称:ClicketyClack,代码行数:7,代码来源:KeyFilterConfig.java



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java ConditionalExpression类代码示例发布时间:2022-05-23
下一篇:
Java JNotify类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap