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


Java GuiYesNo类代码示例

本文整理汇总了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);
	}
}
 
开发者ID:Wurst-Imperium,项目名称:Wurst-MC-1.12,代码行数:18,代码来源:GuiMessage.java

示例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);
        }
    }
}
 
开发者ID:SkidJava,项目名称:BaseClient,代码行数:28,代码来源:GuiOtherSettingsOF.java

示例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();
            }
        }
    }
}
 
开发者ID:WurstSDK-Team,项目名称:WurstSDK,代码行数:25,代码来源:GuiWurstMainMenu.java

示例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");
}
 
开发者ID:null-dev,项目名称:EvenWurse,代码行数:25,代码来源:GuiAlts.java

示例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);
		}
	}
}
 
开发者ID:iTitus,项目名称:GimmeTime,代码行数:25,代码来源:GuiScreenAlarmConfig.java

示例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;
}
 
开发者ID:Wurst-Imperium,项目名称:Wurst-MC-1.12,代码行数:61,代码来源:GuiWurstMainMenu.java

示例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"));
}
 
开发者ID:Wurst-Imperium,项目名称:Wurst-MC-1.12,代码行数:29,代码来源:AltManagerScreen.java

示例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);
        }
    }
}
 
开发者ID:SkidJava,项目名称:BaseClient,代码行数:36,代码来源:GuiOtherSettingsOF.java

示例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));
}
 
开发者ID:rafradek,项目名称:Mods,代码行数:16,代码来源:ClientProxy.java

示例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));
    }
}
 
开发者ID:duke605,项目名称:DiscordCE,代码行数:40,代码来源:GuiServerList.java

示例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);
    }
}
 
开发者ID:null-dev,项目名称:EvenWurse,代码行数:14,代码来源:GuiMessage.java

示例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);
        }
    }
}
 
开发者ID:MinecraftModdedClients,项目名称:Resilience-Client-Source,代码行数:33,代码来源:GuiOtherSettingsOF.java

示例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);
        }
    }

}
 
开发者ID:iTitus,项目名称:MyMod,代码行数:31,代码来源:GuiScreenAlarmConfig.java

示例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_);
      }

   }
}
 
开发者ID:HATB0T,项目名称:RuneCraftery,代码行数:31,代码来源:GuiSelectWorld.java

示例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;
}
 
开发者ID:HATB0T,项目名称:RuneCraftery,代码行数:9,代码来源:GuiSelectWorld.java


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