Search in sources :

Example 1 with PanoramicMainMenu

use of com.almuradev.almura.feature.menu.main.PanoramicMainMenu in project Almura by AlmuraDev.

the class ApplyTexturePackConfirmGui method onUIButtonClickEvent.

@Subscribe
public void onUIButtonClickEvent(UIButton.ClickEvent event) {
    switch(event.getComponent().getName().toLowerCase()) {
        case "button.yes":
            AlmuraSettings.applyPreferredTexturePack();
            new PanoramicMainMenu(null).display();
            break;
        case "button.close":
            new PanoramicMainMenu(null).display();
            this.close();
            break;
    }
}
Also used : PanoramicMainMenu(com.almuradev.almura.feature.menu.main.PanoramicMainMenu) Subscribe(com.google.common.eventbus.Subscribe)

Example 2 with PanoramicMainMenu

use of com.almuradev.almura.feature.menu.main.PanoramicMainMenu in project Almura by AlmuraDev.

the class MainMenuManager method onGuiOpen.

@SubscribeEvent
public void onGuiOpen(final GuiOpenEvent event) {
    final GuiScreen screen = event.getGui();
    final GuiScreen currentScreen = Minecraft.getMinecraft().currentScreen;
    final GameSettings settings = Minecraft.getMinecraft().gameSettings;
    boolean refreshResources = false;
    if (screen != null) {
        if (currentScreen != null && debug) {
            System.out.println("MainMenuManager: current: " + currentScreen.getClass().getSimpleName() + " requested: " + screen.getClass().getSimpleName());
        }
        if (screen.getClass().equals(GuiMainMenu.class)) {
            event.setCanceled(true);
            final GeneralCategory general = configAdapter.get().general;
            if (general.firstLaunch) {
                AlmuraSettings.checkFirstLaunched();
            } else {
                new PanoramicMainMenu(null).display();
            }
        } else if (screen.getClass().equals(GuiIngameMenu.class)) {
            event.setCanceled(true);
            new SimpleIngameMenu().display();
        } else if (screen.getClass().equals(GuiGameOver.class)) {
            event.setCanceled(true);
        // Cancel this, packet sent to client opens the DeathGUI
        } else if (screen.getClass().equals(GuiDisconnected.class)) {
            event.setCanceled(true);
            String message = "";
            if (Almura.networkManager != null && Almura.networkManager.getExitMessage() != null) {
                message = Almura.networkManager.getExitMessage().getFormattedText();
            }
            new DisconnectedGui(message).display();
        }
    }
}
Also used : SimpleIngameMenu(com.almuradev.almura.feature.menu.game.SimpleIngameMenu) GeneralCategory(com.almuradev.almura.core.client.config.category.GeneralCategory) GuiIngameMenu(net.minecraft.client.gui.GuiIngameMenu) GuiScreen(net.minecraft.client.gui.GuiScreen) GameSettings(net.minecraft.client.settings.GameSettings) GuiDisconnected(net.minecraft.client.gui.GuiDisconnected) DisconnectedGui(com.almuradev.almura.feature.menu.main.DisconnectedGui) PanoramicMainMenu(com.almuradev.almura.feature.menu.main.PanoramicMainMenu) SubscribeEvent(net.minecraftforge.fml.common.eventhandler.SubscribeEvent)

Example 3 with PanoramicMainMenu

use of com.almuradev.almura.feature.menu.main.PanoramicMainMenu in project Almura by AlmuraDev.

the class AlmuraSettings method checkFirstLaunched.

public static void checkFirstLaunched() {
    final GameSettings settings = Minecraft.getMinecraft().gameSettings;
    optimizeGame();
    if (!settings.resourcePacks.contains(AlmuraSettings.getFontTexturePack())) {
        AlmuraSettings.applyFontTexturePack();
    }
    if (!settings.resourcePacks.contains(AlmuraSettings.getPreferredTexturePack())) {
        new ApplyTexturePackConfirmGui(null).display();
    } else {
        new PanoramicMainMenu(null).display();
    }
    setFirstLaunched(false);
}
Also used : ApplyTexturePackConfirmGui(com.almuradev.almura.feature.speed.client.gui.ApplyTexturePackConfirmGui) GameSettings(net.minecraft.client.settings.GameSettings) PanoramicMainMenu(com.almuradev.almura.feature.menu.main.PanoramicMainMenu)

Aggregations

PanoramicMainMenu (com.almuradev.almura.feature.menu.main.PanoramicMainMenu)3 GameSettings (net.minecraft.client.settings.GameSettings)2 GeneralCategory (com.almuradev.almura.core.client.config.category.GeneralCategory)1 SimpleIngameMenu (com.almuradev.almura.feature.menu.game.SimpleIngameMenu)1 DisconnectedGui (com.almuradev.almura.feature.menu.main.DisconnectedGui)1 ApplyTexturePackConfirmGui (com.almuradev.almura.feature.speed.client.gui.ApplyTexturePackConfirmGui)1 Subscribe (com.google.common.eventbus.Subscribe)1 GuiDisconnected (net.minecraft.client.gui.GuiDisconnected)1 GuiIngameMenu (net.minecraft.client.gui.GuiIngameMenu)1 GuiScreen (net.minecraft.client.gui.GuiScreen)1 SubscribeEvent (net.minecraftforge.fml.common.eventhandler.SubscribeEvent)1