diff --git a/http-api/src/main/java/net/runelite/http/api/animation/AnimationClient.java b/http-api/src/main/java/net/runelite/http/api/animation/AnimationClient.java index 3fdab53094..7da50db2f4 100644 --- a/http-api/src/main/java/net/runelite/http/api/animation/AnimationClient.java +++ b/http-api/src/main/java/net/runelite/http/api/animation/AnimationClient.java @@ -102,7 +102,7 @@ public class AnimationClient public List get() throws IOException { - HttpUrl url = RuneLiteAPI.getApiBase().newBuilder() + HttpUrl url = RuneLiteAPI.getPlusApiBase().newBuilder() .addPathSegment("animation") .build(); @@ -110,7 +110,7 @@ public class AnimationClient .url(url) .build(); - try (Response response = RuneLiteAPI.CLIENT.newCall(request).execute()) + try (Response response = RuneLiteAPI.RLP_CLIENT.newCall(request).execute()) { InputStream in = response.body().byteStream(); // CHECKSTYLE:OFF @@ -127,7 +127,7 @@ public class AnimationClient public AnimationKey get(int npcid) throws IOException { - HttpUrl url = RuneLiteAPI.getApiBase().newBuilder() + HttpUrl url = RuneLiteAPI.getPlusApiBase().newBuilder() .addPathSegment("animation") .addPathSegment(Integer.toString(npcid)) .build(); @@ -136,7 +136,7 @@ public class AnimationClient .url(url) .build(); - try (Response response = RuneLiteAPI.CLIENT.newCall(request).execute()) + try (Response response = RuneLiteAPI.RLP_CLIENT.newCall(request).execute()) { InputStream in = response.body().byteStream(); return RuneLiteAPI.GSON.fromJson(new InputStreamReader(in), AnimationKey.class); diff --git a/http-api/src/main/java/net/runelite/http/api/xtea/XteaClient.java b/http-api/src/main/java/net/runelite/http/api/xtea/XteaClient.java index ea859d8157..7e01dc4b56 100644 --- a/http-api/src/main/java/net/runelite/http/api/xtea/XteaClient.java +++ b/http-api/src/main/java/net/runelite/http/api/xtea/XteaClient.java @@ -102,7 +102,7 @@ public class XteaClient public List get() throws IOException { - HttpUrl url = RuneLiteAPI.getApiBase().newBuilder() + HttpUrl url = RuneLiteAPI.getPlusApiBase().newBuilder() .addPathSegment("xtea") .build(); @@ -127,7 +127,7 @@ public class XteaClient public XteaKey get(int region) throws IOException { - HttpUrl url = RuneLiteAPI.getApiBase().newBuilder() + HttpUrl url = RuneLiteAPI.getPlusApiBase().newBuilder() .addPathSegment("xtea") .addPathSegment(Integer.toString(region)) .build(); diff --git a/http-service/src/main/java/net/runelite/http/service/animation/AnimationEndpoint.java b/http-service/src/main/java/net/runelite/http/service/animation/AnimationEndpoint.java index 57b54c98d1..d33ca43051 100644 --- a/http-service/src/main/java/net/runelite/http/service/animation/AnimationEndpoint.java +++ b/http-service/src/main/java/net/runelite/http/service/animation/AnimationEndpoint.java @@ -40,33 +40,33 @@ import org.sql2o.Sql2o; public class AnimationEndpoint { private static final String CREATE_SQL = "CREATE TABLE IF NOT EXISTS `animation` (\n" - + " `id` int(11) NOT NULL AUTO_INCREMENT,\n" - + " `region` int(11) NOT NULL,\n" - + " `time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,\n" - + " `rev` int(11) NOT NULL,\n" - + " `anim1` int(11),\n" - + " `anim2` int(11),\n" - + " `anim3` int(11),\n" - + " `anim4` int(11),\n" - + " `anim5` int(11),\n" - + " `anim6` int(11),\n" - + " `anim7` int(11),\n" - + " `anim8` int(11),\n" - + " `anim9` int(11),\n" - + " `anim10` int(11),\n" - + " PRIMARY KEY (`id`),\n" - + " KEY `npcid` (`npcid`,`time`)\n" - + ") ENGINE=InnoDB"; + + " `id` int(11) NOT NULL AUTO_INCREMENT,\n" + + " `npcid` int(11) NOT NULL,\n" + + " `time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,\n" + + " `rev` int(11) NOT NULL,\n" + + " `anim1` int(11) NOT NULL,\n" + + " `anim2` int(11),\n" + + " `anim3` int(11),\n" + + " `anim4` int(11),\n" + + " `anim5` int(11),\n" + + " `anim6` int(11),\n" + + " `anim7` int(11),\n" + + " `anim8` int(11),\n" + + " `anim9` int(11),\n" + + " `anim10` int(11),\n" + + " PRIMARY KEY (`id`),\n" + + " KEY `npcid` (`npcid`,`time`)\n" + + ") ENGINE=InnoDB"; private final Sql2o sql2o; private final Cache keyCache = CacheBuilder.newBuilder() - .maximumSize(1024) - .build(); + .maximumSize(1024) + .build(); @Autowired public AnimationEndpoint( - @Qualifier("Runelite SQL2O") Sql2o sql2o + @Qualifier("Runelite SQL2O") Sql2o sql2o ) { this.sql2o = sql2o; @@ -74,18 +74,18 @@ public class AnimationEndpoint try (Connection con = sql2o.beginTransaction()) { con.createQuery(CREATE_SQL) - .executeUpdate(); + .executeUpdate(); } } private AnimationEntry findLatestAnimations(Connection con, int npcid) { return con.createQuery("select npcid, time, anim1, anim2, anim3, anim4, anim5, anim6, anim7, anim8, anim9, anim10 from animation " - + "where npcid = :npcid " - + "order by time desc " - + "limit 1") - .addParameter("npcid", npcid) - .executeAndFetchFirst(AnimationEntry.class); + + "where npcid = :npcid " + + "order by time desc " + + "limit 1") + .addParameter("npcid", npcid) + .executeAndFetchFirst(AnimationEntry.class); } public void submit(AnimationRequest animationRequest) @@ -98,7 +98,7 @@ public class AnimationEndpoint AnimationCache animationCache = keyCache.getIfPresent(npcid); if (animationCache == null - || animationCache.getAnim1() != animations[0] + || animationCache.getAnim1() != animations[0] || animationCache.getAnim2() != animations[1] || animationCache.getAnim3() != animations[2] || animationCache.getAnim4() != animations[3] @@ -137,7 +137,7 @@ public class AnimationEndpoint // already have these? if (animationEntry != null - && animationEntry.getAnimations()[0] == animations[0] + && animationEntry.getAnimations()[0] == animations[0] && animationEntry.getAnimations()[1] == animations[1] && animationEntry.getAnimations()[2] == animations[2] && animationEntry.getAnimations()[3] == animations[3] @@ -155,22 +155,22 @@ public class AnimationEndpoint if (query == null) { query = con.createQuery("insert into animation (npcid, rev, anim1, anim2, anim3, anim4, anim5, anim6, anim7, anim8, anim9, anim10) " - + "values (:npcid, :rev, :anim1, :anim2, :anim3, :anim4, anim5, anim6, anim7, anim8, anim9, anim10)"); + + "values (:npcid, :rev, :anim1, :anim2, :anim3, :anim4, anim5, anim6, anim7, anim8, anim9, anim10)"); } query.addParameter("npcid", npcid) - .addParameter("rev", animationRequest.getRevision()) - .addParameter("anim1", animations[0]) - .addParameter("anim2", animations[1]) - .addParameter("anim3", animations[2]) - .addParameter("anim4", animations[3]) - .addParameter("anim5", animations[4]) - .addParameter("anim6", animations[5]) - .addParameter("anim7", animations[6]) - .addParameter("anim8", animations[7]) - .addParameter("anim9", animations[8]) - .addParameter("anim10", animations[9]) - .addToBatch(); + .addParameter("rev", animationRequest.getRevision()) + .addParameter("anim1", animations[0]) + .addParameter("anim2", animations[1]) + .addParameter("anim3", animations[2]) + .addParameter("anim4", animations[3]) + .addParameter("anim5", animations[4]) + .addParameter("anim6", animations[5]) + .addParameter("anim7", animations[6]) + .addParameter("anim8", animations[7]) + .addParameter("anim9", animations[8]) + .addParameter("anim10", animations[9]) + .addToBatch(); } if (query != null) @@ -186,10 +186,10 @@ public class AnimationEndpoint try (Connection con = sql2o.open()) { return con.createQuery( - "select t1.npcid, t2.time, t2.rev, t2.anim1, t2.anim2, t2.anim3, t2.anim4, t2.anim5, t2.anim6, t2.anim7, t2.anim8, t2.anim9, t2.anim10 from " + - "(select npcid,max(id) as id from animation group by npcid) t1 " + - "join animation t2 on t1.id = t2.id") - .executeAndFetch(AnimationEntry.class); + "select t1.npcid, t2.time, t2.rev, t2.anim1, t2.anim2, t2.anim3, t2.anim4, t2.anim5, t2.anim6, t2.anim7, t2.anim8, t2.anim9, t2.anim10 from " + + "(select npcid,max(id) as id from animation group by npcid) t1 " + + "join animation t2 on t1.id = t2.id") + .executeAndFetch(AnimationEntry.class); } } @@ -198,9 +198,9 @@ public class AnimationEndpoint try (Connection con = sql2o.open()) { return con.createQuery("select npcid, time, rev, anim1, anim2, anim3, anim4, anim5, anim6, anim7, anim8, anim9, anim10 from animation " - + "where npcid = :npcid order by time desc limit 1") - .addParameter("npcid", npcid) - .executeAndFetchFirst(AnimationEntry.class); + + "where npcid = :npcid order by time desc limit 1") + .addParameter("npcid", npcid) + .executeAndFetchFirst(AnimationEntry.class); } } } diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/grounditems/GroundItemsPlugin.java b/runelite-client/src/main/java/net/runelite/client/plugins/grounditems/GroundItemsPlugin.java index 0da4ce2c94..e29c7dcf14 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/grounditems/GroundItemsPlugin.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/grounditems/GroundItemsPlugin.java @@ -31,6 +31,7 @@ import com.google.inject.Provides; import java.awt.Color; import java.awt.Rectangle; import static java.lang.Boolean.TRUE; +import static java.lang.Math.floor; import java.time.Instant; import java.util.ArrayList; import java.util.Collection; @@ -104,11 +105,15 @@ public class GroundItemsPlugin extends Plugin // items stay on the ground for 30 mins in an instance private static final int INSTANCE_DURATION_MILLIS = 45 * 60 * 1000; + private static final int INSTANCE_DURATION_TICKS = (int) floor(30 * 60 / 0.6); //untradeables stay on the ground for 150 seconds (http://oldschoolrunescape.wikia.com/wiki/Item#Dropping_and_Destroying) private static final int UNTRADEABLE_DURATION_MILLIS = 150 * 1000; + private static final int UNTRADEABLE_DURATION_TICKS = (int) floor(150 / 0.6); //items stay on the ground for 1 hour after death private static final int DEATH_DURATION_MILLIS = 60 * 60 * 1000; + private static final int DEATH_DURATION_TICKS = (int) floor(60 * 60 / 0.6); private static final int NORMAL_DURATION_MILLIS = 60 * 1000; + private static final int NORMAL_DURATION_TICKS = (int) floor(60 / 0.6); // Ground item menu options private static final int FIRST_OPTION = MenuAction.GROUND_ITEM_FIRST_OPTION.getId(); @@ -495,17 +500,21 @@ public class GroundItemsPlugin extends Plugin final int realItemId = itemComposition.getNote() != -1 ? itemComposition.getLinkedNoteId() : itemId; final int alchPrice = itemManager.getAlchValue(realItemId); int durationMillis; + int durationTicks; if (client.isInInstancedRegion()) { durationMillis = INSTANCE_DURATION_MILLIS; + durationTicks = INSTANCE_DURATION_TICKS; } else if (!itemComposition.isTradeable() && realItemId != COINS) { durationMillis = UNTRADEABLE_DURATION_MILLIS; + durationTicks = UNTRADEABLE_DURATION_TICKS; } else { durationMillis = NORMAL_DURATION_MILLIS; + durationTicks = NORMAL_DURATION_TICKS; } WorldPoint playerLocation = client.getLocalPlayer().getWorldLocation(); @@ -523,7 +532,7 @@ public class GroundItemsPlugin extends Plugin .durationMillis(durationMillis) .isAlwaysPrivate(client.isInInstancedRegion() || (!itemComposition.isTradeable() && realItemId != COINS)) .isOwnedByPlayer(tile.getWorldLocation().equals(playerLocation)) - .ticks(tile.getWorldLocation().equals(client.getLocalPlayer().getWorldLocation()) ? 200 : 100) + .ticks(durationTicks) .build(); @@ -593,9 +602,9 @@ public class GroundItemsPlugin extends Plugin { if (config.itemHighlightMode() != OVERLAY && event.getOption().equals("Take") - && event.getType() == THIRD_OPTION) + && event.getIdentifier() == THIRD_OPTION) { - int itemId = event.getIdentifier(); + int itemId = event.getType(); Scene scene = client.getScene(); Tile tile = scene.getTiles()[client.getPlane()][event.getActionParam0()][event.getActionParam1()]; ItemLayer itemLayer = tile.getItemLayer(); diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/keptondeath/ActuallyTradeableItem.java b/runelite-client/src/main/java/net/runelite/client/plugins/keptondeath/ActuallyTradeableItem.java deleted file mode 100644 index a4b50dc30e..0000000000 --- a/runelite-client/src/main/java/net/runelite/client/plugins/keptondeath/ActuallyTradeableItem.java +++ /dev/null @@ -1,221 +0,0 @@ -/* - * Copyright (c) 2018, TheStonedTurtle - * 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.keptondeath; - -import java.util.HashSet; -import static net.runelite.api.ItemID.ADAMANT_FIRE_ARROWS; -import static net.runelite.api.ItemID.ADAMANT_FIRE_ARROWS_2539; -import static net.runelite.api.ItemID.AIR_RUNE_PACK; -import static net.runelite.api.ItemID.AMETHYST_FIRE_ARROWS; -import static net.runelite.api.ItemID.AMETHYST_FIRE_ARROWS_21330; -import static net.runelite.api.ItemID.AMULET_OF_GLORY1; -import static net.runelite.api.ItemID.AMULET_OF_GLORY2; -import static net.runelite.api.ItemID.AMULET_OF_GLORY3; -import static net.runelite.api.ItemID.AMULET_OF_GLORY5; -import static net.runelite.api.ItemID.AMULET_OF_GLORY_T1; -import static net.runelite.api.ItemID.AMULET_OF_GLORY_T2; -import static net.runelite.api.ItemID.AMULET_OF_GLORY_T3; -import static net.runelite.api.ItemID.AMULET_OF_GLORY_T5; -import static net.runelite.api.ItemID.APPLES1; -import static net.runelite.api.ItemID.APPLES2; -import static net.runelite.api.ItemID.APPLES3; -import static net.runelite.api.ItemID.APPLES4; -import static net.runelite.api.ItemID.BANANAS1; -import static net.runelite.api.ItemID.BANANAS2; -import static net.runelite.api.ItemID.BANANAS3; -import static net.runelite.api.ItemID.BANANAS4; -import static net.runelite.api.ItemID.BASKET_PACK; -import static net.runelite.api.ItemID.BLACK_MASK_1; -import static net.runelite.api.ItemID.BLACK_MASK_2; -import static net.runelite.api.ItemID.BLACK_MASK_3; -import static net.runelite.api.ItemID.BLACK_MASK_4; -import static net.runelite.api.ItemID.BLACK_MASK_5; -import static net.runelite.api.ItemID.BLACK_MASK_6; -import static net.runelite.api.ItemID.BLACK_MASK_7; -import static net.runelite.api.ItemID.BLACK_MASK_8; -import static net.runelite.api.ItemID.BLACK_MASK_9; -import static net.runelite.api.ItemID.BLACK_SATCHEL; -import static net.runelite.api.ItemID.BRONZE_FIRE_ARROWS; -import static net.runelite.api.ItemID.BRONZE_FIRE_ARROWS_942; -import static net.runelite.api.ItemID.BURNING_AMULET1; -import static net.runelite.api.ItemID.BURNING_AMULET2; -import static net.runelite.api.ItemID.BURNING_AMULET3; -import static net.runelite.api.ItemID.BURNING_AMULET4; -import static net.runelite.api.ItemID.CAKE; -import static net.runelite.api.ItemID.CHAOS_RUNE_PACK; -import static net.runelite.api.ItemID.CHOCOLATE_CAKE; -import static net.runelite.api.ItemID.CHOCOLATE_SLICE; -import static net.runelite.api.ItemID.COMBAT_BRACELET1; -import static net.runelite.api.ItemID.COMBAT_BRACELET2; -import static net.runelite.api.ItemID.COMBAT_BRACELET3; -import static net.runelite.api.ItemID.COMBAT_BRACELET5; -import static net.runelite.api.ItemID.DRAGON_FIRE_ARROWS; -import static net.runelite.api.ItemID.DRAGON_FIRE_ARROWS_11222; -import static net.runelite.api.ItemID.EARTH_RUNE_PACK; -import static net.runelite.api.ItemID.FEATHER_PACK; -import static net.runelite.api.ItemID.FIRE_RUNE_PACK; -import static net.runelite.api.ItemID.GAMES_NECKLACE1; -import static net.runelite.api.ItemID.GAMES_NECKLACE2; -import static net.runelite.api.ItemID.GAMES_NECKLACE3; -import static net.runelite.api.ItemID.GAMES_NECKLACE4; -import static net.runelite.api.ItemID.GAMES_NECKLACE5; -import static net.runelite.api.ItemID.GAMES_NECKLACE6; -import static net.runelite.api.ItemID.GAMES_NECKLACE7; -import static net.runelite.api.ItemID.GOLD_SATCHEL; -import static net.runelite.api.ItemID.GREEN_SATCHEL; -import static net.runelite.api.ItemID.HALF_AN_ADMIRAL_PIE; -import static net.runelite.api.ItemID.HALF_AN_APPLE_PIE; -import static net.runelite.api.ItemID.HALF_A_BOTANICAL_PIE; -import static net.runelite.api.ItemID.HALF_A_FISH_PIE; -import static net.runelite.api.ItemID.HALF_A_GARDEN_PIE; -import static net.runelite.api.ItemID.HALF_A_MEAT_PIE; -import static net.runelite.api.ItemID.HALF_A_MUSHROOM_PIE; -import static net.runelite.api.ItemID.HALF_A_REDBERRY_PIE; -import static net.runelite.api.ItemID.HALF_A_SUMMER_PIE; -import static net.runelite.api.ItemID.HALF_A_WILD_PIE; -import static net.runelite.api.ItemID.IRON_FIRE_ARROWS; -import static net.runelite.api.ItemID.IRON_FIRE_ARROWS_2533; -import static net.runelite.api.ItemID.MIND_RUNE_PACK; -import static net.runelite.api.ItemID.MITHRIL_FIRE_ARROWS; -import static net.runelite.api.ItemID.MITHRIL_FIRE_ARROWS_2537; -import static net.runelite.api.ItemID.NECKLACE_OF_PASSAGE1; -import static net.runelite.api.ItemID.NECKLACE_OF_PASSAGE2; -import static net.runelite.api.ItemID.NECKLACE_OF_PASSAGE3; -import static net.runelite.api.ItemID.NECKLACE_OF_PASSAGE4; -import static net.runelite.api.ItemID.ORANGES1; -import static net.runelite.api.ItemID.ORANGES2; -import static net.runelite.api.ItemID.ORANGES3; -import static net.runelite.api.ItemID.ORANGES4; -import static net.runelite.api.ItemID.PLAIN_SATCHEL; -import static net.runelite.api.ItemID.PLANT_POT_PACK; -import static net.runelite.api.ItemID.RED_SATCHEL; -import static net.runelite.api.ItemID.RING_OF_DUELING1; -import static net.runelite.api.ItemID.RING_OF_DUELING2; -import static net.runelite.api.ItemID.RING_OF_DUELING3; -import static net.runelite.api.ItemID.RING_OF_DUELING4; -import static net.runelite.api.ItemID.RING_OF_DUELING5; -import static net.runelite.api.ItemID.RING_OF_DUELING6; -import static net.runelite.api.ItemID.RING_OF_DUELING7; -import static net.runelite.api.ItemID.RING_OF_WEALTH_1; -import static net.runelite.api.ItemID.RING_OF_WEALTH_2; -import static net.runelite.api.ItemID.RING_OF_WEALTH_3; -import static net.runelite.api.ItemID.RING_OF_WEALTH_4; -import static net.runelite.api.ItemID.RING_OF_WEALTH_I; -import static net.runelite.api.ItemID.RING_OF_WEALTH_I1; -import static net.runelite.api.ItemID.RING_OF_WEALTH_I2; -import static net.runelite.api.ItemID.RING_OF_WEALTH_I3; -import static net.runelite.api.ItemID.RING_OF_WEALTH_I4; -import static net.runelite.api.ItemID.RING_OF_WEALTH_I5; -import static net.runelite.api.ItemID.RUNE_FIRE_ARROWS; -import static net.runelite.api.ItemID.RUNE_FIRE_ARROWS_2541; -import static net.runelite.api.ItemID.RUNE_SATCHEL; -import static net.runelite.api.ItemID.SACK_PACK; -import static net.runelite.api.ItemID.SKILLS_NECKLACE1; -import static net.runelite.api.ItemID.SKILLS_NECKLACE2; -import static net.runelite.api.ItemID.SKILLS_NECKLACE3; -import static net.runelite.api.ItemID.SKILLS_NECKLACE5; -import static net.runelite.api.ItemID.SLICE_OF_CAKE; -import static net.runelite.api.ItemID.STEEL_FIRE_ARROWS; -import static net.runelite.api.ItemID.STEEL_FIRE_ARROWS_2535; -import static net.runelite.api.ItemID.STRAWBERRIES1; -import static net.runelite.api.ItemID.STRAWBERRIES2; -import static net.runelite.api.ItemID.STRAWBERRIES3; -import static net.runelite.api.ItemID.STRAWBERRIES4; -import static net.runelite.api.ItemID.TOMATOES1; -import static net.runelite.api.ItemID.TOMATOES2; -import static net.runelite.api.ItemID.TOMATOES3; -import static net.runelite.api.ItemID.TOMATOES4; -import static net.runelite.api.ItemID.TZHAAR_AIR_RUNE_PACK; -import static net.runelite.api.ItemID.TZHAAR_EARTH_RUNE_PACK; -import static net.runelite.api.ItemID.TZHAAR_FIRE_RUNE_PACK; -import static net.runelite.api.ItemID.TZHAAR_WATER_RUNE_PACK; -import static net.runelite.api.ItemID.UNFINISHED_BROAD_BOLT_PACK; -import static net.runelite.api.ItemID.WATER_RUNE_PACK; -import static net.runelite.api.ItemID._12_ANCHOVY_PIZZA; -import static net.runelite.api.ItemID._12_MEAT_PIZZA; -import static net.runelite.api.ItemID._12_PINEAPPLE_PIZZA; -import static net.runelite.api.ItemID._12_PLAIN_PIZZA; -import static net.runelite.api.ItemID._23_CAKE; -import static net.runelite.api.ItemID._23_CHOCOLATE_CAKE; - -/** - * Certain items aren't tradeable via the GE but can be traded between players. - * The {@link net.runelite.api.ItemDefinition}'s `isTradeable` value is based on GE trade-ability so we need - * to account for these items. These items should only be kept if protected based on item value. - */ -public enum ActuallyTradeableItem -{ - // Item Packs - RUNE_PACKS(AIR_RUNE_PACK, WATER_RUNE_PACK, EARTH_RUNE_PACK, FIRE_RUNE_PACK, CHAOS_RUNE_PACK, MIND_RUNE_PACK), - TZHAAR_PACKS(TZHAAR_AIR_RUNE_PACK, TZHAAR_WATER_RUNE_PACK, TZHAAR_EARTH_RUNE_PACK, TZHAAR_FIRE_RUNE_PACK), - OTHER_PACKS(BASKET_PACK, FEATHER_PACK, PLANT_POT_PACK, SACK_PACK, UNFINISHED_BROAD_BOLT_PACK), - // Equipment - BLACK_MASK(BLACK_MASK_1, BLACK_MASK_2, BLACK_MASK_3, BLACK_MASK_4, BLACK_MASK_5, BLACK_MASK_6, BLACK_MASK_7, BLACK_MASK_8, BLACK_MASK_9), - SATCHELS(BLACK_SATCHEL, GOLD_SATCHEL, GREEN_SATCHEL, PLAIN_SATCHEL, RED_SATCHEL, RUNE_SATCHEL), - FIRE_ARROWS(BRONZE_FIRE_ARROWS, IRON_FIRE_ARROWS, STEEL_FIRE_ARROWS, MITHRIL_FIRE_ARROWS, ADAMANT_FIRE_ARROWS, RUNE_FIRE_ARROWS, AMETHYST_FIRE_ARROWS, DRAGON_FIRE_ARROWS), - FIRE_ARROWS_2(BRONZE_FIRE_ARROWS_942, IRON_FIRE_ARROWS_2533, STEEL_FIRE_ARROWS_2535, MITHRIL_FIRE_ARROWS_2537, ADAMANT_FIRE_ARROWS_2539, RUNE_FIRE_ARROWS_2541, AMETHYST_FIRE_ARROWS_21330, DRAGON_FIRE_ARROWS_11222), - // Food Items - HALF_A(HALF_A_GARDEN_PIE, HALF_A_MEAT_PIE, HALF_A_MUSHROOM_PIE, HALF_A_REDBERRY_PIE, HALF_A_BOTANICAL_PIE, HALF_A_FISH_PIE, HALF_A_SUMMER_PIE, HALF_A_WILD_PIE, HALF_AN_ADMIRAL_PIE, HALF_AN_APPLE_PIE), - PIZZA(_12_ANCHOVY_PIZZA, _12_MEAT_PIZZA, _12_PINEAPPLE_PIZZA, _12_PLAIN_PIZZA), - CAKES(CAKE, _23_CAKE, SLICE_OF_CAKE, CHOCOLATE_CAKE, _23_CHOCOLATE_CAKE, CHOCOLATE_SLICE), - BASKETS(APPLES1, APPLES2, APPLES3, APPLES4, BANANAS1, BANANAS2, BANANAS3, BANANAS4, ORANGES1, ORANGES2, ORANGES3, ORANGES4, STRAWBERRIES1, STRAWBERRIES2, STRAWBERRIES3, STRAWBERRIES4, TOMATOES1, TOMATOES2, TOMATOES3, TOMATOES4), - // Charged Jewelery - BURNING_AMULET(BURNING_AMULET1, BURNING_AMULET2, BURNING_AMULET3, BURNING_AMULET4), - NECKLACE_OF_PASSAGE(NECKLACE_OF_PASSAGE1, NECKLACE_OF_PASSAGE2, NECKLACE_OF_PASSAGE3, NECKLACE_OF_PASSAGE4), - RING_OF_DUELING(RING_OF_DUELING1, RING_OF_DUELING2, RING_OF_DUELING3, RING_OF_DUELING4, RING_OF_DUELING5, RING_OF_DUELING6, RING_OF_DUELING7), - GAMES_NECKLACE(GAMES_NECKLACE1, GAMES_NECKLACE2, GAMES_NECKLACE3, GAMES_NECKLACE4, GAMES_NECKLACE5, GAMES_NECKLACE6, GAMES_NECKLACE7), - COMBAT_BRACELET(COMBAT_BRACELET1, COMBAT_BRACELET2, COMBAT_BRACELET3, COMBAT_BRACELET5), - RING_OF_WEALTH(RING_OF_WEALTH_I, RING_OF_WEALTH_1, RING_OF_WEALTH_I1, RING_OF_WEALTH_2, RING_OF_WEALTH_I2, RING_OF_WEALTH_3, RING_OF_WEALTH_I3, RING_OF_WEALTH_4, RING_OF_WEALTH_I4, RING_OF_WEALTH_I5), - AMULET_OF_GLORY(AMULET_OF_GLORY1, AMULET_OF_GLORY2, AMULET_OF_GLORY3, AMULET_OF_GLORY5), - AMULET_OF_GLORY_T(AMULET_OF_GLORY_T1, AMULET_OF_GLORY_T2, AMULET_OF_GLORY_T3, AMULET_OF_GLORY_T5), - SKILLS_NECKLACE(SKILLS_NECKLACE1, SKILLS_NECKLACE2, SKILLS_NECKLACE3, SKILLS_NECKLACE5), - ; - - private final int[] ids; - - private static final HashSet ID_SET; - - static - { - ID_SET = new HashSet<>(); - for (ActuallyTradeableItem p : values()) - { - for (int id : p.ids) - { - ID_SET.add(id); - } - } - } - - ActuallyTradeableItem(int... ids) - { - this.ids = ids; - } - - public static Boolean check(int id) - { - return ID_SET.contains(id); - } -} diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/keptondeath/AlwaysLostItem.java b/runelite-client/src/main/java/net/runelite/client/plugins/keptondeath/AlwaysLostItem.java deleted file mode 100644 index 825217cfaa..0000000000 --- a/runelite-client/src/main/java/net/runelite/client/plugins/keptondeath/AlwaysLostItem.java +++ /dev/null @@ -1,70 +0,0 @@ -/* - * Copyright (c) 2018, TheStonedTurtle - * 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.keptondeath; - -import com.google.common.collect.ImmutableMap; -import lombok.Getter; -import net.runelite.api.ItemID; - -/** - * Certain Items receive a white outline by Jagex as they are always lost on death. This is sometimes incorrectly - * added to Items by Jagex as the item is actually kept in non-pvp areas of the game, such as the Rune Pouch. - *

- * The white outline will be added to these items when they are lost on death. - */ -public enum AlwaysLostItem -{ - RUNE_POUCH(ItemID.RUNE_POUCH, true), - LOOTING_BAG(ItemID.LOOTING_BAG, false), - LOOTING_BAG_22586(ItemID.LOOTING_BAG_22586, false), - CLUE_BOX(ItemID.CLUE_BOX, false); - - private final int itemID; - @Getter - private final boolean kept; - - private static final ImmutableMap ID_MAP; - - static - { - ImmutableMap.Builder map = ImmutableMap.builder(); - for (AlwaysLostItem p : values()) - { - map.put(p.itemID, p); - } - ID_MAP = map.build(); - } - - AlwaysLostItem(int itemID, boolean kept) - { - this.itemID = itemID; - this.kept = kept; - } - - public static AlwaysLostItem getByItemID(int itemID) - { - return ID_MAP.get(itemID); - } -} diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/keptondeath/BrokenOnDeathItem.java b/runelite-client/src/main/java/net/runelite/client/plugins/keptondeath/BrokenOnDeathItem.java deleted file mode 100644 index 0c10d2e954..0000000000 --- a/runelite-client/src/main/java/net/runelite/client/plugins/keptondeath/BrokenOnDeathItem.java +++ /dev/null @@ -1,113 +0,0 @@ -/* - * Copyright (c) 2018, TheStonedTurtle - * 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.keptondeath; - -import java.util.HashSet; -import net.runelite.api.ItemID; - -/** - * Some non tradeable items are kept on death inside low level wilderness (1-20) but are turned into a broken variant. - *

- * The non-broken variant will be shown inside the interface. - */ -public enum BrokenOnDeathItem -{ - // Capes - FIRE_CAPE(ItemID.FIRE_CAPE), - FIRE_MAX_CAPE(ItemID.FIRE_MAX_CAPE), - INFERNAL_CAPE(ItemID.INFERNAL_CAPE), - INFERNAL_MAX_CAPE(ItemID.INFERNAL_MAX_CAPE), - AVAS_ASSEMBLER(ItemID.AVAS_ASSEMBLER), - ASSEMBLER_MAX_CAPE(ItemID.ASSEMBLER_MAX_CAPE), - - // Defenders - BRONZE_DEFENDER(ItemID.BRONZE_DEFENDER), - IRON_DEFENDER(ItemID.IRON_DEFENDER), - STEEL_DEFENDER(ItemID.STEEL_DEFENDER), - BLACK_DEFENDER(ItemID.BLACK_DEFENDER), - MITHRIL_DEFENDER(ItemID.MITHRIL_DEFENDER), - ADAMANT_DEFENDER(ItemID.ADAMANT_DEFENDER), - RUNE_DEFENDER(ItemID.RUNE_DEFENDER), - DRAGON_DEFENDER(ItemID.DRAGON_DEFENDER), - AVERNIC_DEFENDER(ItemID.AVERNIC_DEFENDER), - - // Void - VOID_MAGE_HELM(ItemID.VOID_MAGE_HELM), - VOID_RANGER_HELM(ItemID.VOID_RANGER_HELM), - VOID_MELEE_HELM(ItemID.VOID_MELEE_HELM), - VOID_KNIGHT_TOP(ItemID.VOID_KNIGHT_TOP), - VOID_KNIGHT_ROBE(ItemID.VOID_KNIGHT_ROBE), - VOID_KNIGHT_GLOVES(ItemID.VOID_KNIGHT_GLOVES), - VOID_KNIGHT_MACE(ItemID.VOID_KNIGHT_MACE), - ELITE_VOID_TOP(ItemID.ELITE_VOID_TOP), - ELITE_VOID_ROBE(ItemID.ELITE_VOID_ROBE), - - // Barb Assault - FIGHTER_HAT(ItemID.FIGHTER_HAT), - RANGER_HAT(ItemID.RANGER_HAT), - HEALER_HAT(ItemID.HEALER_HAT), - FIGHTER_TORSO(ItemID.FIGHTER_TORSO), - PENANCE_SKIRT(ItemID.PENANCE_SKIRT), - - // Castle Wars - SARADOMIN_HALO(ItemID.SARADOMIN_HALO), - ZAMORAK_HALO(ItemID.ZAMORAK_HALO), - GUTHIX_HALO(ItemID.GUTHIX_HALO), - DECORATIVE_MAGIC_HAT(ItemID.DECORATIVE_ARMOUR_11898), - DECORATIVE_MAGIC_ROBE_TOP(ItemID.DECORATIVE_ARMOUR_11896), - DECORATIVE_MAGIC_ROBE_LEGS(ItemID.DECORATIVE_ARMOUR_11897), - DECORATIVE_RANGE_TOP(ItemID.DECORATIVE_ARMOUR_11899), - DECORATIVE_RANGE_BOTTOM(ItemID.DECORATIVE_ARMOUR_11900), - DECORATIVE_RANGE_QUIVER(ItemID.DECORATIVE_ARMOUR_11901), - GOLD_DECORATIVE_HELM(ItemID.DECORATIVE_HELM_4511), - GOLD_DECORATIVE_BODY(ItemID.DECORATIVE_ARMOUR_4509), - GOLD_DECORATIVE_LEGS(ItemID.DECORATIVE_ARMOUR_4510), - GOLD_DECORATIVE_SKIRT(ItemID.DECORATIVE_ARMOUR_11895), - GOLD_DECORATIVE_SHIELD(ItemID.DECORATIVE_SHIELD_4512), - GOLD_DECORATIVE_SWORD(ItemID.DECORATIVE_SWORD_4508); - - private final int itemID; - - private static final HashSet ID_SET; - - static - { - ID_SET = new HashSet<>(); - for (BrokenOnDeathItem p : values()) - { - ID_SET.add(p.itemID); - } - } - - BrokenOnDeathItem(int itemID) - { - this.itemID = itemID; - } - - public static boolean check(int itemID) - { - return ID_SET.contains(itemID); - } -} diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/keptondeath/KeptOnDeathPlugin.java b/runelite-client/src/main/java/net/runelite/client/plugins/keptondeath/KeptOnDeathPlugin.java deleted file mode 100644 index 9498ef493f..0000000000 --- a/runelite-client/src/main/java/net/runelite/client/plugins/keptondeath/KeptOnDeathPlugin.java +++ /dev/null @@ -1,592 +0,0 @@ -/* - * Copyright (c) 2018, TheStonedTurtle - * 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.keptondeath; - -import lombok.extern.slf4j.Slf4j; -import net.runelite.client.plugins.Plugin; -import net.runelite.client.plugins.PluginDescriptor; -import net.runelite.client.plugins.PluginType; - -@PluginDescriptor( - name = "Kept on Death", - description = "Reworks the Items Kept on Death interface to be more accurate", - type = PluginType.UTILITY, - enabledByDefault = false -) - -@Slf4j -public class KeptOnDeathPlugin extends Plugin -{ -} -//todo once bytecodes work again, re-enable -/* -{ - // Handles Clicking on items in Kept on Death Interface - private static final int SCRIPT_ID = ScriptID.KEPT_LOST_ITEM_EXAMINE; - private static final double HIGH_ALCH = 0.6; - - // Item Container helpers - private static final int MAX_ROW_ITEMS = 8; - private static final int STARTING_X = 5; - private static final int STARTING_Y = 25; - private static final int X_INCREMENT = 40; - private static final int Y_INCREMENT = 38; - private static final int ORIGINAL_WIDTH = 36; - private static final int ORIGINAL_HEIGHT = 32; - private static final int ORIGINAL_LOST_HEIGHT = 209; - private static final int ORIGINAL_LOST_Y = 107; - - // Information panel text helpers - private static final DecimalFormat NUMBER_FORMAT = new DecimalFormat("#,###"); - private static final String MAX_KEPT_ITEMS_FORMAT = "Max items kept on death :

~ %s ~"; - private static final String ACTION_TEXT = "Item: %s"; - private static final String DEFAULT = "3 items protected by default"; - private static final String IS_SKULLED = "PK skull -3"; - private static final String PROTECTING_ITEM = "Protect Item prayer +1"; - private static final String ACTUAL = "Actually protecting %s items"; - private static final String WHITE_OUTLINE = "Items with a white outline will always be lost."; - private static final String CHANGED_MECHANICS = "Untradeable items are kept on death in non-pvp scenarios."; - private static final String NON_PVP = "You will have 1 hour to retrieve your lost items."; - private static final String LINE_BREAK = "
"; - private static final String UIM_DEFAULT = "You are an UIM which means 0 items are protected by default"; - private static final int ORIGINAL_INFO_HEIGHT = 183; - private static final int FONT_COLOR = 0xFF981F; - - // Button Names and Images - private static final String PROTECT_ITEM_BUTTON_NAME = "Protect Item Prayer"; - private static final String SKULLED_BUTTON_NAME = "Skulled"; - private static final String LOW_WILDY_BUTTON_NAME = "Low Wildy (1-20)"; - private static final String DEEP_WILDY_BUTTON_NAME = "Deep Wildy (21+)"; - private static final int PROTECT_ITEM_SPRITE_ID = SpriteID.PRAYER_PROTECT_ITEM; - private static final int SKULL_SPRITE_ID = SpriteID.PLAYER_KILLER_SKULL_523; - private static final int SWORD_SPRITE_ID = SpriteID.MULTI_COMBAT_ZONE_CROSSED_SWORDS; - private static final int SKULL_2_SPRITE_ID = SpriteID.FIGHT_PITS_WINNER_SKULL_RED; - - @Inject - private Client client; - - @Inject - private ItemManager itemManager; - - @Getter - private boolean widgetVisible = false; - - private LinkedHashMap buttonMap = new LinkedHashMap<>(); - private boolean isSkulled = false; - private boolean protectingItem = false; - private boolean hasAlwaysLost = false; - private int wildyLevel = -1; - - @Subscribe - protected void onScriptCallbackEvent(ScriptCallbackEvent event) - { - if (event.getEventName().equals("deathKeepBuild")) - { - // The script in charge of building the Items Kept on Death interface has finished running. - // Make all necessary changes now. - - // Players inside Safe Areas (POH/Clan Wars) & playing DMM see the default interface - if (isInSafeArea() || client.getWorldType().contains(WorldType.DEADMAN)) - { - return; - } - - syncSettings(); - createWidgetButtons(); - recreateItemsKeptOnDeathWidget(); - } - } - - // Sync user settings - private void syncSettings() - { - SkullIcon s = client.getLocalPlayer().getSkullIcon(); - // Ultimate iron men deaths are treated like they are always skulled - isSkulled = (s != null && s.equals(SkullIcon.SKULL)) || isUltimateIronman(); - protectingItem = client.getVar(Varbits.PRAYER_PROTECT_ITEM) == 1; - syncCurrentWildyLevel(); - } - - private void syncCurrentWildyLevel() - { - if (client.getVar(Varbits.IN_WILDERNESS) != 1) - { - // if they are in a PvP world and not in a safe zone act like in lvl 1 wildy - if (isInPvpWorld() && !isInPvPSafeZone()) - { - wildyLevel = 1; - return; - } - wildyLevel = -1; - return; - } - - int y = client.getLocalPlayer().getWorldLocation().getY(); - - // Credits to atomicint_#5069 (Discord) - int underLevel = ((y - 9920) / 8) + 1; - int upperLevel = ((y - 3520) / 8) + 1; - wildyLevel = (y > 6400 ? underLevel : upperLevel); - } - - private boolean isInPvpWorld() - { - EnumSet world = client.getWorldType(); - return world.contains(WorldType.PVP) || world.contains(WorldType.HIGH_RISK); - } - - private boolean isInPvPSafeZone() - { - Widget w = client.getWidget(WidgetInfo.PVP_WORLD_SAFE_ZONE); - return w != null && !w.isHidden(); - } - - private boolean isInSafeArea() - { - Widget w = client.getWidget(WidgetInfo.ITEMS_KEPT_SAFE_ZONE_CONTAINER); - return w != null && !w.isHidden(); - } - - private boolean isUltimateIronman() - { - return client.getAccountType().equals(AccountType.ULTIMATE_IRONMAN); - } - - private int getDefaultItemsKept() - { - int count = isSkulled ? 0 : 3; - - if (protectingItem) - { - count++; - } - - return count; - } - - private void recreateItemsKeptOnDeathWidget() - { - // Text flags based on items should be reset everytime the widget is recreated - hasAlwaysLost = false; - - Widget lost = client.getWidget(WidgetInfo.ITEMS_LOST_ON_DEATH_CONTAINER); - Widget kept = client.getWidget(WidgetInfo.ITEMS_KEPT_ON_DEATH_CONTAINER); - if (lost != null && kept != null) - { - // Grab all items on player and sort by price. - List items = new ArrayList<>(); - ItemContainer inventory = client.getItemContainer(InventoryID.INVENTORY); - Item[] inv = inventory == null ? new Item[0] : inventory.getItems(); - ItemContainer equipment = client.getItemContainer(InventoryID.EQUIPMENT); - Item[] equip = equipment == null ? new Item[0] : equipment.getItems(); - Collections.addAll(items, inv); - Collections.addAll(items, equip); - // Sort by item price - items.sort((o1, o2) -> - { - int o1ID = ItemVariationMapping.map(itemManager.canonicalize(o1.getId())); - int o2ID = ItemVariationMapping.map(itemManager.canonicalize(o2.getId())); - ItemDefinition c1 = itemManager.getItemDefinition(o1ID); - ItemDefinition c2 = itemManager.getItemDefinition(o2ID); - int exchangePrice1 = c1.isTradeable() ? itemManager.getItemPrice(c1.getId()) : c1.getPrice(); - int exchangePrice2 = c2.isTradeable() ? itemManager.getItemPrice(c2.getId()) : c2.getPrice(); - return exchangePrice2 - exchangePrice1; - }); - - int keepCount = getDefaultItemsKept(); - - List keptItems = new ArrayList<>(); - List lostItems = new ArrayList<>(); - for (Item i : items) - { - int id = i.getId(); - if (id == -1) - { - continue; - } - - ItemDefinition c = itemManager.getItemDefinition(i.getId()); - Widget itemWidget = createItemWidget(i.getQuantity(), c); - - // Bonds are always kept and do not count towards the limit. - if (id == ItemID.OLD_SCHOOL_BOND || id == ItemID.OLD_SCHOOL_BOND_UNTRADEABLE) - { - keptItems.add(itemWidget); - continue; - } - - // Certain items are always lost on death and have a white outline which we need to readd - AlwaysLostItem item = AlwaysLostItem.getByItemID(i.getId()); - if (item != null) - { - // Some of these items are kept on death (outside wildy), like the Rune pouch. Ignore them - if (!item.isKept() || wildyLevel > 0) - { - itemWidget.setOnOpListener(SCRIPT_ID, 0, i.getQuantity(), c.getName()); - itemWidget.setBorderType(2); - lostItems.add(itemWidget); - hasAlwaysLost = true; - continue; - } - } - - // Keep most valuable items regardless of trade-ability. - if (keepCount > 0) - { - if (i.getQuantity() > keepCount) - { - keptItems.add(createItemWidget(keepCount, c)); - itemWidget.setItemQuantity(i.getQuantity() - keepCount); - keepCount = 0; - } - else - { - keptItems.add(itemWidget); - keepCount -= i.getQuantity(); - continue; - } - } - - - if (!checkTradeable(i.getId(), c) && wildyLevel < 21) - { - // Certain items are turned into broken variants inside the wilderness. - if (BrokenOnDeathItem.check(i.getId())) - { - keptItems.add(itemWidget); - continue; - } - - // Ignore all non tradeables in wildy except for the above case(s). - if (wildyLevel > 0) - { - lostItems.add(itemWidget); - continue; - } - - keptItems.add(itemWidget); - } - else - { - itemWidget.setOnOpListener(SCRIPT_ID, 0, i.getQuantity(), c.getName()); - lostItems.add(itemWidget); - } - } - - int rows = keptItems.size() > MAX_ROW_ITEMS ? keptItems.size() / MAX_ROW_ITEMS : 0; - // Adjust items lost container position if new rows were added to kept items container - lost.setOriginalY(ORIGINAL_LOST_Y + (rows * Y_INCREMENT)); - lost.setOriginalHeight(ORIGINAL_LOST_HEIGHT - (rows * Y_INCREMENT)); - setWidgetChildren(kept, keptItems); - setWidgetChildren(lost, lostItems); - - updateKeptWidgetInfoText(); - } - } - - */ -/** - * Wrapper for widget.setChildren() but updates the child index and original positions - * Used for Items Kept and Lost containers - * - * @param parent Widget to override children - * @param widgets Children to set on parent - *

- * Creates the text to be displayed in the right side of the interface based on current selections - *

- * Corrects the Information panel based on the item containers - *

- * Creates an Item Widget for use inside the Kept on Death Interface - * @param qty Amount of item - * @param c Items Composition - * @return - *//* - - private void setWidgetChildren(Widget parent, List widgets) - { - Widget[] children = parent.getChildren(); - if (children == null) - { - // Create a child so we can copy the returned Widget[] and avoid hn casting issues from creating a new Widget[] - parent.createChild(0, WidgetType.GRAPHIC); - children = parent.getChildren(); - } - Widget[] itemsArray = Arrays.copyOf(children, widgets.size()); - - int parentId = parent.getId(); - int startingIndex = 0; - for (Widget w : widgets) - { - int originalX = STARTING_X + ((startingIndex % MAX_ROW_ITEMS) * X_INCREMENT); - int originalY = STARTING_Y + ((startingIndex / MAX_ROW_ITEMS) * Y_INCREMENT); - - w.setParentId(parentId); - w.setId(parentId); - w.setIndex(startingIndex); - - w.setOriginalX(originalX); - w.setOriginalY(originalY); - w.revalidate(); - - itemsArray[startingIndex] = w; - startingIndex++; - } - - parent.setChildren(itemsArray); - parent.revalidate(); - } - - */ -/** - * Creates the text to be displayed in the right side of the interface based on current selections - *//* - - private String getUpdatedInfoText() - { - String textToAdd = DEFAULT; - - if (isUltimateIronman()) - { - textToAdd = UIM_DEFAULT; - } - else - { - if (isSkulled) - { - textToAdd += LINE_BREAK + IS_SKULLED; - } - - if (protectingItem) - { - textToAdd += LINE_BREAK + PROTECTING_ITEM; - } - - textToAdd += LINE_BREAK + String.format(ACTUAL, getDefaultItemsKept()); - } - - - if (wildyLevel < 1) - { - textToAdd += LINE_BREAK + LINE_BREAK + NON_PVP; - } - - if (hasAlwaysLost) - { - textToAdd += LINE_BREAK + LINE_BREAK + WHITE_OUTLINE; - } - - textToAdd += LINE_BREAK + LINE_BREAK + CHANGED_MECHANICS; - - return textToAdd; - } - - */ -/** - * Corrects the Information panel based on the item containers - *//* - - private void updateKeptWidgetInfoText() - { - // Add Information text widget - createNewTextWidget(); - - // Update Items lost total value - Widget lost = client.getWidget(WidgetInfo.ITEMS_LOST_ON_DEATH_CONTAINER); - double total = 0; - for (Widget w : lost.getChildren()) - { - if (w.getItemId() == -1) - { - continue; - } - double price = itemManager.getItemPrice(w.getItemId()); - if (price == 0) - { - // Default to alch price - price = itemManager.getItemDefinition(w.getItemId()).getPrice() * HIGH_ALCH; - } - total += price; - } - Widget lostValue = client.getWidget(WidgetInfo.ITEMS_LOST_VALUE); - lostValue.setText(NUMBER_FORMAT.format(total) + " gp"); - - // Update Max items kept - Widget kept = client.getWidget(WidgetInfo.ITEMS_KEPT_ON_DEATH_CONTAINER); - Widget max = client.getWidget(WidgetInfo.ITEMS_KEPT_MAX); - max.setText(String.format(MAX_KEPT_ITEMS_FORMAT, kept.getChildren().length)); - } - - // isTradeable checks if they are traded on the grand exchange, some items are trade-able but not via GE - private boolean checkTradeable(int id, ItemDefinition c) - { - // If the item is a note check the unnoted variants trade ability - if (c.getNote() != -1) - { - return checkTradeable(c.getLinkedNoteId(), itemManager.getItemDefinition(c.getLinkedNoteId())); - } - - switch (id) - { - case ItemID.COINS_995: - case ItemID.PLATINUM_TOKEN: - return true; - default: - if (ActuallyTradeableItem.check(id)) - { - return true; - } - } - - return c.isTradeable(); - } - - private void createNewTextWidget() - { - // The text use to be put inside this container but since we can't create LAYER widgets - // We needed to edit this to be a layer for adding buttons - Widget old = client.getWidget(WidgetInfo.ITEMS_KEPT_INFORMATION_CONTAINER); - - // Update the existing TEXT container if it exists. It should be the last child of the old text widget - // client.getWidget() seems to not find indexed child widgets - Widget[] children = old.getChildren(); - if (children != null && children.length > 0) - { - Widget x = old.getChild(children.length - 1); - if (x.getId() == WidgetInfo.ITEMS_KEPT_CUSTOM_TEXT_CONTAINER.getId()) - { - x.setText(getUpdatedInfoText()); - x.revalidate(); - return; - } - } - - Widget w = old.createChild(-1, WidgetType.TEXT); - // Position under buttons taking remaining space - w.setOriginalWidth(old.getOriginalWidth()); - w.setOriginalHeight(ORIGINAL_INFO_HEIGHT - old.getOriginalHeight()); - w.setOriginalY(old.getOriginalHeight()); - - w.setFontId(FontID.PLAIN_11); - w.setTextShadowed(true); - w.setTextColor(FONT_COLOR); - - w.setText(getUpdatedInfoText()); - w.setId(WidgetInfo.ITEMS_KEPT_CUSTOM_TEXT_CONTAINER.getId()); - w.revalidate(); - - // Need to reset height so text is visible? - old.setOriginalHeight(ORIGINAL_INFO_HEIGHT); - old.revalidate(); - } - - private void createWidgetButtons() - { - buttonMap.clear(); - - // Ultimate Iron men are always skulled and can't use the protect item prayer - if (!isUltimateIronman()) - { - createButton(PROTECT_ITEM_BUTTON_NAME, PROTECT_ITEM_SPRITE_ID, protectingItem); - createButton(SKULLED_BUTTON_NAME, SKULL_SPRITE_ID, isSkulled); - } - createButton(LOW_WILDY_BUTTON_NAME, SWORD_SPRITE_ID, wildyLevel > 0 && wildyLevel <= 20); - createButton(DEEP_WILDY_BUTTON_NAME, SKULL_2_SPRITE_ID, wildyLevel > 20); - - Widget parent = client.getWidget(WidgetInfo.ITEMS_KEPT_INFORMATION_CONTAINER); - parent.setType(WidgetType.LAYER); - parent.revalidate(); - WidgetButton.addButtonsToContainerWidget(parent, buttonMap.values()); - } - - private void createButton(String name, int spriteID, boolean startingFlag) - { - WidgetButton button = new WidgetButton(name, spriteID, startingFlag, this::buttonCallback, client); - buttonMap.put(name, button); - } - - private void buttonCallback(String name, boolean selected) - { - log.debug("Clicked Widget Button {}. New value: {}", name, selected); - switch (name) - { - case PROTECT_ITEM_BUTTON_NAME: - protectingItem = selected; - break; - case SKULLED_BUTTON_NAME: - isSkulled = selected; - break; - case LOW_WILDY_BUTTON_NAME: - if (!selected) - { - syncCurrentWildyLevel(); - break; - } - wildyLevel = 1; - buttonMap.get(DEEP_WILDY_BUTTON_NAME).setSelected(false); - break; - case DEEP_WILDY_BUTTON_NAME: - if (!selected) - { - syncCurrentWildyLevel(); - break; - } - wildyLevel = 21; - buttonMap.get(LOW_WILDY_BUTTON_NAME).setSelected(false); - break; - default: - log.warn("Unhandled Button Name: {}", name); - return; - } - - recreateItemsKeptOnDeathWidget(); - } - - */ -/** - * Creates an Item Widget for use inside the Kept on Death Interface - * - * @param qty Amount of item - * @param c Items Composition - * @return - *//* - - private Widget createItemWidget(int qty, ItemDefinition c) - { - Widget itemWidget = client.createWidget(); - itemWidget.setType(WidgetType.GRAPHIC); - itemWidget.setItemId(c.getId()); - itemWidget.setItemQuantity(qty); - itemWidget.setHasListener(true); - itemWidget.setIsIf3(true); - itemWidget.setOriginalWidth(ORIGINAL_WIDTH); - itemWidget.setOriginalHeight(ORIGINAL_HEIGHT); - itemWidget.setBorderType(1); - - itemWidget.setAction(1, String.format(ACTION_TEXT, c.getName())); - itemWidget.setOnOpListener(SCRIPT_ID, 1, qty, c.getName()); - - return itemWidget; - } -}*/ diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/keptondeath/WidgetButton.java b/runelite-client/src/main/java/net/runelite/client/plugins/keptondeath/WidgetButton.java deleted file mode 100644 index 29a1b13b6e..0000000000 --- a/runelite-client/src/main/java/net/runelite/client/plugins/keptondeath/WidgetButton.java +++ /dev/null @@ -1,176 +0,0 @@ -/* - * Copyright (c) 2018, TheStonedTurtle - * 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.keptondeath; - -import java.util.Arrays; -import java.util.Collection; -import lombok.Getter; -import lombok.extern.slf4j.Slf4j; -import net.runelite.api.Client; -import net.runelite.api.SpriteID; -import net.runelite.api.widgets.JavaScriptCallback; -import net.runelite.api.widgets.Widget; -import net.runelite.api.widgets.WidgetType; - -@Slf4j -public class WidgetButton -{ - private static final int ICON_HEIGHT = 26; - private static final int ICON_WIDTH = 26; - private static final int BACKGROUND_HEIGHT = 32; - private static final int BACKGROUND_WIDTH = 32; - private static final int PADDING = 5; - private static final int ICON_PADDING = (BACKGROUND_HEIGHT - ICON_HEIGHT) / 2; - - private static final int BACKGROUND_SPRITE_ID = SpriteID.EQUIPMENT_SLOT_TILE; - private static final int SELECTED_BACKGROUND_SPRITE_ID = SpriteID.EQUIPMENT_SLOT_SELECTED; - - public interface WidgetButtonCallback - { - void run(String name, boolean newState); - } - - private String name; - private int spriteID; - @Getter - private Widget icon; - @Getter - private Widget background; - private boolean selected; - private WidgetButtonCallback callback; - - WidgetButton(String name, int spriteID, boolean selectedStartState, WidgetButtonCallback callback, Client client) - { - this.name = name; - this.spriteID = spriteID; - this.selected = selectedStartState; - this.callback = callback; - createBackgroundWidget(client); - createIconWidget(client); - } - - private void createBackgroundWidget(Client client) - { - background = createWidget(client); - background.setOriginalWidth(BACKGROUND_WIDTH); - background.setOriginalHeight(BACKGROUND_HEIGHT); - syncBackgroundSprite(); - } - - private void createIconWidget(Client client) - { - icon = createWidget(client); - icon.setAction(1, "Toggle:"); - icon.setOnOpListener((JavaScriptCallback) ev -> onButtonClicked()); - icon.setHasListener(true); - icon.setSpriteId(spriteID); - } - - private Widget createWidget(Client client) - { - Widget w = client.createWidget(); - w.setType(WidgetType.GRAPHIC); - w.setOriginalWidth(ICON_WIDTH); - w.setOriginalHeight(ICON_HEIGHT); - w.setName("" + this.name); - w.setIsIf3(true); - return w; - } - - public void setSelected(boolean selected) - { - this.selected = selected; - syncBackgroundSprite(); - } - - private void syncBackgroundSprite() - { - background.setSpriteId(selected ? SELECTED_BACKGROUND_SPRITE_ID : BACKGROUND_SPRITE_ID); - } - - /** - * Adds the collection of WidgetButtons to the container overriding any existing children. - * - * @param container Widget to add buttons too - * @param buttons buttons to add - */ - static void addButtonsToContainerWidget(Widget container, Collection buttons) - { - Widget[] children = container.getChildren(); - if (children == null) - { - // Create a child so we can copy the returned Widget[] and avoid hn casting issues from creating a new Widget[] - container.createChild(0, WidgetType.GRAPHIC); - children = container.getChildren(); - } - // Each button has two widgets, Icon and Background - Widget[] itemsArray = Arrays.copyOf(children, buttons.size() * 2); - int parentId = container.getId(); - - int xIncrement = BACKGROUND_WIDTH + PADDING; - int yIncrement = BACKGROUND_HEIGHT + PADDING; - int maxRowItems = container.getWidth() / xIncrement; - // Ensure at least 1 button per row - maxRowItems = maxRowItems < 1 ? 1 : maxRowItems; - - int startingIndex = 0; - for (WidgetButton w : buttons) - { - int originalX = (((startingIndex / 2) % maxRowItems) * xIncrement); - int originalY = (((startingIndex / 2) / maxRowItems) * yIncrement); - Widget background = updateWidgetPosition(w.getBackground(), parentId, startingIndex, originalX, originalY); - itemsArray[startingIndex] = background; - startingIndex++; - // Icon must be padded to center inside image - Widget icon = updateWidgetPosition(w.getIcon(), parentId, startingIndex, originalX + ICON_PADDING, originalY + ICON_PADDING); - itemsArray[startingIndex] = icon; - startingIndex++; - } - - int rows = 1 + (buttons.size() > maxRowItems ? buttons.size() / maxRowItems : 0); - container.setOriginalHeight(yIncrement * rows); - container.setChildren(itemsArray); - container.revalidate(); - } - - private static Widget updateWidgetPosition(Widget w, int id, int index, int originalX, int originalY) - { - w.setParentId(id); - w.setId(id); - w.setIndex(index); - - w.setOriginalX(originalX); - w.setOriginalY(originalY); - w.revalidate(); - - return w; - } - - private void onButtonClicked() - { - setSelected(!selected); - callback.run(name, selected); - } -} 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 f62bc775c5..e6497432aa 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 @@ -53,6 +53,10 @@ import net.runelite.client.plugins.menuentryswapper.util.CharterOption; @ConfigGroup("menuentryswapper") public interface MenuEntrySwapperConfig extends Config { + //------------------------------------------------------------// + // Banking + //------------------------------------------------------------// + @ConfigItem( keyName = "withdrawOne", name = "Withdraw/Deposit One", @@ -197,13 +201,15 @@ public interface MenuEntrySwapperConfig extends Config return ""; } + //------------------------------------------------------------// + // Equipment Swapper //------------------------------------------------------------// @ConfigItem( keyName = "swapMax", name = "Swap Max Cape", description = "Enables swapping max cape options in worn interface.", - position = 11, + position = 0, group = "Equipment swapper" ) default boolean swapMax() @@ -215,7 +221,7 @@ public interface MenuEntrySwapperConfig extends Config keyName = "teleEquippedCape", name = "Teleport Equipped Cape", description = "Makes Teleport/Tele to POH the left click option on equip screen", - position = 12, + position = 1, group = "Equipment swapper" ) default boolean teleEquippedCape() @@ -227,7 +233,7 @@ public interface MenuEntrySwapperConfig extends Config keyName = "telecapeMode", name = "ModeTeleCape", description = "", - position = 13, + position = 2, group = "Equipment swapper", hidden = true, unhide = "teleEquippedCape" @@ -241,7 +247,7 @@ public interface MenuEntrySwapperConfig extends Config keyName = "maxMode", name = "Mode", description = "", - position = 14, + position = 3, group = "Equipment swapper", hidden = true, unhide = "swapMax" @@ -255,7 +261,7 @@ public interface MenuEntrySwapperConfig extends Config keyName = "swapArdougneCape", name = "Swap Ardougne Cape", description = "Enables swapping of 'Teleport' and 'Wear'.", - position = 15, + position = 4, group = "Equipment swapper" ) default boolean getSwapArdougneCape() @@ -267,7 +273,7 @@ public interface MenuEntrySwapperConfig extends Config keyName = "swapConstructionCape", name = "Swap Construction Cape", description = "Enables swapping of 'Teleport' and 'Wear'.", - position = 16, + position = 5, group = "Equipment swapper" ) default boolean getSwapConstructionCape() @@ -279,7 +285,7 @@ public interface MenuEntrySwapperConfig extends Config keyName = "swapCraftingCape", name = "Swap Crafting Cape", description = "Enables swapping of 'Teleport' and 'Wear'.", - position = 17, + position = 6, group = "Equipment swapper" ) default boolean getSwapCraftingCape() @@ -291,7 +297,7 @@ public interface MenuEntrySwapperConfig extends Config keyName = "swapMagicCape", name = "Swap Magic Cape", description = "Enables swapping of 'Spellbook' and 'Wear'.", - position = 18, + position = 7, group = "Equipment swapper" ) default boolean getSwapMagicCape() @@ -303,7 +309,7 @@ public interface MenuEntrySwapperConfig extends Config keyName = "swapExplorersRing", name = "Swap Explorer's Ring", description = "Enables swapping of 'Spellbook' and 'Wear'.", - position = 19, + position = 8, group = "Equipment swapper" ) default boolean getSwapExplorersRing() @@ -315,7 +321,7 @@ public interface MenuEntrySwapperConfig extends Config keyName = "swapAdmire", name = "Admire", description = "Swap 'Admire' with 'Teleport', 'Spellbook' and 'Perks' (max cape) for mounted skill capes.", - position = 20, + position = 9, group = "Equipment swapper" ) default boolean swapAdmire() @@ -327,7 +333,7 @@ public interface MenuEntrySwapperConfig extends Config keyName = "swapQuestCape", name = "Swap Quest Cape", description = "Enables swapping Quest cape options in worn interface.", - position = 21, + position = 10, group = "Equipment swapper" ) default boolean swapQuestCape() @@ -339,7 +345,7 @@ public interface MenuEntrySwapperConfig extends Config keyName = "questCapeMode", name = "Mode", description = "", - position = 22, + position = 11, group = "Equipment swapper", hidden = true, unhide = "swapQuestCape" @@ -349,13 +355,15 @@ public interface MenuEntrySwapperConfig extends Config return QuestCapeMode.TELEPORT; } + //------------------------------------------------------------// + // Miscellaneous //------------------------------------------------------------// @ConfigItem( keyName = "customSwaps", name = "Custom Swaps", description = "Add custom swaps here, 1 per line. Syntax: option, target : option, target
Note that the first entry should be the left click one!", - position = 23, + position = 0, group = "Miscellaneous", parse = true, clazz = Parse.class, @@ -370,7 +378,7 @@ public interface MenuEntrySwapperConfig extends Config keyName = "shiftClickCustomization", name = "Customizable Shift-click", description = "Allows customization of shift-clicks on items.", - position = 24, + position = 1, group = "Miscellaneous" ) default boolean shiftClickCustomization() @@ -382,7 +390,7 @@ public interface MenuEntrySwapperConfig extends Config keyName = "swapCoalBag", name = "Swap Coal Bag Empty", description = "Makes Empty the left click option when in a bank", - position = 25, + position = 2, group = "Miscellaneous" ) default boolean swapCoalBag() @@ -394,7 +402,7 @@ public interface MenuEntrySwapperConfig extends Config keyName = "swapBirdhouseEmpty", name = "Birdhouse", description = "Swap 'Interact' with 'Empty' for birdhouses on Fossil Island.", - position = 26, + position = 3, group = "Miscellaneous" ) default boolean swapBirdhouseEmpty() @@ -406,7 +414,7 @@ public interface MenuEntrySwapperConfig extends Config keyName = "swapBones", name = "Bury", description = "Swap 'Bury' with 'Use' on Bones.", - position = 27, + position = 4, group = "Miscellaneous" ) default boolean swapBones() @@ -418,7 +426,7 @@ public interface MenuEntrySwapperConfig extends Config keyName = "swapChase", name = "Chase", description = "Allows to left click your cat to chase rats.", - position = 28, + position = 5, group = "Miscellaneous" ) default boolean swapChase() @@ -430,7 +438,7 @@ public interface MenuEntrySwapperConfig extends Config keyName = "swapHarpoon", name = "Harpoon", description = "Swap 'Cage', 'Big Net' with 'Harpoon' on Fishing spots.", - position = 29, + position = 6, group = "Miscellaneous" ) default boolean swapHarpoon() @@ -442,7 +450,7 @@ public interface MenuEntrySwapperConfig extends Config keyName = "swapOccult", name = "Occult Altar", description = "Swap 'Venerate' with 'Ancient', 'Lunar', or 'Arceuus' on an Altar of the Occult.", - position = 30, + position = 7, group = "Miscellaneous" ) default boolean swapOccult() @@ -454,7 +462,7 @@ public interface MenuEntrySwapperConfig extends Config keyName = "occultalter", name = "Mode", description = "", - position = 31, + position = 8, group = "Miscellaneous", hidden = true, unhide = "swapOccult" @@ -468,7 +476,7 @@ public interface MenuEntrySwapperConfig extends Config keyName = "swapHomePortal", name = "Home", description = "Swap 'Enter' with 'Home', 'Build' or 'Friend's house' on Portal.", - position = 32, + position = 9, group = "Miscellaneous" ) default boolean swapHomePortal() @@ -480,7 +488,7 @@ public interface MenuEntrySwapperConfig extends Config keyName = "home", name = "Mode", description = "", - position = 33, + position = 10, group = "Miscellaneous", hidden = true, unhide = "swapHomePortal" @@ -494,7 +502,7 @@ public interface MenuEntrySwapperConfig extends Config keyName = "swapPrivate", name = "Private", description = "Swap 'Shared' with 'Private' on the Chambers of Xeric storage units.", - position = 34, + position = 11, group = "Miscellaneous" ) default boolean swapPrivate() @@ -506,7 +514,7 @@ public interface MenuEntrySwapperConfig extends Config keyName = "swapPick", name = "Pick", description = "Swap 'Pick' with 'Pick-lots' of the Gourd tree in the Chambers of Xeric.", - position = 35, + position = 12, group = "Miscellaneous" ) default boolean swapPick() @@ -518,7 +526,7 @@ public interface MenuEntrySwapperConfig extends Config keyName = "swapQuick", name = "Quick Pass/Open/Start/Travel", description = "Swap 'Pass' with 'Quick-Pass', 'Open' with 'Quick-Open', 'Ring' with 'Quick-Start' and 'Talk-to' with 'Quick-Travel'.", - position = 36, + position = 13, group = "Miscellaneous" ) default boolean swapQuick() @@ -530,7 +538,7 @@ public interface MenuEntrySwapperConfig extends Config keyName = "swapBoxTrap", name = "Reset", description = "Swap 'Check' with 'Reset' on box traps.", - position = 37, + position = 14, group = "Miscellaneous" ) default boolean swapBoxTrap() @@ -542,7 +550,7 @@ public interface MenuEntrySwapperConfig extends Config keyName = "rockCake", name = "Rock Cake Guzzle", description = "Enables Left Click 'Guzzle' on the Dwarven Rock Cake.", - position = 38, + position = 15, group = "Miscellaneous" ) default boolean rockCake() @@ -554,7 +562,7 @@ public interface MenuEntrySwapperConfig extends Config keyName = "swapRogueschests", name = "Rogues Chests", description = "Swap Rogues Chests from 'Open' to 'Search for traps'.", - position = 39, + position = 16, group = "Miscellaneous" ) default boolean swapRogueschests() @@ -566,7 +574,7 @@ public interface MenuEntrySwapperConfig extends Config keyName = "swapClimbUpDown", name = "Climb", description = "Swap 'Climb-Up'/'Climb-Down' depending on Shift or Control key.", - position = 40, + position = 17, group = "Miscellaneous" ) default boolean swapClimbUpDown() @@ -578,7 +586,7 @@ public interface MenuEntrySwapperConfig extends Config keyName = "swapStun", name = "Stun Hoop Snakes", description = "Swap 'Attack' with 'Stun'.", - position = 41, + position = 18, group = "Miscellaneous" ) default boolean swapStun() @@ -590,7 +598,7 @@ public interface MenuEntrySwapperConfig extends Config keyName = "swapSearch", name = "Search", description = "Swap 'Close', 'Shut' with 'Search' on chests, cupboards, etc.", - position = 42, + position = 19, group = "Miscellaneous" ) default boolean swapSearch() @@ -602,7 +610,7 @@ public interface MenuEntrySwapperConfig extends Config keyName = "swapHardWoodGrove", name = "Hardwood Grove", description = "Swap 'Quick-Pay(100)' and 'Send-Parcel' at Hardwood Grove.", - position = 43, + position = 20, group = "Miscellaneous" ) default boolean swapHardWoodGrove() @@ -615,7 +623,7 @@ public interface MenuEntrySwapperConfig extends Config keyName = "removeObjects", name = "Remove Objects", description = "Removes interaction with the listed objects.", - position = 44, + position = 21, group = "Miscellaneous" ) default boolean getRemoveObjects() @@ -627,7 +635,7 @@ public interface MenuEntrySwapperConfig extends Config keyName = "removedObjects", name = "Objects", description = "Objects listed here will have all interaction be removed.", - position = 45, + position = 22, group = "Miscellaneous", hidden = true, unhide = "removeObjects" @@ -638,38 +646,38 @@ public interface MenuEntrySwapperConfig extends Config } @ConfigItem( - keyName = "swapslayer", - name = "Swap Slayer Ring", - description = "", - position = 46, - group = "Teleportation" - ) - default boolean getSlayerRing() + keyName = "swapImps", + name = "Impling Jars", + description = "Don't open implings if bank has a clue.", + position = 23, + group = "Miscellaneous" +) +default boolean swapImps() { return false; } - @ConfigItem( - keyName = "slayerringmode", - name = "Mode", - description = "", - position = 47, - group = "Teleportation", - hidden = true, - unhide = "swapslayer" - ) - default SlayerRingMode getSlayerRingMode() +@ConfigItem( + keyName = "charterOption", + name = "Trader Crew", + description = "Configure whether you want Charter or Trade to be the first option of Trader Crewmembers.", + position = 24, + group = "Miscellaneous" +) +default CharterOption charterOption() { - return SlayerRingMode.CHECK; + return CharterOption.TRADE; } + //------------------------------------------------------------// + // Shop / Stores //------------------------------------------------------------// @ConfigItem( keyName = "swapBuyOne", name = "Swappable Buy One", description = "", - position = 48, + position = 0, group = "Shop / stores" ) default boolean getSwapBuyOne() @@ -682,7 +690,7 @@ public interface MenuEntrySwapperConfig extends Config name = "Items", description = "", group = "Shop / stores", - position = 49, + position = 1, hidden = true, unhide = "swapBuyOne" ) @@ -695,7 +703,7 @@ public interface MenuEntrySwapperConfig extends Config keyName = "swapBuyFive", name = "Swappable Buy Five", description = "", - position = 50, + position = 2, group = "Shop / stores" ) default boolean getSwapBuyFive() @@ -707,7 +715,7 @@ public interface MenuEntrySwapperConfig extends Config keyName = "buyFiveItems", name = "Items", description = "", - position = 51, + position = 3, group = "Shop / stores", hidden = true, unhide = "swapBuyFive" @@ -721,7 +729,7 @@ public interface MenuEntrySwapperConfig extends Config keyName = "swapBuyTen", name = "Swappable Buy Ten", description = "", - position = 52, + position = 4, group = "Shop / stores" ) default boolean getSwapBuyTen() @@ -733,7 +741,7 @@ public interface MenuEntrySwapperConfig extends Config keyName = "buyTenItems", name = "Items", description = "", - position = 53, + position = 5, group = "Shop / stores", hidden = true, unhide = "swapBuyTen" @@ -747,7 +755,7 @@ public interface MenuEntrySwapperConfig extends Config keyName = "swapBuyFifty", name = "Swappable Buy Fifty", description = "", - position = 54, + position = 6, group = "Shop / stores" ) default boolean getSwapBuyFifty() @@ -759,7 +767,7 @@ public interface MenuEntrySwapperConfig extends Config keyName = "buyFiftyItems", name = "Items", description = "", - position = 55, + position = 7, group = "Shop / stores", hidden = true, unhide = "swapBuyFifty" @@ -773,7 +781,7 @@ public interface MenuEntrySwapperConfig extends Config keyName = "swapSellOne", name = "Swappable Sell One", description = "", - position = 56, + position = 8, group = "Shop / stores" ) default boolean getSwapSellOne() @@ -785,7 +793,7 @@ public interface MenuEntrySwapperConfig extends Config keyName = "sellOneItems", name = "Items", description = "", - position = 57, + position = 9, group = "Shop / stores", hidden = true, unhide = "swapSellOne" @@ -799,7 +807,7 @@ public interface MenuEntrySwapperConfig extends Config keyName = "swapSellFive", name = "Swappable Sell Five", description = "", - position = 58, + position = 10, group = "Shop / stores" ) default boolean getSwapSellFive() @@ -811,7 +819,7 @@ public interface MenuEntrySwapperConfig extends Config keyName = "sellFiveItems", name = "Items", description = "", - position = 59, + position = 11, group = "Shop / stores", hidden = true, unhide = "swapSellFive" @@ -825,7 +833,7 @@ public interface MenuEntrySwapperConfig extends Config keyName = "swapSellTen", name = "Swappable Sell Ten", description = "", - position = 60, + position = 12, group = "Shop / stores" ) default boolean getSwapSellTen() @@ -837,7 +845,7 @@ public interface MenuEntrySwapperConfig extends Config keyName = "sellTenItems", name = "Items", description = "", - position = 61, + position = 13, group = "Shop / stores", hidden = true, unhide = "swapSellTen" @@ -851,7 +859,7 @@ public interface MenuEntrySwapperConfig extends Config keyName = "swapSellFifty", name = "Swappable Sell Fifty", description = "", - position = 62, + position = 14, group = "Shop / stores" ) default boolean getSwapSellFifty() @@ -863,7 +871,7 @@ public interface MenuEntrySwapperConfig extends Config keyName = "sellFiftyItems", name = "Items", description = "", - position = 63, + position = 15, group = "Shop / stores", hidden = true, unhide = "swapSellFifty" @@ -873,11 +881,15 @@ public interface MenuEntrySwapperConfig extends Config return ""; } + //------------------------------------------------------------// + // Skilling + //------------------------------------------------------------// + @ConfigItem( keyName = "getEasyConstruction", name = "Easy Construction", description = "Makes 'Remove'/'Build' the default option for listed items.", - position = 64, + position = 0, group = "Skilling" ) @@ -890,7 +902,7 @@ public interface MenuEntrySwapperConfig extends Config keyName = "getEasyConstructionItems", name = "Build Items", description = "", - position = 65, + position = 1, group = "Skilling", hidden = true, unhide = "getEasyConstruction" @@ -904,7 +916,7 @@ public interface MenuEntrySwapperConfig extends Config keyName = "swapSmithing", name = "Swap Smithing", description = "Enables swapping of 'Smith-1' and 'Smith-all' options.", - position = 66, + position = 2, group = "Skilling" ) default boolean getSwapSmithing() @@ -916,7 +928,7 @@ public interface MenuEntrySwapperConfig extends Config keyName = "swapTanning", name = "Swap Tanning", description = "Enables swapping of 'Tan-1' and 'Tan-all' options.", - position = 67, + position = 3, group = "Skilling" ) default boolean getSwapTanning() @@ -928,7 +940,7 @@ public interface MenuEntrySwapperConfig extends Config keyName = "swapSawmill", name = "Swap Sawmill Operator", description = "Makes 'Buy-plank' the default option on the Sawmill Operator.", - position = 68, + position = 4, group = "Skilling" ) default boolean getSwapSawmill() @@ -940,7 +952,7 @@ public interface MenuEntrySwapperConfig extends Config keyName = "swapSawmillPlanks", name = "Swap Buy Planks", description = "Makes 'Buy All' the default option when buying planks.", - position = 69, + position = 5, group = "Skilling" ) default boolean getSwapSawmillPlanks() @@ -952,7 +964,7 @@ public interface MenuEntrySwapperConfig extends Config keyName = "swapPuroPuro", name = "Swap Puro-Puro Wheat", description = "", - position = 70, + position = 6, group = "Skilling" ) default boolean getSwapPuro() @@ -960,13 +972,15 @@ public interface MenuEntrySwapperConfig extends Config return false; } + //------------------------------------------------------------// + // Talk-To //------------------------------------------------------------// @ConfigItem( keyName = "swapAssignment", name = "Assignment", description = "Swap 'Talk-to' with 'Assignment' for Slayer Masters. This will take priority over swapping Trade.", - position = 71, + position = 0, group = "Talk-To" ) default boolean swapAssignment() @@ -978,7 +992,7 @@ public interface MenuEntrySwapperConfig extends Config keyName = "swapBankExchange", name = "Bank/Exchange", description = "Swap Talk-to with Bank or Exchange on NPC
Example: Banker, Grand Exchange Clerk, Tool Leprechaun, Void Knight", - position = 72, + position = 1, group = "Talk-To" ) default boolean swapBankExchange() @@ -990,7 +1004,7 @@ public interface MenuEntrySwapperConfig extends Config keyName = "swapContract", name = "Contract", description = "Swap 'Talk-to' with 'Contract' on Guildmaster Jane.", - position = 73, + position = 2, group = "Talk-To" ) default boolean swapContract() @@ -1003,7 +1017,7 @@ public interface MenuEntrySwapperConfig extends Config keyName = "swapInteract", name = "Interact", description = "Swap options for generic interactions on NPCs
Example: Decant for Bob Barter, Repairs for Dark Mage, Claim Slime for Robin, Claim Dynamite", - position = 74, + position = 3, group = "Talk-To" ) default boolean swapInteract() @@ -1015,7 +1029,7 @@ public interface MenuEntrySwapperConfig extends Config keyName = "swapPickpocket", name = "Pickpocket", description = "Swap Talk-to with Pickpocket on NPC
Example: Man, Woman", - position = 75, + position = 4, group = "Talk-To" ) default boolean swapPickpocket() @@ -1027,7 +1041,7 @@ public interface MenuEntrySwapperConfig extends Config keyName = "swapPay", name = "Pay", description = "Swap 'Talk-to' with 'Pay' on various NPCs.
Example: Elstan, Heskel, Fayeth.", - position = 76, + position = 5, group = "Talk-To" ) default boolean swapPay() @@ -1039,7 +1053,7 @@ public interface MenuEntrySwapperConfig extends Config keyName = "swapAbyssTeleport", name = "Teleport to Abyss", description = "Swap 'Talk-to' with 'Teleport' for the Mage of Zamorak.", - position = 77, + position = 6, group = "Talk-To" ) default boolean swapAbyssTeleport() @@ -1051,7 +1065,7 @@ public interface MenuEntrySwapperConfig extends Config keyName = "swapTrade", name = "Trade", description = "Swap 'Talk-to' with 'Trade' on various NPCs.
Example: Shop keeper, Shop assistant.", - position = 78, + position = 7, group = "Talk-To" ) default boolean swapTrade() @@ -1060,11 +1074,11 @@ public interface MenuEntrySwapperConfig extends Config } @ConfigItem( - keyName = "swapTravel", - name = "Travel", - description = "Swap 'Talk-to' with 'Travel', 'Take-boat', 'Pay-fare', 'Charter' on various NPCs.
Example: Squire, Monk of Entrana, Customs officer, Trader Crewmember.", - position = 79, - group = "Talk-To" + keyName = "swapTravel", + name = "Travel", + description = "Swap 'Talk-to' with 'Travel', 'Take-boat', 'Pay-fare', 'Charter' on various NPCs.
Example: Squire, Monk of Entrana, Customs officer, Trader Crewmember.", + position = 8, + group = "Talk-To" ) default boolean swapTravel() { @@ -1072,11 +1086,11 @@ public interface MenuEntrySwapperConfig extends Config } @ConfigItem( - keyName = "swapMinigame", - name = "Minigames", - description = "Swap Talk-to with Start-Minigame, Story, Dream on NPC
Example: Guardian mummy, Juna, Dominic Onion", - position = 80, - group = "Talk-To" + keyName = "swapMinigame", + name = "Minigames", + description = "Swap Talk-to with Start-Minigame, Story, Dream on NPC
Example: Guardian mummy, Juna, Dominic Onion", + position = 9, + group = "Talk-To" ) default boolean swapMinigame() { @@ -1087,7 +1101,7 @@ public interface MenuEntrySwapperConfig extends Config keyName = "swapPlank", name = "Buy Planks", description = "Swap 'Talk-to' with 'Buy-planks' at the Lumber Yard.", - position = 81, + position = 10, group = "Talk-To" ) default boolean swapPlank() @@ -1099,7 +1113,7 @@ public interface MenuEntrySwapperConfig extends Config keyName = "swapMetamorphosis", name = "Metamorphosis", description = "Swap 'Talk-to' with 'Metamorphosis' for Baby Chinchompa pet.", - position = 82, + position = 11, group = "Talk-To" ) default boolean swapMetamorphosis() @@ -1111,7 +1125,7 @@ public interface MenuEntrySwapperConfig extends Config keyName = "swapEnchant", name = "Enchant", description = "Swap Talk-to with Enchant for Eluned", - position = 82, + position = 12, group = "Talk-To" ) default boolean swapEnchant() @@ -1119,13 +1133,15 @@ public interface MenuEntrySwapperConfig extends Config return true; } + //------------------------------------------------------------// + // Teleportation //------------------------------------------------------------// @ConfigItem( keyName = "swapFairyRing", name = "Fairy Ring", description = "Swap 'Zanaris' with 'Last-destination' or 'Configure' on Fairy rings.", - position = 83, + position = 0, group = "Teleportation" ) default boolean swapFairyRing() @@ -1137,7 +1153,7 @@ public interface MenuEntrySwapperConfig extends Config keyName = "fairyring", name = "Mode", description = "", - position = 84, + position = 1, group = "Teleportation", hidden = true, unhide = "swapFairyRing" @@ -1151,7 +1167,7 @@ public interface MenuEntrySwapperConfig extends Config keyName = "swapObelisk", name = "Obelisk", description = "Swap the options on wilderness obelisks between 'Activate', 'Set destination' or 'Teleport to destination'.", - position = 85, + position = 2, group = "Teleportation" ) default boolean swapObelisk() @@ -1163,7 +1179,7 @@ public interface MenuEntrySwapperConfig extends Config keyName = "obelisk", name = "Mode", description = "", - position = 86, + position = 3, group = "Teleportation", hidden = true, unhide = "swapObelisk" @@ -1177,7 +1193,7 @@ public interface MenuEntrySwapperConfig extends Config keyName = "swapTeleportItem", name = "Teleport Items", description = "Swap 'Wear' or 'Wield' with 'Rub' or 'Teleport' on teleport items.
Example: Amulet of glory, Explorer's ring, Chronicle.", - position = 87, + position = 4, group = "Teleportation" ) default boolean swapTeleportItem() @@ -1189,7 +1205,7 @@ public interface MenuEntrySwapperConfig extends Config keyName = "swapWildernessLever", name = "Wilderness Lever", description = "Swap the wilderness lever left click to be Edgeville/Ardougne.", - position = 88, + position = 5, group = "Teleportation" ) default boolean swapWildernessLever() @@ -1201,7 +1217,7 @@ public interface MenuEntrySwapperConfig extends Config keyName = "swapNexus", name = "Portal Nexus", description = "Makes the teleport menu have priority over the left click destination on the portal nexus.", - position = 99, + position = 6, group = "Teleportation" ) default boolean swapNexus() @@ -1213,7 +1229,7 @@ public interface MenuEntrySwapperConfig extends Config keyName = "swapGamesNecklace", name = "Swap Games Necklace", description = "Swap the left click 'remove' option with the desired teleport location on a worn Games Necklace.", - position = 100, + position = 7, group = "Teleportation" ) default boolean getGamesNecklace() @@ -1225,7 +1241,7 @@ public interface MenuEntrySwapperConfig extends Config keyName = "gamesNecklaceMode", name = "Mode", description = "", - position = 101, + position = 8, group = "Teleportation", hidden = true, unhide = "swapGamesNecklace" @@ -1239,7 +1255,7 @@ public interface MenuEntrySwapperConfig extends Config keyName = "swapDuelingRing", name = "Swap Dueling Ring", description = "Swap the left click 'remove' option with the desired teleport location on a worn Ring of Dueling.", - position = 102, + position = 9, group = "Teleportation" ) default boolean getDuelingRing() @@ -1251,7 +1267,7 @@ public interface MenuEntrySwapperConfig extends Config keyName = "duelingRingMode", name = "Mode", description = "", - position = 103, + position = 10, group = "Teleportation", hidden = true, unhide = "swapDuelingRing" @@ -1265,7 +1281,7 @@ public interface MenuEntrySwapperConfig extends Config keyName = "swapGlory", name = "Swap Glory", description = "Swap the left click 'remove' option with the desired teleport location on a worn Amulet of Glory / Amulet of Eternal Glory.", - position = 104, + position = 11, group = "Teleportation" ) default boolean getGlory() @@ -1277,7 +1293,7 @@ public interface MenuEntrySwapperConfig extends Config keyName = "gloryMode", name = "Mode", description = "", - position = 105, + position = 12, group = "Teleportation", hidden = true, unhide = "swapGlory" @@ -1291,7 +1307,7 @@ public interface MenuEntrySwapperConfig extends Config keyName = "swapSkill", name = "Swap Skill", description = "Swap the left click 'remove' option with the desired teleport location on a worn Skills Necklace.", - position = 106, + position = 13, group = "Teleportation" ) default boolean getSkillsNecklace() @@ -1303,7 +1319,7 @@ public interface MenuEntrySwapperConfig extends Config keyName = "skillsnecklacemode", name = "Mode", description = "", - position = 107, + position = 14, group = "Teleportation", hidden = true, unhide = "swapSkill" @@ -1317,7 +1333,7 @@ public interface MenuEntrySwapperConfig extends Config keyName = "swapPassage", name = "Swap Passage", description = "Swap the left click 'remove' option with the desired teleport location on a worn Necklace of Passage.", - position = 108, + position = 15, group = "Teleportation" ) default boolean getNecklaceofPassage() @@ -1329,7 +1345,7 @@ public interface MenuEntrySwapperConfig extends Config keyName = "necklaceofpassagemode", name = "Mode", description = "", - position = 109, + position = 16, group = "Teleportation", hidden = true, unhide = "swapPassage" @@ -1343,7 +1359,7 @@ public interface MenuEntrySwapperConfig extends Config keyName = "swapDigsite", name = "Swap Digsite", description = "Swap the left click 'remove' option with the desired teleport location on a worn Digsite Pendant.", - position = 110, + position = 17, group = "Teleportation" ) default boolean getDigsitePendant() @@ -1355,7 +1371,7 @@ public interface MenuEntrySwapperConfig extends Config keyName = "digsitependantmode", name = "Mode", description = "", - position = 111, + position = 18, group = "Teleportation", hidden = true, unhide = "swapDigsite" @@ -1369,7 +1385,7 @@ public interface MenuEntrySwapperConfig extends Config keyName = "swapCombat", name = "Swap Combat", description = "Swap the left click 'remove' option with the desired teleport location on a worn Combat Bracelet.", - position = 112, + position = 19, group = "Teleportation" ) default boolean getCombatBracelet() @@ -1381,7 +1397,7 @@ public interface MenuEntrySwapperConfig extends Config keyName = "combatbraceletmode", name = "Mode", description = "", - position = 113, + position = 20, group = "Teleportation", hidden = true, unhide = "swapCombat" @@ -1395,7 +1411,7 @@ public interface MenuEntrySwapperConfig extends Config keyName = "swapburning", name = "Swap Burning", description = "Swap the left click 'remove' option with the desired teleport location on a worn Burning Amulet.", - position = 114, + position = 21, group = "Teleportation" ) default boolean getBurningAmulet() @@ -1407,7 +1423,7 @@ public interface MenuEntrySwapperConfig extends Config keyName = "burningamuletmode", name = "Mode", description = "", - position = 115, + position = 22, group = "Teleportation", hidden = true, unhide = "swapburning" @@ -1421,7 +1437,7 @@ public interface MenuEntrySwapperConfig extends Config keyName = "swapxeric", name = "Swap Xeric's", description = "Swap the left click 'remove' option with the desired teleport location on a worn Xeric's Talisman.", - position = 116, + position = 23, group = "Teleportation" ) default boolean getXericsTalisman() @@ -1433,7 +1449,7 @@ public interface MenuEntrySwapperConfig extends Config keyName = "xericstalismanmode", name = "Mode", description = "", - position = 117, + position = 24, group = "Teleportation", hidden = true, unhide = "swapxeric" @@ -1447,7 +1463,7 @@ public interface MenuEntrySwapperConfig extends Config keyName = "swapwealth", name = "Swap Wealth", description = "Swap the left click 'remove' option with the desired teleport location on a worn Ring of Wealth.", - position = 118, + position = 25, group = "Teleportation" ) default boolean getRingofWealth() @@ -1459,7 +1475,7 @@ public interface MenuEntrySwapperConfig extends Config keyName = "ringofwealthmode", name = "Mode", description = "", - position = 119, + position = 26, group = "Teleportation", hidden = true, unhide = "swapwealth" @@ -1469,13 +1485,41 @@ public interface MenuEntrySwapperConfig extends Config return RingOfWealthMode.GRAND_EXCHANGE; } + @ConfigItem( + keyName = "swapslayer", + name = "Swap Slayer Ring", + description = "", + position = 27, + group = "Teleportation" + ) + default boolean getSlayerRing() + { + return false; + } + + @ConfigItem( + keyName = "slayerringmode", + name = "Mode", + description = "", + position = 28, + group = "Teleportation", + hidden = true, + unhide = "swapslayer" + ) + default SlayerRingMode getSlayerRingMode() + { + return SlayerRingMode.CHECK; + } + + //------------------------------------------------------------// + // Right Click Options //------------------------------------------------------------// @ConfigItem( keyName = "hideExamine", name = "Hide Examine", description = "Hides the 'Examine' option from the right click menu.", - position = 120, + position = 0, group = "Right Click Options" ) default boolean hideExamine() @@ -1487,7 +1531,7 @@ public interface MenuEntrySwapperConfig extends Config keyName = "hideTradeWith", name = "Hide Trade With", description = "Hides the 'Trade with' option from the right click menu.", - position = 121, + position = 1, group = "Right Click Options" ) default boolean hideTradeWith() @@ -1499,7 +1543,7 @@ public interface MenuEntrySwapperConfig extends Config keyName = "hideReport", name = "Hide Report", description = "Hides the 'Report' option from the right click menu.", - position = 122, + position = 2, group = "Right Click Options" ) default boolean hideReport() @@ -1511,7 +1555,7 @@ public interface MenuEntrySwapperConfig extends Config keyName = "hideLookup", name = "Hide Lookup", description = "Hides the 'Lookup' option from the right click menu.", - position = 123, + position = 3, group = "Right Click Options" ) default boolean hideLookup() @@ -1523,7 +1567,7 @@ public interface MenuEntrySwapperConfig extends Config keyName = "hideNet", name = "Hide Net", description = "Hides the 'Net' option from the right click menu.", - position = 124, + position = 4, group = "Right Click Options" ) default boolean hideNet() @@ -1535,7 +1579,7 @@ public interface MenuEntrySwapperConfig extends Config keyName = "hideBait", name = "Hide Bait", description = "Hides the 'Bait' option from the right click menu.", - position = 125, + position = 5, group = "Right Click Options" ) default boolean hideBait() @@ -1543,13 +1587,15 @@ public interface MenuEntrySwapperConfig extends Config return false; } - //----------------------Untradeables---------------------------// + //------------------------------------------------------------// + // Untradeables + //------------------------------------------------------------// @ConfigItem( keyName = "hideDestroyRunepouch", name = "Hide Destroy on Rune Pouch", description = "Hides the 'Destroy' option when right clicking a Rune pouch.", - position = 126, + position = 0, group = "Untradeables" ) default boolean hideDestroyRunepouch() @@ -1561,7 +1607,7 @@ public interface MenuEntrySwapperConfig extends Config keyName = "hideDestroyCoalbag", name = "Hide Destroy on Coal bag", description = "Hides the 'Destroy' option when right clicking a Coal bag.", - position = 127, + position = 1, group = "Untradeables" ) default boolean hideDestroyCoalbag() @@ -1573,7 +1619,7 @@ public interface MenuEntrySwapperConfig extends Config keyName = "hideDestroyHerbsack", name = "Hide Destroy on Herb sack", description = "Hides the 'Destroy' option when right clicking a Herb sack.", - position = 128, + position = 2, group = "Untradeables" ) default boolean hideDestroyHerbsack() @@ -1585,7 +1631,7 @@ public interface MenuEntrySwapperConfig extends Config keyName = "hideDestroyBoltpouch", name = "Hide Destroy on Bolt pouch", description = "Hides the 'Destroy' option when right clicking a Bolt pouch.", - position = 129, + position = 3, group = "Untradeables" ) default boolean hideDestroyBoltpouch() @@ -1597,7 +1643,7 @@ public interface MenuEntrySwapperConfig extends Config keyName = "hideDestroyGembag", name = "Hide Destroy on Gem bag", description = "Hides the 'Destroy' option when right clicking a Gem bag.", - position = 130, + position = 4, group = "Untradeables" ) default boolean hideDestroyGembag() @@ -1609,7 +1655,7 @@ public interface MenuEntrySwapperConfig extends Config keyName = "hideDropRunecraftingPouch", name = "Hide Drop on RC pouches", description = "Hides the 'Drop' option when right clicking a Small, Medium, Large, or Giant pouch.", - position = 131, + position = 5, group = "Untradeables" ) default boolean hideDropRunecraftingPouch() @@ -1618,30 +1664,30 @@ public interface MenuEntrySwapperConfig extends Config } //------------------------------------------------------------// - - @ConfigItem( - keyName = "swapImps", - name = "Impling Jars", - description = "Don't open implings if bank has a clue.", - position = 132, - group = "Miscellaneous" - ) - default boolean swapImps() - { - return false; - } - - @ConfigItem( - keyName = "charterOption", - name = "Trader Crew", - description = "Configure whether you want Charter or Trade to be the first option of Trader Crewmembers.", - position = 133, - group = "Miscellaneous" - ) - default CharterOption charterOption() - { - return CharterOption.TRADE; - } - + // PVM //------------------------------------------------------------// + + @ConfigItem( + keyName = "removeFreezePlayerToB", + name = "Remove freeze in ToB", + description = "Removes the freeze option for ice barrage, ice blitz, entangle etc. in ToB", + position = 0 + ) + + default boolean getRemoveFreezePlayerToB() + { + return true; + } + + @ConfigItem( + keyName = "removeFreezePlayerCoX", + name = "Remove freeze in CoX", + description = "Removes the freeze option for ice barrage, ice blitz, entangle etc. in CoX", + position = 1 + ) + + default boolean getRemoveFreezePlayerCoX() + { + return true; + } } 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 7a787b9f38..c6eb0a7947 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 @@ -53,6 +53,7 @@ import static net.runelite.api.MenuAction.WALK; import net.runelite.api.MenuEntry; import net.runelite.api.NPC; import net.runelite.api.Player; +import net.runelite.api.Varbits; import static net.runelite.api.Varbits.BUILDING_MODE; import net.runelite.api.coords.WorldPoint; import net.runelite.api.events.ConfigChanged; @@ -105,6 +106,14 @@ public class MenuEntrySwapperPlugin extends Plugin private static final String CONFIG_GROUP = "shiftclick"; private static final String ITEM_KEY_PREFIX = "item_"; private static final int PURO_PURO_REGION_ID = 10307; + private static final String WALK_HERE = "WALK HERE"; + private static final String CANCEL = "CANCEL"; + private static final String CAST_OPTIONS_ATTACK = "CAST"; + public static final HashSet CAST_OPTIONS_KEYWORDS = new HashSet<>(); + static + { + CAST_OPTIONS_KEYWORDS.add(CAST_OPTIONS_ATTACK); + } private MenuEntry[] entries; private final Set leftClickConstructionItems = new HashSet<>(); @@ -533,6 +542,7 @@ public class MenuEntrySwapperPlugin extends Plugin return; } + final String pOptionToReplace = Text.removeTags(event.getOption()).toUpperCase(); final int eventId = event.getIdentifier(); final String option = Text.standardize(event.getOption()); final String target = Text.standardize(event.getTarget()); @@ -896,6 +906,34 @@ public class MenuEntrySwapperPlugin extends Plugin } } } + + Player[] players = client.getCachedPlayers(); + Player player = null; + int identifier = event.getIdentifier(); + + if (identifier >= 0 && identifier < players.length) + { + player = players[identifier]; + } + + if (player == null) + { + return; + } + + //If the option is already to walk there, or cancel we don't need to swap it with anything + if (pOptionToReplace.equals(CANCEL) || pOptionToReplace.equals(WALK_HERE)) + { + return; + } + + if (((config.getRemoveFreezePlayerCoX() && client.getVar(Varbits.IN_RAID) == 1) + || (config.getRemoveFreezePlayerToB() && client.getVar(Varbits.THEATRE_OF_BLOOD) == 2)) + && (player.isFriend() || player.isClanMember()) + && CAST_OPTIONS_KEYWORDS.contains(pOptionToReplace)) + { + addswap(pOptionToReplace); + } if (option.equals("talk-to")) { @@ -1515,4 +1553,47 @@ public class MenuEntrySwapperPlugin extends Plugin { menuManager.removePriorityEntry("climb-down"); } + +/** + * Swaps menu entries if the entries could be found. This places Walk Here where the top level menu option was. + * @param pOptionToReplace The String containing the Menu Option that needs to be replaced. IE: "Attack", "Chop Down". + */ + private void addswap(String pOptionToReplace) + { + MenuEntry[] entries = client.getMenuEntries(); + Integer walkHereEntry = searchIndex(entries, WALK_HERE); + Integer entryToReplace = searchIndex(entries, pOptionToReplace); + + if (walkHereEntry != null + && entryToReplace != null) + { + MenuEntry walkHereMenuEntry = entries[walkHereEntry]; + entries[walkHereEntry] = entries[entryToReplace]; + entries[entryToReplace] = walkHereMenuEntry; + client.setMenuEntries(entries); + } + } + +/** + * Finds the index of the menu that contains the verbiage we are looking for. + * @param pMenuEntries The list of {@link MenuEntry}s. + * @param pMenuEntryToSearchFor The Option in the menu to search for. + * @return The index location or null if it was not found. + */ + private Integer searchIndex(MenuEntry[] pMenuEntries, String pMenuEntryToSearchFor) + { + Integer indexLocation = 0; + + for (MenuEntry menuEntry : pMenuEntries) + { + String entryOption = Text.removeTags(menuEntry.getOption()).toUpperCase(); + + if (entryOption.equals(pMenuEntryToSearchFor)) + { + return indexLocation; + } + indexLocation++; + } + return null; + } } diff --git a/runelite-client/src/main/scripts/DeathKeepBuildScript.hash b/runelite-client/src/main/scripts/DeathKeepBuildScript.hash deleted file mode 100644 index 18f92dce5c..0000000000 --- a/runelite-client/src/main/scripts/DeathKeepBuildScript.hash +++ /dev/null @@ -1 +0,0 @@ -15F58F5939D9311F3D76FA2F0F3441B7B0DA1E8EAE23C654948095A7D51E07F0 \ No newline at end of file diff --git a/runelite-client/src/main/scripts/DeathKeepBuildScript.rs2asm b/runelite-client/src/main/scripts/DeathKeepBuildScript.rs2asm deleted file mode 100644 index 520f2c7e9e..0000000000 --- a/runelite-client/src/main/scripts/DeathKeepBuildScript.rs2asm +++ /dev/null @@ -1,622 +0,0 @@ -.id 1601 -.int_stack_count 4 -.string_stack_count 2 -.int_var_count 13 -.string_var_count 3 - sload 1 - iconst 262167 - if_settext - iconst 0 - istore 4 - iconst 0 - istore 5 - iconst -1 - istore 6 - iconst 0 - istore 7 - sconst "" - sstore 2 - iconst 0 - istore 8 - iconst 0 - istore 9 - iconst 0 - istore 10 - iload 1 - define_array 111 - iconst 0 - istore 11 - iconst 0 - istore 12 - iload 0 - iconst 0 - if_icmpeq LABEL29 - jump LABEL517 -LABEL29: - iconst 93 - iconst 13190 - inv_total - iconst 0 - if_icmpgt LABEL40 - iconst 93 - iconst 13192 - inv_total - iconst 0 - if_icmpgt LABEL40 - jump LABEL42 -LABEL40: - iconst 1 - istore 9 -LABEL42: - iload 10 - iload 1 - if_icmplt LABEL46 - jump LABEL82 -LABEL46: - iconst 584 - iload 10 - inv_getobj - istore 6 - iload 6 - iconst -1 - if_icmpne LABEL54 - jump LABEL79 -LABEL54: - iconst 584 - iload 10 - inv_getnum - istore 7 -LABEL58: - iload 10 - iload 1 - if_icmplt LABEL62 - jump LABEL78 -LABEL62: - iload 7 - iconst 0 - if_icmpgt LABEL66 - jump LABEL78 -LABEL66: - iload 10 - iload 6 - set_array_int - iload 7 - iconst 1 - sub - istore 7 - iload 10 - iconst 1 - add - istore 10 - jump LABEL58 -LABEL78: - jump LABEL81 -LABEL79: - iload 1 - istore 10 -LABEL81: - jump LABEL42 -LABEL82: - iload 4 - iload 1 - if_icmplt LABEL86 - jump LABEL141 -LABEL86: - iconst 262162 - iconst 5 - iload 4 - cc_create - iconst 36 - iconst 32 - iconst 0 - iconst 0 - cc_setsize - iconst 5 - iload 4 - iconst 40 - multiply - add - iconst 25 - iconst 0 - iconst 0 - cc_setposition - iload 4 - get_array_int - istore 6 - iload 6 - iconst -1 - if_icmpne LABEL111 - jump LABEL138 -LABEL111: - iload 6 - iconst 1 - 1200 - sconst "" - iload 6 - oc_name - join_string 2 - cc_setopbase - iconst 1 - sconst "Item:" - cc_setop - iconst 1603 - iconst 1 - iconst 1 - iload 6 - oc_name - sconst "1is" - cc_setonop - iconst 1118481 - cc_setgraphicshadow - iconst 1 - cc_setoutline - iload 4 - iconst 1 - add - istore 4 - jump LABEL140 -LABEL138: - iload 1 - istore 4 -LABEL140: - jump LABEL82 -LABEL141: - iconst 0 - istore 4 -LABEL143: - iload 4 - iconst 468 - inv_size - if_icmplt LABEL148 - jump LABEL342 -LABEL148: - iconst 468 - iload 4 - inv_getobj - istore 6 - iload 6 - iconst -1 - if_icmpne LABEL156 - jump LABEL337 -LABEL156: - iconst 262165 - iconst 5 - iload 5 - cc_create - iconst 36 - iconst 32 - iconst 0 - iconst 0 - cc_setsize - iconst 5 - iload 5 - iconst 8 - mod - iconst 38 - multiply - add - iconst 25 - iconst 38 - iload 5 - iconst 8 - div - multiply - add - iconst 0 - iconst 0 - cc_setposition - iload 6 - iconst 468 - iload 4 - inv_getnum - 1200 - sconst "" - iload 6 - oc_name - join_string 2 - cc_setopbase - iconst 1 - sconst "Item:" - cc_setop - iconst 1603 - iconst 0 - iconst 468 - iload 4 - inv_getnum - iload 6 - oc_name - sconst "1is" - cc_setonop - iconst 1118481 - cc_setgraphicshadow - iconst 111 - iconst 49 - iconst 879 - iload 6 - enum - iconst 1 - if_icmpeq LABEL214 - jump LABEL219 -LABEL214: - iconst 2 - cc_setoutline - iconst 1 - istore 8 - jump LABEL221 -LABEL219: - iconst 1 - cc_setoutline -LABEL221: - iload 5 - iconst 1 - add - istore 5 - iload 6 - oc_stackable - iconst 1 - if_icmpeq LABEL230 - jump LABEL337 -LABEL230: - iconst 0 - istore 10 - iconst 0 - istore 12 -LABEL234: - iload 10 - iload 1 - if_icmplt LABEL238 - jump LABEL252 -LABEL238: - iload 10 - get_array_int - iload 6 - if_icmpeq LABEL243 - jump LABEL247 -LABEL243: - iload 12 - iconst 1 - add - istore 12 -LABEL247: - iload 10 - iconst 1 - add - istore 10 - jump LABEL234 -LABEL252: - iconst 2147483647 - iconst 94 - iload 6 - inv_total - sub - iconst 93 - iload 6 - inv_total - sub - iload 12 - add - istore 11 - iconst 0 - iload 11 - sub - istore 11 - iload 11 - iconst 0 - if_icmpgt LABEL272 - jump LABEL337 -LABEL272: - iconst 262165 - iconst 5 - iload 5 - cc_create - iconst 36 - iconst 32 - iconst 0 - iconst 0 - cc_setsize - iconst 5 - iload 5 - iconst 8 - mod - iconst 38 - multiply - add - iconst 25 - iconst 38 - iload 5 - iconst 8 - div - multiply - add - iconst 0 - iconst 0 - cc_setposition - iload 6 - iload 11 - 1200 - sconst "" - iload 6 - oc_name - join_string 2 - cc_setopbase - iconst 1 - sconst "Item:" - cc_setop - iconst 1603 - iconst 0 - iload 11 - iload 6 - oc_name - sconst "1is" - cc_setonop - iconst 1118481 - cc_setgraphicshadow - iconst 111 - iconst 49 - iconst 879 - iload 6 - enum - iconst 1 - if_icmpeq LABEL326 - jump LABEL331 -LABEL326: - iconst 2 - cc_setoutline - iconst 1 - istore 8 - jump LABEL333 -LABEL331: - iconst 1 - cc_setoutline -LABEL333: - iload 5 - iconst 1 - add - istore 5 -LABEL337: - iload 4 - iconst 1 - add - istore 4 - jump LABEL143 -LABEL342: - sconst "The normal amount of items kept is " - sconst "three" - sconst "." - sconst "
" - sconst "
" - join_string 5 - sstore 2 - iload 3 - iconst 1 - if_icmpeq LABEL353 - jump LABEL363 -LABEL353: - sload 2 - sconst "You're an " - sconst "" - sconst "Ultimate Iron Man" - sconst "" - sconst ", so you will always keep zero items." - join_string 5 - append - sstore 2 - jump LABEL426 -LABEL363: - iload 1 - iconst 0 - if_icmpeq LABEL367 - jump LABEL379 -LABEL367: - sload 2 - sconst "You're marked with a " - sconst "" - sconst "PK skull" - sconst "" - sconst ". This reduces the items you keep from " - sconst "three" - sconst " to zero!" - join_string 7 - append - sstore 2 - jump LABEL426 -LABEL379: - iload 1 - iconst 1 - if_icmpeq LABEL383 - jump LABEL402 -LABEL383: - sload 2 - sconst "You're marked with a " - sconst "" - sconst "PK skull" - sconst "" - sconst ". This reduces the items you keep from " - sconst "three" - sconst " to zero!" - sconst "
" - sconst "
" - sconst "However, you also have the " - sconst "" - sconst "Protect Items" - sconst "" - sconst " prayer active, which saves you one extra item!" - join_string 14 - append - sstore 2 - jump LABEL426 -LABEL402: - iload 1 - iconst 3 - if_icmpeq LABEL406 - jump LABEL411 -LABEL406: - sload 2 - sconst "You have no factors affecting the items you keep." - append - sstore 2 - jump LABEL426 -LABEL411: - iload 1 - iconst 3 - iconst 1 - add - if_icmpeq LABEL417 - jump LABEL426 -LABEL417: - sload 2 - sconst "You have the " - sconst "" - sconst "Protect Items" - sconst "" - sconst " prayer active, which saves you one extra item!" - join_string 5 - append - sstore 2 -LABEL426: - iload 8 - iconst 1 - if_icmpeq LABEL433 - iload 9 - iconst 1 - if_icmpeq LABEL433 - jump LABEL484 -LABEL433: - iload 8 - iconst 1 - if_icmpeq LABEL437 - jump LABEL458 -LABEL437: - iload 9 - iconst 1 - if_icmpeq LABEL441 - jump LABEL458 -LABEL441: - sload 2 - sconst "
" - sconst "
" - sconst "Items with a " - sconst "" - sconst "white outline" - sconst "" - sconst " will always be lost." - sconst "
" - sconst "" - sconst "Bonds" - sconst "" - sconst " are always protected." - join_string 12 - append - sstore 2 - jump LABEL484 -LABEL458: - iload 8 - iconst 1 - if_icmpeq LABEL462 - jump LABEL474 -LABEL462: - sload 2 - sconst "
" - sconst "
" - sconst "Items with a " - sconst "" - sconst "white outline" - sconst "" - sconst " will always be lost." - join_string 7 - append - sstore 2 - jump LABEL484 -LABEL474: - sload 2 - sconst "
" - sconst "
" - sconst "" - sconst "Bonds" - sconst "" - sconst " are always protected, so are not shown here." - join_string 6 - append - sstore 2 -LABEL484: - sload 2 - iconst 262173 - if_settext - sconst "" - sconst "Max items kept on death :" - sconst "
" - sconst "
" - sconst "" - sconst "~ " - iload 1 - tostring - sconst " ~" - join_string 8 - iconst 262174 - if_settext - iload 2 - iconst 0 - if_icmpgt LABEL503 - jump LABEL510 -LABEL503: - sconst "Items you will keep on death:" - iconst 262161 - if_settext - sconst "Items you will lose on death:" - iconst 262164 - if_settext - jump LABEL516 -LABEL510: - sconst "Items you will keep on death if not skulled:" - iconst 262161 - if_settext - sconst "Items you will lose on death if not skulled:" - iconst 262164 - if_settext -LABEL516: - jump LABEL557 -LABEL517: - iconst 1 - iconst 262165 - if_sethide - iconst 1 - iconst 262162 - if_sethide - iconst 0 - iconst 262175 - if_sethide - sload 0 - iconst 262176 - if_settext - sconst "The normal amount of items kept is " - sconst "three" - sconst "." - sconst "
" - sconst "
" - join_string 5 - sstore 2 - sload 2 - sconst "You're in a " - sconst "" - sconst "safe area" - sconst "" - sconst ". See information to the left for a more detailed description." - join_string 5 - append - sstore 2 - sload 2 - iconst 262173 - if_settext - sconst "" - sconst "Max items kept on death :" - sconst "
" - sconst "
" - sconst "" - sconst "All items!" - join_string 6 - iconst 262174 - if_settext -LABEL557: - sconst "deathKeepBuild" ; push event name - runelite_callback ; invoke callback - return