Search in sources :

Example 1 with GuiHyperiumScreenMainMenu

use of cc.hyperium.gui.GuiHyperiumScreenMainMenu in project Hyperium by HyperiumClient.

the class HyperiumGuiMainMenu method drawScreen.

public void drawScreen() {
    if (!Hyperium.INSTANCE.isAcceptedTos()) {
        Hyperium.LOGGER.info("Hasn't accepted! Redirecting them!");
        Hyperium.INSTANCE.getHandlers().getGuiDisplayHandler().setDisplayNextTick(new GuiHyperiumScreenTos());
    } else
        Hyperium.INSTANCE.getHandlers().getGuiDisplayHandler().setDisplayNextTick(!AddonMinecraftBootstrap.getDependenciesLoopMap().isEmpty() || !AddonMinecraftBootstrap.getMissingDependenciesMap().isEmpty() ? new GuiAddonError() : new GuiHyperiumScreenMainMenu());
}
Also used : GuiAddonError(cc.hyperium.gui.GuiAddonError) GuiHyperiumScreenTos(cc.hyperium.gui.GuiHyperiumScreenTos) GuiHyperiumScreenMainMenu(cc.hyperium.gui.GuiHyperiumScreenMainMenu)

Example 2 with GuiHyperiumScreenMainMenu

use of cc.hyperium.gui.GuiHyperiumScreenMainMenu in project Hyperium by HyperiumClient.

the class HyperiumMinecraft method displayGuiScreen.

public void displayGuiScreen(GuiScreen guiScreenIn, GuiScreen currentScreen, WorldClient theWorld, EntityPlayerSP thePlayer, GameSettings gameSettings, GuiIngame ingameGUI) {
    if (currentScreen != null) {
        currentScreen.onGuiClosed();
    }
    if (guiScreenIn == null && theWorld == null) {
        guiScreenIn = new GuiHyperiumScreenMainMenu();
    } else if (guiScreenIn == null && thePlayer.getHealth() <= 0.0F) {
        guiScreenIn = new GuiGameOver();
    }
    GuiOpenEvent event = new GuiOpenEvent(guiScreenIn);
    EventBus.INSTANCE.post(event);
    if (event.isCancelled())
        return;
    guiScreenIn = event.getGui();
    if (currentScreen != null && guiScreenIn != currentScreen)
        currentScreen.onGuiClosed();
    if (currentScreen != null)
        EventBus.INSTANCE.unregister(currentScreen);
    if (guiScreenIn instanceof GuiHyperiumScreenMainMenu) {
        gameSettings.showDebugInfo = false;
        if (!Settings.PERSISTENT_CHAT) {
            ingameGUI.getChatGUI().clearChatMessages();
        }
    }
    parent.currentScreen = guiScreenIn;
    if (guiScreenIn != null) {
        parent.setIngameNotInFocus();
        ScaledResolution scaledresolution = new ScaledResolution(parent);
        int scaledWidth = scaledresolution.getScaledWidth();
        int scaledHeight = scaledresolution.getScaledHeight();
        guiScreenIn.setWorldAndResolution(parent, scaledWidth, scaledHeight);
        parent.skipRenderWorld = false;
    } else {
        parent.getSoundHandler().resumeSounds();
        parent.setIngameFocus();
    }
    if (Hyperium.INSTANCE.getHandlers() != null) {
        Hyperium.INSTANCE.getHandlers().getKeybindHandler().releaseAllKeybinds();
    }
}
Also used : ScaledResolution(net.minecraft.client.gui.ScaledResolution) GuiGameOver(net.minecraft.client.gui.GuiGameOver) GuiHyperiumScreenMainMenu(cc.hyperium.gui.GuiHyperiumScreenMainMenu) GuiOpenEvent(cc.hyperium.event.gui.GuiOpenEvent)

Aggregations

GuiHyperiumScreenMainMenu (cc.hyperium.gui.GuiHyperiumScreenMainMenu)2 GuiOpenEvent (cc.hyperium.event.gui.GuiOpenEvent)1 GuiAddonError (cc.hyperium.gui.GuiAddonError)1 GuiHyperiumScreenTos (cc.hyperium.gui.GuiHyperiumScreenTos)1 GuiGameOver (net.minecraft.client.gui.GuiGameOver)1 ScaledResolution (net.minecraft.client.gui.ScaledResolution)1