From 2bfe724353a2fc078925d5b8fd54301506368a34 Mon Sep 17 00:00:00 2001 From: Ganom Date: Sat, 11 May 2019 13:37:47 -0400 Subject: [PATCH] Removing Merged plugins --- .../OlmCrippleTimerOverlay.java | 89 ------------ .../OlmCrippleTimerPlugin.java | 114 ---------------- .../olmprayagainst/OlmPrayAgainstOverlay.java | 110 --------------- .../olmprayagainst/OlmPrayAgainstPlugin.java | 127 ------------------ .../plugins/olmprayagainst/PrayAgainst.java | 30 ----- 5 files changed, 470 deletions(-) delete mode 100644 runelite-client/src/main/java/net/runelite/client/plugins/olmcrippletimer/OlmCrippleTimerOverlay.java delete mode 100644 runelite-client/src/main/java/net/runelite/client/plugins/olmcrippletimer/OlmCrippleTimerPlugin.java delete mode 100644 runelite-client/src/main/java/net/runelite/client/plugins/olmprayagainst/OlmPrayAgainstOverlay.java delete mode 100644 runelite-client/src/main/java/net/runelite/client/plugins/olmprayagainst/OlmPrayAgainstPlugin.java delete mode 100644 runelite-client/src/main/java/net/runelite/client/plugins/olmprayagainst/PrayAgainst.java diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/olmcrippletimer/OlmCrippleTimerOverlay.java b/runelite-client/src/main/java/net/runelite/client/plugins/olmcrippletimer/OlmCrippleTimerOverlay.java deleted file mode 100644 index c6e52bd5dd..0000000000 --- a/runelite-client/src/main/java/net/runelite/client/plugins/olmcrippletimer/OlmCrippleTimerOverlay.java +++ /dev/null @@ -1,89 +0,0 @@ -/* - * Copyright (c) 2018, https://runelitepl.us - * 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.olmcrippletimer; - - -import java.awt.*; -import java.util.*; -import java.util.List; -import javax.inject.Inject; -import net.runelite.api.*; -import net.runelite.api.Point; -import net.runelite.api.coords.LocalPoint; -import net.runelite.api.coords.WorldArea; -import net.runelite.api.coords.WorldPoint; -import net.runelite.client.ui.overlay.Overlay; -import net.runelite.client.ui.overlay.OverlayLayer; -import net.runelite.client.ui.overlay.OverlayPosition; -import net.runelite.client.ui.overlay.OverlayPriority; -import net.runelite.client.ui.overlay.OverlayUtil; - - -public class OlmCrippleTimerOverlay extends Overlay { - - - private final Client client; - private final OlmCrippleTimerPlugin plugin; - - @Inject - private OlmCrippleTimerOverlay(Client client, OlmCrippleTimerPlugin plugin){ - this.client = client; - this.plugin = plugin; - setPosition(OverlayPosition.DYNAMIC); - setPriority(OverlayPriority.HIGH); - setLayer(OverlayLayer.ABOVE_SCENE); - } - - @Override - public Dimension render(Graphics2D graphics) { - if(plugin.isHandCripple()){ - int tick = plugin.getTimer(); - NPC olmHand = plugin.getHand(); - final String tickStr = String.valueOf(tick); - Point canvasPoint = olmHand.getCanvasTextLocation(graphics, tickStr, 50); - renderTextLocation(graphics, tickStr, 12 , Font.BOLD, Color.GRAY, canvasPoint); - } - - - return null; - } - //this is just copy pasted btw - private void renderTextLocation(Graphics2D graphics, String txtString, int fontSize, int fontStyle, Color fontColor, Point canvasPoint) - { - graphics.setFont(new Font("Arial", fontStyle, fontSize)); - if (canvasPoint != null) - { - final Point canvasCenterPoint = new Point( - canvasPoint.getX(), - canvasPoint.getY()); - final Point canvasCenterPoint_shadow = new Point( - canvasPoint.getX() + 1, - canvasPoint.getY() + 1) ; - OverlayUtil.renderTextLocation(graphics, canvasCenterPoint_shadow, txtString, Color.BLACK); - OverlayUtil.renderTextLocation(graphics, canvasCenterPoint, txtString, fontColor); - } - } - -} \ No newline at end of file diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/olmcrippletimer/OlmCrippleTimerPlugin.java b/runelite-client/src/main/java/net/runelite/client/plugins/olmcrippletimer/OlmCrippleTimerPlugin.java deleted file mode 100644 index 3946d21645..0000000000 --- a/runelite-client/src/main/java/net/runelite/client/plugins/olmcrippletimer/OlmCrippleTimerPlugin.java +++ /dev/null @@ -1,114 +0,0 @@ -/* - * Copyright (c) 2018, https://runelitepl.us - * 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.olmcrippletimer; - -import lombok.AccessLevel; -import lombok.Getter; -import lombok.extern.slf4j.Slf4j; -import net.runelite.api.Client; -import net.runelite.api.NPC; -import net.runelite.api.NpcID; -import net.runelite.api.events.ChatMessage; -import net.runelite.api.events.GameTick; -import net.runelite.api.events.NpcDespawned; -import net.runelite.api.events.NpcSpawned; -import net.runelite.client.eventbus.Subscribe; -import net.runelite.client.plugins.Plugin; -import net.runelite.client.plugins.PluginDescriptor; -import net.runelite.client.plugins.PluginType; -import net.runelite.client.ui.overlay.OverlayManager; - -import javax.inject.Inject; - -@PluginDescriptor( - name="Olm Cripple Timer", - description = "Shows a timer over the olm hand cripple", - tags = {"cox", "raid", "clench", "melee", "hand"}, - type = PluginType.PVM -) - -public class OlmCrippleTimerPlugin extends Plugin{ - - private static final String OLM_HAND_CRIPPLE = "The Great Olm\'s left claw clenches to protect itself temporarily."; - @Inject - private Client client; - @Getter(AccessLevel.PACKAGE) - private boolean HandCripple; - @Getter(AccessLevel.PACKAGE) - private int timer = 45; - @Getter(AccessLevel.PACKAGE) - private NPC hand; - @Inject - private OverlayManager overlayManager; - @Inject - private OlmCrippleTimerOverlay olmCrippleTimerOverlay; - - @Override - protected void startUp() throws Exception { - overlayManager.add(olmCrippleTimerOverlay); - } - @Override - protected void shutDown() throws Exception { - overlayManager.remove(olmCrippleTimerOverlay); - HandCripple = false; - timer = 45; - hand = null; - - } - @Subscribe - public void onChatMessage(ChatMessage event) - { - - String message = event.getMessage(); - if(message.startsWith(OLM_HAND_CRIPPLE)){ - HandCripple = true; - timer = 45; - } - } - @Subscribe - public void onNpcDespawned(NpcDespawned npcdespawned){ - if(npcdespawned.getNpc().getId() == NpcID.GREAT_OLM_RIGHT_CLAW_7553 || npcdespawned.getNpc().getId() == NpcID.GREAT_OLM_RIGHT_CLAW){ - HandCripple = false; - } - } - @Subscribe - public void onNpcSpawned(NpcSpawned npcSpawned) - { - if(npcSpawned.getNpc().getId() == NpcID.GREAT_OLM_LEFT_CLAW_7555 || npcSpawned.getNpc().getId() == NpcID.GREAT_OLM_LEFT_CLAW){ - hand = npcSpawned.getNpc(); - } - } - @Subscribe - public void onGameTick(GameTick event) - { - if(HandCripple) { - timer--; - if (timer <= 0) { - HandCripple = false; - timer = 45; - } - } - } -} diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/olmprayagainst/OlmPrayAgainstOverlay.java b/runelite-client/src/main/java/net/runelite/client/plugins/olmprayagainst/OlmPrayAgainstOverlay.java deleted file mode 100644 index ba93a8f90a..0000000000 --- a/runelite-client/src/main/java/net/runelite/client/plugins/olmprayagainst/OlmPrayAgainstOverlay.java +++ /dev/null @@ -1,110 +0,0 @@ -/* - * Copyright (c) 2019, gazivodag - * 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.olmprayagainst; - -import net.runelite.api.Client; -import net.runelite.api.SpriteID; -import net.runelite.client.game.SpriteManager; -import net.runelite.client.ui.overlay.Overlay; -import net.runelite.client.ui.overlay.OverlayPosition; -import net.runelite.client.ui.overlay.components.InfoBoxComponent; -import net.runelite.client.ui.overlay.components.PanelComponent; - -import javax.inject.Inject; -import java.awt.*; -import java.awt.image.BufferedImage; - -class OlmPrayAgainstOverlay extends Overlay { - - private final OlmPrayAgainstPlugin plugin; - private final Client client; - private final SpriteManager spriteManager; - private final PanelComponent panelComponent = new PanelComponent(); - - @Inject - OlmPrayAgainstOverlay(OlmPrayAgainstPlugin plugin, Client client, SpriteManager spriteManager) { - this.plugin = plugin; - this.client = client; - this.spriteManager = spriteManager; - setPosition(OverlayPosition.BOTTOM_RIGHT); - panelComponent.setOrientation(PanelComponent.Orientation.VERTICAL); - } - - public Dimension render(Graphics2D graphics2D) { - if (plugin.getPrayAgainstOlm() == null) return null; - - panelComponent.getChildren().clear(); - - if (System.currentTimeMillis() < (plugin.getLastPrayTime() + 120000)) { - InfoBoxComponent prayComponent = new InfoBoxComponent(); - Image prayImg = scaleImg(getPrayerImage(plugin.prayAgainstOlm)); - prayComponent.setImage(prayImg); - prayComponent.setColor(Color.WHITE); - prayComponent.setPreferredSize(new Dimension(40,40)); - panelComponent.getChildren().add(prayComponent); - - panelComponent.setPreferredSize(new Dimension(40,40)); - panelComponent.setBorder(new Rectangle(0,0,0,0)); - return panelComponent.render(graphics2D); - } else { - plugin.setPrayAgainstOlm(null); - } - - return null; - } - - private BufferedImage getPrayerImage(PrayAgainst prayAgainst) { - switch (prayAgainst) { - case MAGIC: - return spriteManager.getSprite(SpriteID.PRAYER_PROTECT_FROM_MAGIC, 0); - case MELEE: - return spriteManager.getSprite(SpriteID.PRAYER_PROTECT_FROM_MELEE, 0); - case RANGED: - return spriteManager.getSprite(SpriteID.PRAYER_PROTECT_FROM_MISSILES, 0); - } - return null; - } - - private Image scaleImg(final Image img) { - if (img == null) - { - return null; - } - final double width = img.getWidth(null); - final double height = img.getHeight(null); - final double size = 36; // Limit size to 2 as that is minimum size not causing breakage - final double scalex = size / width; - final double scaley = size / height; - final double scale = Math.min(scalex, scaley); - final int newWidth = (int) (width * scale); - final int newHeight = (int) (height * scale); - final BufferedImage scaledImage = new BufferedImage(newWidth, newHeight, BufferedImage.TYPE_INT_ARGB); - final Graphics g = scaledImage.createGraphics(); - g.drawImage(img, 0, 0, newWidth, newHeight, null); - g.dispose(); - return scaledImage; - } - - -} diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/olmprayagainst/OlmPrayAgainstPlugin.java b/runelite-client/src/main/java/net/runelite/client/plugins/olmprayagainst/OlmPrayAgainstPlugin.java deleted file mode 100644 index b313f817df..0000000000 --- a/runelite-client/src/main/java/net/runelite/client/plugins/olmprayagainst/OlmPrayAgainstPlugin.java +++ /dev/null @@ -1,127 +0,0 @@ -/* - * Copyright (c) 2019, ganom - * Copyright (c) 2019, gazivodag - * 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.olmprayagainst; - -import javax.inject.Inject; -import javax.inject.Singleton; -import lombok.Getter; -import lombok.Setter; -import lombok.extern.slf4j.Slf4j; -import net.runelite.api.ChatMessageType; -import net.runelite.api.Client; -import net.runelite.api.Projectile; -import net.runelite.api.events.ChatMessage; -import net.runelite.api.events.ProjectileMoved; -import net.runelite.client.eventbus.Subscribe; -import net.runelite.client.plugins.Plugin; -import net.runelite.client.plugins.PluginDescriptor; -import net.runelite.client.plugins.PluginType; -import net.runelite.client.ui.overlay.OverlayManager; - -/* - * Tells you what to pray against Olm (Not to be confused with ganoms swapper) - * Most of the code is from Haha Kut's Alchemical Hydra plugin. (See OlmPrayAgainstOverlay) - */ - -@PluginDescriptor( - name = "Olm Pray Against", - description = "Tells you what to pray against Olm", - tags = {"prayer", "olm", "raids", "pray against", "cox"}, - type = PluginType.PVM -) -@Slf4j -@Singleton -public class OlmPrayAgainstPlugin extends Plugin -{ - @Setter - @Getter - protected PrayAgainst prayAgainstOlm; - @Getter - protected long lastPrayTime; - @Inject - private Client client; - @Inject - private OlmPrayAgainstOverlay overlay; - @Inject - private OverlayManager overlayManager; - - @Override - protected void startUp() - { - overlayManager.add(overlay); - } - - @Override - protected void shutDown() throws Exception - { - overlayManager.remove(overlay); - } - - @Subscribe - public void onChatMessage(ChatMessage event) - { - final String msg = event.getMessage(); - if (event.getType() == ChatMessageType.GAMEMESSAGE) - { - if (msg.toLowerCase().contains("aggression")) - { - log.debug("Melee Detected"); - prayAgainstOlm = PrayAgainst.MELEE; - lastPrayTime = System.currentTimeMillis(); - } - if (msg.toLowerCase().contains("of magical power")) - { - log.debug("Mage Detected"); - prayAgainstOlm = PrayAgainst.MAGIC; - lastPrayTime = System.currentTimeMillis(); - } - if (msg.toLowerCase().contains("accuracy and dexterity")) - { - log.debug("Missile Detected"); - prayAgainstOlm = PrayAgainst.RANGED; - lastPrayTime = System.currentTimeMillis(); - } - } - } - - @Subscribe - public void onProjectileMoved(ProjectileMoved event) - { - Projectile projectile = event.getProjectile(); - if (projectile.getId() == 1339) - { - log.debug("Mage Detected"); - prayAgainstOlm = PrayAgainst.MAGIC; - lastPrayTime = System.currentTimeMillis(); - } - if (projectile.getId() == 1340) - { - log.debug("Range Detected"); - prayAgainstOlm = PrayAgainst.RANGED; - lastPrayTime = System.currentTimeMillis(); - } - } - -} diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/olmprayagainst/PrayAgainst.java b/runelite-client/src/main/java/net/runelite/client/plugins/olmprayagainst/PrayAgainst.java deleted file mode 100644 index 8e9360bdef..0000000000 --- a/runelite-client/src/main/java/net/runelite/client/plugins/olmprayagainst/PrayAgainst.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * Copyright (c) 2019, gazivodag - * 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.olmprayagainst; - -enum PrayAgainst { - MELEE, - MAGIC, - RANGED -}