From 26fd53aa8f95ec7a1b3f208a4df59566e1e291f6 Mon Sep 17 00:00:00 2001 From: James Munson Date: Sat, 18 May 2019 09:58:16 -0700 Subject: [PATCH] removed explorers ring --- .../plugins/itemcharges/ItemChargeConfig.java | 33 ---- .../plugins/itemcharges/ItemChargePlugin.java | 5 - .../itemcharges/ItemExplorerRingOverlay.java | 163 ------------------ .../ItemExplorerRingOverlayMode.java | 33 ---- 4 files changed, 234 deletions(-) delete mode 100644 runelite-client/src/main/java/net/runelite/client/plugins/itemcharges/ItemExplorerRingOverlay.java delete mode 100644 runelite-client/src/main/java/net/runelite/client/plugins/itemcharges/ItemExplorerRingOverlayMode.java diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/itemcharges/ItemChargeConfig.java b/runelite-client/src/main/java/net/runelite/client/plugins/itemcharges/ItemChargeConfig.java index 55fa6ae449..7bb41bfabf 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/itemcharges/ItemChargeConfig.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/itemcharges/ItemChargeConfig.java @@ -399,37 +399,4 @@ public interface ItemChargeConfig extends Config { return false; } - - @ConfigItem( - keyName = "showExplorer", - name = "Show Explorer's Ring Charges", - description = "Configures if Explorer's Ring charge is shown", - position = 23 - ) - default boolean showExplorer() - { - return false; - } - - @ConfigItem( - keyName = "fontcolor", - name = "Font Color For Explorer's Ring", - description = "Color of the font for the number of charges", - position = 24 - ) - default Color fontColor() - { - return Color.yellow; - } - - @ConfigItem( - keyName = "explorerRingOverlayMode", - name = "Explorer's Ring Display Mode", - description = "Configures where explorer ring overlay is displayed", - position = 25 - ) - default ItemExplorerRingOverlayMode explorerRingOverlayMode() - { - return ItemExplorerRingOverlayMode.BOTH; - } } \ No newline at end of file diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/itemcharges/ItemChargePlugin.java b/runelite-client/src/main/java/net/runelite/client/plugins/itemcharges/ItemChargePlugin.java index 03be0e56fd..94c5862bc2 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/itemcharges/ItemChargePlugin.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/itemcharges/ItemChargePlugin.java @@ -153,9 +153,6 @@ public class ItemChargePlugin extends Plugin @Inject private ItemRecoilOverlay recoilOverlay; - @Inject - private ItemExplorerRingOverlay eRingOverlay; - @Inject private ItemManager itemManager; @@ -182,7 +179,6 @@ public class ItemChargePlugin extends Plugin { overlayManager.add(overlay); overlayManager.add(recoilOverlay); - overlayManager.add(eRingOverlay); recoilRingImage = itemManager.getImage(RING_OF_RECOIL); } @@ -191,7 +187,6 @@ public class ItemChargePlugin extends Plugin { overlayManager.remove(overlay); overlayManager.remove(recoilOverlay); - overlayManager.remove(eRingOverlay); infoBoxManager.removeIf(ItemChargeInfobox.class::isInstance); lastCheckTick = -1; } diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/itemcharges/ItemExplorerRingOverlay.java b/runelite-client/src/main/java/net/runelite/client/plugins/itemcharges/ItemExplorerRingOverlay.java deleted file mode 100644 index 6c678c5eda..0000000000 --- a/runelite-client/src/main/java/net/runelite/client/plugins/itemcharges/ItemExplorerRingOverlay.java +++ /dev/null @@ -1,163 +0,0 @@ -/* - * Copyright (c) 2018, https://runelitepl.us - * Copyright (c) 2018, https://github.com/runeliteplusplus - * 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.itemcharges; - -import javax.inject.Inject; -import net.runelite.api.Client; -import net.runelite.api.ItemID; -import net.runelite.api.Point; -import net.runelite.api.Varbits; -import net.runelite.api.widgets.WidgetItem; -import net.runelite.client.ui.FontManager; -import net.runelite.client.ui.overlay.WidgetItemOverlay; - -import java.awt.*; -import net.runelite.client.ui.overlay.tooltip.Tooltip; -import net.runelite.client.ui.overlay.tooltip.TooltipManager; - -public class ItemExplorerRingOverlay extends WidgetItemOverlay -{ - private static final Varbits TELEPORTS = Varbits.EXPLORER_RING_TELEPORTS; - private static final Varbits ALCHS = Varbits.EXPLORER_RING_ALCHS; - private static final Varbits RUNENERGY = Varbits.EXPLORER_RING_RUNENERGY; - private static final Varbits ALCHTYPE = Varbits.EXPLORER_RING_ALCHTYPE; - - private static final int MAX_ALCHS = 30; - private static final int MAX_TELEPORTS = 3; - private static final int[] MAX_RUNREPLENISH = { - 2, /* Explorer's ring 1 */ - 3, - 4, - 3 - }; - - private final Client client; - private final ItemChargeConfig config; - private final TooltipManager tooltipManager; - - @Inject - ItemExplorerRingOverlay(Client client, ItemChargeConfig config, TooltipManager tooltipManager) - { - this.client = client; - this.config = config; - this.tooltipManager = tooltipManager; - - showOnInventory(); - showOnEquipment(); - } - - @Override - public void renderItemOverlay(Graphics2D graphics, int itemId, WidgetItem itemWidget) - { - if (config.showExplorer()) - { - if (itemId < ItemID.EXPLORERS_RING_1 || itemId > ItemID.EXPLORERS_RING_4) - return; - - graphics.setFont(FontManager.getRunescapeSmallFont()); - - Point location = itemWidget.getCanvasLocation(); - StringBuilder tooltipBuilder = new StringBuilder(); - - // Pen position tracking. - int penShadowX = location.getX() + 1; - int penX = location.getX(); - int penShadowY = location.getY(); - int penY = location.getY(); - - // Alchemy (level 4 ring is High Alc) - int alchAmount = MAX_ALCHS - client.getVar(ALCHS); - if (config.explorerRingOverlayMode() != ItemExplorerRingOverlayMode.MOUSE_HOVER) - { - String alchStr = "A: " + alchAmount; - - penShadowY += 1 + (graphics.getFontMetrics().getHeight() - 1); - graphics.setColor(Color.BLACK); - graphics.drawString(alchStr, penShadowX, - penShadowY); - - penY += (graphics.getFontMetrics().getHeight() - 1); - graphics.setColor(config.fontColor()); - graphics.drawString(alchStr, penX, - penY); - } - - tooltipBuilder.append("Alchs: " + alchAmount + "
"); - - // Run energy - int runAmount = MAX_RUNREPLENISH[itemId - ItemID.EXPLORERS_RING_1] - client.getVar(RUNENERGY); - - if (config.explorerRingOverlayMode() != ItemExplorerRingOverlayMode.MOUSE_HOVER) - { - String runStr = "R: " + runAmount; - - penShadowY += 1 + (graphics.getFontMetrics().getHeight() - 1); - graphics.setColor(Color.BLACK); - graphics.drawString(runStr, penShadowX, - penShadowY); - - penY += (graphics.getFontMetrics().getHeight() - 1); - graphics.setColor(config.fontColor()); - graphics.drawString(runStr, penX, - penY); - } - - tooltipBuilder.append("Run Replenish: " + runAmount + "
"); - - // Teleport charges (unique to level 2 ring). - if (itemId == ItemID.EXPLORERS_RING_2) - { - int teleAmount = MAX_TELEPORTS - client.getVar(TELEPORTS); - - if (config.explorerRingOverlayMode() != ItemExplorerRingOverlayMode.MOUSE_HOVER) - { - String teleStr = "T: " + teleAmount; - - penShadowY += 1 + (graphics.getFontMetrics().getHeight() - 1); - graphics.setColor(Color.BLACK); - graphics.drawString(teleStr, penShadowX + 1, - penShadowY); - - penY += (graphics.getFontMetrics().getHeight() - 1); - graphics.setColor(config.fontColor()); - graphics.drawString(teleStr, penX + 1, - penY); - } - - tooltipBuilder.append("Teleports: " + teleAmount + "
"); - } - - // Display tooltip - String finalTooltip = tooltipBuilder.toString(); - if (!finalTooltip.isEmpty() && - (config.explorerRingOverlayMode() != ItemExplorerRingOverlayMode.INVENTORY) && - itemWidget.getCanvasBounds().contains(client.getMouseCanvasPosition().getX(), client.getMouseCanvasPosition().getY())) - { - tooltipManager.add(new Tooltip(finalTooltip)); - } - } - } -} \ No newline at end of file diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/itemcharges/ItemExplorerRingOverlayMode.java b/runelite-client/src/main/java/net/runelite/client/plugins/itemcharges/ItemExplorerRingOverlayMode.java deleted file mode 100644 index 7d0c5a05cc..0000000000 --- a/runelite-client/src/main/java/net/runelite/client/plugins/itemcharges/ItemExplorerRingOverlayMode.java +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Copyright (c) 2018, https://runelitepl.us - * Copyright (c) 2018, https://github.com/runeliteplusplus - * 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.itemcharges; - -public enum ItemExplorerRingOverlayMode -{ - INVENTORY, - MOUSE_HOVER, - BOTH -} \ No newline at end of file