Search in sources :

Example 1 with GuiYesNo

use of net.minecraft.client.gui.GuiYesNo in project Minestuck by mraof.

the class SylladexGuiHandler method actionPerformed.

@Override
protected void actionPerformed(GuiButton button) throws IOException {
    if (button == emptySylladex) {
        mc.currentScreen = new GuiYesNo(this, I18n.format("gui.emptySylladex1"), I18n.format("gui.emptySylladex2"), 0);
        mc.currentScreen.setWorldAndResolution(mc, width, height);
    }
}
Also used : GuiYesNo(net.minecraft.client.gui.GuiYesNo)

Example 2 with GuiYesNo

use of net.minecraft.client.gui.GuiYesNo in project BetterQuesting by Funwayguy.

the class GuiGameOverBQ method actionPerformed.

protected void actionPerformed(GuiButton button) {
    switch(button.id) {
        case 0:
            this.mc.player.respawnPlayer();
            this.mc.displayGuiScreen(null);
            break;
        case 1:
            if (this.mc.world.getWorldInfo().isHardcoreModeEnabled()) {
                this.mc.displayGuiScreen(new GuiMainMenu());
            } else {
                GuiYesNo guiyesno = new GuiYesNo(this, I18n.format("deathScreen.quit.confirm"), "", I18n.format("deathScreen.titleScreen"), I18n.format("deathScreen.respawn"), 0);
                this.mc.displayGuiScreen(guiyesno);
                guiyesno.setButtonDelay(20);
            }
    }
}
Also used : GuiYesNo(net.minecraft.client.gui.GuiYesNo) GuiMainMenu(net.minecraft.client.gui.GuiMainMenu)

Example 3 with GuiYesNo

use of net.minecraft.client.gui.GuiYesNo in project Wurst-MC-1.12 by Wurst-Imperium.

the class AltManagerScreen method initGui.

@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"));
}
Also used : GuiYesNo(net.minecraft.client.gui.GuiYesNo) GuiButton(net.minecraft.client.gui.GuiButton)

Example 4 with GuiYesNo

use of net.minecraft.client.gui.GuiYesNo in project Wurst-MC-1.12 by Wurst-Imperium.

the class GuiMessage method actionPerformed.

@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);
    }
}
Also used : GuiYesNo(net.minecraft.client.gui.GuiYesNo)

Example 5 with GuiYesNo

use of net.minecraft.client.gui.GuiYesNo in project Wurst-MC-1.12 by Wurst-Imperium.

the class GuiWurstMainMenu method updateScreen.

@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;
}
Also used : GuiYesNo(net.minecraft.client.gui.GuiYesNo) InputStreamReader(java.io.InputStreamReader) JsonObject(com.google.gson.JsonObject) HttpsURLConnection(javax.net.ssl.HttpsURLConnection) URL(java.net.URL) IOException(java.io.IOException)

Aggregations

GuiYesNo (net.minecraft.client.gui.GuiYesNo)10 IOException (java.io.IOException)2 GuiMainMenu (net.minecraft.client.gui.GuiMainMenu)2 CavernAPI (cavern.api.CavernAPI)1 IIceEquipment (cavern.api.IIceEquipment)1 RandomiteHelper (cavern.block.RandomiteHelper)1 CaveKeyBindings (cavern.client.CaveKeyBindings)1 GuiDownloadCaveTerrain (cavern.client.gui.GuiDownloadCaveTerrain)1 GuiLoadCaveTerrain (cavern.client.gui.GuiLoadCaveTerrain)1 GuiMiningRecords (cavern.client.gui.GuiMiningRecords)1 DelayedToast (cavern.client.gui.toasts.DelayedToast)1 AquaCavernConfig (cavern.config.AquaCavernConfig)1 CavelandConfig (cavern.config.CavelandConfig)1 CaveniaConfig (cavern.config.CaveniaConfig)1 CavernConfig (cavern.config.CavernConfig)1 Config (cavern.config.Config)1 DisplayConfig (cavern.config.DisplayConfig)1 GeneralConfig (cavern.config.GeneralConfig)1 HugeCavernConfig (cavern.config.HugeCavernConfig)1 MiningAssistConfig (cavern.config.MiningAssistConfig)1