runelite-client: standardize plugin names
This commit is contained in:
@@ -35,7 +35,7 @@ import net.runelite.client.ui.overlay.Overlay;
|
||||
@PluginDescriptor(
|
||||
name = "Boosts plugin"
|
||||
)
|
||||
public class Boosts extends Plugin
|
||||
public class BoostsPlugin extends Plugin
|
||||
{
|
||||
@Inject
|
||||
BoostsOverlay boostsOverlay;
|
||||
@@ -36,11 +36,11 @@ import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
@PluginDescriptor(
|
||||
name = "Boss timers"
|
||||
name = "Boss timers plugin"
|
||||
)
|
||||
public class BossTimers extends Plugin
|
||||
public class BossTimersPlugin extends Plugin
|
||||
{
|
||||
private static final Logger logger = LoggerFactory.getLogger(BossTimers.class);
|
||||
private static final Logger logger = LoggerFactory.getLogger(BossTimersPlugin.class);
|
||||
|
||||
@Inject
|
||||
InfoBoxManager infoBoxManager;
|
||||
@@ -31,7 +31,7 @@ import net.runelite.client.config.ConfigItem;
|
||||
|
||||
@ConfigGroup(
|
||||
keyName = "chatcommands",
|
||||
name = "Chat commands",
|
||||
name = "Chat Commands",
|
||||
description = "Configuration for chat commands"
|
||||
)
|
||||
public interface ChatCommandsConfig extends Config
|
||||
|
||||
@@ -63,11 +63,11 @@ import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
@PluginDescriptor(
|
||||
name = "Chat commands"
|
||||
name = "Chat commands plugin"
|
||||
)
|
||||
public class ChatCommands extends Plugin
|
||||
public class ChatCommandsPlugin extends Plugin
|
||||
{
|
||||
private static final Logger logger = LoggerFactory.getLogger(ChatCommands.class);
|
||||
private static final Logger logger = LoggerFactory.getLogger(ChatCommandsPlugin.class);
|
||||
|
||||
private static final float HIGH_ALCHEMY_CONSTANT = 0.6f;
|
||||
|
||||
@@ -38,7 +38,7 @@ import net.runelite.client.task.Schedule;
|
||||
@PluginDescriptor(
|
||||
name = "Clan chat plugin"
|
||||
)
|
||||
public class ClanChat extends Plugin
|
||||
public class ClanChatPlugin extends Plugin
|
||||
{
|
||||
@Inject
|
||||
@Nullable
|
||||
@@ -43,7 +43,7 @@ import net.runelite.client.task.Schedule;
|
||||
@PluginDescriptor(
|
||||
name = "Combat level plugin"
|
||||
)
|
||||
public class CombatLevel extends Plugin
|
||||
public class CombatLevelPlugin extends Plugin
|
||||
{
|
||||
private final DecimalFormat decimalFormat = new DecimalFormat("#.###");
|
||||
|
||||
@@ -36,7 +36,7 @@ import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
@PluginDescriptor(
|
||||
name = "Config plugin"
|
||||
name = "Configuration plugin"
|
||||
)
|
||||
public class ConfigPlugin extends Plugin
|
||||
{
|
||||
|
||||
@@ -32,7 +32,6 @@ import java.awt.FontMetrics;
|
||||
import java.awt.Graphics2D;
|
||||
import java.awt.Polygon;
|
||||
import java.awt.Rectangle;
|
||||
|
||||
import java.awt.geom.Rectangle2D;
|
||||
import java.util.List;
|
||||
import javax.annotation.Nullable;
|
||||
@@ -76,10 +75,10 @@ public class DevToolsOverlay extends Overlay
|
||||
private static final int MAX_DISTANCE = 2400;
|
||||
|
||||
private final Client client;
|
||||
private final DevTools plugin;
|
||||
private final DevToolsPlugin plugin;
|
||||
|
||||
@Inject
|
||||
public DevToolsOverlay(@Nullable Client client, DevTools plugin)
|
||||
public DevToolsOverlay(@Nullable Client client, DevToolsPlugin plugin)
|
||||
{
|
||||
super(OverlayPosition.DYNAMIC);
|
||||
this.client = client;
|
||||
|
||||
@@ -25,15 +25,21 @@
|
||||
*/
|
||||
package net.runelite.client.plugins.devtools;
|
||||
|
||||
import java.awt.*;
|
||||
import java.awt.BorderLayout;
|
||||
import java.awt.Color;
|
||||
import java.awt.Dimension;
|
||||
import java.awt.GridLayout;
|
||||
import java.util.Collection;
|
||||
import javax.annotation.Nullable;
|
||||
import javax.inject.Inject;
|
||||
import javax.swing.*;
|
||||
import javax.swing.JButton;
|
||||
import javax.swing.JLabel;
|
||||
import javax.swing.JPanel;
|
||||
import javax.swing.JScrollPane;
|
||||
import javax.swing.JTree;
|
||||
import javax.swing.border.EmptyBorder;
|
||||
import javax.swing.tree.DefaultMutableTreeNode;
|
||||
import javax.swing.tree.DefaultTreeModel;
|
||||
|
||||
import net.runelite.api.Client;
|
||||
import net.runelite.api.widgets.Widget;
|
||||
import static net.runelite.api.widgets.WidgetInfo.TO_CHILD;
|
||||
@@ -69,12 +75,12 @@ public class DevToolsPanel extends PluginPanel
|
||||
private JLabel contentTypeLbl = new JLabel();
|
||||
|
||||
private final Client client;
|
||||
private final DevTools plugin;
|
||||
private final DevToolsPlugin plugin;
|
||||
|
||||
private final SettingsTracker settingsTracker;
|
||||
|
||||
@Inject
|
||||
public DevToolsPanel(@Nullable Client client, DevTools plugin)
|
||||
public DevToolsPanel(@Nullable Client client, DevToolsPlugin plugin)
|
||||
{
|
||||
this.client = client;
|
||||
this.plugin = plugin;
|
||||
|
||||
@@ -38,10 +38,10 @@ import net.runelite.client.ui.NavigationButton;
|
||||
import net.runelite.client.ui.overlay.Overlay;
|
||||
|
||||
@PluginDescriptor(
|
||||
name = "Developer tools",
|
||||
name = "Developer tools plugin",
|
||||
developerPlugin = true
|
||||
)
|
||||
public class DevTools extends Plugin
|
||||
public class DevToolsPlugin extends Plugin
|
||||
{
|
||||
@Inject
|
||||
ClientUI ui;
|
||||
@@ -77,7 +77,7 @@ public class DevTools extends Plugin
|
||||
protected void startUp() throws Exception
|
||||
{
|
||||
panel = injector.getInstance(DevToolsPanel.class);
|
||||
navButton = new NavigationButton("DevTools", () -> panel);
|
||||
navButton = new NavigationButton("Developer Tools", () -> panel);
|
||||
|
||||
ImageIcon icon = new ImageIcon(ImageIO.read(getClass().getResourceAsStream("devtools_icon.png")));
|
||||
navButton.getButton().setIcon(icon);
|
||||
@@ -24,14 +24,6 @@
|
||||
*/
|
||||
package net.runelite.client.plugins.fightcave;
|
||||
|
||||
import net.runelite.api.Client;
|
||||
import net.runelite.api.widgets.Widget;
|
||||
import net.runelite.client.ui.overlay.Overlay;
|
||||
import net.runelite.client.ui.overlay.OverlayPosition;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import javax.imageio.ImageIO;
|
||||
import java.awt.Color;
|
||||
import java.awt.Dimension;
|
||||
import java.awt.FontMetrics;
|
||||
@@ -41,7 +33,14 @@ import java.awt.Rectangle;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import javax.annotation.Nullable;
|
||||
import javax.imageio.ImageIO;
|
||||
import javax.inject.Inject;
|
||||
import net.runelite.api.Client;
|
||||
import net.runelite.api.widgets.Widget;
|
||||
import net.runelite.client.ui.overlay.Overlay;
|
||||
import net.runelite.client.ui.overlay.OverlayPosition;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
public class FightCaveOverlay extends Overlay
|
||||
{
|
||||
@@ -54,13 +53,13 @@ public class FightCaveOverlay extends Overlay
|
||||
private static final Color RED_BACKGROUND = new Color(255, 0, 0, 100);
|
||||
|
||||
private final Client client;
|
||||
private final FightCave plugin;
|
||||
private final FightCavePlugin plugin;
|
||||
|
||||
private Image protectFromMagicImg;
|
||||
private Image protectFromMissilesImg;
|
||||
|
||||
@Inject
|
||||
FightCaveOverlay(@Nullable Client client, FightCave plugin)
|
||||
FightCaveOverlay(@Nullable Client client, FightCavePlugin plugin)
|
||||
{
|
||||
super(OverlayPosition.DYNAMIC);
|
||||
this.client = client;
|
||||
|
||||
@@ -42,7 +42,7 @@ import net.runelite.client.ui.overlay.Overlay;
|
||||
@PluginDescriptor(
|
||||
name = "Fight cave plugin"
|
||||
)
|
||||
public class FightCave extends Plugin
|
||||
public class FightCavePlugin extends Plugin
|
||||
{
|
||||
@Inject
|
||||
@Nullable
|
||||
@@ -43,10 +43,10 @@ import net.runelite.client.ui.overlay.OverlayPriority;
|
||||
public class FPSOverlay extends Overlay
|
||||
{
|
||||
private final Client client;
|
||||
private final FPS plugin;
|
||||
private final FPSPlugin plugin;
|
||||
|
||||
@Inject
|
||||
public FPSOverlay(@Nullable Client client, FPS plugin)
|
||||
public FPSOverlay(@Nullable Client client, FPSPlugin plugin)
|
||||
{
|
||||
super(OverlayPosition.DYNAMIC, OverlayPriority.HIGH);
|
||||
this.client = client;
|
||||
|
||||
@@ -33,9 +33,9 @@ import net.runelite.client.ui.FontManager;
|
||||
import net.runelite.client.ui.overlay.Overlay;
|
||||
|
||||
@PluginDescriptor(
|
||||
name = "Frames per second"
|
||||
name = "Frames per second plugin"
|
||||
)
|
||||
public class FPS extends Plugin
|
||||
public class FPSPlugin extends Plugin
|
||||
{
|
||||
@Inject
|
||||
FPSOverlay overlay;
|
||||
@@ -35,7 +35,7 @@ import net.runelite.client.ui.overlay.Overlay;
|
||||
@PluginDescriptor(
|
||||
name = "Ground items plugin"
|
||||
)
|
||||
public class GroundItems extends Plugin
|
||||
public class GroundItemsPlugin extends Plugin
|
||||
{
|
||||
@Inject
|
||||
ConfigManager configManager;
|
||||
@@ -41,9 +41,9 @@ import org.slf4j.LoggerFactory;
|
||||
@PluginDescriptor(
|
||||
name = "Hiscore plugin"
|
||||
)
|
||||
public class Hiscore extends Plugin
|
||||
public class HiscorePlugin extends Plugin
|
||||
{
|
||||
private static final Logger logger = LoggerFactory.getLogger(Hiscore.class);
|
||||
private static final Logger logger = LoggerFactory.getLogger(HiscorePlugin.class);
|
||||
|
||||
private static final String LOOKUP = "Lookup";
|
||||
|
||||
@@ -48,9 +48,9 @@ import net.runelite.client.task.Schedule;
|
||||
import net.runelite.client.ui.ClientUI;
|
||||
|
||||
@PluginDescriptor(
|
||||
name = "Idle notifier"
|
||||
name = "Idle notifier plugin"
|
||||
)
|
||||
public class IdleNotifier extends Plugin
|
||||
public class IdleNotifierPlugin extends Plugin
|
||||
{
|
||||
@Inject
|
||||
RuneLite runelite;
|
||||
@@ -41,7 +41,7 @@ import net.runelite.client.ui.overlay.Overlay;
|
||||
@PluginDescriptor(
|
||||
name = "Implings plugin"
|
||||
)
|
||||
public class Implings extends Plugin
|
||||
public class ImplingsPlugin extends Plugin
|
||||
{
|
||||
@Inject
|
||||
ImplingsOverlay overlay;
|
||||
@@ -35,7 +35,7 @@ import net.runelite.client.ui.overlay.Overlay;
|
||||
@PluginDescriptor(
|
||||
name = "Mouse highlight plugin"
|
||||
)
|
||||
public class MouseHighlight extends Plugin
|
||||
public class MouseHighlightPlugin extends Plugin
|
||||
{
|
||||
@Inject
|
||||
MouseHighlightConfig config;
|
||||
@@ -65,7 +65,7 @@ class OpponentInfoOverlay extends Overlay
|
||||
private float lastRatio = 0;
|
||||
private Instant lastTime = Instant.now();
|
||||
private String opponentName;
|
||||
private Map<String, Integer> oppInfoHealth = OpponentInfo.loadNpcHealth();
|
||||
private Map<String, Integer> oppInfoHealth = OpponentInfoPlugin.loadNpcHealth();
|
||||
|
||||
@Inject
|
||||
OpponentInfoOverlay(@Nullable Client client, OpponentConfig config)
|
||||
|
||||
@@ -41,7 +41,7 @@ import net.runelite.client.ui.overlay.Overlay;
|
||||
@PluginDescriptor(
|
||||
name = "Opponent information plugin"
|
||||
)
|
||||
public class OpponentInfo extends Plugin
|
||||
public class OpponentInfoPlugin extends Plugin
|
||||
{
|
||||
@Inject
|
||||
OpponentInfoOverlay overlay;
|
||||
@@ -71,7 +71,7 @@ public class OpponentInfo extends Plugin
|
||||
{
|
||||
}.getType();
|
||||
|
||||
InputStream healthFile = OpponentInfo.class.getResourceAsStream("/npc_health.json");
|
||||
InputStream healthFile = OpponentInfoPlugin.class.getResourceAsStream("/npc_health.json");
|
||||
return gson.fromJson(new InputStreamReader(healthFile), type);
|
||||
}
|
||||
}
|
||||
@@ -58,13 +58,13 @@ public class PestControlOverlay extends Overlay
|
||||
private final RuneLite runelite;
|
||||
private final Client client;
|
||||
|
||||
private final PestControl plugin;
|
||||
private final PestControlPlugin plugin;
|
||||
|
||||
// Pest control game
|
||||
private Game game;
|
||||
|
||||
@Inject
|
||||
public PestControlOverlay(RuneLite runelite, PestControl plugin)
|
||||
public PestControlOverlay(RuneLite runelite, PestControlPlugin plugin)
|
||||
{
|
||||
super(OverlayPosition.DYNAMIC);
|
||||
this.runelite = runelite;
|
||||
|
||||
@@ -35,7 +35,7 @@ import net.runelite.client.ui.overlay.Overlay;
|
||||
@PluginDescriptor(
|
||||
name = "Pest control plugin"
|
||||
)
|
||||
public class PestControl extends Plugin
|
||||
public class PestControlPlugin extends Plugin
|
||||
{
|
||||
private Font font;
|
||||
|
||||
@@ -38,7 +38,7 @@ import net.runelite.client.plugins.PluginDescriptor;
|
||||
@PluginDescriptor(
|
||||
name = "Remember username plugin"
|
||||
)
|
||||
public class RememberUsername extends Plugin
|
||||
public class RememberUsernamePlugin extends Plugin
|
||||
{
|
||||
@Inject
|
||||
@Nullable
|
||||
@@ -42,7 +42,7 @@ import net.runelite.client.ui.overlay.Overlay;
|
||||
@PluginDescriptor(
|
||||
name = "Runecraft plugin"
|
||||
)
|
||||
public class Runecraft extends Plugin
|
||||
public class RunecraftPlugin extends Plugin
|
||||
{
|
||||
private static Pattern bindNeckString = Pattern.compile("You have ([0-9]+) charges left before your Binding necklace disintegrates.");
|
||||
|
||||
@@ -35,7 +35,7 @@ import net.runelite.client.ui.overlay.Overlay;
|
||||
@PluginDescriptor(
|
||||
name = "Runepouch plugin"
|
||||
)
|
||||
public class Runepouch extends Plugin
|
||||
public class RunepouchPlugin extends Plugin
|
||||
{
|
||||
@Inject
|
||||
ConfigManager configManager;
|
||||
@@ -54,7 +54,7 @@ class SlayerOverlay extends Overlay
|
||||
private final RuneLite runelite;
|
||||
private final Client client;
|
||||
private final SlayerConfig config;
|
||||
private final Slayer plugin;
|
||||
private final SlayerPlugin plugin;
|
||||
private final Font font = FontManager.getRunescapeSmallFont().deriveFont(Font.PLAIN, 16);
|
||||
|
||||
private final Set<Integer> slayerJewelry = Sets.newHashSet(
|
||||
@@ -85,7 +85,7 @@ class SlayerOverlay extends Overlay
|
||||
);
|
||||
|
||||
@Inject
|
||||
SlayerOverlay(RuneLite runelite, Slayer plugin, SlayerConfig config)
|
||||
SlayerOverlay(RuneLite runelite, SlayerPlugin plugin, SlayerConfig config)
|
||||
{
|
||||
super(OverlayPosition.DYNAMIC);
|
||||
this.runelite = runelite;
|
||||
|
||||
@@ -57,9 +57,9 @@ import org.slf4j.LoggerFactory;
|
||||
@PluginDescriptor(
|
||||
name = "Slayer plugin"
|
||||
)
|
||||
public class Slayer extends Plugin
|
||||
public class SlayerPlugin extends Plugin
|
||||
{
|
||||
private static final Logger logger = LoggerFactory.getLogger(Slayer.class);
|
||||
private static final Logger logger = LoggerFactory.getLogger(SlayerPlugin.class);
|
||||
|
||||
//Chat messages
|
||||
private static final Pattern CHAT_GEM_PROGRESS_MESSAGE = Pattern.compile("You're assigned to kill (.*); only (\\d*) more to go\\.");
|
||||
@@ -39,7 +39,7 @@ import net.runelite.client.ui.overlay.infobox.InfoBoxManager;
|
||||
@PluginDescriptor(
|
||||
name = "Timers plugin"
|
||||
)
|
||||
public class Timers extends Plugin
|
||||
public class TimersPlugin extends Plugin
|
||||
{
|
||||
@Inject
|
||||
TimersConfig config;
|
||||
@@ -31,14 +31,14 @@ import net.runelite.client.config.ConfigItem;
|
||||
@ConfigGroup(
|
||||
keyName = "xpglobes",
|
||||
name = "XP Globes",
|
||||
description = "Configuration for the xp globes plugin"
|
||||
description = "Configuration for the XP globes plugin"
|
||||
)
|
||||
public interface XpGlobesConfig extends Config
|
||||
{
|
||||
@ConfigItem(
|
||||
keyName = "enabled",
|
||||
name = "Enabled",
|
||||
description = "Configures whether or not xp globes are displayed"
|
||||
description = "Configures whether or not XP globes are displayed"
|
||||
)
|
||||
default boolean enabled()
|
||||
{
|
||||
|
||||
@@ -53,7 +53,7 @@ public class XpGlobesOverlay extends Overlay
|
||||
private static final Logger logger = LoggerFactory.getLogger(XpGlobesOverlay.class);
|
||||
|
||||
private final Client client;
|
||||
private final XpGlobes plugin;
|
||||
private final XpGlobesPlugin plugin;
|
||||
private final XpGlobesConfig config;
|
||||
|
||||
private static final int DEFAULT_CIRCLE_WIDTH = 40;
|
||||
@@ -76,7 +76,7 @@ public class XpGlobesOverlay extends Overlay
|
||||
private static final int TOOLTIP_RECT_SIZE_Y = 80;
|
||||
|
||||
@Inject
|
||||
public XpGlobesOverlay(@Nullable Client client, XpGlobes plugin, XpGlobesConfig config)
|
||||
public XpGlobesOverlay(@Nullable Client client, XpGlobesPlugin plugin, XpGlobesConfig config)
|
||||
{
|
||||
super(OverlayPosition.DYNAMIC);
|
||||
this.client = client;
|
||||
|
||||
@@ -44,9 +44,9 @@ import net.runelite.client.plugins.PluginDescriptor;
|
||||
import net.runelite.client.ui.overlay.Overlay;
|
||||
|
||||
@PluginDescriptor(
|
||||
name = "Xp Globes plugin"
|
||||
name = "XP globes plugin"
|
||||
)
|
||||
public class XpGlobes extends Plugin
|
||||
public class XpGlobesPlugin extends Plugin
|
||||
{
|
||||
private static final int SECONDS_TO_SHOW_GLOBE = 10;
|
||||
private static final int MAXIMUM_SHOWN_GLOBES = 5;
|
||||
@@ -46,11 +46,11 @@ import javax.swing.JLabel;
|
||||
import javax.swing.JPanel;
|
||||
import javax.swing.JScrollPane;
|
||||
|
||||
public class XPPanel extends PluginPanel
|
||||
public class XpPanel extends PluginPanel
|
||||
{
|
||||
private static final Logger logger = LoggerFactory.getLogger(XPPanel.class);
|
||||
private static final Logger logger = LoggerFactory.getLogger(XpPanel.class);
|
||||
private Map<Skill, JPanel> labelMap = new HashMap<>();
|
||||
private final XPTracker xpTracker;
|
||||
private final XpTrackerPlugin xpTracker;
|
||||
private JPanel statsPanel;
|
||||
|
||||
@Inject
|
||||
@@ -61,7 +61,7 @@ public class XPPanel extends PluginPanel
|
||||
ScheduledExecutorService executor;
|
||||
|
||||
@Inject
|
||||
public XPPanel(XPTracker xpTracker)
|
||||
public XpPanel(XpTrackerPlugin xpTracker)
|
||||
{
|
||||
this.xpTracker = xpTracker;
|
||||
|
||||
@@ -119,7 +119,7 @@ public class XPPanel extends PluginPanel
|
||||
|
||||
String skillIcon = "/skill_icons/" + skill.getName().toLowerCase() + ".png";
|
||||
logger.debug("Loading skill icon from {}", skillIcon);
|
||||
JLabel icon = new JLabel(new ImageIcon(ImageIO.read(XPPanel.class.getResourceAsStream(skillIcon))));
|
||||
JLabel icon = new JLabel(new ImageIcon(ImageIO.read(XpPanel.class.getResourceAsStream(skillIcon))));
|
||||
iconLevel.add(icon, BorderLayout.LINE_START);
|
||||
|
||||
iconLevel.add(levelLabel, BorderLayout.CENTER);
|
||||
|
||||
@@ -40,9 +40,9 @@ import net.runelite.client.plugins.PluginDescriptor;
|
||||
import net.runelite.client.task.Schedule;
|
||||
|
||||
@PluginDescriptor(
|
||||
name = "XP Tracker plugin"
|
||||
name = "XP tracker plugin"
|
||||
)
|
||||
public class XPTracker extends Plugin
|
||||
public class XpTrackerPlugin extends Plugin
|
||||
{
|
||||
private static final int NUMBER_OF_SKILLS = Skill.values().length - 1; //ignore overall
|
||||
|
||||
@@ -54,15 +54,14 @@ public class XPTracker extends Plugin
|
||||
Client client;
|
||||
|
||||
private NavigationButton navButton;
|
||||
private XPPanel xpPanel;
|
||||
private XpPanel xpPanel;
|
||||
private final SkillXPInfo[] xpInfos = new SkillXPInfo[NUMBER_OF_SKILLS];
|
||||
|
||||
@Override
|
||||
protected void startUp() throws Exception
|
||||
{
|
||||
navButton = new NavigationButton("XP Tracker", () -> xpPanel);
|
||||
xpPanel = injector.getInstance(XPPanel.class);
|
||||
|
||||
xpPanel = injector.getInstance(XpPanel.class);
|
||||
navButton.getButton().setText("XP");
|
||||
ui.getPluginToolbar().addNavigation(navButton);
|
||||
}
|
||||
@@ -43,9 +43,9 @@ import org.slf4j.LoggerFactory;
|
||||
@PluginDescriptor(
|
||||
name = "Xtea plugin"
|
||||
)
|
||||
public class Xtea extends Plugin
|
||||
public class XteaPlugin extends Plugin
|
||||
{
|
||||
private static final Logger logger = LoggerFactory.getLogger(Xtea.class);
|
||||
private static final Logger logger = LoggerFactory.getLogger(XteaPlugin.class);
|
||||
|
||||
private final XteaClient xteaClient = new XteaClient();
|
||||
|
||||
@@ -69,13 +69,13 @@ public class ZulrahOverlay extends Overlay
|
||||
private static final Color JAD_BACKGROUND_COLOR = new Color(255, 115, 0, 100);
|
||||
|
||||
private final Client client;
|
||||
private final Zulrah plugin;
|
||||
private final ZulrahPlugin plugin;
|
||||
private final Image[] zulrahImages = new Image[3];
|
||||
private final Image[] smallZulrahImages = new Image[3];
|
||||
private final Image[] prayerImages = new Image[2];
|
||||
|
||||
@Inject
|
||||
ZulrahOverlay(@Nullable Client client, Zulrah plugin)
|
||||
ZulrahOverlay(@Nullable Client client, ZulrahPlugin plugin)
|
||||
{
|
||||
super(OverlayPosition.DYNAMIC);
|
||||
this.client = client;
|
||||
|
||||
@@ -54,9 +54,9 @@ import org.slf4j.LoggerFactory;
|
||||
@PluginDescriptor(
|
||||
name = "Zulrah plugin"
|
||||
)
|
||||
public class Zulrah extends Plugin
|
||||
public class ZulrahPlugin extends Plugin
|
||||
{
|
||||
private static final Logger logger = LoggerFactory.getLogger(Zulrah.class);
|
||||
private static final Logger logger = LoggerFactory.getLogger(ZulrahPlugin.class);
|
||||
|
||||
@Inject
|
||||
RuneLite runelite;
|
||||
@@ -1,143 +1,143 @@
|
||||
/*
|
||||
* Copyright (c) 2017, Adam <Adam@sigterm.info>
|
||||
* 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.slayer;
|
||||
|
||||
import com.google.inject.Guice;
|
||||
import com.google.inject.testing.fieldbinder.Bind;
|
||||
import com.google.inject.testing.fieldbinder.BoundFieldModule;
|
||||
import javax.inject.Inject;
|
||||
import static net.runelite.api.ChatMessageType.SERVER;
|
||||
import net.runelite.api.Client;
|
||||
import net.runelite.client.events.ChatMessage;
|
||||
import net.runelite.client.game.ItemManager;
|
||||
import net.runelite.client.ui.overlay.infobox.InfoBoxManager;
|
||||
import static org.junit.Assert.assertEquals;
|
||||
import org.junit.Before;
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
import org.mockito.Mock;
|
||||
import static org.mockito.Mockito.when;
|
||||
import org.mockito.runners.MockitoJUnitRunner;
|
||||
|
||||
@RunWith(MockitoJUnitRunner.class)
|
||||
public class SlayerTest
|
||||
{
|
||||
private static final String TASK_ONE = "You've completed one task; return to a Slayer master.";
|
||||
private static final String TASK_COMPLETE_NO_POINTS = "<col=ef1020>You've completed 3 tasks; return to a Slayer master.</col>";
|
||||
private static final String TASK_POINTS = "You've completed 9 tasks and received 0 points, giving you a total of 18,000; return to a Slayer master.";
|
||||
|
||||
private static final String TASK_COMPLETE = "You need something new to hunt.";
|
||||
private static final String TASK_CANCELED = "Your task has been cancelled.";
|
||||
|
||||
@Mock
|
||||
@Bind
|
||||
Client client;
|
||||
|
||||
@Mock
|
||||
@Bind
|
||||
SlayerConfig slayerConfig;
|
||||
|
||||
@Mock
|
||||
@Bind
|
||||
SlayerOverlay overlay;
|
||||
|
||||
@Mock
|
||||
@Bind
|
||||
InfoBoxManager infoBoxManager;
|
||||
|
||||
@Mock
|
||||
@Bind
|
||||
ItemManager itemManager;
|
||||
|
||||
@Inject
|
||||
Slayer slayerPlugin;
|
||||
|
||||
@Before
|
||||
public void before()
|
||||
{
|
||||
Guice.createInjector(BoundFieldModule.of(this)).injectMembers(this);
|
||||
when(slayerConfig.enabled()).thenReturn(true);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testOneTask()
|
||||
{
|
||||
ChatMessage chatMessageEvent = new ChatMessage(SERVER, "Perterter", TASK_ONE, null);
|
||||
slayerPlugin.onChatMessage(chatMessageEvent);
|
||||
|
||||
assertEquals(1, slayerPlugin.getStreak());
|
||||
assertEquals("", slayerPlugin.getTaskName());
|
||||
assertEquals(0, slayerPlugin.getAmount());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testNoPoints()
|
||||
{
|
||||
ChatMessage chatMessageEvent = new ChatMessage(SERVER, "Perterter", TASK_COMPLETE_NO_POINTS, null);
|
||||
slayerPlugin.onChatMessage(chatMessageEvent);
|
||||
|
||||
assertEquals(3, slayerPlugin.getStreak());
|
||||
assertEquals("", slayerPlugin.getTaskName());
|
||||
assertEquals(0, slayerPlugin.getAmount());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testPoints()
|
||||
{
|
||||
ChatMessage chatMessageEvent = new ChatMessage(SERVER, "Perterter", TASK_POINTS, null);
|
||||
slayerPlugin.onChatMessage(chatMessageEvent);
|
||||
|
||||
assertEquals(9, slayerPlugin.getStreak());
|
||||
assertEquals("", slayerPlugin.getTaskName());
|
||||
assertEquals(0, slayerPlugin.getAmount());
|
||||
assertEquals(18_000, slayerPlugin.getPoints());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testComplete()
|
||||
{
|
||||
slayerPlugin.setTaskName("cows");
|
||||
slayerPlugin.setAmount(42);
|
||||
|
||||
ChatMessage chatMessageEvent = new ChatMessage(SERVER, "Perterter", TASK_COMPLETE, null);
|
||||
slayerPlugin.onChatMessage(chatMessageEvent);
|
||||
|
||||
assertEquals("", slayerPlugin.getTaskName());
|
||||
assertEquals(0, slayerPlugin.getAmount());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testCancelled()
|
||||
{
|
||||
slayerPlugin.setTaskName("cows");
|
||||
slayerPlugin.setAmount(42);
|
||||
|
||||
ChatMessage chatMessageEvent = new ChatMessage(SERVER, "Perterter", TASK_CANCELED, null);
|
||||
slayerPlugin.onChatMessage(chatMessageEvent);
|
||||
|
||||
assertEquals("", slayerPlugin.getTaskName());
|
||||
assertEquals(0, slayerPlugin.getAmount());
|
||||
}
|
||||
}
|
||||
/*
|
||||
* Copyright (c) 2017, Adam <Adam@sigterm.info>
|
||||
* 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.slayer;
|
||||
|
||||
import com.google.inject.Guice;
|
||||
import com.google.inject.testing.fieldbinder.Bind;
|
||||
import com.google.inject.testing.fieldbinder.BoundFieldModule;
|
||||
import javax.inject.Inject;
|
||||
import static net.runelite.api.ChatMessageType.SERVER;
|
||||
import net.runelite.api.Client;
|
||||
import net.runelite.client.events.ChatMessage;
|
||||
import net.runelite.client.game.ItemManager;
|
||||
import net.runelite.client.ui.overlay.infobox.InfoBoxManager;
|
||||
import static org.junit.Assert.assertEquals;
|
||||
import org.junit.Before;
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
import org.mockito.Mock;
|
||||
import static org.mockito.Mockito.when;
|
||||
import org.mockito.runners.MockitoJUnitRunner;
|
||||
|
||||
@RunWith(MockitoJUnitRunner.class)
|
||||
public class SlayerPluginTest
|
||||
{
|
||||
private static final String TASK_ONE = "You've completed one task; return to a Slayer master.";
|
||||
private static final String TASK_COMPLETE_NO_POINTS = "<col=ef1020>You've completed 3 tasks; return to a Slayer master.</col>";
|
||||
private static final String TASK_POINTS = "You've completed 9 tasks and received 0 points, giving you a total of 18,000; return to a Slayer master.";
|
||||
|
||||
private static final String TASK_COMPLETE = "You need something new to hunt.";
|
||||
private static final String TASK_CANCELED = "Your task has been cancelled.";
|
||||
|
||||
@Mock
|
||||
@Bind
|
||||
Client client;
|
||||
|
||||
@Mock
|
||||
@Bind
|
||||
SlayerConfig slayerConfig;
|
||||
|
||||
@Mock
|
||||
@Bind
|
||||
SlayerOverlay overlay;
|
||||
|
||||
@Mock
|
||||
@Bind
|
||||
InfoBoxManager infoBoxManager;
|
||||
|
||||
@Mock
|
||||
@Bind
|
||||
ItemManager itemManager;
|
||||
|
||||
@Inject
|
||||
SlayerPlugin slayerPlugin;
|
||||
|
||||
@Before
|
||||
public void before()
|
||||
{
|
||||
Guice.createInjector(BoundFieldModule.of(this)).injectMembers(this);
|
||||
when(slayerConfig.enabled()).thenReturn(true);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testOneTask()
|
||||
{
|
||||
ChatMessage chatMessageEvent = new ChatMessage(SERVER, "Perterter", TASK_ONE, null);
|
||||
slayerPlugin.onChatMessage(chatMessageEvent);
|
||||
|
||||
assertEquals(1, slayerPlugin.getStreak());
|
||||
assertEquals("", slayerPlugin.getTaskName());
|
||||
assertEquals(0, slayerPlugin.getAmount());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testNoPoints()
|
||||
{
|
||||
ChatMessage chatMessageEvent = new ChatMessage(SERVER, "Perterter", TASK_COMPLETE_NO_POINTS, null);
|
||||
slayerPlugin.onChatMessage(chatMessageEvent);
|
||||
|
||||
assertEquals(3, slayerPlugin.getStreak());
|
||||
assertEquals("", slayerPlugin.getTaskName());
|
||||
assertEquals(0, slayerPlugin.getAmount());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testPoints()
|
||||
{
|
||||
ChatMessage chatMessageEvent = new ChatMessage(SERVER, "Perterter", TASK_POINTS, null);
|
||||
slayerPlugin.onChatMessage(chatMessageEvent);
|
||||
|
||||
assertEquals(9, slayerPlugin.getStreak());
|
||||
assertEquals("", slayerPlugin.getTaskName());
|
||||
assertEquals(0, slayerPlugin.getAmount());
|
||||
assertEquals(18_000, slayerPlugin.getPoints());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testComplete()
|
||||
{
|
||||
slayerPlugin.setTaskName("cows");
|
||||
slayerPlugin.setAmount(42);
|
||||
|
||||
ChatMessage chatMessageEvent = new ChatMessage(SERVER, "Perterter", TASK_COMPLETE, null);
|
||||
slayerPlugin.onChatMessage(chatMessageEvent);
|
||||
|
||||
assertEquals("", slayerPlugin.getTaskName());
|
||||
assertEquals(0, slayerPlugin.getAmount());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testCancelled()
|
||||
{
|
||||
slayerPlugin.setTaskName("cows");
|
||||
slayerPlugin.setAmount(42);
|
||||
|
||||
ChatMessage chatMessageEvent = new ChatMessage(SERVER, "Perterter", TASK_CANCELED, null);
|
||||
slayerPlugin.onChatMessage(chatMessageEvent);
|
||||
|
||||
assertEquals("", slayerPlugin.getTaskName());
|
||||
assertEquals(0, slayerPlugin.getAmount());
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user