Search in sources :

Example 1 with CreateServerButton

use of cc.hyperium.gui.util.CreateServerButton in project Hyperium by HyperiumClient.

the class GuiHyperiumScreenMainMenu method actionPerformed.

@Override
public void actionPerformed(GuiButton button) {
    switch(button.id) {
        case 0:
            Hyperium.INSTANCE.getHandlers().getGuiDisplayHandler().setDisplayNextTick(new GuiSelectWorld(this));
            break;
        case 1:
            Hyperium.INSTANCE.getHandlers().getGuiDisplayHandler().setDisplayNextTick(new GuiMultiplayer(this));
            break;
        case 2:
            if (!(Keyboard.isKeyDown(Keyboard.KEY_LSHIFT) || Keyboard.isKeyDown(Keyboard.KEY_RSHIFT))) {
                GuiMultiplayer guiMultiplayer = new GuiMultiplayer(new GuiMainMenu());
                guiMultiplayer.setWorldAndResolution(Minecraft.getMinecraft(), width, height);
                ((IMixinGuiMultiplayer) guiMultiplayer).makeDirectConnect();
                ServerData data = new ServerData("customServer", Settings.SERVER_IP, false);
                ((IMixinGuiMultiplayer) guiMultiplayer).setIp(data);
                guiMultiplayer.confirmClicked(true, 0);
            } else {
                Hyperium.INSTANCE.getHandlers().getGuiDisplayHandler().setDisplayNextTick(new CreateServerButton(this));
            }
            break;
        case 3:
            HyperiumMainGui.INSTANCE.show();
            break;
        case 4:
            Hyperium.INSTANCE.getHandlers().getGuiDisplayHandler().setDisplayNextTick(new GuiOptions(this, mc.gameSettings));
            break;
        case 5:
            if (Settings.CONFIRM_QUIT) {
                Hyperium.INSTANCE.getHandlers().getGuiDisplayHandler().setDisplayNextTick(new GuiConfirmQuit());
            } else {
                mc.shutdown();
            }
            break;
        case 6:
            HyperiumMainGui.INSTANCE.setTab(1);
            Hyperium.INSTANCE.getHandlers().getGuiDisplayHandler().setDisplayNextTick(HyperiumMainGui.INSTANCE);
            break;
        case 7:
            mc.displayGuiScreen(new ChangeBackgroundGui(this));
            break;
    }
}
Also used : IMixinGuiMultiplayer(cc.hyperium.mixinsimp.client.gui.IMixinGuiMultiplayer) ServerData(net.minecraft.client.multiplayer.ServerData) CreateServerButton(cc.hyperium.gui.util.CreateServerButton) IMixinGuiMultiplayer(cc.hyperium.mixinsimp.client.gui.IMixinGuiMultiplayer)

Aggregations

CreateServerButton (cc.hyperium.gui.util.CreateServerButton)1 IMixinGuiMultiplayer (cc.hyperium.mixinsimp.client.gui.IMixinGuiMultiplayer)1 ServerData (net.minecraft.client.multiplayer.ServerData)1