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


Java GuiOptionButton类代码示例

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


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

示例1: actionPerformed

import net.minecraft.client.gui.GuiOptionButton; //导入依赖的package包/类
/**
 * Called by the controls from the buttonList when activated. (Mouse pressed for buttons)
 */
protected void actionPerformed(GuiButton button)
{
    if (button.enabled)
    {
        if (button.id < 200 && button instanceof GuiOptionButton)
        {
            this.settings.setOptionValue(((GuiOptionButton)button).returnEnumOptions(), 1);
            button.displayString = this.settings.getKeyBinding(GameSettings.Options.getEnumOptions(button.id));
        }

        if (button.id == 200)
        {
            this.mc.gameSettings.saveOptions();
            this.mc.displayGuiScreen(this.prevScreen);
        }

        if (button.id != GameSettings.Options.AA_LEVEL.ordinal())
        {
            ScaledResolution scaledresolution = new ScaledResolution(this.mc);
            this.setWorldAndResolution(this.mc, scaledresolution.getScaledWidth(), scaledresolution.getScaledHeight());
        }
    }
}
 
开发者ID:SkidJava,项目名称:BaseClient,代码行数:27,代码来源:GuiQualitySettingsOF.java

示例2: actionPerformed

import net.minecraft.client.gui.GuiOptionButton; //导入依赖的package包/类
/**
 * Called by the controls from the buttonList when activated. (Mouse pressed for buttons)
 */
protected void actionPerformed(GuiButton button)
{
    if (button.enabled)
    {
        if (button.id < 200 && button instanceof GuiOptionButton)
        {
            this.settings.setOptionValue(((GuiOptionButton)button).returnEnumOptions(), 1);
            button.displayString = this.settings.getKeyBinding(GameSettings.Options.getEnumOptions(button.id));
        }

        if (button.id == 200)
        {
            this.mc.gameSettings.saveOptions();
            this.mc.displayGuiScreen(this.prevScreen);
        }
    }
}
 
开发者ID:SkidJava,项目名称:BaseClient,代码行数:21,代码来源:GuiDetailSettingsOF.java

示例3: initGui

import net.minecraft.client.gui.GuiOptionButton; //导入依赖的package包/类
/**
 * Adds the buttons (and other controls) to the screen in question. Called when the GUI is displayed and when the
 * window resizes, the buttonList is cleared beforehand.
 */
public void initGui()
{
    this.title = I18n.format("of.options.animationsTitle", new Object[0]);
    this.buttonList.clear();

    for (int i = 0; i < enumOptions.length; ++i)
    {
        GameSettings.Options gamesettings$options = enumOptions[i];
        int j = this.width / 2 - 155 + i % 2 * 160;
        int k = this.height / 6 + 21 * (i / 2) - 12;

        if (!gamesettings$options.getEnumFloat())
        {
            this.buttonList.add(new GuiOptionButtonOF(gamesettings$options.returnEnumOrdinal(), j, k, gamesettings$options, this.settings.getKeyBinding(gamesettings$options)));
        }
        else
        {
            this.buttonList.add(new GuiOptionSliderOF(gamesettings$options.returnEnumOrdinal(), j, k, gamesettings$options));
        }
    }

    this.buttonList.add(new GuiButton(210, this.width / 2 - 155, this.height / 6 + 168 + 11, 70, 20, Lang.get("of.options.animation.allOn")));
    this.buttonList.add(new GuiButton(211, this.width / 2 - 155 + 80, this.height / 6 + 168 + 11, 70, 20, Lang.get("of.options.animation.allOff")));
    this.buttonList.add(new GuiOptionButton(200, this.width / 2 + 5, this.height / 6 + 168 + 11, I18n.format("gui.done", new Object[0])));
}
 
开发者ID:SkidJava,项目名称:BaseClient,代码行数:30,代码来源:GuiAnimationSettingsOF.java

示例4: actionPerformed

import net.minecraft.client.gui.GuiOptionButton; //导入依赖的package包/类
/**
 * Called by the controls from the buttonList when activated. (Mouse pressed for buttons)
 */
protected void actionPerformed(GuiButton button)
{
    if (button.enabled)
    {
        if (button.id < 200 && button instanceof GuiOptionButton)
        {
            this.settings.setOptionValue(((GuiOptionButton)button).returnEnumOptions(), 1);
            button.displayString = this.settings.getKeyBinding(GameSettings.Options.getEnumOptions(button.id));
        }

        if (button.id == 200)
        {
            this.mc.gameSettings.saveOptions();
            this.mc.displayGuiScreen(this.prevScreen);
        }

        if (button.id == 210)
        {
            this.mc.gameSettings.saveOptions();
            GuiYesNo guiyesno = new GuiYesNo(this, I18n.format("of.message.other.reset", new Object[0]), "", 9999);
            this.mc.displayGuiScreen(guiyesno);
        }
    }
}
 
开发者ID:SkidJava,项目名称:BaseClient,代码行数:28,代码来源:GuiOtherSettingsOF.java

示例5: initGui

import net.minecraft.client.gui.GuiOptionButton; //导入依赖的package包/类
/**
 * Adds the buttons (and other controls) to the screen in question. Called when the GUI is displayed and when the
 * window resizes, the buttonList is cleared beforehand.
 */
public void initGui()
{
    int i = 0;

    for (GameSettings.Options gamesettings$options : enumOptions)
    {
        int j = this.width / 2 - 155 + i % 2 * 160;
        int k = this.height / 6 + 21 * (i / 2) - 10;

        if (!gamesettings$options.getEnumFloat())
        {
            this.buttonList.add(new GuiOptionButton(gamesettings$options.returnEnumOrdinal(), j, k, gamesettings$options, this.settings.getKeyBinding(gamesettings$options)));
        }
        else
        {
            this.buttonList.add(new GuiOptionSlider(gamesettings$options.returnEnumOrdinal(), j, k, gamesettings$options));
        }

        ++i;
    }

    this.buttonList.add(new GuiButton(200, this.width / 2 - 100, this.height / 6 + 168 + 11, I18n.format("gui.done", new Object[0])));
}
 
开发者ID:SkidJava,项目名称:BaseClient,代码行数:28,代码来源:GuiQualitySettingsOF.java

示例6: actionPerformed

import net.minecraft.client.gui.GuiOptionButton; //导入依赖的package包/类
/**
 * Called by the controls from the buttonList when activated. (Mouse pressed for buttons)
 */
protected void actionPerformed(GuiButton button)
{
    if (button.enabled)
    {
        if (button.id < 200 && button instanceof GuiOptionButton)
        {
            this.settings.setOptionValue(((GuiOptionButton)button).returnEnumOptions(), 1);
            button.displayString = this.settings.getKeyBinding(GameSettings.Options.getEnumOptions(button.id));
        }

        if (button.id == 200)
        {
            this.mc.gameSettings.saveOptions();
            this.mc.displayGuiScreen(this.prevScreen);
        }

        if (button.id != GameSettings.Options.CLOUD_HEIGHT.ordinal())
        {
            ScaledResolution scaledresolution = new ScaledResolution(this.mc);
            int i = scaledresolution.getScaledWidth();
            int j = scaledresolution.getScaledHeight();
            this.setWorldAndResolution(this.mc, i, j);
        }
    }
}
 
开发者ID:SkidJava,项目名称:BaseClient,代码行数:29,代码来源:GuiQualitySettingsOF.java

示例7: initGui

import net.minecraft.client.gui.GuiOptionButton; //导入依赖的package包/类
/**
 * Adds the buttons (and other controls) to the screen in question. Called when the GUI is displayed and when the
 * window resizes, the buttonList is cleared beforehand.
 */
public void initGui()
{
    int i = 0;

    for (GameSettings.Options gamesettings$options : enumOptions)
    {
        int j = this.width / 2 - 155 + i % 2 * 160;
        int k = this.height / 6 + 21 * (i / 2) - 10;

        if (!gamesettings$options.getEnumFloat())
        {
            this.buttonList.add(new GuiOptionButton(gamesettings$options.returnEnumOrdinal(), j, k, gamesettings$options, this.settings.getKeyBinding(gamesettings$options)));
        }
        else
        {
            this.buttonList.add(new GuiOptionSlider(gamesettings$options.returnEnumOrdinal(), j, k, gamesettings$options));
        }

        ++i;
    }

    this.buttonList.add(new GuiButton(210, this.width / 2 - 155, this.height / 6 + 168 + 11, 70, 20, "All ON"));
    this.buttonList.add(new GuiButton(211, this.width / 2 - 155 + 80, this.height / 6 + 168 + 11, 70, 20, "All OFF"));
    this.buttonList.add(new GuiOptionButton(200, this.width / 2 + 5, this.height / 6 + 168 + 11, I18n.format("gui.done", new Object[0])));
}
 
开发者ID:SkidJava,项目名称:BaseClient,代码行数:30,代码来源:GuiAnimationSettingsOF.java

示例8: initGui

import net.minecraft.client.gui.GuiOptionButton; //导入依赖的package包/类
/**
 * Adds the buttons (and other controls) to the screen in question. Called when the GUI is displayed and when the
 * window resizes, the buttonList is cleared beforehand.
 */
public void initGui()
{
    int i = 0;

    for (GameSettings.Options gamesettings$options : enumOptions)
    {
        int j = this.width / 2 - 155 + i % 2 * 160;
        int k = this.height / 6 + 21 * (i / 2) - 10;

        if (!gamesettings$options.getEnumFloat())
        {
            this.buttonList.add(new GuiOptionButton(gamesettings$options.returnEnumOrdinal(), j, k, gamesettings$options, this.settings.getKeyBinding(gamesettings$options)));
        }
        else
        {
            this.buttonList.add(new GuiOptionSlider(gamesettings$options.returnEnumOrdinal(), j, k, gamesettings$options));
        }

        ++i;
    }

    this.buttonList.add(new GuiButton(210, this.width / 2 - 100, this.height / 6 + 168 + 11 - 44, "Reset Video Settings..."));
    this.buttonList.add(new GuiButton(200, this.width / 2 - 100, this.height / 6 + 168 + 11, I18n.format("gui.done", new Object[0])));
}
 
开发者ID:SkidJava,项目名称:BaseClient,代码行数:29,代码来源:GuiOtherSettingsOF.java

示例9: actionPerformed

import net.minecraft.client.gui.GuiOptionButton; //导入依赖的package包/类
protected void actionPerformed(GuiButton guibutton)
{
    if (guibutton.enabled)
    {
        if (guibutton.id < 200 && guibutton instanceof GuiOptionButton)
        {
            this.settings.setOptionValue(((GuiOptionButton)guibutton).func_146136_c(), 1);
            guibutton.displayString = this.settings.getKeyBinding(GameSettings.Options.getEnumOptions(guibutton.id));
        }

        if (guibutton.id == 200)
        {
            this.mc.gameSettings.saveOptions();
            this.mc.displayGuiScreen(this.prevScreen);
        }

        if (guibutton.id != GameSettings.Options.CLOUD_HEIGHT.ordinal())
        {
            ScaledResolution scaledresolution = new ScaledResolution(this.mc.gameSettings, this.mc.displayWidth, this.mc.displayHeight);
            int i = scaledresolution.getScaledWidth();
            int j = scaledresolution.getScaledHeight();
            this.setWorldAndResolution(this.mc, i, j);
        }
    }
}
 
开发者ID:MinecraftModdedClients,项目名称:Resilience-Client-Source,代码行数:26,代码来源:GuiQualitySettingsOF.java

示例10: mousePressed

import net.minecraft.client.gui.GuiOptionButton; //导入依赖的package包/类
/**
 * Returns true if the mouse has been pressed on this control.
 */
@Override
public boolean mousePressed(int p_148278_1_, int p_148278_2_, int p_148278_3_, int p_148278_4_, int p_148278_5_, int p_148278_6_) {
	if (this.field_148323_b.mousePressed(this.field_148325_a, p_148278_2_, p_148278_3_)) {
		if (this.field_148323_b instanceof GuiOptionButton) {
			this.field_148325_a.gameSettings.setOptionValue(((GuiOptionButton) this.field_148323_b).returnEnumOptions(), 1);
			//this.field_148323_b.displayString = this.field_148325_a.gameSettings.getKeyBinding(NausicaaGameSettings.Options.getEnumOptions(this.field_148323_b.id));
		}

		return true;
	} else if (this.field_148324_c != null && this.field_148324_c.mousePressed(this.field_148325_a, p_148278_2_, p_148278_3_)) {
		if (this.field_148324_c instanceof GuiOptionButton) {
			this.field_148325_a.gameSettings.setOptionValue(((GuiOptionButton) this.field_148324_c).returnEnumOptions(), 1);
		//	this.field_148324_c.displayString = this.field_148325_a.gameSettings.getKeyBinding(NausicaaGameSettings.Options.getEnumOptions(this.field_148324_c.id));
		}

		return true;
	} else {
		return false;
	}
}
 
开发者ID:mookie1097,项目名称:NausicaaMod,代码行数:24,代码来源:NausicaaGuiOptionsRowList.java

示例11: initGui

import net.minecraft.client.gui.GuiOptionButton; //导入依赖的package包/类
@SuppressWarnings("unchecked")
public void initGui() {
	w = this.width;
	h = this.height;
	btnW = w / 4;
	btnH = this.fontRendererObj.FONT_HEIGHT * 2;
	fH = this.fontRendererObj.FONT_HEIGHT;
	this.buttonList.clear();
	this.buttonList.add(new GuiOptionButton(0, w / 2 + btnW / 2, h / 4 - 60 + 50 - btnH / 2 + (btnH + fH / 2) * 0, btnW, btnH, Setting.displayAdvInfoMob ? "ON" : "OFF"));
	this.buttonList.add(new CustomGuiOptionSlider(1, w / 2 + btnW / 2, h / 4 - 60 + 50 - btnH / 2 + (btnH + fH / 2) * 1, btnW, btnH, StatCollector.translateToLocal("smartcursor.gui.heartCount"), 5F, 50F, 1F,
			(float) Setting.maxHeartCount, this));
	this.buttonList.add(new GuiOptionButton(2, w / 2 + btnW / 2, h / 4 - 60 + 50 - btnH / 2 + (btnH + fH / 2) * 2, btnW, btnH, renderHandler.getDropStyleName()));
	this.buttonList.add(new CustomGuiOptionSlider(3, w / 2 + btnW / 2, h / 4 - 60 + 50 - btnH / 2 + (btnH + fH / 2) * 3, btnW, btnH, StatCollector.translateToLocal("smartcursor.gui.distance"), 1F, 100F, 1F,
			(float) Setting.lookDistance, this));
	this.buttonList
			.add(new CustomGuiOptionSlider(4, w / 2 + btnW / 2, h / 4 - 60 + 50 - btnH / 2 + (btnH + fH / 2) * 4, btnW, btnH, StatCollector.translateToLocal("smartcursor.gui.transparent"), 0F, 255F, 1F, Setting.transparent, this));
	this.buttonList.add(new GuiOptionButton(5, w / 2 + btnW / 2, h / 4 - 60 + 50 - btnH / 2 + (btnH + fH / 2) * 5, btnW, btnH, renderHandler.getPlayerStyleName()));
	this.buttonList.add(new GuiOptionButton(6, w / 2 + btnW / 2, h / 4 - 60 + 50 - btnH / 2 + (btnH + fH / 2) * 6, btnW, btnH, Setting.showTooltipInRightCorner ? StatCollector.translateToLocal("smartcursor.gui.rightCorner")
			: StatCollector.translateToLocal("smartcursor.gui.leftCorner")));
	this.buttonList.add(new CustomGuiOptionSlider(7, w / 2 + btnW / 2, h / 4 - 60 + 50 - btnH / 2 + (btnH + fH / 2) * 7, btnW, btnH, StatCollector.translateToLocal("smartcursor.gui.tooltipDelta"), 0F, 5000F, 1F, (float) Setting.delta,
			this));
}
 
开发者ID:asaskevich,项目名称:SmartCursor,代码行数:23,代码来源:GuiAdvancedSettings.java

示例12: initGui

import net.minecraft.client.gui.GuiOptionButton; //导入依赖的package包/类
/**
 * Adds the buttons (and other controls) to the screen in question. Called when the GUI is displayed and when the
 * window resizes, the buttonList is cleared beforehand.
 */
public void initGui()
{
    this.mc.getNetHandler().addToSendQueue(new C16PacketClientStatus(C16PacketClientStatus.EnumState.REQUEST_STATS));
    this.buttonList.clear();
    this.buttonList.add(new GuiOptionButton(1, this.width / 2 + 24, this.height / 2 + 74, 80, 20, I18n.format("gui.done", new Object[0])));
}
 
开发者ID:Notoh,项目名称:DecompiledMinecraft,代码行数:11,代码来源:GuiAchievements.java

示例13: actionPerformed

import net.minecraft.client.gui.GuiOptionButton; //导入依赖的package包/类
/**
 * Called by the controls from the buttonList when activated. (Mouse pressed for buttons)
 */
protected void actionPerformed(GuiButton button)
{
    if (button.enabled)
    {
        if (button.id < 200 && button instanceof GuiOptionButton)
        {
            this.settings.setOptionValue(((GuiOptionButton)button).returnEnumOptions(), 1);
            button.displayString = this.settings.getKeyBinding(GameSettings.Options.getEnumOptions(button.id));
        }

        if (button.id == 200)
        {
            this.mc.gameSettings.saveOptions();
            this.mc.displayGuiScreen(this.prevScreen);
        }

        if (button.id == 210)
        {
            this.mc.gameSettings.setAllAnimations(true);
        }

        if (button.id == 211)
        {
            this.mc.gameSettings.setAllAnimations(false);
        }

        ScaledResolution scaledresolution = new ScaledResolution(this.mc);
        this.setWorldAndResolution(this.mc, scaledresolution.getScaledWidth(), scaledresolution.getScaledHeight());
    }
}
 
开发者ID:SkidJava,项目名称:BaseClient,代码行数:34,代码来源:GuiAnimationSettingsOF.java

示例14: initGui

import net.minecraft.client.gui.GuiOptionButton; //导入依赖的package包/类
/**
 * Adds the buttons (and other controls) to the screen in question. Called when the GUI is displayed and when the
 * window resizes, the buttonList is cleared beforehand.
 */
public void initGui()
{
    this.buttonList.add(new GuiOptionButton(0, this.width / 2 - 74, this.height / 6 + 96, this.confirmButtonText));
    this.listLines2.clear();
    this.listLines2.addAll(this.fontRendererObj.listFormattedStringToWidth(this.messageLine2, this.width - 50));
}
 
开发者ID:SkidJava,项目名称:BaseClient,代码行数:11,代码来源:GuiMessage.java

示例15: actionPerformed

import net.minecraft.client.gui.GuiOptionButton; //导入依赖的package包/类
/**
 * Called by the controls from the buttonList when activated. (Mouse pressed for buttons)
 */
protected void actionPerformed(GuiButton button)
{
    if (button.enabled)
    {
        if (button.id < 200 && button instanceof GuiOptionButton)
        {
            this.settings.setOptionValue(((GuiOptionButton)button).returnEnumOptions(), 1);
            button.displayString = this.settings.getKeyBinding(GameSettings.Options.getEnumOptions(button.id));
        }

        if (button.id == 200)
        {
            this.mc.gameSettings.saveOptions();
            this.mc.displayGuiScreen(this.prevScreen);
        }

        if (button.id == 210)
        {
            this.mc.gameSettings.setAllAnimations(true);
        }

        if (button.id == 211)
        {
            this.mc.gameSettings.setAllAnimations(false);
        }

        if (button.id != GameSettings.Options.CLOUD_HEIGHT.ordinal())
        {
            ScaledResolution scaledresolution = new ScaledResolution(this.mc);
            int i = scaledresolution.getScaledWidth();
            int j = scaledresolution.getScaledHeight();
            this.setWorldAndResolution(this.mc, i, j);
        }
    }
}
 
开发者ID:SkidJava,项目名称:BaseClient,代码行数:39,代码来源:GuiAnimationSettingsOF.java


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