static void guiInstance(GuiOpenEvent e) { if (!(mc.currentScreen instanceof ScreenGUI)) { if (mc.currentScreen != e.gui) { if ((e.gui instanceof GuiIngameMenu) || ((e.gui instanceof GuiInventory) && (!OptionCore.DEFAULT_INVENTORY.getValue()))) { final boolean inv = (e.gui instanceof GuiInventory); if (mc.playerController.isInCreativeMode() && inv) e.gui = new GuiContainerCreative(mc.thePlayer); else { e.gui = new IngameMenuGUI((inv ? (GuiInventory) mc.currentScreen : null)); } } if ((e.gui instanceof GuiGameOver) && (!OptionCore.DEFAULT_DEATH_SCREEN.getValue())) { if (mc.ingameGUI instanceof IngameGUI) { e.gui = new DeathScreen(); } } } else e.setCanceled(true); } }
@Override protected void execute() { if (Minecraft.getMinecraft().getIntegratedServer() != null && Minecraft.getMinecraft().world != null) { // If the integrated server has been opened to the LAN, we won't be able to pause it. // To get around this, we need to make it think it's not open, by modifying its isPublic flag. if (Minecraft.getMinecraft().getIntegratedServer().getPublic()) { if (!killPublicFlag(Minecraft.getMinecraft().getIntegratedServer())) { // Can't pause, don't want to risk the hang - so bail. episodeHasCompletedWithErrors(ClientState.ERROR_CANNOT_CREATE_WORLD, "Can not pause the old server since it's open to LAN; no way to safely create new world."); } } Minecraft.getMinecraft().displayGuiScreen(new GuiIngameMenu()); } }
@Override public void actionPerformed(GuiButton button) throws IOException { switch (button.id) { case 0: mc.displayGuiScreen(new GuiIngameMenu()); break; case 2: TConfigs.updateShowHUD(!TConfigs.showHUD); button.displayString = "Show HUD: " + TConfigs.showHUD; break; case 3: TConfigs.updateShowEntity(!TConfigs.showEntity); button.displayString = "Show entity: " + TConfigs.showEntity; break; case 4: TConfigs.updateCustomSwordSound(!TConfigs.customSwordSound); button.displayString = "Custom sounds: " + TConfigs.customSwordSound; break; case 5: TConfigs.updateFovAtBowOrSpeed(!TConfigs.fovAtBowOrSpeed); button.displayString = "Change fov: " + TConfigs.fovAtBowOrSpeed; break; } }
@SubscribeEvent public void onKey(KeyInputEvent.KeyInputEvent event){ if(keyBinding.isPressed() && minecraft.thePlayer != null){ synchronized(state){ if(state) return; state = true; } minecraft.displayGuiScreen(new GuiIngameMenu()); executor.submit(new Runnable() { @Override public void run() { openInputUI(); state = false; } }); } }
public boolean shouldAllowWalking() { // check if mod is active if (!isActive()) return false; // check if there is a player to move Minecraft mc = Minecraft.getMinecraft(); if (mc.thePlayer == null) return false; // check if player is viewing chat if ((mc.currentScreen instanceof GuiChat) || (mc.currentScreen instanceof GuiIngameMenu) || (mc.currentScreen instanceof NavigatorScreen)) { return false; } // check if inventory key is pressed return !Keyboard.isKeyDown(mc.gameSettings.keyBindInventory.getKeyCode()); }
@SubscribeEvent public void onDraw(GuiScreenEvent.DrawScreenEvent.Post event) { if (event.gui instanceof GuiMainMenu || event.gui instanceof GuiIngameMenu) { GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); GL11.glDisable(GL11.GL_LIGHTING); if (MoteCraft.mote == null) { this.mc.renderEngine.bindTexture(new ResourceLocation( MoteCraft.MODID, String.format("wiimote_search%02d.png", this.animstate / 3))); } else { this.mc.renderEngine.bindTexture(new ResourceLocation( MoteCraft.MODID, "wiimote_found.png")); } /* * this.drawTexturedModalRect( 0, 0, 0, 0, 230, 1000); */ Utils.drawTexturedQuadFit(10, 10, 32, 32, zLevel + 1); } }
/** * Displays the ingame menu */ public void displayInGameMenu() { if (this.currentScreen == null) { this.displayGuiScreen(new GuiIngameMenu()); if (this.isSingleplayer() && !this.theIntegratedServer.getPublic()) { this.mcSoundHandler.pauseSounds(); } } }
@Override protected void execute() { if (Minecraft.getMinecraft().getIntegratedServer() != null && Minecraft.getMinecraft().theWorld != null) { // If the integrated server has been opened to the LAN, we won't be able to pause it. // To get around this, we need to make it think it's not open, by modifying its isPublic flag. if (Minecraft.getMinecraft().getIntegratedServer().getPublic()) { if (!killPublicFlag(Minecraft.getMinecraft().getIntegratedServer())) { // Can't pause, don't want to risk the hang - so bail. episodeHasCompletedWithErrors(ClientState.ERROR_CANNOT_CREATE_WORLD, "Can not pause the old server since it's open to LAN; no way to safely create new world."); } } Minecraft.getMinecraft().displayGuiScreen(new GuiIngameMenu()); } }
public boolean instanceOf(CommonScreenTypes type) { if (type.equals(CommonScreenTypes.GuiDisconnected)) { return screen instanceof GuiDisconnected; } else if (type.equals(CommonScreenTypes.GuiIngameMenu)) { return screen instanceof GuiIngameMenu; } return false; }
@SubscribeEvent public void onOpenGui(GuiOpenEvent event) { if (event.gui instanceof GuiMainMenu) { event.gui = new RewiMainMenu(); } if (event.gui instanceof GuiIngameMenu) { event.gui = new RewiIngameMenu(); } if (event.gui instanceof GuiOptions) { event.gui = new RewiOptionsMenu(Minecraft.getMinecraft().currentScreen, Minecraft.getMinecraft().gameSettings); } }
@SubscribeEvent public void onInitGuiScreen(GuiScreenEvent.InitGuiEvent.Post event) { if (active) { LabelButtonInfo.inject(event.getGui()); if (event.getGui() instanceof GuiIngameMenu) { event.getButtonList().add(new GuiButton(200, (event.getGui().width / 2) - 100, event.getGui().height - 20, I18n.format("gui.controller"))); } if (event.getGui() instanceof GuiMainMenu) { this.selector = new GuiButtonSelector(event.getGui().width / 2, event.getGui().height / 2 + 30, 40, event.getButtonList().toArray(new GuiButton[0])); event.getButtonList().clear(); } if (event.getButtonList().size() != 0) ActionButtonChange.moveMouse(new Wrapper(event.getButtonList().get(0)), event.getGui().width, event.getGui().height); } }
@SubscribeEvent public void onGuiScreenonInitGui(GuiScreenEvent.InitGuiEvent event) { if (event.gui instanceof GuiIngameMenu) { GuiIngameMenu menue = (GuiIngameMenu) event.gui; event.buttonList.add(new GuiButton(20, menue.width / 2 - 100, menue.height / 4 + 128, 200, 20, "Teambattle Settings")); } }
public boolean canDisplayInfoBar(Minecraft mc, ClientProxy clientProxy) { if(!clientProxy.isBuildMode()) return false; if(mc.currentScreen == null) return true; if(mc.currentScreen instanceof GuiIngameMenu) return true; if(mc.currentScreen instanceof GuiChat) return true; return false; }
@SideOnly(Side.CLIENT) @SubscribeEvent(priority=EventPriority.NORMAL, receiveCanceled=true) public void onEvent(GuiOpenEvent event) { if (event.gui instanceof GuiIngameModOptions) { event.gui = new GuiModList(new GuiIngameMenu()); } }
/** * Displays the ingame menu */ public void displayInGameMenu() { if (this.currentScreen == null) { this.displayGuiScreen(new GuiIngameMenu()); if (this.isSingleplayer() && !this.theIntegratedServer.getPublic()) { this.mcSoundHandler.func_147689_b(); } } }
public void displayInGameMenu() { if (this.currentScreen == null) { this.displayGuiScreen(new GuiIngameMenu()); if (this.isSingleplayer() && !this.theIntegratedServer.getPublic()) { this.mcSoundHandler.pauseSounds(); } } }
public void func_71385_j() { if(this.field_71462_r == null) { this.func_71373_a(new GuiIngameMenu()); if(this.func_71356_B() && !this.field_71437_Z.func_71344_c()) { this.field_71416_A.func_82466_e(); } } }
/** * Displays the ingame menu */ public void displayInGameMenu() { if (this.currentScreen == null) { this.displayGuiScreen(new GuiIngameMenu()); if (this.isSingleplayer() && !this.theIntegratedServer.getPublic()) { this.sndManager.pauseAllSounds(); } } }
@SubscribeEvent public void onPostInitGui(GuiScreenEvent.InitGuiEvent.Post event) { if(event.getGui() instanceof GuiIngameMenu || event.getGui() instanceof GuiModList){ int x = event.getGui().width / 2 + 105; int y = event.getGui().height / 4 + 8; if(event.getGui() instanceof GuiModList){ x = event.getGui().width - 110; y = 10; } event.getButtonList().add(new GuiModUpdateButton(BUTTON_ID, x, y, event.getGui())); } }
@Override public void keyDown(EnumSet<TickType> types, KeyBinding kb, boolean tickEnd, boolean isRepeat) { Minecraft mc = ModLoader.getMinecraftInstance(); if(mc.theWorld!=null && mc.currentScreen instanceof GuiIngameMenu){ HDSkinHandler.forceUpdateSkins(mc.theWorld); } }
public void showInGameModOptions(GuiIngameMenu guiIngameMenu) { showGuiScreen(new GuiModList(guiIngameMenu)); }
@SideOnly(Side.CLIENT) @SubscribeEvent public void actionPreformed(GuiScreenEvent.ActionPerformedEvent.Post event) { GuiScreen gui = event.getGui(); if (gui instanceof GuiOptions) { if(event.getButton().id == Reference.MACROKEY_OPTIONS_BUTTON){ Minecraft.getMinecraft().displayGuiScreen(new GuiManageKeybindings(gui, Minecraft.getMinecraft().gameSettings)); } } if(gui instanceof GuiIngameMenu){ if(event.getButton().id == Reference.MACROKEY_INGAME_LAYER_TOGGLE) { currentSelectedLayer++; if(currentSelectedLayer< MacroKey.instance.layers.size()) { event.getButton().displayString = "Layer: " + MacroKey.instance.layers.get(currentSelectedLayer).getDisplayName(); Layer.setActiveLayer(MacroKey.instance.layers.get(currentSelectedLayer)); }else if(currentSelectedLayer+1>=MacroKey.instance.layers.size()){ currentSelectedLayer=-1; event.getButton().displayString = "Layer: Master"; Layer.setActiveLayer(null); } } } }
public void showInGameModOptions(GuiIngameMenu guiIngameMenu) { showGuiScreen(new GuiIngameModOptions(guiIngameMenu)); }
@SubscribeEvent public void onGuiScreenButtonPress(GuiScreenEvent.ActionPerformedEvent.Post event) { if (active) { if (event.getGui() instanceof GuiIngameMenu) { if (event.getButton().id == 200) { Minecraft.getMinecraft().displayGuiScreen(new GuiScreenControllerHelp(event.getGui())); } } } }
@SubscribeEvent public void onGuiScreenonActionPerformed(GuiScreenEvent.ActionPerformedEvent event) { if (event.gui instanceof GuiIngameMenu) { if (event.button.id == 20) { event.gui.mc.displayGuiScreen(new GuiTeambattleSettings()); } } }
@SubscribeEvent public void GuiOpenEvent(GuiOpenEvent event) { if(event.gui instanceof GuiOptions && mc.theWorld != null) { event.gui = new GuiOptionsReplace(new GuiIngameMenu(), mc.gameSettings); } }
public static void onRender(RenderGameOverlayEvent event) { // If this doesn't render during the TEXT phase, other displays will be screwed up due to OpenGL settings. if (!ServerHelper.onMCPVP() || event.type != RenderGameOverlayEvent.ElementType.TEXT) return; // Draw the split chat. Main.secondChat.drawChat(Main.mc.ingameGUI.getUpdateCounter()); // Prevent everything else from being rendered when debug is showing. if (Main.mc.gameSettings.showDebugInfo) return; // Render the armor display. if (ConfigHUD.showArmor || (Data.get("showArmor") != null && Boolean.valueOf(Data.get("showArmor")))) { Main.start("mcpvp", "armorDisplay"); Main.armorDisplay.renderArmor(); Main.end(2); } // Render the potion display. if (ConfigHUD.showPotion || (Data.get("showPotion") != null && Boolean.valueOf(Data.get("showPotion")))) { Main.start("mcpvp", "potionDisplay"); Main.potionDisplay.displayPotions(event); PotionDisplay.displayStrings(); Main.end(2); } // Outline the current Selectable. if (Selectable.selected != null) Selectable.selected.outline(); // Hi-jack the GuiIngameMenu and inject a new one. if (Main.mc.currentScreen instanceof GuiIngameMenu) Main.mc.displayGuiScreen(new GuiIngameMCPVP()); // Checking the time imposes a limit to the frequency of the event. if (ConfigHUD.fixSkins && System.currentTimeMillis() % 10 == 0) { Main.start("mcpvp", "skinFixer"); fixSkins(); Main.end(2); } // Display all InfoBoxes for the current Server and State. Main.start("mcpvp", "infoBox"); InfoBox.displayAll(Server.getServer(), Server.getState()); Main.end(2); }
@Override public void tickStart(EnumSet<TickType> type, Object... tickData) { final Minecraft mc = Minecraft.getMinecraft(); tick_count++; if (mc.currentScreen != null) { if ( (mc.currentScreen instanceof GuiIngameMenu) && ! (mc.currentScreen instanceof WDLGuiIngameMenuExtend)) { mc.currentScreen = new WDLGuiIngameMenuExtend(mc.currentScreen); } //System.out.println(mc.currentScreen.getClass().getName()); } /*if (!started) { mc.ingameGUI = new GuiIngameCustom(mc); // Just put in your custom gui // instead of GuiIngameCustom ;) started = true; }*/ /*WDL>>>*/ if( WDL.guiToShowAsync != null ) { mc.displayGuiScreen( WDL.guiToShowAsync ); WDL.guiToShowAsync = null; } if( WDL.downloading ) { if( WDL.tp.openContainer != WDL.windowContainer ) { if( WDL.tp.openContainer == WDL.tp.inventoryContainer ) WDL.onItemGuiClosed(); else WDL.onItemGuiOpened(); WDL.windowContainer = WDL.tp.openContainer; } } /*<<<WDL*/ }