Make plugins work with new OverlayManager
- Remove the usage of getOverlay and getOverlays - Replace the overlay addition/removal with correct calls to overlayManager.add and overlayManager.remove - Update tests Signed-off-by: Tomas Slusny <slusnucky@gmail.com>
This commit is contained in:
@@ -26,8 +26,6 @@ package net.runelite.client.plugins.agility;
|
||||
|
||||
import com.google.common.eventbus.Subscribe;
|
||||
import com.google.inject.Provides;
|
||||
import java.util.Arrays;
|
||||
import java.util.Collection;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
import java.util.Objects;
|
||||
@@ -65,7 +63,7 @@ import net.runelite.client.Notifier;
|
||||
import net.runelite.client.config.ConfigManager;
|
||||
import net.runelite.client.plugins.Plugin;
|
||||
import net.runelite.client.plugins.PluginDescriptor;
|
||||
import net.runelite.client.ui.overlay.Overlay;
|
||||
import net.runelite.client.ui.overlay.OverlayManager;
|
||||
import net.runelite.client.ui.overlay.infobox.InfoBoxManager;
|
||||
|
||||
@PluginDescriptor(
|
||||
@@ -83,11 +81,13 @@ public class AgilityPlugin extends Plugin
|
||||
private Tile markOfGrace;
|
||||
|
||||
@Inject
|
||||
@Getter
|
||||
private AgilityOverlay overlay;
|
||||
private OverlayManager overlayManager;
|
||||
|
||||
@Inject
|
||||
private LapCounterOverlay lapOverlay;
|
||||
private AgilityOverlay agilityOverlay;
|
||||
|
||||
@Inject
|
||||
private LapCounterOverlay lapCounterOverlay;
|
||||
|
||||
@Inject
|
||||
private Notifier notifier;
|
||||
@@ -114,14 +114,17 @@ public class AgilityPlugin extends Plugin
|
||||
}
|
||||
|
||||
@Override
|
||||
public Collection<Overlay> getOverlays()
|
||||
protected void startUp() throws Exception
|
||||
{
|
||||
return Arrays.asList(overlay, lapOverlay);
|
||||
overlayManager.add(agilityOverlay);
|
||||
overlayManager.add(lapCounterOverlay);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void shutDown() throws Exception
|
||||
{
|
||||
overlayManager.remove(agilityOverlay);
|
||||
overlayManager.remove(lapCounterOverlay);
|
||||
markOfGrace = null;
|
||||
obstacles.clear();
|
||||
session = null;
|
||||
|
||||
@@ -52,6 +52,7 @@ import net.runelite.client.plugins.PluginDescriptor;
|
||||
import static net.runelite.client.plugins.attackstyles.AttackStyle.CASTING;
|
||||
import static net.runelite.client.plugins.attackstyles.AttackStyle.DEFENSIVE_CASTING;
|
||||
import static net.runelite.client.plugins.attackstyles.AttackStyle.OTHER;
|
||||
import net.runelite.client.ui.overlay.OverlayManager;
|
||||
|
||||
@PluginDescriptor(
|
||||
name = "Attack Styles"
|
||||
@@ -73,6 +74,9 @@ public class AttackStylesPlugin extends Plugin
|
||||
@Inject
|
||||
private AttackStylesConfig config;
|
||||
|
||||
@Inject
|
||||
private OverlayManager overlayManager;
|
||||
|
||||
@Inject
|
||||
private AttackStylesOverlay overlay;
|
||||
|
||||
@@ -82,16 +86,11 @@ public class AttackStylesPlugin extends Plugin
|
||||
return configManager.getConfig(AttackStylesConfig.class);
|
||||
}
|
||||
|
||||
@Override
|
||||
public AttackStylesOverlay getOverlay()
|
||||
{
|
||||
return overlay;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
protected void startUp() throws Exception
|
||||
{
|
||||
overlayManager.add(overlay);
|
||||
|
||||
if (client.getGameState() == GameState.LOGGED_IN)
|
||||
{
|
||||
updateWarnedSkills(config.warnForAttack(), Skill.ATTACK);
|
||||
@@ -111,6 +110,7 @@ public class AttackStylesPlugin extends Plugin
|
||||
@Override
|
||||
protected void shutDown()
|
||||
{
|
||||
overlayManager.remove(overlay);
|
||||
hideWarnedStyles(false);
|
||||
processWidgets();
|
||||
}
|
||||
|
||||
@@ -45,7 +45,7 @@ import net.runelite.client.config.ConfigManager;
|
||||
import net.runelite.client.plugins.Plugin;
|
||||
import net.runelite.client.plugins.PluginDescriptor;
|
||||
import net.runelite.client.ui.FontManager;
|
||||
import net.runelite.client.ui.overlay.Overlay;
|
||||
import net.runelite.client.ui.overlay.OverlayManager;
|
||||
|
||||
@PluginDescriptor(
|
||||
name = "Barbarian Assault"
|
||||
@@ -63,6 +63,9 @@ public class BarbarianAssaultPlugin extends Plugin
|
||||
@Inject
|
||||
private Client client;
|
||||
|
||||
@Inject
|
||||
private OverlayManager overlayManager;
|
||||
|
||||
@Inject
|
||||
private BarbarianAssaultConfig config;
|
||||
|
||||
@@ -78,6 +81,7 @@ public class BarbarianAssaultPlugin extends Plugin
|
||||
@Override
|
||||
protected void startUp() throws Exception
|
||||
{
|
||||
overlayManager.add(overlay);
|
||||
font = FontManager.getRunescapeFont()
|
||||
.deriveFont(Font.BOLD, 24);
|
||||
|
||||
@@ -87,6 +91,12 @@ public class BarbarianAssaultPlugin extends Plugin
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void shutDown() throws Exception
|
||||
{
|
||||
overlayManager.remove(overlay);
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
public void onGameTick(GameTick event)
|
||||
{
|
||||
@@ -155,12 +165,6 @@ public class BarbarianAssaultPlugin extends Plugin
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public Overlay getOverlay()
|
||||
{
|
||||
return overlay;
|
||||
}
|
||||
|
||||
public Font getFont()
|
||||
{
|
||||
return font;
|
||||
|
||||
@@ -28,7 +28,6 @@ import com.google.common.collect.Sets;
|
||||
import com.google.common.eventbus.Subscribe;
|
||||
import com.google.inject.Provides;
|
||||
import java.util.Arrays;
|
||||
import java.util.Collection;
|
||||
import java.util.HashSet;
|
||||
import java.util.Set;
|
||||
import java.util.concurrent.CompletableFuture;
|
||||
@@ -64,7 +63,7 @@ import net.runelite.client.config.ConfigManager;
|
||||
import net.runelite.client.game.ItemManager;
|
||||
import net.runelite.client.plugins.Plugin;
|
||||
import net.runelite.client.plugins.PluginDescriptor;
|
||||
import net.runelite.client.ui.overlay.Overlay;
|
||||
import net.runelite.client.ui.overlay.OverlayManager;
|
||||
import net.runelite.client.util.StackFormatter;
|
||||
import net.runelite.http.api.item.ItemPrice;
|
||||
|
||||
@@ -88,26 +87,19 @@ public class BarrowsPlugin extends Plugin
|
||||
|
||||
@Getter(AccessLevel.PACKAGE)
|
||||
private final Set<WallObject> walls = new HashSet<>();
|
||||
|
||||
@Getter(AccessLevel.PACKAGE)
|
||||
private final Set<GameObject> ladders = new HashSet<>();
|
||||
|
||||
@Inject
|
||||
private OverlayManager overlayManager;
|
||||
|
||||
@Inject
|
||||
private BarrowsOverlay barrowsOverlay;
|
||||
|
||||
@Inject
|
||||
private BarrowsBrotherSlainOverlay brotherOverlay;
|
||||
|
||||
@Provides
|
||||
BarrowsConfig provideConfig(ConfigManager configManager)
|
||||
{
|
||||
return configManager.getConfig(BarrowsConfig.class);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Collection<Overlay> getOverlays()
|
||||
{
|
||||
return Arrays.asList(barrowsOverlay, brotherOverlay);
|
||||
}
|
||||
|
||||
@Inject
|
||||
private Client client;
|
||||
|
||||
@@ -122,9 +114,24 @@ public class BarrowsPlugin extends Plugin
|
||||
|
||||
private long chestPrice;
|
||||
|
||||
@Provides
|
||||
BarrowsConfig provideConfig(ConfigManager configManager)
|
||||
{
|
||||
return configManager.getConfig(BarrowsConfig.class);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void startUp() throws Exception
|
||||
{
|
||||
overlayManager.add(barrowsOverlay);
|
||||
overlayManager.add(brotherOverlay);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void shutDown()
|
||||
{
|
||||
overlayManager.remove(barrowsOverlay);
|
||||
overlayManager.remove(brotherOverlay);
|
||||
walls.clear();
|
||||
ladders.clear();
|
||||
}
|
||||
|
||||
@@ -26,8 +26,6 @@ package net.runelite.client.plugins.blastfurnace;
|
||||
|
||||
import com.google.common.eventbus.Subscribe;
|
||||
import com.google.inject.Provides;
|
||||
import java.util.Arrays;
|
||||
import java.util.Collection;
|
||||
import javax.inject.Inject;
|
||||
import lombok.AccessLevel;
|
||||
import lombok.Getter;
|
||||
@@ -41,7 +39,7 @@ import net.runelite.api.events.GameStateChanged;
|
||||
import net.runelite.client.config.ConfigManager;
|
||||
import net.runelite.client.plugins.Plugin;
|
||||
import net.runelite.client.plugins.PluginDescriptor;
|
||||
import net.runelite.client.ui.overlay.Overlay;
|
||||
import net.runelite.client.ui.overlay.OverlayManager;
|
||||
|
||||
@PluginDescriptor(
|
||||
name = "Blast Furnace"
|
||||
@@ -56,6 +54,9 @@ public class BlastFurnacePlugin extends Plugin
|
||||
@Getter(AccessLevel.PACKAGE)
|
||||
private GameObject barDispenser;
|
||||
|
||||
@Inject
|
||||
private OverlayManager overlayManager;
|
||||
|
||||
@Inject
|
||||
private BlastFurnaceOverlay overlay;
|
||||
|
||||
@@ -65,9 +66,20 @@ public class BlastFurnacePlugin extends Plugin
|
||||
@Inject
|
||||
private BlastFurnaceClickBoxOverlay clickBoxOverlay;
|
||||
|
||||
@Override
|
||||
protected void startUp() throws Exception
|
||||
{
|
||||
overlayManager.add(overlay);
|
||||
overlayManager.add(cofferOverlay);
|
||||
overlayManager.add(clickBoxOverlay);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void shutDown()
|
||||
{
|
||||
overlayManager.remove(overlay);
|
||||
overlayManager.remove(cofferOverlay);
|
||||
overlayManager.remove(clickBoxOverlay);
|
||||
conveyorBelt = null;
|
||||
barDispenser = null;
|
||||
}
|
||||
@@ -78,12 +90,6 @@ public class BlastFurnacePlugin extends Plugin
|
||||
return configManager.getConfig(BlastFurnaceConfig.class);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Collection<Overlay> getOverlays()
|
||||
{
|
||||
return Arrays.asList(overlay, cofferOverlay, clickBoxOverlay);
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
public void onGameObjectSpawn(GameObjectSpawned event)
|
||||
{
|
||||
|
||||
@@ -26,8 +26,6 @@ package net.runelite.client.plugins.blastmine;
|
||||
|
||||
import com.google.common.eventbus.Subscribe;
|
||||
import com.google.inject.Provides;
|
||||
import java.util.Arrays;
|
||||
import java.util.Collection;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
import javax.inject.Inject;
|
||||
@@ -44,7 +42,7 @@ import net.runelite.api.widgets.WidgetInfo;
|
||||
import net.runelite.client.config.ConfigManager;
|
||||
import net.runelite.client.plugins.Plugin;
|
||||
import net.runelite.client.plugins.PluginDescriptor;
|
||||
import net.runelite.client.ui.overlay.Overlay;
|
||||
import net.runelite.client.ui.overlay.OverlayManager;
|
||||
|
||||
@PluginDescriptor(name = "Blast Mine")
|
||||
public class BlastMinePlugin extends Plugin
|
||||
@@ -52,6 +50,9 @@ public class BlastMinePlugin extends Plugin
|
||||
@Getter
|
||||
private final Map<WorldPoint, BlastMineRock> rocks = new HashMap<>();
|
||||
|
||||
@Inject
|
||||
private OverlayManager overlayManager;
|
||||
|
||||
@Inject
|
||||
private Client client;
|
||||
|
||||
@@ -68,14 +69,17 @@ public class BlastMinePlugin extends Plugin
|
||||
}
|
||||
|
||||
@Override
|
||||
public Collection<Overlay> getOverlays()
|
||||
protected void startUp() throws Exception
|
||||
{
|
||||
return Arrays.asList(blastMineRockOverlay, blastMineOreCountOverlay);
|
||||
overlayManager.add(blastMineRockOverlay);
|
||||
overlayManager.add(blastMineOreCountOverlay);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void shutDown() throws Exception
|
||||
{
|
||||
overlayManager.remove(blastMineRockOverlay);
|
||||
overlayManager.remove(blastMineOreCountOverlay);
|
||||
final Widget blastMineWidget = client.getWidget(WidgetInfo.BLAST_MINE);
|
||||
|
||||
if (blastMineWidget != null)
|
||||
|
||||
@@ -44,7 +44,7 @@ import net.runelite.client.config.ConfigManager;
|
||||
import net.runelite.client.game.SkillIconManager;
|
||||
import net.runelite.client.plugins.Plugin;
|
||||
import net.runelite.client.plugins.PluginDescriptor;
|
||||
import net.runelite.client.ui.overlay.Overlay;
|
||||
import net.runelite.client.ui.overlay.OverlayManager;
|
||||
import net.runelite.client.ui.overlay.infobox.InfoBoxManager;
|
||||
|
||||
@PluginDescriptor(
|
||||
@@ -78,6 +78,9 @@ public class BoostsPlugin extends Plugin
|
||||
@Inject
|
||||
private InfoBoxManager infoBoxManager;
|
||||
|
||||
@Inject
|
||||
private OverlayManager overlayManager;
|
||||
|
||||
@Inject
|
||||
private BoostsOverlay boostsOverlay;
|
||||
|
||||
@@ -100,15 +103,10 @@ public class BoostsPlugin extends Plugin
|
||||
return configManager.getConfig(BoostsConfig.class);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Overlay getOverlay()
|
||||
{
|
||||
return boostsOverlay;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void startUp()
|
||||
{
|
||||
overlayManager.add(boostsOverlay);
|
||||
updateShownSkills(config.enableSkill());
|
||||
Arrays.fill(lastSkillLevels, -1);
|
||||
overallIcon = skillIconManager.getSkillImage(Skill.OVERALL);
|
||||
@@ -117,6 +115,7 @@ public class BoostsPlugin extends Plugin
|
||||
@Override
|
||||
protected void shutDown() throws Exception
|
||||
{
|
||||
overlayManager.remove(boostsOverlay);
|
||||
infoBoxManager.removeIf(t -> t instanceof BoostIndicator || t instanceof StatChangeIndicator);
|
||||
}
|
||||
|
||||
|
||||
@@ -29,8 +29,6 @@ import com.google.inject.Provides;
|
||||
import java.awt.Color;
|
||||
import java.time.temporal.ChronoUnit;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
import java.util.regex.Matcher;
|
||||
import java.util.regex.Pattern;
|
||||
@@ -59,7 +57,7 @@ import net.runelite.client.game.ItemManager;
|
||||
import net.runelite.client.plugins.Plugin;
|
||||
import net.runelite.client.plugins.PluginDescriptor;
|
||||
import net.runelite.client.task.Schedule;
|
||||
import net.runelite.client.ui.overlay.Overlay;
|
||||
import net.runelite.client.ui.overlay.OverlayManager;
|
||||
import net.runelite.client.ui.overlay.infobox.InfoBoxManager;
|
||||
|
||||
@PluginDescriptor(
|
||||
@@ -97,6 +95,9 @@ public class CannonPlugin extends Plugin
|
||||
@Inject
|
||||
private Notifier notifier;
|
||||
|
||||
@Inject
|
||||
private OverlayManager overlayManager;
|
||||
|
||||
@Inject
|
||||
private CannonOverlay cannonOverlay;
|
||||
|
||||
@@ -119,14 +120,17 @@ public class CannonPlugin extends Plugin
|
||||
}
|
||||
|
||||
@Override
|
||||
public Collection<Overlay> getOverlays()
|
||||
protected void startUp() throws Exception
|
||||
{
|
||||
return Arrays.asList(cannonOverlay, cannonSpotOverlay);
|
||||
overlayManager.add(cannonOverlay);
|
||||
overlayManager.add(cannonSpotOverlay);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void shutDown() throws Exception
|
||||
{
|
||||
overlayManager.remove(cannonOverlay);
|
||||
overlayManager.remove(cannonSpotOverlay);
|
||||
cannonPlaced = false;
|
||||
cannonPosition = null;
|
||||
cballsLeft = 0;
|
||||
|
||||
@@ -41,7 +41,7 @@ import net.runelite.api.events.NpcDespawned;
|
||||
import net.runelite.api.events.NpcSpawned;
|
||||
import net.runelite.client.plugins.Plugin;
|
||||
import net.runelite.client.plugins.PluginDescriptor;
|
||||
import net.runelite.client.ui.overlay.Overlay;
|
||||
import net.runelite.client.ui.overlay.OverlayManager;
|
||||
|
||||
@PluginDescriptor(name = "Cerberus")
|
||||
@Singleton
|
||||
@@ -50,21 +50,25 @@ public class CerberusPlugin extends Plugin
|
||||
@Getter
|
||||
private final List<NPC> ghosts = new ArrayList<>();
|
||||
|
||||
@Inject
|
||||
private OverlayManager overlayManager;
|
||||
|
||||
@Inject
|
||||
private CerberusOverlay overlay;
|
||||
|
||||
@Override
|
||||
protected void startUp() throws Exception
|
||||
{
|
||||
overlayManager.add(overlay);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void shutDown() throws Exception
|
||||
{
|
||||
overlayManager.remove(overlay);
|
||||
ghosts.clear();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Overlay getOverlay()
|
||||
{
|
||||
return overlay;
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
public void onGameStateChange(GameStateChanged event)
|
||||
{
|
||||
|
||||
@@ -33,7 +33,6 @@ import java.io.IOException;
|
||||
import java.time.Duration;
|
||||
import java.time.Instant;
|
||||
import java.util.Arrays;
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
import java.util.stream.Stream;
|
||||
import javax.imageio.ImageIO;
|
||||
@@ -82,7 +81,7 @@ import net.runelite.client.plugins.cluescrolls.clues.MapClue;
|
||||
import net.runelite.client.plugins.cluescrolls.clues.NpcClueScroll;
|
||||
import net.runelite.client.plugins.cluescrolls.clues.ObjectClueScroll;
|
||||
import net.runelite.client.plugins.cluescrolls.clues.TextClueScroll;
|
||||
import net.runelite.client.ui.overlay.Overlay;
|
||||
import net.runelite.client.ui.overlay.OverlayManager;
|
||||
import net.runelite.client.ui.overlay.worldmap.WorldMapPointManager;
|
||||
import net.runelite.client.util.QueryRunner;
|
||||
import net.runelite.client.util.Text;
|
||||
@@ -128,6 +127,9 @@ public class ClueScrollPlugin extends Plugin
|
||||
@Inject
|
||||
private QueryRunner queryRunner;
|
||||
|
||||
@Inject
|
||||
private OverlayManager overlayManager;
|
||||
|
||||
@Inject
|
||||
private ClueScrollOverlay clueScrollOverlay;
|
||||
|
||||
@@ -172,15 +174,20 @@ public class ClueScrollPlugin extends Plugin
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void shutDown() throws Exception
|
||||
protected void startUp() throws Exception
|
||||
{
|
||||
resetClue();
|
||||
overlayManager.add(clueScrollOverlay);
|
||||
overlayManager.add(clueScrollEmoteOverlay);
|
||||
overlayManager.add(clueScrollWorldOverlay);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Collection<Overlay> getOverlays()
|
||||
protected void shutDown() throws Exception
|
||||
{
|
||||
return Arrays.asList(clueScrollOverlay, clueScrollEmoteOverlay, clueScrollWorldOverlay);
|
||||
overlayManager.remove(clueScrollOverlay);
|
||||
overlayManager.remove(clueScrollEmoteOverlay);
|
||||
overlayManager.remove(clueScrollWorldOverlay);
|
||||
resetClue();
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
|
||||
@@ -58,7 +58,7 @@ import net.runelite.api.events.ProjectileMoved;
|
||||
import net.runelite.client.callback.ClientThread;
|
||||
import net.runelite.client.plugins.Plugin;
|
||||
import net.runelite.client.plugins.PluginDescriptor;
|
||||
import net.runelite.client.ui.overlay.Overlay;
|
||||
import net.runelite.client.ui.overlay.OverlayManager;
|
||||
|
||||
@PluginDescriptor(
|
||||
name = "Demonic Gorillas"
|
||||
@@ -69,6 +69,9 @@ public class DemonicGorillaPlugin extends Plugin
|
||||
@Inject
|
||||
private Client client;
|
||||
|
||||
@Inject
|
||||
private OverlayManager overlayManager;
|
||||
|
||||
@Inject
|
||||
private DemonicGorillaOverlay overlay;
|
||||
|
||||
@@ -87,6 +90,7 @@ public class DemonicGorillaPlugin extends Plugin
|
||||
@Override
|
||||
protected void startUp() throws Exception
|
||||
{
|
||||
overlayManager.add(overlay);
|
||||
gorillas = new HashMap<>();
|
||||
recentBoulders = new ArrayList<>();
|
||||
pendingAttacks = new ArrayList<>();
|
||||
@@ -97,18 +101,13 @@ public class DemonicGorillaPlugin extends Plugin
|
||||
@Override
|
||||
protected void shutDown() throws Exception
|
||||
{
|
||||
overlayManager.remove(overlay);
|
||||
gorillas = null;
|
||||
recentBoulders = null;
|
||||
pendingAttacks = null;
|
||||
memorizedPlayers = null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Overlay getOverlay()
|
||||
{
|
||||
return overlay;
|
||||
}
|
||||
|
||||
private void clear()
|
||||
{
|
||||
recentBoulders.clear();
|
||||
|
||||
@@ -32,8 +32,6 @@ import com.google.inject.Provides;
|
||||
import java.awt.Font;
|
||||
import java.awt.image.BufferedImage;
|
||||
import static java.lang.Math.min;
|
||||
import java.util.Arrays;
|
||||
import java.util.Collection;
|
||||
import javax.imageio.ImageIO;
|
||||
import javax.inject.Inject;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
@@ -52,7 +50,7 @@ import net.runelite.client.plugins.PluginDescriptor;
|
||||
import net.runelite.client.ui.FontManager;
|
||||
import net.runelite.client.ui.NavigationButton;
|
||||
import net.runelite.client.ui.PluginToolbar;
|
||||
import net.runelite.client.ui.overlay.Overlay;
|
||||
import net.runelite.client.ui.overlay.OverlayManager;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
@PluginDescriptor(
|
||||
@@ -68,6 +66,9 @@ public class DevToolsPlugin extends Plugin
|
||||
@Inject
|
||||
private PluginToolbar pluginToolbar;
|
||||
|
||||
@Inject
|
||||
private OverlayManager overlayManager;
|
||||
|
||||
@Inject
|
||||
private DevToolsOverlay overlay;
|
||||
|
||||
@@ -120,6 +121,12 @@ public class DevToolsPlugin extends Plugin
|
||||
@Override
|
||||
protected void startUp() throws Exception
|
||||
{
|
||||
overlayManager.add(overlay);
|
||||
overlayManager.add(locationOverlay);
|
||||
overlayManager.add(sceneOverlay);
|
||||
overlayManager.add(cameraOverlay);
|
||||
overlayManager.add(worldMapLocationOverlay);
|
||||
|
||||
final DevToolsPanel panel = injector.getInstance(DevToolsPanel.class);
|
||||
|
||||
BufferedImage icon;
|
||||
@@ -144,15 +151,14 @@ public class DevToolsPlugin extends Plugin
|
||||
@Override
|
||||
protected void shutDown() throws Exception
|
||||
{
|
||||
overlayManager.remove(overlay);
|
||||
overlayManager.remove(locationOverlay);
|
||||
overlayManager.remove(sceneOverlay);
|
||||
overlayManager.remove(cameraOverlay);
|
||||
overlayManager.remove(worldMapLocationOverlay);
|
||||
pluginToolbar.removeNavigation(navButton);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Collection<Overlay> getOverlays()
|
||||
{
|
||||
return Arrays.asList(overlay, locationOverlay, sceneOverlay, cameraOverlay, worldMapLocationOverlay);
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
public void onCommand(CommandExecuted commandExecuted)
|
||||
{
|
||||
|
||||
@@ -34,7 +34,7 @@ import net.runelite.api.queries.NPCQuery;
|
||||
import net.runelite.client.plugins.Plugin;
|
||||
import net.runelite.client.plugins.PluginDescriptor;
|
||||
import net.runelite.client.task.Schedule;
|
||||
import net.runelite.client.ui.overlay.Overlay;
|
||||
import net.runelite.client.ui.overlay.OverlayManager;
|
||||
import net.runelite.client.util.QueryRunner;
|
||||
|
||||
@PluginDescriptor(
|
||||
@@ -48,15 +48,24 @@ public class FightCavePlugin extends Plugin
|
||||
@Inject
|
||||
private QueryRunner queryRunner;
|
||||
|
||||
@Inject
|
||||
private OverlayManager overlayManager;
|
||||
|
||||
@Inject
|
||||
private FightCaveOverlay overlay;
|
||||
|
||||
private JadAttack attack;
|
||||
|
||||
@Override
|
||||
public Overlay getOverlay()
|
||||
protected void startUp() throws Exception
|
||||
{
|
||||
return overlay;
|
||||
overlayManager.add(overlay);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void shutDown() throws Exception
|
||||
{
|
||||
overlayManager.remove(overlay);
|
||||
}
|
||||
|
||||
@Schedule(
|
||||
|
||||
@@ -30,7 +30,6 @@ import com.google.common.primitives.Ints;
|
||||
import com.google.inject.Provides;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.Collection;
|
||||
import java.util.Comparator;
|
||||
import java.util.List;
|
||||
import javax.inject.Inject;
|
||||
@@ -50,7 +49,7 @@ import net.runelite.client.plugins.Plugin;
|
||||
import net.runelite.client.plugins.PluginDependency;
|
||||
import net.runelite.client.plugins.PluginDescriptor;
|
||||
import net.runelite.client.plugins.xptracker.XpTrackerPlugin;
|
||||
import net.runelite.client.ui.overlay.Overlay;
|
||||
import net.runelite.client.ui.overlay.OverlayManager;
|
||||
import net.runelite.client.util.QueryRunner;
|
||||
|
||||
@PluginDescriptor(
|
||||
@@ -71,6 +70,9 @@ public class FishingPlugin extends Plugin
|
||||
@Inject
|
||||
private QueryRunner queryRunner;
|
||||
|
||||
@Inject
|
||||
private OverlayManager overlayManager;
|
||||
|
||||
@Inject
|
||||
private FishingConfig config;
|
||||
|
||||
@@ -94,14 +96,18 @@ public class FishingPlugin extends Plugin
|
||||
@Override
|
||||
protected void startUp() throws Exception
|
||||
{
|
||||
// Initialize overlay config
|
||||
overlayManager.add(overlay);
|
||||
overlayManager.add(spotOverlay);
|
||||
overlayManager.add(fishingSpotMinimapOverlay);
|
||||
updateConfig();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Collection<Overlay> getOverlays()
|
||||
protected void shutDown() throws Exception
|
||||
{
|
||||
return Arrays.asList(overlay, spotOverlay, fishingSpotMinimapOverlay);
|
||||
overlayManager.remove(overlay);
|
||||
overlayManager.remove(spotOverlay);
|
||||
overlayManager.remove(fishingSpotMinimapOverlay);
|
||||
}
|
||||
|
||||
public FishingSession getSession()
|
||||
|
||||
@@ -33,7 +33,7 @@ import net.runelite.client.config.ConfigManager;
|
||||
import net.runelite.client.plugins.Plugin;
|
||||
import net.runelite.client.plugins.PluginDescriptor;
|
||||
import net.runelite.client.ui.DrawManager;
|
||||
import net.runelite.client.ui.overlay.Overlay;
|
||||
import net.runelite.client.ui.overlay.OverlayManager;
|
||||
|
||||
/**
|
||||
* FPS Control has two primary areas, this plugin class just keeps those areas up to date and handles setup / teardown.
|
||||
@@ -53,6 +53,9 @@ public class FpsPlugin extends Plugin
|
||||
{
|
||||
static final String CONFIG_GROUP_KEY = "fpscontrol";
|
||||
|
||||
@Inject
|
||||
private OverlayManager overlayManager;
|
||||
|
||||
@Inject
|
||||
private FpsOverlay overlay;
|
||||
|
||||
@@ -68,12 +71,6 @@ public class FpsPlugin extends Plugin
|
||||
return configManager.getConfig(FpsConfig.class);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Overlay getOverlay()
|
||||
{
|
||||
return overlay;
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
public void onConfigChanged(ConfigChanged event)
|
||||
{
|
||||
@@ -93,6 +90,7 @@ public class FpsPlugin extends Plugin
|
||||
@Override
|
||||
protected void startUp() throws Exception
|
||||
{
|
||||
overlayManager.add(overlay);
|
||||
drawManager.registerEveryFrameListener(drawListener);
|
||||
drawListener.reloadConfig();
|
||||
}
|
||||
@@ -100,6 +98,7 @@ public class FpsPlugin extends Plugin
|
||||
@Override
|
||||
protected void shutDown() throws Exception
|
||||
{
|
||||
overlayManager.remove(overlay);
|
||||
drawManager.unregisterEveryFrameListener(drawListener);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -48,7 +48,7 @@ import net.runelite.client.config.ConfigManager;
|
||||
import net.runelite.client.game.ChatboxInputManager;
|
||||
import net.runelite.client.plugins.Plugin;
|
||||
import net.runelite.client.plugins.PluginDescriptor;
|
||||
import net.runelite.client.ui.overlay.Overlay;
|
||||
import net.runelite.client.ui.overlay.OverlayManager;
|
||||
import net.runelite.client.util.Text;
|
||||
|
||||
@Slf4j
|
||||
@@ -69,6 +69,9 @@ public class FriendNotesPlugin extends Plugin
|
||||
@Inject
|
||||
private ConfigManager configManager;
|
||||
|
||||
@Inject
|
||||
private OverlayManager overlayManager;
|
||||
|
||||
@Inject
|
||||
private FriendNoteOverlay overlay;
|
||||
|
||||
@@ -79,9 +82,15 @@ public class FriendNotesPlugin extends Plugin
|
||||
private HoveredFriend hoveredFriend = null;
|
||||
|
||||
@Override
|
||||
public Overlay getOverlay()
|
||||
protected void startUp() throws Exception
|
||||
{
|
||||
return overlay;
|
||||
overlayManager.add(overlay);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void shutDown() throws Exception
|
||||
{
|
||||
overlayManager.remove(overlay);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -81,7 +81,7 @@ import net.runelite.client.plugins.grounditems.config.MenuHighlightMode;
|
||||
import static net.runelite.client.plugins.grounditems.config.MenuHighlightMode.BOTH;
|
||||
import static net.runelite.client.plugins.grounditems.config.MenuHighlightMode.NAME;
|
||||
import static net.runelite.client.plugins.grounditems.config.MenuHighlightMode.OPTION;
|
||||
import net.runelite.client.ui.overlay.Overlay;
|
||||
import net.runelite.client.ui.overlay.OverlayManager;
|
||||
import net.runelite.http.api.item.ItemPrice;
|
||||
|
||||
@PluginDescriptor(
|
||||
@@ -140,6 +140,9 @@ public class GroundItemsPlugin extends Plugin
|
||||
@Inject
|
||||
private ItemManager itemManager;
|
||||
|
||||
@Inject
|
||||
private OverlayManager overlayManager;
|
||||
|
||||
@Inject
|
||||
private GroundItemsConfig config;
|
||||
|
||||
@@ -171,15 +174,10 @@ public class GroundItemsPlugin extends Plugin
|
||||
return configManager.getConfig(GroundItemsConfig.class);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Overlay getOverlay()
|
||||
{
|
||||
return overlay;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void startUp()
|
||||
{
|
||||
overlayManager.add(overlay);
|
||||
reset();
|
||||
mouseManager.registerMouseListener(inputListener);
|
||||
keyManager.registerKeyListener(inputListener);
|
||||
@@ -188,6 +186,7 @@ public class GroundItemsPlugin extends Plugin
|
||||
@Override
|
||||
protected void shutDown() throws Exception
|
||||
{
|
||||
overlayManager.remove(overlay);
|
||||
mouseManager.unregisterMouseListener(inputListener);
|
||||
keyManager.unregisterKeyListener(inputListener);
|
||||
groundItems.clear();
|
||||
|
||||
@@ -56,6 +56,7 @@ import net.runelite.client.config.ConfigManager;
|
||||
import net.runelite.client.input.KeyManager;
|
||||
import net.runelite.client.plugins.Plugin;
|
||||
import net.runelite.client.plugins.PluginDescriptor;
|
||||
import net.runelite.client.ui.overlay.OverlayManager;
|
||||
|
||||
@Slf4j
|
||||
@PluginDescriptor(
|
||||
@@ -85,6 +86,9 @@ public class GroundMarkerPlugin extends Plugin
|
||||
@Inject
|
||||
private ConfigManager configManager;
|
||||
|
||||
@Inject
|
||||
private OverlayManager overlayManager;
|
||||
|
||||
@Inject
|
||||
private GroundMarkerOverlay overlay;
|
||||
|
||||
@@ -286,20 +290,17 @@ public class GroundMarkerPlugin extends Plugin
|
||||
@Override
|
||||
protected void startUp()
|
||||
{
|
||||
overlayManager.add(overlay);
|
||||
keyManager.registerKeyListener(inputListener);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void shutDown()
|
||||
{
|
||||
overlayManager.remove(overlay);
|
||||
keyManager.unregisterKeyListener(inputListener);
|
||||
}
|
||||
|
||||
@Override
|
||||
public GroundMarkerOverlay getOverlay()
|
||||
{
|
||||
return overlay;
|
||||
}
|
||||
|
||||
protected void markTile(LocalPoint localPoint)
|
||||
{
|
||||
|
||||
@@ -27,7 +27,6 @@ package net.runelite.client.plugins.herbiboars;
|
||||
import com.google.common.eventbus.Subscribe;
|
||||
import com.google.inject.Provides;
|
||||
import java.util.Arrays;
|
||||
import java.util.Collection;
|
||||
import java.util.HashMap;
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
@@ -58,7 +57,7 @@ import net.runelite.api.events.VarbitChanged;
|
||||
import net.runelite.client.config.ConfigManager;
|
||||
import net.runelite.client.plugins.Plugin;
|
||||
import net.runelite.client.plugins.PluginDescriptor;
|
||||
import net.runelite.client.ui.overlay.Overlay;
|
||||
import net.runelite.client.ui.overlay.OverlayManager;
|
||||
|
||||
@Slf4j
|
||||
@PluginDescriptor(
|
||||
@@ -96,24 +95,15 @@ public class HerbiboarPlugin extends Plugin
|
||||
@Inject
|
||||
private Client client;
|
||||
|
||||
@Inject
|
||||
private OverlayManager overlayManager;
|
||||
|
||||
@Inject
|
||||
private HerbiboarOverlay overlay;
|
||||
|
||||
@Inject
|
||||
private HerbiboarMinimapOverlay minimapOverlay;
|
||||
|
||||
@Override
|
||||
public Collection<Overlay> getOverlays()
|
||||
{
|
||||
return Arrays.asList(overlay, minimapOverlay);
|
||||
}
|
||||
|
||||
@Provides
|
||||
HerbiboarConfig getConfig(ConfigManager configManager)
|
||||
{
|
||||
return configManager.getConfig(HerbiboarConfig.class);
|
||||
}
|
||||
|
||||
@Getter
|
||||
private boolean inHerbiboarArea;
|
||||
|
||||
@@ -145,12 +135,27 @@ public class HerbiboarPlugin extends Plugin
|
||||
@Setter
|
||||
private int finishId;
|
||||
|
||||
@Provides
|
||||
HerbiboarConfig getConfig(ConfigManager configManager)
|
||||
{
|
||||
return configManager.getConfig(HerbiboarConfig.class);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void startUp() throws Exception
|
||||
{
|
||||
overlayManager.add(overlay);
|
||||
overlayManager.add(minimapOverlay);
|
||||
inHerbiboarArea = checkArea();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void shutDown() throws Exception
|
||||
{
|
||||
overlayManager.remove(overlay);
|
||||
overlayManager.remove(minimapOverlay);
|
||||
}
|
||||
|
||||
private void updateTrailData()
|
||||
{
|
||||
currentTrail = null;
|
||||
|
||||
@@ -48,7 +48,7 @@ import net.runelite.client.Notifier;
|
||||
import net.runelite.client.config.ConfigManager;
|
||||
import net.runelite.client.plugins.Plugin;
|
||||
import net.runelite.client.plugins.PluginDescriptor;
|
||||
import net.runelite.client.util.QueryRunner;
|
||||
import net.runelite.client.ui.overlay.OverlayManager;
|
||||
|
||||
@Slf4j
|
||||
@PluginDescriptor(
|
||||
@@ -60,10 +60,9 @@ public class HunterPlugin extends Plugin
|
||||
private Client client;
|
||||
|
||||
@Inject
|
||||
private QueryRunner queryRunner;
|
||||
private OverlayManager overlayManager;
|
||||
|
||||
@Inject
|
||||
@Getter
|
||||
private TrapOverlay overlay;
|
||||
|
||||
@Inject
|
||||
@@ -89,12 +88,14 @@ public class HunterPlugin extends Plugin
|
||||
@Override
|
||||
protected void startUp()
|
||||
{
|
||||
overlayManager.add(overlay);
|
||||
overlay.updateConfig();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void shutDown() throws Exception
|
||||
{
|
||||
overlayManager.remove(overlay);
|
||||
lastActionTime = Instant.ofEpochMilli(0);
|
||||
traps.clear();
|
||||
}
|
||||
|
||||
@@ -28,8 +28,6 @@ import com.google.common.eventbus.Subscribe;
|
||||
import com.google.inject.Provides;
|
||||
import java.awt.Color;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
import javax.inject.Inject;
|
||||
import lombok.AccessLevel;
|
||||
@@ -42,8 +40,7 @@ import net.runelite.api.events.NpcSpawned;
|
||||
import net.runelite.client.config.ConfigManager;
|
||||
import net.runelite.client.plugins.Plugin;
|
||||
import net.runelite.client.plugins.PluginDescriptor;
|
||||
import net.runelite.client.ui.overlay.Overlay;
|
||||
import net.runelite.client.util.QueryRunner;
|
||||
import net.runelite.client.ui.overlay.OverlayManager;
|
||||
|
||||
/**
|
||||
* @author robin
|
||||
@@ -56,6 +53,9 @@ public class ImplingsPlugin extends Plugin
|
||||
@Getter(AccessLevel.PACKAGE)
|
||||
private final List<NPC> implings = new ArrayList<>();
|
||||
|
||||
@Inject
|
||||
private OverlayManager overlayManager;
|
||||
|
||||
@Inject
|
||||
private ImplingsOverlay overlay;
|
||||
|
||||
@@ -65,19 +65,25 @@ public class ImplingsPlugin extends Plugin
|
||||
@Inject
|
||||
private ImplingsConfig config;
|
||||
|
||||
@Inject
|
||||
private QueryRunner queryRunner;
|
||||
|
||||
@Provides
|
||||
ImplingsConfig getConfig(ConfigManager configManager)
|
||||
{
|
||||
return configManager.getConfig(ImplingsConfig.class);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public Collection<Overlay> getOverlays()
|
||||
protected void startUp() throws Exception
|
||||
{
|
||||
return Arrays.asList(overlay, minimapOverlay);
|
||||
overlayManager.add(overlay);
|
||||
overlayManager.add(minimapOverlay);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void shutDown() throws Exception
|
||||
{
|
||||
overlayManager.remove(overlay);
|
||||
overlayManager.remove(minimapOverlay);
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
|
||||
@@ -37,7 +37,7 @@ import net.runelite.client.menus.MenuManager;
|
||||
import net.runelite.client.menus.WidgetMenuOption;
|
||||
import net.runelite.client.plugins.Plugin;
|
||||
import net.runelite.client.plugins.PluginDescriptor;
|
||||
import net.runelite.client.ui.overlay.Overlay;
|
||||
import net.runelite.client.ui.overlay.OverlayManager;
|
||||
|
||||
@PluginDescriptor(
|
||||
name = "Instance Map"
|
||||
@@ -49,6 +49,9 @@ public class InstanceMapPlugin extends Plugin
|
||||
@Inject
|
||||
private InstanceMapInputListener inputListener;
|
||||
|
||||
@Inject
|
||||
private OverlayManager overlayManager;
|
||||
|
||||
@Inject
|
||||
private InstanceMapOverlay overlay;
|
||||
|
||||
@@ -80,6 +83,7 @@ public class InstanceMapPlugin extends Plugin
|
||||
@Override
|
||||
protected void startUp() throws Exception
|
||||
{
|
||||
overlayManager.add(overlay);
|
||||
addCustomOptions();
|
||||
keyManager.registerKeyListener(inputListener);
|
||||
mouseManager.registerMouseListener(inputListener);
|
||||
@@ -89,6 +93,7 @@ public class InstanceMapPlugin extends Plugin
|
||||
@Override
|
||||
protected void shutDown() throws Exception
|
||||
{
|
||||
overlayManager.remove(overlay);
|
||||
removeCustomOptions();
|
||||
keyManager.unregisterKeyListener(inputListener);
|
||||
mouseManager.registerMouseListener(inputListener);
|
||||
@@ -127,12 +132,6 @@ public class InstanceMapPlugin extends Plugin
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public Overlay getOverlay()
|
||||
{
|
||||
return overlay;
|
||||
}
|
||||
|
||||
public void showMap()
|
||||
{
|
||||
overlay.setShowMap(true);
|
||||
|
||||
@@ -24,22 +24,25 @@
|
||||
*/
|
||||
package net.runelite.client.plugins.itemcharges;
|
||||
|
||||
import javax.inject.Inject;
|
||||
import net.runelite.api.ChatMessageType;
|
||||
import net.runelite.client.plugins.Plugin;
|
||||
import net.runelite.client.ui.overlay.Overlay;
|
||||
import com.google.common.eventbus.Subscribe;
|
||||
import com.google.inject.Provides;
|
||||
import javax.inject.Inject;
|
||||
import net.runelite.api.ChatMessageType;
|
||||
import net.runelite.api.events.ChatMessage;
|
||||
import net.runelite.client.Notifier;
|
||||
import net.runelite.client.config.ConfigManager;
|
||||
import net.runelite.client.plugins.Plugin;
|
||||
import net.runelite.client.plugins.PluginDescriptor;
|
||||
import net.runelite.client.ui.overlay.OverlayManager;
|
||||
|
||||
@PluginDescriptor(
|
||||
name = "Item Charges"
|
||||
)
|
||||
public class ItemChargePlugin extends Plugin
|
||||
{
|
||||
@Inject
|
||||
private OverlayManager overlayManager;
|
||||
|
||||
@Inject
|
||||
private ItemChargeOverlay overlay;
|
||||
|
||||
@@ -49,18 +52,24 @@ public class ItemChargePlugin extends Plugin
|
||||
@Inject
|
||||
private ItemChargeConfig config;
|
||||
|
||||
@Override
|
||||
public Overlay getOverlay()
|
||||
{
|
||||
return overlay;
|
||||
}
|
||||
|
||||
@Provides
|
||||
ItemChargeConfig getConfig(ConfigManager configManager)
|
||||
{
|
||||
return configManager.getConfig(ItemChargeConfig.class);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void startUp() throws Exception
|
||||
{
|
||||
overlayManager.add(overlay);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void shutDown() throws Exception
|
||||
{
|
||||
overlayManager.remove(overlay);
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
public void onChatMessage(ChatMessage event)
|
||||
{
|
||||
|
||||
@@ -29,7 +29,7 @@ import javax.inject.Inject;
|
||||
import net.runelite.client.config.ConfigManager;
|
||||
import net.runelite.client.plugins.Plugin;
|
||||
import net.runelite.client.plugins.PluginDescriptor;
|
||||
import net.runelite.client.ui.overlay.Overlay;
|
||||
import net.runelite.client.ui.overlay.OverlayManager;
|
||||
|
||||
@PluginDescriptor(
|
||||
name = "Item Prices",
|
||||
@@ -38,7 +38,8 @@ import net.runelite.client.ui.overlay.Overlay;
|
||||
public class ItemPricesPlugin extends Plugin
|
||||
{
|
||||
@Inject
|
||||
private ItemPricesConfig config;
|
||||
private OverlayManager overlayManager;
|
||||
|
||||
@Inject
|
||||
private ItemPricesOverlay overlay;
|
||||
|
||||
@@ -49,8 +50,14 @@ public class ItemPricesPlugin extends Plugin
|
||||
}
|
||||
|
||||
@Override
|
||||
public Overlay getOverlay()
|
||||
protected void startUp() throws Exception
|
||||
{
|
||||
return overlay;
|
||||
overlayManager.add(overlay);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void shutDown() throws Exception
|
||||
{
|
||||
overlayManager.remove(overlay);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -29,13 +29,16 @@ import com.google.inject.Provides;
|
||||
import net.runelite.client.config.ConfigManager;
|
||||
import net.runelite.client.plugins.Plugin;
|
||||
import net.runelite.client.plugins.PluginDescriptor;
|
||||
import net.runelite.client.ui.overlay.Overlay;
|
||||
import net.runelite.client.ui.overlay.OverlayManager;
|
||||
|
||||
@PluginDescriptor(
|
||||
name = "Item Stats"
|
||||
)
|
||||
public class ItemStatPlugin extends Plugin
|
||||
{
|
||||
@Inject
|
||||
private OverlayManager overlayManager;
|
||||
|
||||
@Inject
|
||||
private ItemStatOverlay overlay;
|
||||
|
||||
@@ -46,8 +49,14 @@ public class ItemStatPlugin extends Plugin
|
||||
}
|
||||
|
||||
@Override
|
||||
public Overlay getOverlay()
|
||||
protected void startUp() throws Exception
|
||||
{
|
||||
return overlay;
|
||||
overlayManager.add(overlay);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void shutDown() throws Exception
|
||||
{
|
||||
overlayManager.remove(overlay);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -47,7 +47,7 @@ import net.runelite.client.plugins.Plugin;
|
||||
import net.runelite.client.plugins.PluginDescriptor;
|
||||
import net.runelite.client.ui.NavigationButton;
|
||||
import net.runelite.client.ui.PluginToolbar;
|
||||
import net.runelite.client.ui.overlay.Overlay;
|
||||
import net.runelite.client.ui.overlay.OverlayManager;
|
||||
|
||||
@PluginDescriptor(
|
||||
name = "Kourend Library"
|
||||
@@ -66,6 +66,9 @@ public class KourendLibraryPlugin extends Plugin
|
||||
@Inject
|
||||
private Library library;
|
||||
|
||||
@Inject
|
||||
private OverlayManager overlayManager;
|
||||
|
||||
@Inject
|
||||
private KourendLibraryOverlay overlay;
|
||||
|
||||
@@ -81,6 +84,7 @@ public class KourendLibraryPlugin extends Plugin
|
||||
@Override
|
||||
protected void startUp() throws Exception
|
||||
{
|
||||
overlayManager.add(overlay);
|
||||
Book.fillImages(itemManager);
|
||||
|
||||
panel = injector.getInstance(KourendLibraryPanel.class);
|
||||
@@ -105,15 +109,10 @@ public class KourendLibraryPlugin extends Plugin
|
||||
@Override
|
||||
protected void shutDown()
|
||||
{
|
||||
overlayManager.remove(overlay);
|
||||
pluginToolbar.removeNavigation(navButton);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Overlay getOverlay()
|
||||
{
|
||||
return overlay;
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
private void onMenuOptionClicked(MenuOptionClicked menuOpt)
|
||||
{
|
||||
|
||||
@@ -32,8 +32,6 @@ import com.google.inject.Provides;
|
||||
import java.time.Duration;
|
||||
import java.time.Instant;
|
||||
import java.time.temporal.ChronoUnit;
|
||||
import java.util.Arrays;
|
||||
import java.util.Collection;
|
||||
import java.util.HashSet;
|
||||
import java.util.Set;
|
||||
import javax.inject.Inject;
|
||||
@@ -72,7 +70,7 @@ import net.runelite.client.config.ConfigManager;
|
||||
import net.runelite.client.plugins.Plugin;
|
||||
import net.runelite.client.plugins.PluginDescriptor;
|
||||
import net.runelite.client.task.Schedule;
|
||||
import net.runelite.client.ui.overlay.Overlay;
|
||||
import net.runelite.client.ui.overlay.OverlayManager;
|
||||
|
||||
@PluginDescriptor(
|
||||
name = "Motherlode Mine",
|
||||
@@ -91,6 +89,9 @@ public class MotherlodePlugin extends Plugin
|
||||
|
||||
private static final int UPPER_FLOOR_HEIGHT = -500;
|
||||
|
||||
@Inject
|
||||
private OverlayManager overlayManager;
|
||||
|
||||
@Inject
|
||||
private MotherlodeOverlay overlay;
|
||||
|
||||
@@ -132,15 +133,14 @@ public class MotherlodePlugin extends Plugin
|
||||
return configManager.getConfig(MotherlodeConfig.class);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Collection<Overlay> getOverlays()
|
||||
{
|
||||
return Arrays.asList(overlay, rocksOverlay, motherlodeSackOverlay, motherlodeGemOverlay);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void startUp()
|
||||
{
|
||||
overlayManager.add(overlay);
|
||||
overlayManager.add(rocksOverlay);
|
||||
overlayManager.add(motherlodeGemOverlay);
|
||||
overlayManager.add(motherlodeSackOverlay);
|
||||
|
||||
session = new MotherlodeSession();
|
||||
inMlm = checkInMlm();
|
||||
|
||||
@@ -153,6 +153,10 @@ public class MotherlodePlugin extends Plugin
|
||||
@Override
|
||||
protected void shutDown() throws Exception
|
||||
{
|
||||
overlayManager.remove(overlay);
|
||||
overlayManager.remove(rocksOverlay);
|
||||
overlayManager.remove(motherlodeGemOverlay);
|
||||
overlayManager.remove(motherlodeSackOverlay);
|
||||
session = null;
|
||||
veins.clear();
|
||||
rocks.clear();
|
||||
|
||||
@@ -29,13 +29,16 @@ import javax.inject.Inject;
|
||||
import net.runelite.client.config.ConfigManager;
|
||||
import net.runelite.client.plugins.Plugin;
|
||||
import net.runelite.client.plugins.PluginDescriptor;
|
||||
import net.runelite.client.ui.overlay.Overlay;
|
||||
import net.runelite.client.ui.overlay.OverlayManager;
|
||||
|
||||
@PluginDescriptor(
|
||||
name = "Mouse Tooltips"
|
||||
)
|
||||
public class MouseHighlightPlugin extends Plugin
|
||||
{
|
||||
@Inject
|
||||
private OverlayManager overlayManager;
|
||||
|
||||
@Inject
|
||||
private MouseHighlightOverlay overlay;
|
||||
|
||||
@@ -46,8 +49,14 @@ public class MouseHighlightPlugin extends Plugin
|
||||
}
|
||||
|
||||
@Override
|
||||
public Overlay getOverlay()
|
||||
protected void startUp() throws Exception
|
||||
{
|
||||
return overlay;
|
||||
overlayManager.add(overlay);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void shutDown() throws Exception
|
||||
{
|
||||
overlayManager.remove(overlay);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -39,7 +39,7 @@ import net.runelite.client.Notifier;
|
||||
import net.runelite.client.config.ConfigManager;
|
||||
import net.runelite.client.plugins.Plugin;
|
||||
import net.runelite.client.plugins.PluginDescriptor;
|
||||
import net.runelite.client.ui.overlay.Overlay;
|
||||
import net.runelite.client.ui.overlay.OverlayManager;
|
||||
import net.runelite.client.util.Text;
|
||||
|
||||
@PluginDescriptor(
|
||||
@@ -53,6 +53,9 @@ public class NightmareZonePlugin extends Plugin
|
||||
@Inject
|
||||
private Client client;
|
||||
|
||||
@Inject
|
||||
private OverlayManager overlayManager;
|
||||
|
||||
@Inject
|
||||
private NightmareZoneConfig config;
|
||||
|
||||
@@ -64,8 +67,16 @@ public class NightmareZonePlugin extends Plugin
|
||||
private boolean absorptionNotificationSend = true;
|
||||
|
||||
@Override
|
||||
protected void shutDown()
|
||||
protected void startUp() throws Exception
|
||||
{
|
||||
overlayManager.add(overlay);
|
||||
overlay.removeAbsorptionCounter();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void shutDown() throws Exception
|
||||
{
|
||||
overlayManager.remove(overlay);
|
||||
overlay.removeAbsorptionCounter();
|
||||
}
|
||||
|
||||
@@ -81,12 +92,6 @@ public class NightmareZonePlugin extends Plugin
|
||||
return configManager.getConfig(NightmareZoneConfig.class);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Overlay getOverlay()
|
||||
{
|
||||
return overlay;
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
public void onGameTick(GameTick event)
|
||||
{
|
||||
|
||||
@@ -30,8 +30,6 @@ import com.google.common.eventbus.Subscribe;
|
||||
import com.google.inject.Provides;
|
||||
import java.time.Instant;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.Collection;
|
||||
import java.util.Collections;
|
||||
import java.util.HashMap;
|
||||
import java.util.HashSet;
|
||||
@@ -62,7 +60,7 @@ import net.runelite.client.input.KeyManager;
|
||||
import net.runelite.client.menus.MenuManager;
|
||||
import net.runelite.client.plugins.Plugin;
|
||||
import net.runelite.client.plugins.PluginDescriptor;
|
||||
import net.runelite.client.ui.overlay.Overlay;
|
||||
import net.runelite.client.ui.overlay.OverlayManager;
|
||||
import net.runelite.client.util.WildcardMatcher;
|
||||
|
||||
@PluginDescriptor(name = "NPC Indicators")
|
||||
@@ -85,6 +83,9 @@ public class NpcIndicatorsPlugin extends Plugin
|
||||
@Inject
|
||||
private NpcIndicatorsConfig config;
|
||||
|
||||
@Inject
|
||||
private OverlayManager overlayManager;
|
||||
|
||||
@Inject
|
||||
private NpcSceneOverlay npcSceneOverlay;
|
||||
|
||||
@@ -174,6 +175,8 @@ public class NpcIndicatorsPlugin extends Plugin
|
||||
@Override
|
||||
protected void startUp() throws Exception
|
||||
{
|
||||
overlayManager.add(npcSceneOverlay);
|
||||
overlayManager.add(npcMinimapOverlay);
|
||||
keyManager.registerKeyListener(inputListener);
|
||||
highlights = getHighlights();
|
||||
clientThread.invokeLater(() ->
|
||||
@@ -186,6 +189,8 @@ public class NpcIndicatorsPlugin extends Plugin
|
||||
@Override
|
||||
protected void shutDown() throws Exception
|
||||
{
|
||||
overlayManager.remove(npcSceneOverlay);
|
||||
overlayManager.remove(npcMinimapOverlay);
|
||||
deadNpcsToDisplay.clear();
|
||||
memorizedNpcs.clear();
|
||||
spawnedNpcsThisTick.clear();
|
||||
@@ -321,12 +326,6 @@ public class NpcIndicatorsPlugin extends Plugin
|
||||
lastPlayerLocation = client.getLocalPlayer().getWorldLocation();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Collection<Overlay> getOverlays()
|
||||
{
|
||||
return Arrays.asList(npcSceneOverlay, npcMinimapOverlay);
|
||||
}
|
||||
|
||||
private static boolean isInViewRange(WorldPoint wp1, WorldPoint wp2)
|
||||
{
|
||||
int distance = wp1.distanceTo(wp2);
|
||||
|
||||
@@ -41,7 +41,7 @@ import net.runelite.api.WorldType;
|
||||
import net.runelite.api.events.GameStateChanged;
|
||||
import net.runelite.client.plugins.Plugin;
|
||||
import net.runelite.client.plugins.PluginDescriptor;
|
||||
import net.runelite.client.ui.overlay.Overlay;
|
||||
import net.runelite.client.ui.overlay.OverlayManager;
|
||||
import net.runelite.http.api.hiscore.HiscoreEndpoint;
|
||||
|
||||
@PluginDescriptor(
|
||||
@@ -52,6 +52,9 @@ public class OpponentInfoPlugin extends Plugin
|
||||
@Inject
|
||||
private Client client;
|
||||
|
||||
@Inject
|
||||
private OverlayManager overlayManager;
|
||||
|
||||
@Inject
|
||||
private OpponentInfoOverlay overlay;
|
||||
|
||||
@@ -59,9 +62,15 @@ public class OpponentInfoPlugin extends Plugin
|
||||
private HiscoreEndpoint hiscoreEndpoint = HiscoreEndpoint.NORMAL;
|
||||
|
||||
@Override
|
||||
public Overlay getOverlay()
|
||||
protected void startUp() throws Exception
|
||||
{
|
||||
return overlay;
|
||||
overlayManager.add(overlay);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void shutDown() throws Exception
|
||||
{
|
||||
overlayManager.remove(overlay);
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
|
||||
@@ -27,19 +27,28 @@ package net.runelite.client.plugins.pestcontrol;
|
||||
import javax.inject.Inject;
|
||||
import net.runelite.client.plugins.Plugin;
|
||||
import net.runelite.client.plugins.PluginDescriptor;
|
||||
import net.runelite.client.ui.overlay.Overlay;
|
||||
import net.runelite.client.ui.overlay.OverlayManager;
|
||||
|
||||
@PluginDescriptor(
|
||||
name = "Pest Control"
|
||||
)
|
||||
public class PestControlPlugin extends Plugin
|
||||
{
|
||||
@Inject
|
||||
private OverlayManager overlayManager;
|
||||
|
||||
@Inject
|
||||
private PestControlOverlay overlay;
|
||||
|
||||
@Override
|
||||
public Overlay getOverlay()
|
||||
protected void startUp() throws Exception
|
||||
{
|
||||
return overlay;
|
||||
overlayManager.add(overlay);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void shutDown() throws Exception
|
||||
{
|
||||
overlayManager.remove(overlay);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -24,27 +24,14 @@
|
||||
*/
|
||||
package net.runelite.client.plugins.playerindicators;
|
||||
|
||||
import com.google.common.collect.Sets;
|
||||
import com.google.common.eventbus.Subscribe;
|
||||
import com.google.inject.Provides;
|
||||
import java.awt.Color;
|
||||
import java.util.Collection;
|
||||
import javax.inject.Inject;
|
||||
import net.runelite.api.ClanMemberRank;
|
||||
import static net.runelite.api.ClanMemberRank.UNRANKED;
|
||||
import net.runelite.api.Client;
|
||||
import static net.runelite.api.MenuAction.FOLLOW;
|
||||
import static net.runelite.api.MenuAction.ITEM_USE_ON_PLAYER;
|
||||
import static net.runelite.api.MenuAction.PLAYER_EIGTH_OPTION;
|
||||
import static net.runelite.api.MenuAction.PLAYER_FIFTH_OPTION;
|
||||
import static net.runelite.api.MenuAction.PLAYER_FIRST_OPTION;
|
||||
import static net.runelite.api.MenuAction.PLAYER_FOURTH_OPTION;
|
||||
import static net.runelite.api.MenuAction.PLAYER_SECOND_OPTION;
|
||||
import static net.runelite.api.MenuAction.PLAYER_SEVENTH_OPTION;
|
||||
import static net.runelite.api.MenuAction.PLAYER_SIXTH_OPTION;
|
||||
import static net.runelite.api.MenuAction.PLAYER_THIRD_OPTION;
|
||||
import static net.runelite.api.MenuAction.SPELL_CAST_ON_PLAYER;
|
||||
import static net.runelite.api.MenuAction.TRADE;
|
||||
import static net.runelite.api.MenuAction.*;
|
||||
import net.runelite.api.MenuEntry;
|
||||
import net.runelite.api.Player;
|
||||
import net.runelite.api.events.MenuEntryAdded;
|
||||
@@ -52,13 +39,16 @@ import net.runelite.client.config.ConfigManager;
|
||||
import net.runelite.client.game.ClanManager;
|
||||
import net.runelite.client.plugins.Plugin;
|
||||
import net.runelite.client.plugins.PluginDescriptor;
|
||||
import net.runelite.client.ui.overlay.Overlay;
|
||||
import net.runelite.client.ui.overlay.OverlayManager;
|
||||
|
||||
@PluginDescriptor(
|
||||
name = "Player Indicators"
|
||||
)
|
||||
public class PlayerIndicatorsPlugin extends Plugin
|
||||
{
|
||||
@Inject
|
||||
private OverlayManager overlayManager;
|
||||
|
||||
@Inject
|
||||
private PlayerIndicatorsConfig config;
|
||||
|
||||
@@ -81,9 +71,17 @@ public class PlayerIndicatorsPlugin extends Plugin
|
||||
}
|
||||
|
||||
@Override
|
||||
public Collection<Overlay> getOverlays()
|
||||
protected void startUp() throws Exception
|
||||
{
|
||||
return Sets.newHashSet(playerIndicatorsOverlay, playerIndicatorsMinimapOverlay);
|
||||
overlayManager.add(playerIndicatorsOverlay);
|
||||
overlayManager.add(playerIndicatorsMinimapOverlay);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void shutDown() throws Exception
|
||||
{
|
||||
overlayManager.remove(playerIndicatorsOverlay);
|
||||
overlayManager.remove(playerIndicatorsMinimapOverlay);
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
|
||||
@@ -27,8 +27,6 @@ package net.runelite.client.plugins.poh;
|
||||
import com.google.common.collect.Sets;
|
||||
import com.google.common.eventbus.Subscribe;
|
||||
import com.google.inject.Provides;
|
||||
import java.util.Arrays;
|
||||
import java.util.Collection;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
@@ -55,7 +53,7 @@ import net.runelite.api.events.GameStateChanged;
|
||||
import net.runelite.client.config.ConfigManager;
|
||||
import net.runelite.client.plugins.Plugin;
|
||||
import net.runelite.client.plugins.PluginDescriptor;
|
||||
import net.runelite.client.ui.overlay.Overlay;
|
||||
import net.runelite.client.ui.overlay.OverlayManager;
|
||||
|
||||
@PluginDescriptor(
|
||||
name = "Player-owned House"
|
||||
@@ -68,6 +66,9 @@ public class PohPlugin extends Plugin
|
||||
@Getter(AccessLevel.PACKAGE)
|
||||
private final Map<TileObject, Tile> pohObjects = new HashMap<>();
|
||||
|
||||
@Inject
|
||||
private OverlayManager overlayManager;
|
||||
|
||||
@Inject
|
||||
private PohOverlay overlay;
|
||||
|
||||
@@ -80,21 +81,19 @@ public class PohPlugin extends Plugin
|
||||
return configManager.getConfig(PohConfig.class);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Collection<Overlay> getOverlays()
|
||||
{
|
||||
return Arrays.asList(overlay, burnerOverlay);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void startUp() throws Exception
|
||||
{
|
||||
overlayManager.add(overlay);
|
||||
overlayManager.add(burnerOverlay);
|
||||
overlay.updateConfig();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void shutDown() throws Exception
|
||||
{
|
||||
overlayManager.remove(overlay);
|
||||
overlayManager.remove(burnerOverlay);
|
||||
pohObjects.clear();
|
||||
}
|
||||
|
||||
|
||||
@@ -36,7 +36,7 @@ import net.runelite.client.config.ConfigManager;
|
||||
import net.runelite.client.game.SpriteManager;
|
||||
import net.runelite.client.plugins.Plugin;
|
||||
import net.runelite.client.plugins.PluginDescriptor;
|
||||
import net.runelite.client.ui.overlay.Overlay;
|
||||
import net.runelite.client.ui.overlay.OverlayManager;
|
||||
import net.runelite.client.ui.overlay.infobox.InfoBoxManager;
|
||||
|
||||
@PluginDescriptor(
|
||||
@@ -55,6 +55,9 @@ public class PrayerPlugin extends Plugin
|
||||
@Inject
|
||||
private SpriteManager spriteManager;
|
||||
|
||||
@Inject
|
||||
private OverlayManager overlayManager;
|
||||
|
||||
@Inject
|
||||
private PrayerFlickOverlay overlay;
|
||||
|
||||
@@ -68,15 +71,16 @@ public class PrayerPlugin extends Plugin
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void shutDown()
|
||||
protected void startUp()
|
||||
{
|
||||
removeIndicators();
|
||||
overlayManager.add(overlay);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Overlay getOverlay()
|
||||
protected void shutDown()
|
||||
{
|
||||
return overlay;
|
||||
overlayManager.remove(overlay);
|
||||
removeIndicators();
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
|
||||
@@ -26,11 +26,11 @@
|
||||
package net.runelite.client.plugins.puzzlesolver;
|
||||
|
||||
import com.google.inject.Provides;
|
||||
import java.util.concurrent.ScheduledExecutorService;
|
||||
import javax.inject.Inject;
|
||||
import net.runelite.client.config.ConfigManager;
|
||||
import net.runelite.client.plugins.Plugin;
|
||||
import net.runelite.client.plugins.PluginDescriptor;
|
||||
import net.runelite.client.ui.overlay.OverlayManager;
|
||||
|
||||
@PluginDescriptor(
|
||||
name = "Puzzle Solver"
|
||||
@@ -38,10 +38,10 @@ import net.runelite.client.plugins.PluginDescriptor;
|
||||
public class PuzzleSolverPlugin extends Plugin
|
||||
{
|
||||
@Inject
|
||||
private PuzzleSolverOverlay puzzleSolverOverlay;
|
||||
private OverlayManager overlayManager;
|
||||
|
||||
@Inject
|
||||
private ScheduledExecutorService executorService;
|
||||
private PuzzleSolverOverlay overlay;
|
||||
|
||||
@Provides
|
||||
PuzzleSolverConfig provideConfig(ConfigManager configManager)
|
||||
@@ -50,8 +50,14 @@ public class PuzzleSolverPlugin extends Plugin
|
||||
}
|
||||
|
||||
@Override
|
||||
public PuzzleSolverOverlay getOverlay()
|
||||
protected void startUp() throws Exception
|
||||
{
|
||||
return puzzleSolverOverlay;
|
||||
overlayManager.add(overlay);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void shutDown() throws Exception
|
||||
{
|
||||
overlayManager.remove(overlay);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -33,7 +33,6 @@ import java.text.DecimalFormat;
|
||||
import java.time.Instant;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.regex.Matcher;
|
||||
import java.util.regex.Pattern;
|
||||
import javax.imageio.ImageIO;
|
||||
@@ -66,7 +65,7 @@ import net.runelite.client.plugins.PluginDescriptor;
|
||||
import net.runelite.client.plugins.raids.solver.Layout;
|
||||
import net.runelite.client.plugins.raids.solver.LayoutSolver;
|
||||
import net.runelite.client.plugins.raids.solver.RotationSolver;
|
||||
import net.runelite.client.ui.overlay.Overlay;
|
||||
import net.runelite.client.ui.overlay.OverlayManager;
|
||||
import net.runelite.client.ui.overlay.infobox.InfoBoxManager;
|
||||
import net.runelite.client.util.Text;
|
||||
|
||||
@@ -81,7 +80,7 @@ public class RaidsPlugin extends Plugin
|
||||
private static final String LEVEL_COMPLETE_MESSAGE = "level complete!";
|
||||
private static final String RAID_COMPLETE_MESSAGE = "Congratulations - your raid is complete!";
|
||||
private static final DecimalFormat DECIMAL_FORMAT = new DecimalFormat("###.##");
|
||||
public static final DecimalFormat POINTS_FORMAT = new DecimalFormat("#,###");
|
||||
static final DecimalFormat POINTS_FORMAT = new DecimalFormat("#,###");
|
||||
private static final String SPLIT_REGEX = "\\s*,\\s*";
|
||||
private static final Pattern ROTATION_REGEX = Pattern.compile("\\[(.*?)\\]");
|
||||
|
||||
@@ -103,6 +102,9 @@ public class RaidsPlugin extends Plugin
|
||||
@Inject
|
||||
private RaidsConfig config;
|
||||
|
||||
@Inject
|
||||
private OverlayManager overlayManager;
|
||||
|
||||
@Inject
|
||||
private RaidsOverlay overlay;
|
||||
|
||||
@@ -139,15 +141,12 @@ public class RaidsPlugin extends Plugin
|
||||
binder.bind(RaidsOverlay.class);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<Overlay> getOverlays()
|
||||
{
|
||||
return Arrays.asList(overlay, pointsOverlay);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void startUp() throws Exception
|
||||
{
|
||||
overlayManager.add(overlay);
|
||||
overlayManager.add(pointsOverlay);
|
||||
|
||||
if (client.getGameState() == GameState.LOGGED_IN)
|
||||
{
|
||||
inRaidChambers = client.getVar(Varbits.IN_RAID) == 1;
|
||||
@@ -160,6 +159,9 @@ public class RaidsPlugin extends Plugin
|
||||
@Override
|
||||
protected void shutDown() throws Exception
|
||||
{
|
||||
overlayManager.remove(overlay);
|
||||
overlayManager.remove(pointsOverlay);
|
||||
|
||||
if (timer != null)
|
||||
{
|
||||
infoBoxManager.removeInfoBox(timer);
|
||||
|
||||
@@ -33,15 +33,15 @@ import lombok.Getter;
|
||||
import net.runelite.api.Client;
|
||||
import net.runelite.api.GameState;
|
||||
import net.runelite.api.Prayer;
|
||||
import net.runelite.api.VarPlayer;
|
||||
import net.runelite.api.Skill;
|
||||
import net.runelite.api.VarPlayer;
|
||||
import net.runelite.api.events.GameStateChanged;
|
||||
import net.runelite.api.events.GameTick;
|
||||
import net.runelite.api.events.VarbitChanged;
|
||||
import net.runelite.client.config.ConfigManager;
|
||||
import net.runelite.client.plugins.Plugin;
|
||||
import net.runelite.client.plugins.PluginDescriptor;
|
||||
import net.runelite.client.ui.overlay.Overlay;
|
||||
import net.runelite.client.ui.overlay.OverlayManager;
|
||||
|
||||
@PluginDescriptor(name = "Regeneration Meter")
|
||||
public class RegenMeterPlugin extends Plugin
|
||||
@@ -49,34 +49,27 @@ public class RegenMeterPlugin extends Plugin
|
||||
private static final int SPEC_REGEN_TICKS = 50;
|
||||
private static final int NORMAL_HP_REGEN_TICKS = 100;
|
||||
|
||||
@Inject
|
||||
private RegenMeterOverlay overlay;
|
||||
|
||||
@Inject
|
||||
private Client client;
|
||||
|
||||
@Inject
|
||||
RegenMeterConfig config;
|
||||
private OverlayManager overlayManager;
|
||||
|
||||
@Inject
|
||||
private RegenMeterOverlay overlay;
|
||||
|
||||
private int ticksSinceHPRegen;
|
||||
|
||||
private boolean wasRapidHeal;
|
||||
@Inject
|
||||
private RegenMeterConfig config;
|
||||
|
||||
@Getter
|
||||
private double hitpointsPercentage;
|
||||
|
||||
|
||||
private int ticksSinceSpecRegen;
|
||||
|
||||
@Getter
|
||||
private double specialPercentage;
|
||||
|
||||
@Override
|
||||
public Overlay getOverlay()
|
||||
{
|
||||
return overlay;
|
||||
}
|
||||
private int ticksSinceSpecRegen;
|
||||
private int ticksSinceHPRegen;
|
||||
private boolean wasRapidHeal;
|
||||
|
||||
@Provides
|
||||
RegenMeterConfig provideConfig(ConfigManager configManager)
|
||||
@@ -84,6 +77,18 @@ public class RegenMeterPlugin extends Plugin
|
||||
return configManager.getConfig(RegenMeterConfig.class);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void startUp() throws Exception
|
||||
{
|
||||
overlayManager.add(overlay);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void shutDown() throws Exception
|
||||
{
|
||||
overlayManager.remove(overlay);
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
private void onGameStateChanged(GameStateChanged ev)
|
||||
{
|
||||
|
||||
@@ -49,6 +49,7 @@ import net.runelite.api.events.GroundObjectSpawned;
|
||||
import net.runelite.client.plugins.Plugin;
|
||||
import net.runelite.client.plugins.PluginDescriptor;
|
||||
import net.runelite.client.task.Schedule;
|
||||
import net.runelite.client.ui.overlay.OverlayManager;
|
||||
|
||||
@PluginDescriptor(
|
||||
name = "Rogues' Den"
|
||||
@@ -69,12 +70,21 @@ public class RoguesDenPlugin extends Plugin
|
||||
private Client client;
|
||||
|
||||
@Inject
|
||||
@Getter
|
||||
private OverlayManager overlayManager;
|
||||
|
||||
@Inject
|
||||
private RoguesDenOverlay overlay;
|
||||
|
||||
@Override
|
||||
protected void shutDown()
|
||||
protected void startUp() throws Exception
|
||||
{
|
||||
overlayManager.add(overlay);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void shutDown() throws Exception
|
||||
{
|
||||
overlayManager.remove(overlay);
|
||||
obstaclesHull.clear();
|
||||
obstaclesTile.clear();
|
||||
hasGem = false;
|
||||
|
||||
@@ -26,8 +26,6 @@ package net.runelite.client.plugins.runecraft;
|
||||
|
||||
import com.google.common.eventbus.Subscribe;
|
||||
import com.google.inject.Provides;
|
||||
import java.util.Arrays;
|
||||
import java.util.Collection;
|
||||
import java.util.HashSet;
|
||||
import java.util.Set;
|
||||
import java.util.regex.Matcher;
|
||||
@@ -35,7 +33,15 @@ import java.util.regex.Pattern;
|
||||
import javax.inject.Inject;
|
||||
import lombok.AccessLevel;
|
||||
import lombok.Getter;
|
||||
import net.runelite.api.*;
|
||||
import net.runelite.api.ChatMessageType;
|
||||
import net.runelite.api.DecorativeObject;
|
||||
import net.runelite.api.GameState;
|
||||
import net.runelite.api.InventoryID;
|
||||
import net.runelite.api.Item;
|
||||
import net.runelite.api.ItemID;
|
||||
import net.runelite.api.NPC;
|
||||
import net.runelite.api.NpcID;
|
||||
import net.runelite.api.Query;
|
||||
import net.runelite.api.events.ChatMessage;
|
||||
import net.runelite.api.events.ConfigChanged;
|
||||
import net.runelite.api.events.DecorativeObjectDespawned;
|
||||
@@ -47,7 +53,7 @@ import net.runelite.api.queries.NPCQuery;
|
||||
import net.runelite.client.config.ConfigManager;
|
||||
import net.runelite.client.plugins.Plugin;
|
||||
import net.runelite.client.plugins.PluginDescriptor;
|
||||
import net.runelite.client.ui.overlay.Overlay;
|
||||
import net.runelite.client.ui.overlay.OverlayManager;
|
||||
import net.runelite.client.util.QueryRunner;
|
||||
|
||||
@PluginDescriptor(
|
||||
@@ -66,6 +72,9 @@ public class RunecraftPlugin extends Plugin
|
||||
@Getter(AccessLevel.PACKAGE)
|
||||
private NPC darkMage;
|
||||
|
||||
@Inject
|
||||
private OverlayManager overlayManager;
|
||||
|
||||
@Inject
|
||||
private RunecraftOverlay overlay;
|
||||
|
||||
@@ -87,21 +96,21 @@ public class RunecraftPlugin extends Plugin
|
||||
return configManager.getConfig(RunecraftConfig.class);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Collection<Overlay> getOverlays()
|
||||
{
|
||||
return Arrays.asList(overlay, bindNeckOverlay, abyssOverlay);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void startUp() throws Exception
|
||||
{
|
||||
overlayManager.add(overlay);
|
||||
overlayManager.add(bindNeckOverlay);
|
||||
overlayManager.add(abyssOverlay);
|
||||
abyssOverlay.updateConfig();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void shutDown() throws Exception
|
||||
{
|
||||
overlayManager.remove(overlay);
|
||||
overlayManager.remove(bindNeckOverlay);
|
||||
overlayManager.remove(abyssOverlay);
|
||||
abyssObjects.clear();
|
||||
darkMage = null;
|
||||
degradedPouchInInventory = false;
|
||||
|
||||
@@ -29,7 +29,7 @@ import javax.inject.Inject;
|
||||
import net.runelite.client.config.ConfigManager;
|
||||
import net.runelite.client.plugins.Plugin;
|
||||
import net.runelite.client.plugins.PluginDescriptor;
|
||||
import net.runelite.client.ui.overlay.Overlay;
|
||||
import net.runelite.client.ui.overlay.OverlayManager;
|
||||
|
||||
@PluginDescriptor(
|
||||
name = "Rune Pouch"
|
||||
@@ -37,7 +37,7 @@ import net.runelite.client.ui.overlay.Overlay;
|
||||
public class RunepouchPlugin extends Plugin
|
||||
{
|
||||
@Inject
|
||||
private ConfigManager configManager;
|
||||
private OverlayManager overlayManager;
|
||||
|
||||
@Inject
|
||||
private RunepouchOverlay overlay;
|
||||
@@ -49,8 +49,14 @@ public class RunepouchPlugin extends Plugin
|
||||
}
|
||||
|
||||
@Override
|
||||
public Overlay getOverlay()
|
||||
protected void startUp() throws Exception
|
||||
{
|
||||
return overlay;
|
||||
overlayManager.add(overlay);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void shutDown() throws Exception
|
||||
{
|
||||
overlayManager.remove(overlay);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -36,7 +36,6 @@ import java.awt.Rectangle;
|
||||
import java.awt.image.BufferedImage;
|
||||
import java.time.Instant;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
import java.util.stream.Stream;
|
||||
@@ -53,8 +52,7 @@ import net.runelite.client.plugins.PluginDescriptor;
|
||||
import net.runelite.client.plugins.screenmarkers.ui.ScreenMarkerPluginPanel;
|
||||
import net.runelite.client.ui.NavigationButton;
|
||||
import net.runelite.client.ui.PluginToolbar;
|
||||
import net.runelite.client.ui.overlay.Overlay;
|
||||
import net.runelite.client.ui.overlay.OverlayRenderer;
|
||||
import net.runelite.client.ui.overlay.OverlayManager;
|
||||
|
||||
@PluginDescriptor(
|
||||
name = "Screen Markers"
|
||||
@@ -82,10 +80,10 @@ public class ScreenMarkerPlugin extends Plugin
|
||||
private PluginToolbar pluginToolbar;
|
||||
|
||||
@Inject
|
||||
private ScreenMarkerCreationOverlay overlay;
|
||||
private OverlayManager overlayManager;
|
||||
|
||||
@Inject
|
||||
private OverlayRenderer overlayRenderer;
|
||||
private ScreenMarkerCreationOverlay overlay;
|
||||
|
||||
private ScreenMarkerMouseListener mouseListener;
|
||||
private ScreenMarkerPluginPanel pluginPanel;
|
||||
@@ -98,20 +96,12 @@ public class ScreenMarkerPlugin extends Plugin
|
||||
private boolean creatingScreenMarker = false;
|
||||
private Point startLocation = null;
|
||||
|
||||
@Override
|
||||
public Collection<Overlay> getOverlays()
|
||||
{
|
||||
final List<Overlay> overlays = new ArrayList<>();
|
||||
overlays.add(overlay);
|
||||
overlays.addAll(screenMarkers);
|
||||
return overlays;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void startUp() throws Exception
|
||||
{
|
||||
overlayManager.add(overlay);
|
||||
loadConfig(configManager.getConfiguration(CONFIG_GROUP, CONFIG_KEY)).forEach(screenMarkers::add);
|
||||
overlayRenderer.rebuildOverlays();
|
||||
screenMarkers.forEach(overlayManager::add);
|
||||
|
||||
pluginPanel = injector.getInstance(ScreenMarkerPluginPanel.class);
|
||||
pluginPanel.init();
|
||||
@@ -137,10 +127,12 @@ public class ScreenMarkerPlugin extends Plugin
|
||||
@Override
|
||||
protected void shutDown() throws Exception
|
||||
{
|
||||
overlayManager.remove(overlay);
|
||||
overlayManager.removeIf(ScreenMarkerOverlay.class::isInstance);
|
||||
screenMarkers.clear();;
|
||||
pluginToolbar.removeNavigation(navigationButton);
|
||||
setMouseListenerEnabled(false);
|
||||
creatingScreenMarker = false;
|
||||
screenMarkers.clear();
|
||||
|
||||
pluginPanel = null;
|
||||
currentMarker = null;
|
||||
@@ -154,7 +146,8 @@ public class ScreenMarkerPlugin extends Plugin
|
||||
if (screenMarkers.isEmpty() && event.getGroup().equals(CONFIG_GROUP) && event.getKey().equals(CONFIG_KEY))
|
||||
{
|
||||
loadConfig(event.getNewValue()).forEach(screenMarkers::add);
|
||||
overlayRenderer.rebuildOverlays();
|
||||
overlayManager.removeIf(ScreenMarkerOverlay.class::isInstance);
|
||||
screenMarkers.forEach(overlayManager::add);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -197,10 +190,10 @@ public class ScreenMarkerPlugin extends Plugin
|
||||
screenMarkerOverlay.setPreferredSize(overlay.getBounds().getSize());
|
||||
|
||||
screenMarkers.add(screenMarkerOverlay);
|
||||
overlayManager.add(screenMarkerOverlay);
|
||||
overlayManager.saveOverlay(screenMarkerOverlay);
|
||||
pluginPanel.rebuild();
|
||||
updateConfig();
|
||||
overlayRenderer.saveOverlay(screenMarkerOverlay);
|
||||
overlayRenderer.rebuildOverlays();
|
||||
}
|
||||
|
||||
creatingScreenMarker = false;
|
||||
@@ -219,11 +212,11 @@ public class ScreenMarkerPlugin extends Plugin
|
||||
|
||||
public void deleteMarker(final ScreenMarkerOverlay marker)
|
||||
{
|
||||
overlayRenderer.resetOverlay(marker);
|
||||
screenMarkers.remove(marker);
|
||||
overlayManager.remove(marker);
|
||||
overlayManager.resetOverlay(marker);
|
||||
pluginPanel.rebuild();
|
||||
updateConfig();
|
||||
overlayRenderer.rebuildOverlays();
|
||||
}
|
||||
|
||||
void resizeMarker(Point point)
|
||||
|
||||
@@ -81,7 +81,7 @@ import net.runelite.client.ui.ClientUI;
|
||||
import net.runelite.client.ui.DrawManager;
|
||||
import net.runelite.client.ui.NavigationButton;
|
||||
import net.runelite.client.ui.TitleToolbar;
|
||||
import net.runelite.client.ui.overlay.Overlay;
|
||||
import net.runelite.client.ui.overlay.OverlayManager;
|
||||
import net.runelite.client.util.Text;
|
||||
import net.runelite.http.api.RuneLiteAPI;
|
||||
import okhttp3.Call;
|
||||
@@ -126,6 +126,9 @@ public class ScreenshotPlugin extends Plugin
|
||||
@Inject
|
||||
private ScreenshotConfig config;
|
||||
|
||||
@Inject
|
||||
private OverlayManager overlayManager;
|
||||
|
||||
@Inject
|
||||
private ScreenshotOverlay screenshotOverlay;
|
||||
|
||||
@@ -161,15 +164,10 @@ public class ScreenshotPlugin extends Plugin
|
||||
return configManager.getConfig(ScreenshotConfig.class);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Overlay getOverlay()
|
||||
{
|
||||
return screenshotOverlay;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void startUp() throws Exception
|
||||
{
|
||||
overlayManager.add(screenshotOverlay);
|
||||
SCREENSHOT_DIR.mkdirs();
|
||||
keyManager.registerKeyListener(inputListener);
|
||||
|
||||
@@ -213,6 +211,7 @@ public class ScreenshotPlugin extends Plugin
|
||||
@Override
|
||||
protected void shutDown() throws Exception
|
||||
{
|
||||
overlayManager.remove(screenshotOverlay);
|
||||
titleToolbar.removeNavigation(titleBarButton);
|
||||
keyManager.unregisterKeyListener(inputListener);
|
||||
}
|
||||
|
||||
@@ -69,7 +69,7 @@ import net.runelite.client.config.ConfigManager;
|
||||
import net.runelite.client.game.ItemManager;
|
||||
import net.runelite.client.plugins.Plugin;
|
||||
import net.runelite.client.plugins.PluginDescriptor;
|
||||
import net.runelite.client.ui.overlay.Overlay;
|
||||
import net.runelite.client.ui.overlay.OverlayManager;
|
||||
import net.runelite.client.ui.overlay.infobox.InfoBoxManager;
|
||||
import net.runelite.client.util.QueryRunner;
|
||||
import net.runelite.client.util.Text;
|
||||
@@ -112,6 +112,9 @@ public class SlayerPlugin extends Plugin
|
||||
@Inject
|
||||
private SlayerConfig config;
|
||||
|
||||
@Inject
|
||||
private OverlayManager overlayManager;
|
||||
|
||||
@Inject
|
||||
private SlayerOverlay overlay;
|
||||
|
||||
@@ -142,30 +145,46 @@ public class SlayerPlugin extends Plugin
|
||||
@Getter(AccessLevel.PACKAGE)
|
||||
private Collection<WidgetItem> slayerItems = Collections.emptyList();
|
||||
|
||||
private String taskName;
|
||||
@Getter(AccessLevel.PACKAGE)
|
||||
@Setter(AccessLevel.PACKAGE)
|
||||
private int amount;
|
||||
private TaskCounter counter;
|
||||
private int streak;
|
||||
private int points;
|
||||
private int cachedXp;
|
||||
private Instant infoTimer;
|
||||
private boolean loginFlag;
|
||||
|
||||
@Getter(AccessLevel.PACKAGE)
|
||||
@Setter(AccessLevel.PACKAGE)
|
||||
private int expeditiousChargeCount;
|
||||
|
||||
@Getter(AccessLevel.PACKAGE)
|
||||
@Setter(AccessLevel.PACKAGE)
|
||||
private int slaughterChargeCount;
|
||||
|
||||
@Getter(AccessLevel.PACKAGE)
|
||||
@Setter(AccessLevel.PACKAGE)
|
||||
private String taskName;
|
||||
|
||||
@Getter(AccessLevel.PACKAGE)
|
||||
private int streak;
|
||||
|
||||
@Getter(AccessLevel.PACKAGE)
|
||||
private int points;
|
||||
|
||||
private TaskCounter counter;
|
||||
private int cachedXp;
|
||||
private Instant infoTimer;
|
||||
private boolean loginFlag;
|
||||
|
||||
@Override
|
||||
protected void startUp() throws Exception
|
||||
{
|
||||
overlayManager.add(overlay);
|
||||
overlayManager.add(targetClickboxOverlay);
|
||||
overlayManager.add(targetMinimapOverlay);
|
||||
|
||||
if (client.getGameState() == GameState.LOGGED_IN
|
||||
&& config.amount() != -1
|
||||
&& !config.taskName().isEmpty())
|
||||
{
|
||||
setPoints(config.points());
|
||||
setStreak(config.streak());
|
||||
points = config.points();
|
||||
streak = config.streak();
|
||||
setExpeditiousChargeCount(config.expeditious());
|
||||
setSlaughterChargeCount(config.slaughter());
|
||||
clientThread.invokeLater(() -> setTask(config.taskName(), config.amount()));
|
||||
@@ -175,6 +194,9 @@ public class SlayerPlugin extends Plugin
|
||||
@Override
|
||||
protected void shutDown() throws Exception
|
||||
{
|
||||
overlayManager.remove(overlay);
|
||||
overlayManager.remove(targetClickboxOverlay);
|
||||
overlayManager.remove(targetMinimapOverlay);
|
||||
removeCounter();
|
||||
}
|
||||
|
||||
@@ -199,10 +221,10 @@ public class SlayerPlugin extends Plugin
|
||||
case LOGGED_IN:
|
||||
if (config.amount() != -1
|
||||
&& !config.taskName().isEmpty()
|
||||
&& loginFlag == true)
|
||||
&& loginFlag)
|
||||
{
|
||||
setPoints(config.points());
|
||||
setStreak(config.streak());
|
||||
points = config.points();
|
||||
streak = config.streak();
|
||||
setExpeditiousChargeCount(config.expeditious());
|
||||
setSlaughterChargeCount(config.slaughter());
|
||||
setTask(config.taskName(), config.amount());
|
||||
@@ -572,53 +594,6 @@ public class SlayerPlugin extends Plugin
|
||||
return composition;
|
||||
}
|
||||
|
||||
//Getters
|
||||
@Override
|
||||
public Collection<Overlay> getOverlays()
|
||||
{
|
||||
return Arrays.asList(overlay, targetClickboxOverlay, targetMinimapOverlay);
|
||||
}
|
||||
|
||||
public String getTaskName()
|
||||
{
|
||||
return taskName;
|
||||
}
|
||||
|
||||
void setTaskName(String taskName)
|
||||
{
|
||||
this.taskName = taskName;
|
||||
}
|
||||
|
||||
public int getAmount()
|
||||
{
|
||||
return amount;
|
||||
}
|
||||
|
||||
void setAmount(int amount)
|
||||
{
|
||||
this.amount = amount;
|
||||
}
|
||||
|
||||
public int getStreak()
|
||||
{
|
||||
return streak;
|
||||
}
|
||||
|
||||
void setStreak(int streak)
|
||||
{
|
||||
this.streak = streak;
|
||||
}
|
||||
|
||||
public int getPoints()
|
||||
{
|
||||
return points;
|
||||
}
|
||||
|
||||
void setPoints(int points)
|
||||
{
|
||||
this.points = points;
|
||||
}
|
||||
|
||||
//Utils
|
||||
private String capsString(String str)
|
||||
{
|
||||
|
||||
@@ -24,6 +24,7 @@
|
||||
*/
|
||||
package net.runelite.client.plugins.teamcapes;
|
||||
|
||||
import com.google.inject.Provides;
|
||||
import java.time.temporal.ChronoUnit;
|
||||
import java.util.Comparator;
|
||||
import java.util.HashMap;
|
||||
@@ -32,7 +33,6 @@ import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.stream.Collectors;
|
||||
import javax.inject.Inject;
|
||||
import com.google.inject.Provides;
|
||||
import net.runelite.api.Client;
|
||||
import net.runelite.api.GameState;
|
||||
import net.runelite.api.Player;
|
||||
@@ -40,7 +40,7 @@ import net.runelite.client.config.ConfigManager;
|
||||
import net.runelite.client.plugins.Plugin;
|
||||
import net.runelite.client.plugins.PluginDescriptor;
|
||||
import net.runelite.client.task.Schedule;
|
||||
import net.runelite.client.ui.overlay.Overlay;
|
||||
import net.runelite.client.ui.overlay.OverlayManager;
|
||||
|
||||
@PluginDescriptor(
|
||||
name = "Team Capes",
|
||||
@@ -52,10 +52,10 @@ public class TeamCapesPlugin extends Plugin
|
||||
private Client client;
|
||||
|
||||
@Inject
|
||||
private TeamCapesConfig config;
|
||||
private OverlayManager overlayManager;
|
||||
|
||||
@Inject
|
||||
private TeamCapesOverlay teamCapesOverlay;
|
||||
private TeamCapesOverlay overlay;
|
||||
|
||||
// Hashmap of team capes: Key is the teamCape #, Value is the count of teamcapes in the area.
|
||||
private Map<Integer, Integer> teams = new HashMap<>();
|
||||
@@ -67,14 +67,15 @@ public class TeamCapesPlugin extends Plugin
|
||||
}
|
||||
|
||||
@Override
|
||||
public Overlay getOverlay()
|
||||
protected void startUp() throws Exception
|
||||
{
|
||||
return teamCapesOverlay;
|
||||
overlayManager.add(overlay);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void shutDown() throws Exception
|
||||
{
|
||||
overlayManager.remove(overlay);
|
||||
teams.clear();
|
||||
}
|
||||
|
||||
|
||||
@@ -27,6 +27,7 @@ package net.runelite.client.plugins.tileindicators;
|
||||
import java.awt.Dimension;
|
||||
import java.awt.Graphics2D;
|
||||
import java.awt.Polygon;
|
||||
import javax.inject.Inject;
|
||||
import net.runelite.api.Client;
|
||||
import net.runelite.api.Perspective;
|
||||
import net.runelite.api.coords.LocalPoint;
|
||||
@@ -41,7 +42,8 @@ public class TileIndicatorsOverlay extends Overlay
|
||||
private final Client client;
|
||||
private final TileIndicatorsConfig config;
|
||||
|
||||
TileIndicatorsOverlay(Client client, TileIndicatorsConfig config)
|
||||
@Inject
|
||||
private TileIndicatorsOverlay(Client client, TileIndicatorsConfig config)
|
||||
{
|
||||
this.client = client;
|
||||
this.config = config;
|
||||
|
||||
@@ -26,11 +26,10 @@ package net.runelite.client.plugins.tileindicators;
|
||||
|
||||
import com.google.inject.Provides;
|
||||
import javax.inject.Inject;
|
||||
import net.runelite.api.Client;
|
||||
import net.runelite.client.config.ConfigManager;
|
||||
import net.runelite.client.plugins.Plugin;
|
||||
import net.runelite.client.plugins.PluginDescriptor;
|
||||
import net.runelite.client.ui.overlay.Overlay;
|
||||
import net.runelite.client.ui.overlay.OverlayManager;
|
||||
|
||||
@PluginDescriptor(
|
||||
name = "Tile Indicators",
|
||||
@@ -39,12 +38,10 @@ import net.runelite.client.ui.overlay.Overlay;
|
||||
public class TileIndicatorsPlugin extends Plugin
|
||||
{
|
||||
@Inject
|
||||
private Client client;
|
||||
private OverlayManager overlayManager;
|
||||
|
||||
@Inject
|
||||
private TileIndicatorsConfig config;
|
||||
|
||||
private TileIndicatorsOverlay tileIndicatorsOverlay;
|
||||
private TileIndicatorsOverlay overlay;
|
||||
|
||||
@Provides
|
||||
TileIndicatorsConfig provideConfig(ConfigManager configManager)
|
||||
@@ -55,12 +52,12 @@ public class TileIndicatorsPlugin extends Plugin
|
||||
@Override
|
||||
protected void startUp() throws Exception
|
||||
{
|
||||
tileIndicatorsOverlay = new TileIndicatorsOverlay(client, config);
|
||||
overlayManager.add(overlay);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Overlay getOverlay()
|
||||
protected void shutDown() throws Exception
|
||||
{
|
||||
return tileIndicatorsOverlay;
|
||||
overlayManager.remove(overlay);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -26,8 +26,6 @@ package net.runelite.client.plugins.tithefarm;
|
||||
|
||||
import com.google.common.eventbus.Subscribe;
|
||||
import com.google.inject.Provides;
|
||||
import java.util.Arrays;
|
||||
import java.util.Collection;
|
||||
import java.util.HashSet;
|
||||
import java.util.Set;
|
||||
import javax.inject.Inject;
|
||||
@@ -41,7 +39,7 @@ import net.runelite.api.events.GameTick;
|
||||
import net.runelite.client.config.ConfigManager;
|
||||
import net.runelite.client.plugins.Plugin;
|
||||
import net.runelite.client.plugins.PluginDescriptor;
|
||||
import net.runelite.client.ui.overlay.Overlay;
|
||||
import net.runelite.client.ui.overlay.OverlayManager;
|
||||
|
||||
@Slf4j
|
||||
@PluginDescriptor(
|
||||
@@ -49,6 +47,9 @@ import net.runelite.client.ui.overlay.Overlay;
|
||||
)
|
||||
public class TitheFarmPlugin extends Plugin
|
||||
{
|
||||
@Inject
|
||||
private OverlayManager overlayManager;
|
||||
|
||||
@Inject
|
||||
private TitheFarmPlantOverlay titheFarmOverlay;
|
||||
|
||||
@@ -65,15 +66,18 @@ public class TitheFarmPlugin extends Plugin
|
||||
}
|
||||
|
||||
@Override
|
||||
public Collection<Overlay> getOverlays()
|
||||
protected void startUp() throws Exception
|
||||
{
|
||||
return Arrays.asList(titheFarmOverlay, titheFarmSackOverlay);
|
||||
overlayManager.add(titheFarmOverlay);
|
||||
overlayManager.add(titheFarmSackOverlay);
|
||||
titheFarmOverlay.updateConfig();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void startUp() throws Exception
|
||||
protected void shutDown() throws Exception
|
||||
{
|
||||
titheFarmOverlay.updateConfig();
|
||||
overlayManager.remove(titheFarmOverlay);
|
||||
overlayManager.remove(titheFarmSackOverlay);
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
|
||||
@@ -28,8 +28,6 @@ import com.google.common.eventbus.Subscribe;
|
||||
import com.google.inject.Provides;
|
||||
import java.time.Duration;
|
||||
import java.time.Instant;
|
||||
import java.util.Arrays;
|
||||
import java.util.Collection;
|
||||
import java.util.HashSet;
|
||||
import java.util.Set;
|
||||
import javax.inject.Inject;
|
||||
@@ -52,7 +50,7 @@ import net.runelite.client.plugins.Plugin;
|
||||
import net.runelite.client.plugins.PluginDependency;
|
||||
import net.runelite.client.plugins.PluginDescriptor;
|
||||
import net.runelite.client.plugins.xptracker.XpTrackerPlugin;
|
||||
import net.runelite.client.ui.overlay.Overlay;
|
||||
import net.runelite.client.ui.overlay.OverlayManager;
|
||||
|
||||
@PluginDescriptor(
|
||||
name = "Woodcutting"
|
||||
@@ -66,6 +64,9 @@ public class WoodcuttingPlugin extends Plugin
|
||||
@Inject
|
||||
private Client client;
|
||||
|
||||
@Inject
|
||||
private OverlayManager overlayManager;
|
||||
|
||||
@Inject
|
||||
private WoodcuttingOverlay overlay;
|
||||
|
||||
@@ -91,14 +92,17 @@ public class WoodcuttingPlugin extends Plugin
|
||||
}
|
||||
|
||||
@Override
|
||||
public Collection<Overlay> getOverlays()
|
||||
protected void startUp() throws Exception
|
||||
{
|
||||
return Arrays.asList(overlay, treesOverlay);
|
||||
overlayManager.add(overlay);
|
||||
overlayManager.add(treesOverlay);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void shutDown() throws Exception
|
||||
{
|
||||
overlayManager.remove(overlay);
|
||||
overlayManager.remove(treesOverlay);
|
||||
treeObjects.clear();
|
||||
session = null;
|
||||
axe = null;
|
||||
|
||||
@@ -43,7 +43,7 @@ import net.runelite.client.plugins.PluginDependency;
|
||||
import net.runelite.client.plugins.PluginDescriptor;
|
||||
import net.runelite.client.plugins.xptracker.XpTrackerPlugin;
|
||||
import net.runelite.client.task.Schedule;
|
||||
import net.runelite.client.ui.overlay.Overlay;
|
||||
import net.runelite.client.ui.overlay.OverlayManager;
|
||||
|
||||
@PluginDescriptor(
|
||||
name = "XP Globes"
|
||||
@@ -62,6 +62,9 @@ public class XpGlobesPlugin extends Plugin
|
||||
@Inject
|
||||
private XpGlobesConfig config;
|
||||
|
||||
@Inject
|
||||
private OverlayManager overlayManager;
|
||||
|
||||
@Inject
|
||||
private XpGlobesOverlay overlay;
|
||||
|
||||
@@ -72,9 +75,15 @@ public class XpGlobesPlugin extends Plugin
|
||||
}
|
||||
|
||||
@Override
|
||||
public Overlay getOverlay()
|
||||
protected void startUp() throws Exception
|
||||
{
|
||||
return overlay;
|
||||
overlayManager.add(overlay);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void shutDown() throws Exception
|
||||
{
|
||||
overlayManager.remove(overlay);
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
|
||||
Reference in New Issue
Block a user