if(GuiScreen.isCtrlKeyDown() && GuiScreen.isShiftKeyDown()) { event.getLeft().add(PREFIX + "Config Context"); event.getLeft().add(" shaders.enabled: " + ConfigHandler.useShaders);
@SubscribeEvent public static void buttonPressed(KeyboardInputEvent.Post event) { Minecraft mc = Minecraft.getMinecraft(); if(mc.world == null || !supportedGuiFilter.test(mc.currentScreen) || Keyboard.getEventKey() != ClientProxy.CORPOREA_REQUEST.getKeyCode() || !Keyboard.getEventKeyState() || Keyboard.isRepeatEvent() || TileCorporeaIndex.InputHandler.getNearbyIndexes(mc.player).isEmpty()) return; ItemStack stack = getStackUnderMouse(); if(stack != null && !stack.isEmpty()) { int count = 1; int max = stack.getMaxStackSize(); if(GuiScreen.isShiftKeyDown()) { count = max; if(GuiScreen.isCtrlKeyDown()) count /= 4; } else if(GuiScreen.isCtrlKeyDown()) count = max / 2; if(count > 0) { String name = CorporeaHelper.stripControlCodes(stack.getDisplayName()); String full = count + " " + name; mc.ingameGUI.getChatGUI().addToSentMessages(full); mc.player.sendChatMessage(full); event.setCanceled(true); } } }
@Override public boolean isEnabled(GuiBase gui, EntityPlayer player) { return GuiScreen.isShiftKeyDown() && GuiScreen.isCtrlKeyDown(); }
@Override public boolean isEnabled(GuiBase gui, EntityPlayer player) { return GuiScreen.isCtrlKeyDown() && GuiScreen.isShiftKeyDown(); }
/** * @deprecated override {@link #processPickBlock(IBlockState, RayTraceResult, World, BlockPos, EntityPlayer, ItemStack)} instead if possible */ @Override @Deprecated public @Nonnull ItemStack getPickBlock(@Nonnull IBlockState state, @Nonnull RayTraceResult target, @Nonnull World world, @Nonnull BlockPos pos, @Nonnull EntityPlayer player) { if (player.capabilities.isCreativeMode && GuiScreen.isCtrlKeyDown()) { ItemStack nbtDrop = getNBTDrop(world, pos, state, 0, getTileEntity(world, pos)); if (nbtDrop != null) { return nbtDrop; } } return processPickBlock(state, target, world, pos, player, super.getPickBlock(state, target, world, pos, player)); }
private boolean handleDelete(final int key) { final int direction = (key == Keyboard.KEY_BACK) ? -1 : 1; if (GuiScreen.isCtrlKeyDown()) { deleteWords(direction); } else { deleteFromCursor(direction); } return true; }
/** @reason Implement using Ctrl + 0-9 to select profiler sections 10-19. */ @ModifyVariable(method = "updateDebugProfilerName", at = @At("HEAD"), ordinal = 0) private int getKeyCountForProfilerNameUpdate(int keyCount) { return GuiScreen.isCtrlKeyDown() ? keyCount + 10 : keyCount; }
Gui.drawRect(x - 6, tooltipY - 6, x + 22, tooltipY + 28, 0x44000000); if(ConfigHandler.useShiftForQuickLookup ? GuiScreen.isShiftKeyDown() : GuiScreen.isCtrlKeyDown()) { lexiconLookupTime += ClientTickHandler.delta;
return; if(GuiScreen.isCtrlKeyDown() && GuiScreen.isShiftKeyDown() && Minecraft.getMinecraft().currentScreen == null) { takingPanorama = true; panoramaStep = 0;
private <V> boolean handleClickEdit(IClickedIngredient<V> clicked) { V ingredient = clicked.getValue(); IngredientBlacklistType blacklistType = GuiScreen.isCtrlKeyDown() ? IngredientBlacklistType.WILDCARD : IngredientBlacklistType.ITEM; IIngredientHelper<V> ingredientHelper = ingredientRegistry.getIngredientHelper(ingredient); if (Config.isIngredientOnConfigBlacklist(ingredient, ingredientHelper)) { Config.removeIngredientFromConfigBlacklist(ingredientFilter, ingredientRegistry, ingredient, blacklistType, ingredientHelper); } else { Config.addIngredientToConfigBlacklist(ingredientFilter, ingredientRegistry, ingredient, blacklistType, ingredientHelper); } clicked.onClickHandled(); return true; }
if (GuiScreen.isCtrlKeyDown()) else if (GuiScreen.isCtrlKeyDown())
private boolean handleArrowKeys(final int key) { final int direction = (key == Keyboard.KEY_LEFT) ? -1 : 1; if (GuiScreen.isShiftKeyDown()) { if (GuiScreen.isCtrlKeyDown()) { setSelectionEnd(getNthWordFromPos(direction, getSelectionEnd())); } else { setSelectionEnd(getSelectionEnd() + direction); } } else if (GuiScreen.isCtrlKeyDown()) { setCursorPosition(getNthWordFromCursor(direction)); } else { moveCursorBy(direction); } return true; }
info.add(GuiColor.PURPLE.toString() + Translator.translate(reward != 1, "hqm.questBook.unclaimedQuests", reward)); if (Quest.canQuestsBeEdited() && !GuiScreen.isCtrlKeyDown()) { info.add(GuiColor.LIGHT_GRAY.toString() + Translator.translate(realTotal != 1, "hqm.questBook.inclInvisiQuests", realTotal));
@Override public void handleMouseClick(int mouseX, int mouseY, int mouseButton) { if (mouseButton != 0 && mouseButton != 1 && mouseButton != 2 || !manager.minecraft.player.inventory.getItemStack().isEmpty()) { return; } GuiDatabase gui = (GuiDatabase) manager.gui; DatabaseItem item = gui.getItem(databaseIndex); if (item == null) { return; } if (GuiScreen.isCtrlKeyDown() && mouseButton == 0) { gui.analyzer.setSelectedSlot(databaseIndex); return; } ignoreMouseUp = true; byte flags = 0; if (GuiScreen.isShiftKeyDown()) { flags |= PacketExtractItem.SHIFT; } if (mouseButton == 1) { flags |= PacketExtractItem.HALF; } else if (mouseButton == 2 && manager.minecraft.player.capabilities.isCreativeMode) { flags |= PacketExtractItem.CLONE; } NetworkUtil.sendToServer(new PacketExtractItem(item.invIndex, flags)); }
/** * @reason Checks if Ctrl + I is pressed and opens a warning screen if there is a visible or * queued error notification. TODO: Main menu too */ @Inject(method = "runTickKeyboard", at = @At("HEAD")) private void checkForCtrlI(CallbackInfo ci) { if (GuiScreen.isCtrlKeyDown() && !GuiScreen.isShiftKeyDown() && !GuiScreen.isAltKeyDown() && Keyboard.isKeyDown(Keyboard.KEY_I)) { ProblemToast lastToast = getToastGui().getToast(ProblemToast.class, IToast.NO_TOKEN); if (lastToast != null) { lastToast.hide = true; displayGuiScreen(new GuiWarningScreen(lastToast.report, currentScreen)); } } }
@Override protected void elementClicked(int index, boolean doubleClick) { if (isCtrlKeyDown()) { if (isSelected(index)) { removeSelection(index); } else { selectIndex(index); } } else if (isShiftKeyDown()) { clearSelection(); int start = index > selectedIndex ? selectedIndex : index; int end = index > selectedIndex ? index : selectedIndex; selectRange(start, end); } else { clearSelection(); selectIndex(index); } }
@SubscribeEvent public void keyboardEvent(GuiScreenEvent.KeyboardInputEvent.Post event) { boolean down = Keyboard.isKeyDown(Keyboard.KEY_DELETE); if(GuiScreen.isCtrlKeyDown() && down && !this.keyboardDown && event.getGui() instanceof GuiContainer) { GuiContainer gui = (GuiContainer) event.getGui(); Slot slot = gui.getSlotUnderMouse(); if(slot != null) { IInventory inv = slot.inventory; if(inv instanceof InventoryPlayer) { int index = slot.getSlotIndex(); if(Minecraft.getMinecraft().player.capabilities.isCreativeMode && index >= 36) index -= 36; // Creative mode messes with the indexes for some reason if(index < ((InventoryPlayer) inv).mainInventory.size()) NetworkHandler.INSTANCE.sendToServer(new MessageDeleteItem(index)); } } } this.keyboardDown = down; }
public static void draw() { float alpha = 1; if (GuiScreen.isCtrlKeyDown()) { alpha = 0.5f; } // Bind texture atlas and disable scaling for debug render (see MixinGlStateManager) Minecraft.getMinecraft().renderEngine.bindTexture(TextureMap.LOCATION_BLOCKS_TEXTURE); pushTextureIdentity(); Minecraft.getMinecraft().entityRenderer.setupOverlayRendering(); GlStateManager.enableAlpha(); GlStateManager.enableBlend(); GlStateManager.disableColorLogic(); GlStateManager.color(1, 1, 1, alpha); drawTexture(5, 5, 0, 0, 230 * stitcher.getImageWidth() / stitcher.getImageHeight(), 230, 1, 1); popTextureMatrix(); }
if (GuiScreen.isCtrlKeyDown()) { GuiHabitatFormer former = (GuiHabitatFormer) getWindow().getGui(); IClimateState climateState = former.getClimate();
@Override protected void mouseDragged(Minecraft mc, int mouseX, int mouseY) { if (clicked && hovered) { if (hoverTimer == 0 || (hoverTimer %20 == 0 && GuiScreen.isCtrlKeyDown())) { if (GuiScreen.isShiftKeyDown() && canPurchaseX(stackSize + 10)) { stackSize += 10; StatsClient stats = HFTrackers.getClientPlayerTracker().getStats(); stats.setGoldValue(stats.getGold() - (data.getSellValue(shop.getShop(), purchasable) * 10)); if (purchasable.getCost() >= 0) shop.updatePurchased(StackHelper.toStack(purchasable.getDisplayStack(), 10 * purchasable.getDisplayStack().stackSize), 10 * purchasable.getDisplayStack().stackSize); if (hoverTimer %40 == 1) playPressSound(mc.getSoundHandler()); } else if (canPurchaseX(stackSize + 1)) { stackSize++; if (purchasable.getCost() >= 0) shop.updatePurchased(purchasable.getDisplayStack(), purchasable.getDisplayStack().stackSize); StatsClient stats = HFTrackers.getClientPlayerTracker().getStats(); stats.setGoldValue(stats.getGold() - data.getSellValue(shop.getShop(), purchasable)); if (hoverTimer %40 == 1) playPressSound(mc.getSoundHandler()); } hoverTimer++; } if (GuiScreen.isCtrlKeyDown()) { hoverTimer++; } } else { hoverTimer = 0; stackSize = 0; } }