diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/menuentryswapper/GEItemCollectMode.java b/runelite-client/src/main/java/net/runelite/client/plugins/menuentryswapper/GEItemCollectMode.java new file mode 100644 index 0000000000..e15277e320 --- /dev/null +++ b/runelite-client/src/main/java/net/runelite/client/plugins/menuentryswapper/GEItemCollectMode.java @@ -0,0 +1,46 @@ +/* + * Copyright (c) 2019, Rami + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR + * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ +package net.runelite.client.plugins.menuentryswapper; + +import lombok.Getter; +import lombok.RequiredArgsConstructor; + +@Getter +@RequiredArgsConstructor +public enum GEItemCollectMode +{ + DEFAULT("Default"), + ITEMS("Collect-items"), + NOTES("Collect-notes"), + BANK("Bank"); + + private final String name; + + @Override + public String toString() + { + return name; + } +} diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/menuentryswapper/MenuEntrySwapperConfig.java b/runelite-client/src/main/java/net/runelite/client/plugins/menuentryswapper/MenuEntrySwapperConfig.java index 6d14f0188d..cbd75154c5 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/menuentryswapper/MenuEntrySwapperConfig.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/menuentryswapper/MenuEntrySwapperConfig.java @@ -361,4 +361,14 @@ public interface MenuEntrySwapperConfig extends Config { return false; } + + @ConfigItem( + keyName = "swapGEItemCollect", + name = "GE Item Collect", + description = "Swap Collect-notes, Collect-items, or Bank options from GE offer" + ) + default GEItemCollectMode swapGEItemCollect() + { + return GEItemCollectMode.DEFAULT; + } } diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/menuentryswapper/MenuEntrySwapperPlugin.java b/runelite-client/src/main/java/net/runelite/client/plugins/menuentryswapper/MenuEntrySwapperPlugin.java index 28802618d0..ccc61e2049 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/menuentryswapper/MenuEntrySwapperPlugin.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/menuentryswapper/MenuEntrySwapperPlugin.java @@ -1,6 +1,7 @@ /* * Copyright (c) 2018, Adam * Copyright (c) 2018, Kamiel + * Copyright (c) 2019, Rami * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -40,7 +41,6 @@ import net.runelite.api.MenuAction; import net.runelite.api.MenuEntry; import net.runelite.api.NPC; import net.runelite.api.events.ClientTick; -import net.runelite.client.events.ConfigChanged; import net.runelite.api.events.FocusChanged; import net.runelite.api.events.MenuOpened; import net.runelite.api.events.MenuOptionClicked; @@ -50,6 +50,7 @@ import net.runelite.api.widgets.WidgetInfo; import net.runelite.client.callback.ClientThread; import net.runelite.client.config.ConfigManager; import net.runelite.client.eventbus.Subscribe; +import net.runelite.client.events.ConfigChanged; import net.runelite.client.game.ItemManager; import net.runelite.client.game.ItemVariationMapping; import net.runelite.client.input.KeyManager; @@ -647,6 +648,24 @@ public class MenuEntrySwapperPlugin extends Plugin { swap("use", option, target, index); } + else if (option.equals("collect to inventory") || option.startsWith("collect-note") || option.startsWith("collect-item")) + { + switch (config.swapGEItemCollect()) + { + case ITEMS: + swap("collect-items", option, target, index); + swap("collect-item", option, target, index); + break; + case NOTES: + swap("collect-notes", option, target, index); + swap("collect-note", option, target, index); + break; + case BANK: + swap("collect to bank", option, target, index); + swap("bank", option, target, index); + break; + } + } if (shiftModifier && config.swapTeleportSpell()) {