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;
}
}
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();
}
}
}
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);
}
Aggregations