From ac41ecd855a511c76499d61983ddb6c723ae0844 Mon Sep 17 00:00:00 2001 From: Cow Date: Sun, 11 Jul 2021 15:35:49 +0200 Subject: Swapped copy inventory and copy item keybindings - also changed default position of dungeon overlay --- .../de/cowtipper/cowlection/config/MooConfig.java | 4 ++-- .../cowlection/listener/PlayerListener.java | 24 +++++++++++----------- 2 files changed, 14 insertions(+), 14 deletions(-) (limited to 'src/main/java/de/cowtipper') diff --git a/src/main/java/de/cowtipper/cowlection/config/MooConfig.java b/src/main/java/de/cowtipper/cowlection/config/MooConfig.java index f37f19b..026308a 100644 --- a/src/main/java/de/cowtipper/cowlection/config/MooConfig.java +++ b/src/main/java/de/cowtipper/cowlection/config/MooConfig.java @@ -585,7 +585,7 @@ public class MooConfig { "dungOverlayEnabled", true, "Enable Dungeon performance overlay?")); Property propDungOverlayPositionX = subCat.addConfigEntry(cfg.get(configCat.getConfigName(), - "dungOverlayPositionX", 1, "Dungeon performance overlay position: x value", 0, 1000), + "dungOverlayPositionX", 6, "Dungeon performance overlay position: x value", 0, 1000), null, "‰", // per mille (slider) -> { MooConfig.dungOverlayPositionX = slider.getValueInt(); @@ -593,7 +593,7 @@ public class MooConfig { }); Property propDungOverlayPositionY = subCat.addConfigEntry(cfg.get(configCat.getConfigName(), - "dungOverlayPositionY", 1, "Dungeon performance overlay position: y value", 0, 1000), + "dungOverlayPositionY", 200, "Dungeon performance overlay position: y value", 0, 1000), null, "‰", // per mille (slider) -> { MooConfig.dungOverlayPositionY = slider.getValueInt(); diff --git a/src/main/java/de/cowtipper/cowlection/listener/PlayerListener.java b/src/main/java/de/cowtipper/cowlection/listener/PlayerListener.java index 5b5a4e6..cafa4a3 100644 --- a/src/main/java/de/cowtipper/cowlection/listener/PlayerListener.java +++ b/src/main/java/de/cowtipper/cowlection/listener/PlayerListener.java @@ -67,18 +67,7 @@ public class PlayerListener { public void onKeyboardInput(GuiScreenEvent.KeyboardInputEvent.Pre e) { if (MooConfig.enableCopyInventory && Keyboard.getEventKeyState() && Keyboard.getEventKey() == Keyboard.KEY_C && GuiScreen.isCtrlKeyDown()) { if (GuiScreen.isShiftKeyDown()) { - // ctrl + shift + C - if (e.gui instanceof GuiContainer) { - Slot slotUnderMouse = GuiHelper.getSlotUnderMouse((GuiContainer) e.gui); - if (slotUnderMouse != null && slotUnderMouse.getHasStack()) { - ItemStack itemUnderMouse = slotUnderMouse.getStack(); - NBTTagCompound itemNbt = new NBTTagCompound(); - itemUnderMouse.writeToNBT(itemNbt); - Utils.copyToClipboardOrSaveAsFile(itemUnderMouse.getDisplayName() + EnumChatFormatting.RESET + EnumChatFormatting.GREEN, "item_" + itemUnderMouse.getDisplayName(), itemNbt, false); - } - } - } else { - // ctrl + C + // ctrl + shift + C: Copy inventory IInventory inventory; String inventoryName; if (e.gui instanceof GuiChest) { @@ -106,6 +95,17 @@ public class PlayerListener { } } Utils.copyToClipboardOrSaveAsFile(items.tagCount() + " items from '" + inventoryName + "'", "inventory_" + inventoryName, items, false); + } else { + // ctrl + C: Copy one item + if (e.gui instanceof GuiContainer) { + Slot slotUnderMouse = GuiHelper.getSlotUnderMouse((GuiContainer) e.gui); + if (slotUnderMouse != null && slotUnderMouse.getHasStack()) { + ItemStack itemUnderMouse = slotUnderMouse.getStack(); + NBTTagCompound itemNbt = new NBTTagCompound(); + itemUnderMouse.writeToNBT(itemNbt); + Utils.copyToClipboardOrSaveAsFile(itemUnderMouse.getDisplayName() + EnumChatFormatting.RESET + EnumChatFormatting.GREEN, "item_" + itemUnderMouse.getDisplayName(), itemNbt, false); + } + } } } } -- cgit