本文整理汇总了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());
}
}
}
示例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);
}
}
}
示例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])));
}
示例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);
}
}
}
示例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])));
}
示例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);
}
}
}
示例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])));
}
示例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])));
}
示例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);
}
}
}
示例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;
}
}
示例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));
}
示例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])));
}
示例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());
}
}
示例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));
}
示例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);
}
}
}