本文整理汇总了Java中net.minecraft.client.gui.GuiYesNo类的典型用法代码示例。如果您正苦于以下问题:Java GuiYesNo类的具体用法?Java GuiYesNo怎么用?Java GuiYesNo使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
GuiYesNo类属于net.minecraft.client.gui包,在下文中一共展示了GuiYesNo类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: actionPerformed
import net.minecraft.client.gui.GuiYesNo; //导入依赖的package包/类
@Override
protected void actionPerformed(GuiButton button) throws IOException
{
if(button.id == buttons.entrySet().size())
{
if(cancel.equals("allowed"))
mc.displayGuiScreen(new GuiWurstMainMenu());
else if(cancel.equals("prompt"))
mc.displayGuiScreen(new GuiYesNo(this,
"Are you sure you want to cancel?", "", 0));
}else
{
MiscUtils.openLink(buttons.get(button.displayString).getAsString());
WurstClient.INSTANCE.analytics.trackEvent("message", "click",
"v" + WurstClient.VERSION, button.id);
}
}
示例2: actionPerformed
import net.minecraft.client.gui.GuiYesNo; //导入依赖的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);
}
}
}
示例3: enablePermissions
import net.minecraft.client.gui.GuiYesNo; //导入依赖的package包/类
private void enablePermissions(JavaPlugin pl) {
Iterator<Permission> permissions = pl.getPermissions().iterator();
AtomicBoolean done = new AtomicBoolean(false);
for (; permissions.hasNext(); ) {
done.set(false);
Permission permission = permissions.next();
currentPerm = permission;
mc.displayGuiScreen(new GuiYesNo((b, i) -> {
((WurstSDK) SDK.getClient()).getConfig().change(currentPl, currentPerm, b, token);
permissions.remove();
mc.displayGuiScreen(this);
done.set(true);
},
"'" + pl.getName() + "' Would Like to " + permission.getDescription(), "",
"OK", "Don't Allow", 99));
while (!done.get()) {
try {
Thread.sleep(100);
} catch (InterruptedException e) {
e.printStackTrace();
}
}
}
}
示例4: initGui
import net.minecraft.client.gui.GuiYesNo; //导入依赖的package包/类
@SuppressWarnings("unchecked")
@Override
public void initGui() {
altList = new GuiAltList(mc, this);
altList.registerScrollButtons(7, 8);
altList.elementClicked(-1, false, 0, 0);
if (GuiAltList.alts.isEmpty() && shouldAsk) {
mc.displayGuiScreen(
new GuiYesNo(this, "Your alt list is empty.", "Would you like some random alts to get started?",
0));
}
buttonList.clear();
buttonList.add(new GuiButton(0, width / 2 - 154, height - 52, 100, 20, "Use"));
buttonList.add(new GuiButton(1, width / 2 - 50, height - 52, 100, 20, "Direct Login"));
buttonList.add(new GuiButton(2, width / 2 + 54, height - 52, 100, 20, "Add"));
buttonList.add(new GuiButton(3, width / 2 - 154, height - 28, 75, 20, "Star"));
buttonList.add(new GuiButton(4, width / 2 - 76, height - 28, 74, 20, "Edit"));
buttonList.add(new GuiButton(5, width / 2 + 2, height - 28, 74, 20, "Delete"));
buttonList.add(new GuiButton(6, width / 2 + 80, height - 28, 75, 20, "Cancel"));
buttonList.add(new GuiButton(8, width - 108, 8, 100, 20, "Session Stealer"));
buttonList.add(new GuiButton(7, 8, 8, 100, 20, "Import Alts"));
WurstClient.INSTANCE.analytics.trackPageView("/alt-manager/", "Alt Manager");
}
示例5: actionPerformed
import net.minecraft.client.gui.GuiYesNo; //导入依赖的package包/类
@Override
protected void actionPerformed(GuiButton button) {
IGuiListEntry entry = alarmList.getListEntry(alarmList.getSelected());
if (button.enabled) {
switch (button.id) {
case 0:
if (entry == null)
break;
case 1:
mc.displayGuiScreen(new GuiScreenEditAlarm(this, ((button.id == 0 && entry instanceof GuiAlarmEntry) ? (((GuiAlarmEntry) entry).getAlarm()) : null), button.id == 1));
break;
case 2:
if (entry instanceof GuiAlarmEntry)
mc.displayGuiScreen(new GuiYesNo(
this,
StatCollector.translateToLocal("gui.alarmConfig.delete.question"),
StatCollector.translateToLocalFormatted(((GuiAlarmEntry) entry).getAlarm().getTitle()),
alarmList.getSelected()));
break;
default:
mc.displayGuiScreen(parent);
}
}
}
示例6: updateScreen
import net.minecraft.client.gui.GuiYesNo; //导入依赖的package包/类
@Override
public void updateScreen()
{
super.updateScreen();
// updater
if(startupMessageDisabled)
return;
if(WurstClient.INSTANCE.updater.isOutdated())
{
WurstClient.INSTANCE.analytics.trackEvent("updater",
"update to v" + WurstClient.INSTANCE.updater.getLatestVersion(),
"from " + WurstClient.VERSION);
WurstClient.INSTANCE.updater.update();
startupMessageDisabled = true;
}
// emergency message
if(startupMessageDisabled)
return;
try
{
HttpsURLConnection connection = (HttpsURLConnection)new URL(
"https://www.wurstclient.net/api/v1/messages.json")
.openConnection();
connection.connect();
JsonObject json = JsonUtils.jsonParser
.parse(
new InputStreamReader(connection.getInputStream(), "UTF-8"))
.getAsJsonObject();
if(json.get(WurstClient.VERSION) != null)
{
System.out.println("Emergency message found!");
mc.displayGuiScreen(new GuiMessage(
json.get(WurstClient.VERSION).getAsJsonObject()));
startupMessageDisabled = true;
}
}catch(Exception e)
{
e.printStackTrace();
}
// changelog
if(startupMessageDisabled)
return;
if(!WurstClient.VERSION
.equals(WurstClient.INSTANCE.options.lastLaunchedVersion))
{
mc.displayGuiScreen(new GuiYesNo(this,
"Successfully updated to Wurst v" + WurstClient.VERSION, "",
"Go Play", "View Changelog", 64));
WurstClient.INSTANCE.options.lastLaunchedVersion =
WurstClient.VERSION;
ConfigFiles.OPTIONS.save();
}
startupMessageDisabled = true;
}
示例7: initGui
import net.minecraft.client.gui.GuiYesNo; //导入依赖的package包/类
@Override
public void initGui()
{
altList = new GuiAltList(mc, this);
altList.registerScrollButtons(7, 8);
altList.elementClicked(-1, false, 0, 0);
if(GuiAltList.alts.isEmpty() && shouldAsk)
mc.displayGuiScreen(new GuiYesNo(this, "Your alt list is empty.",
"Would you like some random alts to get started?", 0));
buttonList.clear();
buttonList.add(
new GuiButton(0, width / 2 - 154, height - 52, 100, 20, "Use"));
buttonList.add(new GuiButton(1, width / 2 - 50, height - 52, 100, 20,
"Direct Login"));
buttonList
.add(new GuiButton(2, width / 2 + 54, height - 52, 100, 20, "Add"));
buttonList.add(
new GuiButton(3, width / 2 - 154, height - 28, 75, 20, "Star"));
buttonList
.add(new GuiButton(4, width / 2 - 76, height - 28, 74, 20, "Edit"));
buttonList.add(
new GuiButton(5, width / 2 + 2, height - 28, 74, 20, "Delete"));
buttonList.add(
new GuiButton(6, width / 2 + 80, height - 28, 75, 20, "Cancel"));
buttonList.add(new GuiButton(7, 8, 8, 100, 20, "Import Alts"));
}
示例8: actionPerformed
import net.minecraft.client.gui.GuiYesNo; //导入依赖的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, "Reset all video settings to their default values?", "", 9999);
this.mc.displayGuiScreen(guiyesno);
}
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);
}
}
}
示例9: displayScreenJoinTeam
import net.minecraft.client.gui.GuiYesNo; //导入依赖的package包/类
public static void displayScreenJoinTeam() {
final GuiScreen prevScreen = Minecraft.getMinecraft().currentScreen;
Minecraft.getMinecraft().displayGuiScreen(new GuiYesNo(new GuiYesNoCallback() {
@Override
public void confirmClicked(boolean result, int id) {
if (result)
TF2weapons.network.sendToServer(new TF2Message.ActionMessage(16));
else
TF2weapons.network.sendToServer(new TF2Message.ActionMessage(17));
Minecraft.getMinecraft().displayGuiScreen(prevScreen);
}
}, "Choose your team", "Before using the store, you need to join a team", "RED", "BLU", 0));
}
示例10: actionPerformed
import net.minecraft.client.gui.GuiYesNo; //导入依赖的package包/类
protected void actionPerformed(GuiButton button)
{
GuiListButton b = (GuiListButton) button;
// Muting server
if (b.id == 0)
{
if (!Preferences.i.mutedGuilds.contains(guild.getId()))
Preferences.i.mutedGuilds.add(guild.getId());
else
Preferences.i.mutedGuilds.remove(guild.getId());
b.displayString = Preferences.i.mutedGuilds.contains(guild.getId())
? TextFormatting.RED + "Unmute"
: "Mute";
}
// Leaving server
else if (b.id == 1)
{
GuiYesNo yn = new GuiYesNo((result, id) ->
{
// leaving guild
if (result)
guild.getManager().leave();
mc.displayGuiScreen(guiServers);
}
, "Are you sure you want to leave " + guild.getName() + "?"
, "You'll have to get an invite link to join again."
, 0);
mc.displayGuiScreen(yn);
}
// Showing channels for guild
if (b.id == 2)
{
mc.displayGuiScreen(new GuiChannels(guiServers, guild));
}
}
示例11: actionPerformed
import net.minecraft.client.gui.GuiYesNo; //导入依赖的package包/类
@Override
protected void actionPerformed(GuiButton button) throws IOException {
if (button.id == buttons.entrySet().size()) {
if (cancel.equals("allowed")) {
mc.displayGuiScreen(new GuiWurstMainMenu());
} else if (cancel.equals("prompt")) {
mc.displayGuiScreen(new GuiYesNo(this, "Are you sure you want to cancel?", "", 0));
}
} else {
MiscUtils.openLink(buttons.get(button.displayString).getAsString());
WurstClient.INSTANCE.analytics.trackEvent("message", "click", "v" + WurstClient.VERSION, button.id);
}
}
示例12: actionPerformed
import net.minecraft.client.gui.GuiYesNo; //导入依赖的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 == 210)
{
this.mc.gameSettings.saveOptions();
GuiYesNo scaledresolution = new GuiYesNo(this, "Reset all video settings to their default values?", "", 9999);
this.mc.displayGuiScreen(scaledresolution);
}
if (guibutton.id != GameSettings.Options.CLOUD_HEIGHT.ordinal())
{
ScaledResolution scaledresolution1 = new ScaledResolution(this.mc.gameSettings, this.mc.displayWidth, this.mc.displayHeight);
int i = scaledresolution1.getScaledWidth();
int j = scaledresolution1.getScaledHeight();
this.setWorldAndResolution(this.mc, i, j);
}
}
}
示例13: actionPerformed
import net.minecraft.client.gui.GuiYesNo; //导入依赖的package包/类
@Override
protected void actionPerformed(GuiButton button) {
if (button.enabled) {
switch (button.id) {
case 0:
case 1:
GuiAlarm guiAlarm = (GuiAlarm) alarmList.getListEntry(alarmList
.getSelected());
mc.displayGuiScreen(new GuiScreenEditAlarm(this, alarmList
.getSelected(), ((guiAlarm != null) ? (guiAlarm
.getAlarm()) : null), button.id == 1));
break;
case 2:
mc.displayGuiScreen(new GuiYesNo(
this,
StatCollector
.translateToLocal("gui.alarmConfig.delete.question"),
StatCollector.translateToLocalFormatted(
"gui.alarmConfig.delete.warning",
((GuiAlarm) alarmList.getListEntry(alarmList
.getSelected())).getAlarm().getTitle()),
alarmList.getSelected()));
break;
default:
mc.displayGuiScreen(parent);
}
}
}
示例14: func_73875_a
import net.minecraft.client.gui.GuiYesNo; //导入依赖的package包/类
protected void func_73875_a(GuiButton p_73875_1_) {
if(p_73875_1_.field_73742_g) {
if(p_73875_1_.field_73741_f == 2) {
String var2 = this.func_74063_d(this.field_74080_m);
if(var2 != null) {
this.field_74084_s = true;
GuiYesNo var3 = func_74061_a(this, var2, this.field_74080_m);
this.field_73882_e.func_71373_a(var3);
}
} else if(p_73875_1_.field_73741_f == 1) {
this.func_74064_e(this.field_74080_m);
} else if(p_73875_1_.field_73741_f == 3) {
this.field_73882_e.func_71373_a(new GuiCreateWorld(this));
} else if(p_73875_1_.field_73741_f == 6) {
this.field_73882_e.func_71373_a(new GuiRenameWorld(this, this.func_74069_a(this.field_74080_m)));
} else if(p_73875_1_.field_73741_f == 0) {
this.field_73882_e.func_71373_a(this.field_74077_a);
} else if(p_73875_1_.field_73741_f == 7) {
GuiCreateWorld var5 = new GuiCreateWorld(this);
ISaveHandler var6 = this.field_73882_e.func_71359_d().func_75804_a(this.func_74069_a(this.field_74080_m), false);
WorldInfo var4 = var6.func_75757_d();
var6.func_75759_a();
var5.func_82286_a(var4);
this.field_73882_e.func_71373_a(var5);
} else {
this.field_74079_o.func_77219_a(p_73875_1_);
}
}
}
示例15: func_74061_a
import net.minecraft.client.gui.GuiYesNo; //导入依赖的package包/类
public static GuiYesNo func_74061_a(GuiScreen p_74061_0_, String p_74061_1_, int p_74061_2_) {
String var3 = I18n.func_135053_a("selectWorld.deleteQuestion");
String var4 = "\'" + p_74061_1_ + "\' " + I18n.func_135053_a("selectWorld.deleteWarning");
String var5 = I18n.func_135053_a("selectWorld.deleteButton");
String var6 = I18n.func_135053_a("gui.cancel");
GuiYesNo var7 = new GuiYesNo(p_74061_0_, var3, var4, var5, var6, p_74061_2_);
return var7;
}