Merge remote-tracking branch 'upstream/master' into master
This commit is contained in:
@@ -169,6 +169,7 @@ public enum AgilityShortcut
|
||||
SLAYER_DUNGEON_CREVICE(62, "Narrow Crevice", new WorldPoint(2729, 10008, 0), CREVICE_16539),
|
||||
MOUNT_KARUULM_UPPER(62, "Rocks", new WorldPoint(1322, 3791, 0), ROCKS_34396),
|
||||
TAVERLEY_DUNGEON_RAILING(63, "Loose Railing", new WorldPoint(2935, 9811, 0), LOOSE_RAILING_28849),
|
||||
DARKMEYER_WALL(63, "Wall (Long rope)", new WorldPoint(3669, 3375, 0), NULL_39541, NULL_39542),
|
||||
TROLLHEIM_WILDERNESS_ROCKS_EAST(64, "Rocks", new WorldPoint(2945, 3678, 0), ROCKS_16545),
|
||||
TROLLHEIM_WILDERNESS_ROCKS_WEST(64, "Rocks", new WorldPoint(2917, 3672, 0), ROCKS_16545),
|
||||
FOSSIL_ISLAND_VOLCANO(64, "Rope", new WorldPoint(3780, 3822, 0), ROPE_ANCHOR, ROPE_ANCHOR_30917),
|
||||
|
||||
@@ -28,12 +28,44 @@ package net.runelite.client.plugins.chatnotifications;
|
||||
import net.runelite.client.config.Config;
|
||||
import net.runelite.client.config.ConfigGroup;
|
||||
import net.runelite.client.config.ConfigItem;
|
||||
import net.runelite.client.config.ConfigSection;
|
||||
|
||||
@ConfigGroup("chatnotification")
|
||||
public interface ChatNotificationsConfig extends Config
|
||||
{
|
||||
@ConfigSection(
|
||||
name = "Highlight Lists",
|
||||
description = "Custom single word and regex filter lists",
|
||||
position = 0
|
||||
)
|
||||
String highlightLists = "highlightLists";
|
||||
|
||||
@ConfigItem(
|
||||
position = 0,
|
||||
position = 1,
|
||||
keyName = "highlightWordsString",
|
||||
name = "Highlight words",
|
||||
description = "Highlights the following words in chat",
|
||||
section = highlightLists
|
||||
)
|
||||
default String highlightWordsString()
|
||||
{
|
||||
return "";
|
||||
}
|
||||
|
||||
@ConfigItem(
|
||||
position = 2,
|
||||
keyName = "highlightRegexString",
|
||||
name = "Highlight Regex",
|
||||
description = "Highlights the following regular expressions in chat, one per line",
|
||||
section = highlightLists
|
||||
)
|
||||
default String highlightRegexString()
|
||||
{
|
||||
return "";
|
||||
}
|
||||
|
||||
@ConfigItem(
|
||||
position = 1,
|
||||
keyName = "highlightOwnName",
|
||||
name = "Highlight own name",
|
||||
description = "Highlights any instance of your username in chat"
|
||||
@@ -43,17 +75,6 @@ public interface ChatNotificationsConfig extends Config
|
||||
return true;
|
||||
}
|
||||
|
||||
@ConfigItem(
|
||||
position = 1,
|
||||
keyName = "highlightWordsString",
|
||||
name = "Highlight words",
|
||||
description = "Highlights the following words in chat"
|
||||
)
|
||||
default String highlightWordsString()
|
||||
{
|
||||
return "";
|
||||
}
|
||||
|
||||
@ConfigItem(
|
||||
position = 2,
|
||||
keyName = "notifyOnOwnName",
|
||||
|
||||
@@ -27,12 +27,16 @@ package net.runelite.client.plugins.chatnotifications;
|
||||
|
||||
import com.google.common.annotations.VisibleForTesting;
|
||||
import com.google.common.base.MoreObjects;
|
||||
import com.google.common.base.Splitter;
|
||||
import com.google.common.base.Strings;
|
||||
import com.google.inject.Provides;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
import java.util.regex.Matcher;
|
||||
import java.util.regex.Pattern;
|
||||
import java.util.regex.PatternSyntaxException;
|
||||
import java.util.stream.Collectors;
|
||||
import javax.inject.Inject;
|
||||
import javax.inject.Named;
|
||||
@@ -77,7 +81,7 @@ public class ChatNotificationsPlugin extends Plugin
|
||||
|
||||
//Custom Highlights
|
||||
private Pattern usernameMatcher = null;
|
||||
private Pattern highlightMatcher = null;
|
||||
private final List<Pattern> highlightPatterns = new ArrayList<>();
|
||||
|
||||
@Provides
|
||||
ChatNotificationsConfig provideConfig(ConfigManager configManager)
|
||||
@@ -91,6 +95,13 @@ public class ChatNotificationsPlugin extends Plugin
|
||||
updateHighlights();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void shutDown()
|
||||
{
|
||||
usernameMatcher = null;
|
||||
highlightPatterns.clear();
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
public void onGameStateChanged(GameStateChanged event)
|
||||
{
|
||||
@@ -114,7 +125,7 @@ public class ChatNotificationsPlugin extends Plugin
|
||||
|
||||
private void updateHighlights()
|
||||
{
|
||||
highlightMatcher = null;
|
||||
highlightPatterns.clear();
|
||||
|
||||
if (!config.highlightWordsString().trim().equals(""))
|
||||
{
|
||||
@@ -125,7 +136,28 @@ public class ChatNotificationsPlugin extends Plugin
|
||||
.collect(Collectors.joining("|"));
|
||||
// To match <word> \b doesn't work due to <> not being in \w,
|
||||
// so match \b or \s, as well as \A and \z for beginning and end of input respectively
|
||||
highlightMatcher = Pattern.compile("(?:\\b|(?<=\\s)|\\A)(?:" + joined + ")(?:\\b|(?=\\s)|\\z)", Pattern.CASE_INSENSITIVE);
|
||||
highlightPatterns.add(Pattern.compile("(?:\\b|(?<=\\s)|\\A)(?:" + joined + ")(?:\\b|(?=\\s)|\\z)", Pattern.CASE_INSENSITIVE));
|
||||
}
|
||||
|
||||
Splitter
|
||||
.on("\n")
|
||||
.omitEmptyStrings()
|
||||
.trimResults()
|
||||
.splitToList(config.highlightRegexString()).stream()
|
||||
.map(ChatNotificationsPlugin::compilePattern)
|
||||
.filter(Objects::nonNull)
|
||||
.forEach(highlightPatterns::add);
|
||||
}
|
||||
|
||||
private static Pattern compilePattern(String pattern)
|
||||
{
|
||||
try
|
||||
{
|
||||
return Pattern.compile(pattern, Pattern.CASE_INSENSITIVE);
|
||||
}
|
||||
catch (PatternSyntaxException ex)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -225,14 +257,22 @@ public class ChatNotificationsPlugin extends Plugin
|
||||
}
|
||||
}
|
||||
|
||||
if (highlightMatcher != null)
|
||||
boolean matchesHighlight = false;
|
||||
// Get nodeValue to store and update in between the different pattern passes
|
||||
// The messageNode value is only set after all patterns have been processed
|
||||
String nodeValue = messageNode.getValue();
|
||||
|
||||
for (Pattern pattern : highlightPatterns)
|
||||
{
|
||||
String nodeValue = messageNode.getValue();
|
||||
Matcher matcher = highlightMatcher.matcher(nodeValue);
|
||||
boolean found = false;
|
||||
Matcher matcher = pattern.matcher(nodeValue);
|
||||
if (!matcher.find())
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
StringBuffer stringBuffer = new StringBuffer();
|
||||
|
||||
while (matcher.find())
|
||||
do
|
||||
{
|
||||
String value = matcher.group();
|
||||
|
||||
@@ -256,18 +296,21 @@ public class ChatNotificationsPlugin extends Plugin
|
||||
stringBuffer.append(endColor == null ? "<col" + ChatColorType.NORMAL + ">" : endColor);
|
||||
|
||||
update = true;
|
||||
found = true;
|
||||
matchesHighlight = true;
|
||||
}
|
||||
while (matcher.find());
|
||||
|
||||
if (found)
|
||||
// Append stringBuffer with remainder of message and update nodeValue
|
||||
matcher.appendTail(stringBuffer);
|
||||
nodeValue = stringBuffer.toString();
|
||||
}
|
||||
|
||||
if (matchesHighlight)
|
||||
{
|
||||
messageNode.setValue(nodeValue);
|
||||
if (config.notifyOnHighlight())
|
||||
{
|
||||
matcher.appendTail(stringBuffer);
|
||||
messageNode.setValue(stringBuffer.toString());
|
||||
|
||||
if (config.notifyOnHighlight())
|
||||
{
|
||||
sendNotification(chatMessage);
|
||||
}
|
||||
sendNotification(chatMessage);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -288,7 +331,7 @@ public class ChatNotificationsPlugin extends Plugin
|
||||
{
|
||||
stringBuilder.append('[').append(sender).append("] ");
|
||||
}
|
||||
|
||||
|
||||
if (!Strings.isNullOrEmpty(name))
|
||||
{
|
||||
stringBuilder.append(name).append(": ");
|
||||
|
||||
@@ -237,6 +237,7 @@ enum DiscordGameEventType
|
||||
DUNGEON_OURANIA("Ourania Cave", DiscordAreaType.DUNGEONS, 12119),
|
||||
DUNGEON_QUIDAMORTEM_CAVE("Quidamortem Cave", DiscordAreaType.DUNGEONS, 4763),
|
||||
DUNGEON_RASHILIYIAS_TOMB("Rashiliyta's Tomb", DiscordAreaType.DUNGEONS, 11668),
|
||||
DUNGEON_SALT_MINE("Salt Mine", DiscordAreaType.DUNGEONS, 11425),
|
||||
DUNGEON_SARADOMINSHRINE("Saradomin Shrine (Paterdomus)", DiscordAreaType.DUNGEONS, 13722),
|
||||
DUNGEON_SHADE_CATACOMBS("Shade Catacombs", DiscordAreaType.DUNGEONS, 13975),
|
||||
DUNGEON_SHADOW("Shadow Dungeon", DiscordAreaType.DUNGEONS, 10575, 10831),
|
||||
@@ -294,7 +295,7 @@ enum DiscordGameEventType
|
||||
MG_PEST_CONTROL("Pest Control", DiscordAreaType.MINIGAMES, 10536),
|
||||
MG_PORT_SARIM_RAT_PITS("Port Sarim Rat Pits", DiscordAreaType.MINIGAMES, 11926),
|
||||
MG_PYRAMID_PLUNDER("Pyramid Plunder", DiscordAreaType.MINIGAMES, 7749),
|
||||
MG_ROGUES_DEN("Rogues' Den", DiscordAreaType.MINIGAMES, 11855, 11854, 12111, 12110),
|
||||
MG_ROGUES_DEN("Rogues' Den", DiscordAreaType.MINIGAMES, 11854, 11855, 12109, 12110, 12111),
|
||||
MG_SORCERESS_GARDEN("Sorceress's Garden", DiscordAreaType.MINIGAMES, 11605),
|
||||
MG_SOUL_WARS("Soul Wars", DiscordAreaType.MINIGAMES, 8493, 8748, 8749, 9005),
|
||||
MG_TEMPLE_TREKKING("Temple Trekking", DiscordAreaType.MINIGAMES, 8014, 8270, 8256, 8782, 9038, 9294, 9550, 9806),
|
||||
@@ -424,6 +425,7 @@ enum DiscordGameEventType
|
||||
REGION_TROLLWEISS_MTN("Trollweiss Mountain", DiscordAreaType.REGIONS, 11066, 11067, 11068),
|
||||
REGION_UNDERWATER("Underwater", DiscordAreaType.REGIONS, 15008, 15264),
|
||||
REGION_WATER_ALTAR("Water Altar", DiscordAreaType.REGIONS, 10827),
|
||||
REGION_WATERBIRTH_ISLAND("Waterbirth Island", DiscordAreaType.REGIONS, 10042),
|
||||
REGION_WINTERTODT_CAMP("Wintertodt Camp", DiscordAreaType.REGIONS, 6461),
|
||||
REGION_WIZARDS_TOWER("Wizards' Tower", DiscordAreaType.REGIONS, 12337),
|
||||
REGION_WOODCUTTING_GUILD("Woodcutting Guild", DiscordAreaType.REGIONS, 6198, 6454),
|
||||
|
||||
@@ -51,8 +51,8 @@ class GrandExchangeItemPanel extends JPanel
|
||||
{
|
||||
private static final Dimension ICON_SIZE = new Dimension(32, 32);
|
||||
|
||||
GrandExchangeItemPanel(AsyncBufferedImage icon, String name, int itemID, int gePrice, Double
|
||||
haPrice, int geItemLimit)
|
||||
GrandExchangeItemPanel(GrandExchangePlugin grandExchangePlugin, AsyncBufferedImage icon, String name, int itemID,
|
||||
int gePrice, int haPrice, int geItemLimit)
|
||||
{
|
||||
BorderLayout layout = new BorderLayout();
|
||||
layout.setHgap(5);
|
||||
@@ -89,7 +89,7 @@ class GrandExchangeItemPanel extends JPanel
|
||||
@Override
|
||||
public void mouseReleased(MouseEvent e)
|
||||
{
|
||||
GrandExchangePlugin.openGeLink(name, itemID);
|
||||
grandExchangePlugin.openGeLink(name, itemID);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -138,7 +138,7 @@ class GrandExchangeItemPanel extends JPanel
|
||||
|
||||
// Alch price
|
||||
JLabel haPriceLabel = new JLabel();
|
||||
haPriceLabel.setText(QuantityFormatter.formatNumber(haPrice.intValue()) + " alch");
|
||||
haPriceLabel.setText(QuantityFormatter.formatNumber(haPrice) + " alch");
|
||||
haPriceLabel.setForeground(ColorScheme.GRAND_EXCHANGE_ALCH);
|
||||
alchAndLimitPanel.add(haPriceLabel, BorderLayout.WEST);
|
||||
|
||||
|
||||
@@ -34,6 +34,6 @@ class GrandExchangeItems
|
||||
private final String name;
|
||||
private final int itemId;
|
||||
private final int gePrice;
|
||||
private final double haPrice;
|
||||
private final int haPrice;
|
||||
private final int geItemLimit;
|
||||
}
|
||||
|
||||
@@ -66,6 +66,8 @@ public class GrandExchangeOfferSlot extends JPanel
|
||||
private static final ImageIcon RIGHT_ARROW_ICON;
|
||||
private static final ImageIcon LEFT_ARROW_ICON;
|
||||
|
||||
private final GrandExchangePlugin grandExchangePlugin;
|
||||
|
||||
private final JPanel container = new JPanel();
|
||||
private final CardLayout cardLayout = new CardLayout();
|
||||
|
||||
@@ -91,8 +93,10 @@ public class GrandExchangeOfferSlot extends JPanel
|
||||
* This (sub)panel is used for each GE slot displayed
|
||||
* in the sidebar
|
||||
*/
|
||||
GrandExchangeOfferSlot()
|
||||
GrandExchangeOfferSlot(GrandExchangePlugin grandExchangePlugin)
|
||||
{
|
||||
this.grandExchangePlugin = grandExchangePlugin;
|
||||
|
||||
setLayout(new BorderLayout());
|
||||
setBackground(ColorScheme.DARK_GRAY_COLOR);
|
||||
setBorder(new EmptyBorder(7, 0, 0, 0));
|
||||
@@ -235,7 +239,7 @@ public class GrandExchangeOfferSlot extends JPanel
|
||||
popupMenu.setBorder(new EmptyBorder(5, 5, 5, 5));
|
||||
|
||||
final JMenuItem openGeLink = new JMenuItem("Open Grand Exchange website");
|
||||
openGeLink.addActionListener(e -> GrandExchangePlugin.openGeLink(offerItem.getName(), offerItem.getId()));
|
||||
openGeLink.addActionListener(e -> grandExchangePlugin.openGeLink(offerItem.getName(), offerItem.getId()));
|
||||
popupMenu.add(openGeLink);
|
||||
|
||||
/* Couldn't set the tooltip for the container panel as the children override it, so I'm setting
|
||||
@@ -252,7 +256,6 @@ public class GrandExchangeOfferSlot extends JPanel
|
||||
}
|
||||
|
||||
revalidate();
|
||||
repaint();
|
||||
}
|
||||
|
||||
private String htmlTooltip(String value)
|
||||
|
||||
@@ -30,6 +30,8 @@ import java.awt.CardLayout;
|
||||
import java.awt.GridBagConstraints;
|
||||
import java.awt.GridBagLayout;
|
||||
import java.awt.image.BufferedImage;
|
||||
import java.util.Arrays;
|
||||
import javax.inject.Inject;
|
||||
import javax.swing.JPanel;
|
||||
import javax.swing.border.EmptyBorder;
|
||||
import net.runelite.api.GrandExchangeOffer;
|
||||
@@ -45,6 +47,8 @@ class GrandExchangeOffersPanel extends JPanel
|
||||
|
||||
private static final int MAX_OFFERS = 8;
|
||||
|
||||
private final GrandExchangePlugin grandExchangePlugin;
|
||||
|
||||
private final GridBagConstraints constraints = new GridBagConstraints();
|
||||
private final CardLayout cardLayout = new CardLayout();
|
||||
|
||||
@@ -56,8 +60,11 @@ class GrandExchangeOffersPanel extends JPanel
|
||||
|
||||
private final GrandExchangeOfferSlot[] offerSlotPanels = new GrandExchangeOfferSlot[MAX_OFFERS];
|
||||
|
||||
GrandExchangeOffersPanel()
|
||||
@Inject
|
||||
private GrandExchangeOffersPanel(final GrandExchangePlugin grandExchangePlugin)
|
||||
{
|
||||
this.grandExchangePlugin = grandExchangePlugin;
|
||||
|
||||
setLayout(new BorderLayout());
|
||||
setBackground(ColorScheme.DARK_GRAY_COLOR);
|
||||
|
||||
@@ -96,10 +103,7 @@ class GrandExchangeOffersPanel extends JPanel
|
||||
void resetOffers()
|
||||
{
|
||||
offerPanel.removeAll();
|
||||
for (int i = 0; i < offerSlotPanels.length; i++)
|
||||
{
|
||||
offerSlotPanels[i] = null;
|
||||
}
|
||||
Arrays.fill(offerSlotPanels, null);
|
||||
updateEmptyOffersPanel();
|
||||
}
|
||||
|
||||
@@ -122,15 +126,16 @@ class GrandExchangeOffersPanel extends JPanel
|
||||
}
|
||||
|
||||
/* If slot was empty, and is now filled, add it to the list */
|
||||
if (offerSlotPanels[slot] == null)
|
||||
GrandExchangeOfferSlot offerSlot = offerSlotPanels[slot];
|
||||
if (offerSlot == null)
|
||||
{
|
||||
GrandExchangeOfferSlot newSlot = new GrandExchangeOfferSlot();
|
||||
offerSlotPanels[slot] = newSlot;
|
||||
offerPanel.add(newSlot, constraints);
|
||||
offerSlot = new GrandExchangeOfferSlot(grandExchangePlugin);
|
||||
offerSlotPanels[slot] = offerSlot;
|
||||
offerPanel.add(offerSlot, constraints);
|
||||
constraints.gridy++;
|
||||
}
|
||||
|
||||
offerSlotPanels[slot].updateOffer(item, itemImage, newOffer);
|
||||
offerSlot.updateOffer(item, itemImage, newOffer);
|
||||
|
||||
removeTopMargin();
|
||||
|
||||
|
||||
@@ -48,21 +48,19 @@ class GrandExchangePanel extends PluginPanel
|
||||
@Getter
|
||||
private final GrandExchangeSearchPanel searchPanel;
|
||||
@Getter
|
||||
private GrandExchangeOffersPanel offersPanel;
|
||||
private final GrandExchangeOffersPanel offersPanel;
|
||||
|
||||
@Inject
|
||||
private GrandExchangePanel(GrandExchangeSearchPanel searchPanel)
|
||||
private GrandExchangePanel(GrandExchangeSearchPanel searchPanel, GrandExchangeOffersPanel offersPanel)
|
||||
{
|
||||
super(false);
|
||||
|
||||
this.searchPanel = searchPanel;
|
||||
this.offersPanel = offersPanel;
|
||||
|
||||
setLayout(new BorderLayout());
|
||||
setBackground(ColorScheme.DARK_GRAY_COLOR);
|
||||
|
||||
//Offers Panel
|
||||
offersPanel = new GrandExchangeOffersPanel();
|
||||
|
||||
MaterialTab offersTab = new MaterialTab("Offers", tabGroup, offersPanel);
|
||||
searchTab = new MaterialTab("Search", tabGroup, searchPanel);
|
||||
|
||||
|
||||
@@ -82,6 +82,7 @@ import net.runelite.client.Notifier;
|
||||
import net.runelite.client.account.AccountSession;
|
||||
import net.runelite.client.account.SessionManager;
|
||||
import net.runelite.client.config.ConfigManager;
|
||||
import net.runelite.client.config.RuneLiteConfig;
|
||||
import net.runelite.client.eventbus.Subscribe;
|
||||
import net.runelite.client.events.ConfigChanged;
|
||||
import net.runelite.client.events.SessionClose;
|
||||
@@ -178,6 +179,9 @@ public class GrandExchangePlugin extends Plugin
|
||||
@Inject
|
||||
private Gson gson;
|
||||
|
||||
@Inject
|
||||
private RuneLiteConfig runeLiteConfig;
|
||||
|
||||
private Widget grandExchangeText;
|
||||
private Widget grandExchangeItem;
|
||||
private String grandExchangeExamine;
|
||||
@@ -877,12 +881,14 @@ public class GrandExchangePlugin extends Plugin
|
||||
geText.setText(text);
|
||||
}
|
||||
|
||||
static void openGeLink(String name, int itemId)
|
||||
void openGeLink(String name, int itemId)
|
||||
{
|
||||
final String url = "https://services.runescape.com/m=itemdb_oldschool/"
|
||||
+ name.replaceAll(" ", "+")
|
||||
+ "/viewitem?obj="
|
||||
+ itemId;
|
||||
final String url = runeLiteConfig.useWikiItemPrices() ?
|
||||
"https://prices.runescape.wiki/osrs/item/" + itemId :
|
||||
"https://services.runescape.com/m=itemdb_oldschool/"
|
||||
+ name.replaceAll(" ", "+")
|
||||
+ "/viewitem?obj="
|
||||
+ itemId;
|
||||
LinkBrowser.browse(url);
|
||||
}
|
||||
|
||||
|
||||
@@ -67,6 +67,7 @@ class GrandExchangeSearchPanel extends JPanel
|
||||
private final ItemManager itemManager;
|
||||
private final ScheduledExecutorService executor;
|
||||
private final RuneLiteConfig runeLiteConfig;
|
||||
private final GrandExchangePlugin grandExchangePlugin;
|
||||
|
||||
private final IconTextField searchBar = new IconTextField();
|
||||
|
||||
@@ -83,12 +84,13 @@ class GrandExchangeSearchPanel extends JPanel
|
||||
|
||||
@Inject
|
||||
private GrandExchangeSearchPanel(ClientThread clientThread, ItemManager itemManager,
|
||||
ScheduledExecutorService executor, RuneLiteConfig runeLiteConfig)
|
||||
ScheduledExecutorService executor, RuneLiteConfig runeLiteConfig, GrandExchangePlugin grandExchangePlugin)
|
||||
{
|
||||
this.clientThread = clientThread;
|
||||
this.itemManager = itemManager;
|
||||
this.executor = executor;
|
||||
this.runeLiteConfig = runeLiteConfig;
|
||||
this.grandExchangePlugin = grandExchangePlugin;
|
||||
|
||||
setLayout(new BorderLayout());
|
||||
setBackground(ColorScheme.DARK_GRAY_COLOR);
|
||||
@@ -215,9 +217,10 @@ class GrandExchangeSearchPanel extends JPanel
|
||||
|
||||
int itemPrice = useActivelyTradedPrice && item.getWikiPrice() > 0 ? item.getWikiPrice() : item.getPrice();
|
||||
int itemLimit = itemStats != null ? itemStats.getGeLimit() : 0;
|
||||
final int haPrice = itemComp.getHaPrice();
|
||||
AsyncBufferedImage itemImage = itemManager.getImage(itemId);
|
||||
|
||||
itemsList.add(new GrandExchangeItems(itemImage, item.getName(), itemId, itemPrice, itemComp.getPrice() * 0.6, itemLimit));
|
||||
itemsList.add(new GrandExchangeItems(itemImage, item.getName(), itemId, itemPrice, haPrice, itemLimit));
|
||||
|
||||
// If using hotkey to lookup item, stop after finding match.
|
||||
if (exactMatch && item.getName().equalsIgnoreCase(lookup))
|
||||
@@ -231,7 +234,7 @@ class GrandExchangeSearchPanel extends JPanel
|
||||
int index = 0;
|
||||
for (GrandExchangeItems item : itemsList)
|
||||
{
|
||||
GrandExchangeItemPanel panel = new GrandExchangeItemPanel(item.getIcon(), item.getName(),
|
||||
GrandExchangeItemPanel panel = new GrandExchangeItemPanel(grandExchangePlugin, item.getIcon(), item.getName(),
|
||||
item.getItemId(), item.getGePrice(), item.getHaPrice(), item.getGeItemLimit());
|
||||
|
||||
/*
|
||||
|
||||
@@ -80,7 +80,7 @@ enum DungeonLocation
|
||||
FREMENNIK_SLAYER("Fremennik Slayer Dungeon", new WorldPoint(2796, 3615, 0)),
|
||||
GOBLIN_CAVE("Goblin Cave", new WorldPoint(2622, 3393, 0)),
|
||||
GOD_WARS("God Wars Dungeon", new WorldPoint(2917, 3747, 0)),
|
||||
GRAND_TREE("Grand Tree Tunnels", new WorldPoint(2464, 3496, 0)),
|
||||
GRAND_TREE("Grand Tree Tunnels", new WorldPoint(2462, 3496, 0)),
|
||||
GAUNTLET("The Gauntlet", new WorldPoint(3227, 6116, 0)),
|
||||
HAM_HIDEOUT("H.A.M. Hideout", new WorldPoint(3164, 3252, 0)),
|
||||
HEROES_GUILD("Heroes' Guild mine", new WorldPoint(2891, 3507, 0)),
|
||||
@@ -140,6 +140,7 @@ enum DungeonLocation
|
||||
RED_CHIN_HUNTING("Red chinchompa hunting ground", new WorldPoint(2525, 2894, 0)),
|
||||
REVENANT_CAVES_N("Revenant Caves", new WorldPoint(3124, 3832, 0)),
|
||||
REVENANT_CAVES_S("Revenant Caves", new WorldPoint(3074, 3655, 0)),
|
||||
REVENANT_CAVES_W("Revenant Caves", new WorldPoint(3065, 3740, 0)),
|
||||
RIVER_ELID("River Elid Dungeon", new WorldPoint(3370, 3132, 0)),
|
||||
RIVER_KELDA("River Kelda", new WorldPoint(2835, 10112, 0)),
|
||||
SALT_MINE("Salt Mine", new WorldPoint(2866, 3941, 0)),
|
||||
|
||||
@@ -199,6 +199,10 @@ enum RareTreeLocation
|
||||
// Feldip Hills
|
||||
new WorldPoint(2476, 2893, 0)),
|
||||
|
||||
BLISTERWOOD("Blisterwood tree", 62,
|
||||
// Darkmeyer
|
||||
new WorldPoint(3631, 3362, 0)),
|
||||
|
||||
SULLIUSCEP("Sulliuscep", 65,
|
||||
// Fossil Island
|
||||
new WorldPoint(3662, 3802, 0),
|
||||
|
||||
@@ -82,6 +82,8 @@ public class ChatNotificationsPluginTest
|
||||
public void before()
|
||||
{
|
||||
Guice.createInjector(BoundFieldModule.of(this)).injectMembers(this);
|
||||
when(config.highlightRegexString()).thenReturn("");
|
||||
when(config.highlightWordsString()).thenReturn("");
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -102,6 +104,42 @@ public class ChatNotificationsPluginTest
|
||||
verify(messageNode).setValue("<colHIGHLIGHT>Deathbeam<colNORMAL>, <colHIGHLIGHT>Deathbeam<colNORMAL> OSRS");
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testRegexMultiplePatternsMessage()
|
||||
{
|
||||
when(config.highlightRegexString()).thenReturn("brandie+\ntest");
|
||||
|
||||
MessageNode messageNode = mock(MessageNode.class);
|
||||
when(messageNode.getValue()).thenReturn("brandieeee testing");
|
||||
|
||||
ChatMessage chatMessage = new ChatMessage();
|
||||
chatMessage.setType(ChatMessageType.PUBLICCHAT);
|
||||
chatMessage.setMessageNode(messageNode);
|
||||
|
||||
chatNotificationsPlugin.startUp();
|
||||
chatNotificationsPlugin.onChatMessage(chatMessage);
|
||||
|
||||
verify(messageNode).setValue("<colHIGHLIGHT>brandieeee<colNORMAL> <colHIGHLIGHT>test<colNORMAL>ing");
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testRegexMultiplePatternsWithOnlyOneMatch()
|
||||
{
|
||||
when(config.highlightRegexString()).thenReturn("brandie+\nwillNotMatch");
|
||||
|
||||
MessageNode messageNode = mock(MessageNode.class);
|
||||
when(messageNode.getValue()).thenReturn("brandieeee testing");
|
||||
|
||||
ChatMessage chatMessage = new ChatMessage();
|
||||
chatMessage.setType(ChatMessageType.PUBLICCHAT);
|
||||
chatMessage.setMessageNode(messageNode);
|
||||
|
||||
chatNotificationsPlugin.startUp();
|
||||
chatNotificationsPlugin.onChatMessage(chatMessage);
|
||||
|
||||
verify(messageNode).setValue("<colHIGHLIGHT>brandieeee<colNORMAL> testing");
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testLtGt()
|
||||
{
|
||||
@@ -179,7 +217,7 @@ public class ChatNotificationsPluginTest
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testPreceedingColor()
|
||||
public void testPrecedingColor()
|
||||
{
|
||||
when(config.highlightWordsString()).thenReturn("you. It");
|
||||
|
||||
@@ -239,10 +277,10 @@ public class ChatNotificationsPluginTest
|
||||
public void highlightListTest()
|
||||
{
|
||||
when(config.highlightWordsString()).thenReturn("this,is, a , test, ");
|
||||
final List<String> higlights = Text.fromCSV(config.highlightWordsString());
|
||||
assertEquals(4, higlights.size());
|
||||
final List<String> highlights = Text.fromCSV(config.highlightWordsString());
|
||||
assertEquals(4, highlights.size());
|
||||
|
||||
final Iterator<String> iterator = higlights.iterator();
|
||||
final Iterator<String> iterator = highlights.iterator();
|
||||
assertEquals("this", iterator.next());
|
||||
assertEquals("is", iterator.next());
|
||||
assertEquals("a", iterator.next());
|
||||
|
||||
@@ -0,0 +1,2 @@
|
||||
package net.runelite.client.plugins.grandexchange;public class GrandExchangeOfferSlotTest {
|
||||
}
|
||||
Reference in New Issue
Block a user