Merge remote-tracking branch 'upstream/master'

This commit is contained in:
Owain van Brakel
2020-02-09 11:49:14 +01:00
131 changed files with 2703 additions and 1712 deletions

View File

@@ -45,6 +45,7 @@ public class RuneLiteProperties
private static final String TROUBLESHOOTING_LINK = "runelite.wiki.troubleshooting.link";
private static final String BUILDING_LINK = "runelite.wiki.building.link";
private static final String DNS_CHANGE_LINK = "runelite.dnschange.link";
private static final String IMGUR_CLIENT_ID = "runelite.imgur.client.id";
private static final Properties properties = new Properties();
@@ -137,4 +138,9 @@ public class RuneLiteProperties
String launcherVersion = properties.getProperty(LAUNCHER_VERSION_PROPERTY);
return launcherVersion.equals("-1") ? null : launcherVersion;
}
public static String getImgurClientId()
{
return properties.getProperty(IMGUR_CLIENT_ID);
}
}

View File

@@ -33,4 +33,5 @@ public class ConfigItemDescriptor
private final Class<?> type;
private final Range range;
private final Alpha alpha;
private final Units units;
}

View File

@@ -350,7 +350,8 @@ public class ConfigManager
m.getDeclaredAnnotation(ConfigItem.class),
m.getReturnType(),
m.getDeclaredAnnotation(Range.class),
m.getDeclaredAnnotation(Alpha.class)
m.getDeclaredAnnotation(Alpha.class),
m.getDeclaredAnnotation(Units.class)
))
.sorted((a, b) -> ComparisonChain.start()
.compare(a.getItem().position(), b.getItem().position())

View File

@@ -325,6 +325,7 @@ public interface OpenOSRSConfig extends Config
position = 19,
titleSection = "opacityTitle"
)
@Units(Units.PERCENT)
default int opacityPercentage()
{
return 100;

View File

@@ -52,6 +52,7 @@ public interface RuneLiteConfig extends Config
position = 2,
titleSection = "uiTitle"
)
@Units(Units.PIXELS)
default Dimension gameSize()
{
return Constants.GAME_FIXED_SIZE;
@@ -174,6 +175,7 @@ public interface RuneLiteConfig extends Config
position = 12,
titleSection = "miscTitle"
)
@Units(Units.PERCENT)
default int volume()
{
return 100;
@@ -332,6 +334,17 @@ public interface RuneLiteConfig extends Config
return true;
}
@ConfigItem(
keyName = "tooltipPosition",
name = "Tooltip Position",
description = "Configures whether to show the tooltip above or under the cursor",
position = 35
)
default TooltipPositionType tooltipPosition()
{
return TooltipPositionType.UNDER_CURSOR;
}
@ConfigItem(
keyName = "infoBoxVertical",
name = "Display infoboxes vertically",
@@ -358,11 +371,12 @@ public interface RuneLiteConfig extends Config
@ConfigItem(
keyName = "infoBoxSize",
name = "Infobox size (px)",
name = "Infobox size",
description = "Configures the size of each infobox in pixels",
position = 28,
titleSection = "infoboxTitle"
)
@Units(Units.PIXELS)
default int infoBoxSize()
{
return 35;

View File

@@ -1,5 +1,5 @@
/*
* Copyright (c) 2019, Alexsuperfly <https://github.com/Alexsuperfly>
* Copyright (c) 2020, Crypthead <https://github.com/Crypthead>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -22,23 +22,23 @@
* (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.screenshot;
package net.runelite.client.config;
import lombok.RequiredArgsConstructor;
import lombok.Getter;
@Getter
@RequiredArgsConstructor
public enum UploadStyle
public enum TooltipPositionType
{
NEITHER("Neither"),
IMGUR("Imgur"),
CLIPBOARD("Clipboard");
ABOVE_CURSOR("Above cursor"),
UNDER_CURSOR("Under cursor");
private final String name;
private final String type;
@Override
public String toString()
{
return name;
return type;
}
}
}

View File

@@ -0,0 +1,53 @@
/*
* Copyright (c) 2020, Hydrox6 <ikada@protonmail.ch>
* 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.config;
import java.lang.annotation.Documented;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
/**
* Used with ConfigItem, defines what units are shown to the side of the box.
*/
@Retention(RetentionPolicy.RUNTIME)
@Target(ElementType.METHOD)
@Documented
public @interface Units
{
String MILLISECONDS = "ms";
String MINUTES = " mins";
String PERCENT = "%";
String PIXELS = "px";
String POINTS = "pt";
String SECONDS = "s";
String TICKS = " ticks";
String LEVELS = " lvls";
String FPS = " fps";
String GP = " GP";
String value();
}

View File

@@ -214,7 +214,7 @@ public enum ItemMapping
BLACK_MASK, BLACK_MASK_I, BLACK_MASK_1, BLACK_MASK_1_I, BLACK_MASK_2, BLACK_MASK_2_I, BLACK_MASK_3, BLACK_MASK_3_I, BLACK_MASK_4, BLACK_MASK_4_I, BLACK_MASK_5,
BLACK_MASK_5_I, BLACK_MASK_6, BLACK_MASK_6_I, BLACK_MASK_7, BLACK_MASK_7_I, BLACK_MASK_8, BLACK_MASK_8_I, BLACK_MASK_9, BLACK_MASK_9_I, BLACK_MASK_10_I,
SLAYER_HELMET, SLAYER_HELMET_I, BLACK_SLAYER_HELMET, BLACK_SLAYER_HELMET_I, PURPLE_SLAYER_HELMET, PURPLE_SLAYER_HELMET_I, RED_SLAYER_HELMET, RED_SLAYER_HELMET_I,
GREEN_SLAYER_HELMET, GREEN_SLAYER_HELMET_I, TURQUOISE_SLAYER_HELMET, TURQUOISE_SLAYER_HELMET_I, HYDRA_SLAYER_HELMET, HYDRA_SLAYER_HELMET_I),
GREEN_SLAYER_HELMET, GREEN_SLAYER_HELMET_I, TURQUOISE_SLAYER_HELMET, TURQUOISE_SLAYER_HELMET_I, TWISTED_SLAYER_HELMET, TWISTED_SLAYER_HELMET_I, HYDRA_SLAYER_HELMET, HYDRA_SLAYER_HELMET_I),
// Pharaoh's Sceptres
ITEM_PHARAOHS_SCEPTRE_1(PHARAOHS_SCEPTRE, PHARAOHS_SCEPTRE_1),
@@ -232,6 +232,7 @@ public enum ItemMapping
ITEM_BOTTOMLESS_COMPOST_BUCKET(BOTTOMLESS_COMPOST_BUCKET, BOTTOMLESS_COMPOST_BUCKET_22997),
ITEM_BASILISK_JAW(BASILISK_JAW, NEITIZNOT_FACEGUARD),
ITEM_HELM_OF_NEITIZNOT(HELM_OF_NEITIZNOT, NEITIZNOT_FACEGUARD),
ITEM_TWISTED_HORNS(TWISTED_HORNS, TWISTED_SLAYER_HELMET, TWISTED_SLAYER_HELMET_I),
// Crystal items
ITEM_CRYSTAL_TOOL_SEED(CRYSTAL_TOOL_SEED, CRYSTAL_AXE, CRYSTAL_AXE_INACTIVE, CRYSTAL_HARPOON, CRYSTAL_HARPOON_INACTIVE, CRYSTAL_PICKAXE, CRYSTAL_PICKAXE_INACTIVE),

View File

@@ -87,4 +87,8 @@ public abstract class Plugin implements Module
{
subs.forEach(s -> s.subscribe(eventBus, this));
}
public void resetConfiguration()
{
}
}

View File

@@ -30,6 +30,7 @@ import net.runelite.client.config.ConfigGroup;
import net.runelite.client.config.ConfigItem;
import net.runelite.client.config.ConfigTitleSection;
import net.runelite.client.config.Title;
import net.runelite.client.config.Units;
@ConfigGroup("agility")
public interface AgilityConfig extends Config
@@ -91,6 +92,7 @@ public interface AgilityConfig extends Config
hidden = true,
unhide = "showLapCount"
)
@Units(Units.MINUTES)
default int lapTimeout()
{
return 5;

View File

@@ -32,6 +32,8 @@ import net.runelite.api.Client;
import net.runelite.api.GameState;
import net.runelite.api.events.FocusChanged;
import net.runelite.api.events.GameStateChanged;
import net.runelite.api.widgets.Widget;
import net.runelite.api.widgets.WidgetInfo;
import net.runelite.client.config.ConfigManager;
import net.runelite.client.config.Keybind;
import net.runelite.client.eventbus.Subscribe;
@@ -122,7 +124,9 @@ public class AntiDragPlugin extends Plugin
clientUI.setCursor(selectedCursor.getCursorImage(), selectedCursor.toString());
}
client.setInventoryDragDelay(config.dragDelay());
final int delay = config.dragDelay();
client.setInventoryDragDelay(delay);
setBankDragDelay(delay);
}
@Override
@@ -130,6 +134,8 @@ public class AntiDragPlugin extends Plugin
{
overlayManager.remove(overlay);
client.setInventoryDragDelay(DEFAULT_DELAY);
// In this case, 0 is the default for bank item widgets.
setBankDragDelay(0);
clientUI.resetCursor();
}
};
@@ -224,6 +230,7 @@ public class AntiDragPlugin extends Plugin
if (!focusChanged.isFocused() && config.reqFocus() && !config.alwaysOn())
{
client.setInventoryDragDelay(DEFAULT_DELAY);
setBankDragDelay(0);
overlayManager.remove(overlay);
}
}
@@ -248,4 +255,17 @@ public class AntiDragPlugin extends Plugin
keyManager.unregisterKeyListener(toggleListener);
}
}
private void setBankDragDelay(int delay)
{
final Widget bankItemContainer = client.getWidget(WidgetInfo.BANK_ITEM_CONTAINER);
if (bankItemContainer != null)
{
Widget[] items = bankItemContainer.getDynamicChildren();
for (Widget item : items)
{
item.setDragDeadTime(delay);
}
}
}
}

View File

@@ -37,6 +37,7 @@ import net.runelite.client.config.ConfigItem;
import net.runelite.client.config.ConfigTitleSection;
import net.runelite.client.config.Range;
import net.runelite.client.config.Title;
import net.runelite.client.config.Units;
@ConfigGroup("aoe")
public interface AoeWarningConfig extends Config
@@ -124,6 +125,7 @@ public interface AoeWarningConfig extends Config
titleSection = "overlayTitle",
position = 4
)
@Units(Units.MILLISECONDS)
default int delay()
{
return 300;

View File

@@ -30,6 +30,7 @@ package net.runelite.client.plugins.banktags;
import com.google.common.annotations.VisibleForTesting;
import com.google.common.collect.HashMultiset;
import com.google.common.collect.Multiset;
import com.google.common.collect.Lists;
import com.google.inject.Provides;
import java.awt.event.KeyEvent;
import java.awt.event.MouseWheelEvent;
@@ -100,6 +101,7 @@ public class BankTagsPlugin extends Plugin implements MouseWheelListener, KeyLis
public static final String CONFIG_GROUP = "banktags";
public static final String TAG_SEARCH = "tag:";
public static final String ICON_SEARCH = "icon_";
public static final String TAG_TABS_CONFIG = "tagtabs";
public static final String VAR_TAG_SUFFIX = "*";
private static final String EDIT_TAGS_MENU_OPTION = "Edit-tags";
private static final String NUMBER_REGEX = "[0-9]+(\\.[0-9]+)?[kmb]?";
@@ -162,6 +164,36 @@ public class BankTagsPlugin extends Plugin implements MouseWheelListener, KeyLis
return configManager.getConfig(BankTagsConfig.class);
}
@Override
public void resetConfiguration()
{
List<String> extraKeys = Lists.newArrayList(
CONFIG_GROUP + "." + TagManager.ITEM_KEY_PREFIX,
CONFIG_GROUP + "." + ICON_SEARCH,
CONFIG_GROUP + "." + TAG_TABS_CONFIG
);
for (String prefix : extraKeys)
{
List<String> keys = configManager.getConfigurationKeys(prefix);
for (String key : keys)
{
String[] str = key.split("\\.", 2);
if (str.length == 2)
{
configManager.unsetConfiguration(str[0], str[1]);
}
}
}
clientThread.invokeLater(() ->
{
tabInterface.destroy();
tabInterface.init();
});
}
@Override
public void startUp()
{
@@ -481,7 +513,7 @@ public class BankTagsPlugin extends Plugin implements MouseWheelListener, KeyLis
@Subscribe
private void onConfigChanged(ConfigChanged configChanged)
{
if (configChanged.getGroup().equals("banktags") && configChanged.getKey().equals("useTabs"))
if (configChanged.getGroup().equals(CONFIG_GROUP) && configChanged.getKey().equals("useTabs"))
{
if (config.tabs())
{

View File

@@ -50,7 +50,7 @@ import net.runelite.client.plugins.cluescrolls.clues.item.ItemRequirement;
@Singleton
public class TagManager
{
private static final String ITEM_KEY_PREFIX = "item_";
static final String ITEM_KEY_PREFIX = "item_";
private final ConfigManager configManager;
private final ItemManager itemManager;
private final ClueScrollService clueScrollService;

View File

@@ -40,13 +40,12 @@ import net.runelite.api.util.Text;
import net.runelite.client.config.ConfigManager;
import static net.runelite.client.plugins.banktags.BankTagsPlugin.CONFIG_GROUP;
import static net.runelite.client.plugins.banktags.BankTagsPlugin.ICON_SEARCH;
import static net.runelite.client.plugins.banktags.BankTagsPlugin.TAG_TABS_CONFIG;
import org.apache.commons.lang3.math.NumberUtils;
@Singleton
class TabManager
{
private static final String TAG_TABS_CONFIG = "tagtabs";
@Getter(AccessLevel.PACKAGE)
private final List<TagTab> tabs = new ArrayList<>();
private final ConfigManager configManager;

View File

@@ -27,6 +27,7 @@ package net.runelite.client.plugins.boosts;
import net.runelite.client.config.Config;
import net.runelite.client.config.ConfigGroup;
import net.runelite.client.config.ConfigItem;
import net.runelite.client.config.Units;
@ConfigGroup("boosts")
public interface BoostsConfig extends Config
@@ -129,6 +130,7 @@ public interface BoostsConfig extends Config
description = "The amount of levels boosted to send a notification at. A value of 0 will disable notification.",
position = 8
)
@Units(Units.LEVELS)
default int boostThreshold()
{
return 0;

View File

@@ -4,6 +4,7 @@ import java.awt.Color;
import net.runelite.client.config.Config;
import net.runelite.client.config.ConfigGroup;
import net.runelite.client.config.ConfigItem;
import net.runelite.client.config.Units;
@ConfigGroup("clanmanmode")
public interface ClanManModeConfig extends Config
@@ -135,6 +136,7 @@ public interface ClanManModeConfig extends Config
name = "Ticks to hide",
description = "How many ticks after you are logged in that attackbles are hidden (1 tick = 0.6 seconds)"
)
@Units(Units.TICKS)
default int hideTime()
{
return 5;

View File

@@ -1,6 +1,7 @@
/*
* Copyright (c) 2016-2017, Seth <Sethtroll3@gmail.com>
* Copyright (c) 2018, Lotto <https://github.com/devLotto>
* Copyright (c) 2019, David <https://github.com/drahenshaw>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -31,10 +32,14 @@ import java.awt.Dimension;
import java.awt.Graphics2D;
import javax.inject.Inject;
import javax.inject.Singleton;
import static net.runelite.api.ItemID.SPADE;
import net.runelite.api.Client;
import net.runelite.api.Item;
import static net.runelite.api.ItemID.*;
import static net.runelite.api.MenuOpcode.RUNELITE_OVERLAY_CONFIG;
import net.runelite.client.plugins.cluescrolls.clues.ClueScroll;
import net.runelite.client.plugins.cluescrolls.clues.item.AnyRequirementCollection;
import net.runelite.client.plugins.cluescrolls.clues.item.ItemRequirement;
import static net.runelite.client.plugins.cluescrolls.clues.item.ItemRequirements.item;
import net.runelite.client.plugins.cluescrolls.clues.item.SingleItemRequirement;
import net.runelite.client.ui.overlay.Overlay;
import static net.runelite.client.ui.overlay.OverlayManager.OPTION_CONFIGURE;
@@ -48,17 +53,42 @@ import net.runelite.client.ui.overlay.components.PanelComponent;
public class ClueScrollOverlay extends Overlay
{
private static final ItemRequirement HAS_SPADE = new SingleItemRequirement(SPADE);
private static final ItemRequirement HAS_LIGHT = new AnyRequirementCollection("Light Source",
item(LIT_TORCH),
item(LIT_CANDLE),
item(LIT_BLACK_CANDLE),
item(CANDLE_LANTERN_4531),
item(CANDLE_LANTERN_4534), // lit black candle lantern
item(OIL_LAMP_4524),
item(OIL_LANTERN_4539),
item(BULLSEYE_LANTERN_4550),
item(SAPPHIRE_LANTERN_4702),
item(EMERALD_LANTERN_9065),
item(MINING_HELMET),
item(FIREMAKING_CAPE),
item(FIREMAKING_CAPE_10659),
item(FIREMAKING_CAPET),
item(KANDARIN_HEADGEAR_1),
item(KANDARIN_HEADGEAR_2),
item(KANDARIN_HEADGEAR_3),
item(KANDARIN_HEADGEAR_4),
item(BRUMA_TORCH),
item(MAX_CAPE),
item(MAX_CAPE_13282),
item(MAX_CAPE_13342));
public static final Color TITLED_CONTENT_COLOR = new Color(190, 190, 190);
private final ClueScrollPlugin plugin;
private final PanelComponent panelComponent = new PanelComponent();
private final Client client;
@Inject
private ClueScrollOverlay(final ClueScrollPlugin plugin)
private ClueScrollOverlay(final ClueScrollPlugin plugin, final Client client)
{
super(plugin);
this.plugin = plugin;
this.client = client;
setPriority(OverlayPriority.LOW);
getMenuEntries().add(new OverlayMenuEntry(RUNELITE_OVERLAY_CONFIG, OPTION_CONFIGURE, "Clue Scroll overlay"));
}
@@ -76,12 +106,25 @@ public class ClueScrollOverlay extends Overlay
panelComponent.getChildren().clear();
panelComponent.setPreferredSize(new Dimension(ComponentConstants.STANDARD_WIDTH, 0));
clue.makeOverlayHint(panelComponent, plugin);
final Item[] inventoryItems = plugin.getInventoryItems();
final Item[] equippedItems = plugin.getEquippedItems();
if (clue.isRequiresSpade() && plugin.getInventoryItems() != null && !HAS_SPADE.fulfilledBy(plugin.getInventoryItems()))
if (clue.isRequiresSpade() && inventoryItems != null)
{
if (!HAS_SPADE.fulfilledBy(inventoryItems))
{
panelComponent.getChildren().add(LineComponent.builder().left("").build());
panelComponent.getChildren().add(LineComponent.builder().left("Requires Spade!").leftColor(Color.RED).build());
}
}
if (clue.isRequiresLight()
&& ((clue.getHasFirePit() == null || client.getVar(clue.getHasFirePit()) != 1)
&& (inventoryItems == null || !HAS_LIGHT.fulfilledBy(inventoryItems))
&& (equippedItems == null || !HAS_LIGHT.fulfilledBy(equippedItems))))
{
panelComponent.getChildren().add(LineComponent.builder().left("").build());
panelComponent.getChildren().add(LineComponent.builder().left("Requires Spade!").leftColor(Color.RED).build());
panelComponent.getChildren().add(LineComponent.builder().left("Requires Light Source!").leftColor(Color.RED).build());
}
return panelComponent.render(graphics);

View File

@@ -39,7 +39,9 @@ import java.util.ArrayList;
import java.util.List;
import java.util.Objects;
import javax.inject.Inject;
import javax.inject.Named;
import javax.inject.Singleton;
import joptsimple.internal.Strings;
import lombok.AccessLevel;
import lombok.Getter;
import lombok.extern.slf4j.Slf4j;
@@ -61,6 +63,7 @@ import net.runelite.api.TileObject;
import net.runelite.api.coords.LocalPoint;
import net.runelite.api.coords.WorldPoint;
import net.runelite.api.events.ChatMessage;
import net.runelite.api.events.CommandExecuted;
import net.runelite.api.events.GameStateChanged;
import net.runelite.api.events.GameTick;
import net.runelite.api.events.ItemContainerChanged;
@@ -169,6 +172,10 @@ public class ClueScrollPlugin extends Plugin
@Inject
private WorldMapPointManager worldMapPointManager;
@Inject
@Named("developerMode")
boolean developerMode;
private BufferedImage emoteImage;
private BufferedImage mapArrow;
private Integer clueItemId;
@@ -442,7 +449,13 @@ public class ClueScrollPlugin extends Plugin
// If we have a clue, save that knowledge
// so the clue window doesn't have to be open.
updateClue(findClueScroll());
final Widget clueScrollText = client.getWidget(WidgetInfo.CLUE_SCROLL_TEXT);
if (clueScrollText != null)
{
ClueScroll clueScroll = findClueScroll(clueScrollText.getText());
updateClue(clueScroll);
}
}
@Subscribe
@@ -457,6 +470,18 @@ public class ClueScrollPlugin extends Plugin
updateClue(BeginnerMapClue.forWidgetID(event.getGroupId()));
}
@Subscribe
public void onCommandExecuted(CommandExecuted commandExecuted)
{
if (developerMode && commandExecuted.getCommand().equals("clue"))
{
String text = Strings.join(commandExecuted.getArguments(), " ");
ClueScroll clueScroll = findClueScroll(text);
log.debug("Found clue scroll for '{}': {}", text, clueScroll);
updateClue(clueScroll);
}
}
public BufferedImage getClueScrollImage()
{
return itemManager.getImage(ItemID.CLUE_SCROLL_MASTER);
@@ -514,17 +539,10 @@ public class ClueScrollPlugin extends Plugin
}
}
private ClueScroll findClueScroll()
private ClueScroll findClueScroll(String rawText)
{
final Widget clueScrollText = client.getWidget(WidgetInfo.CLUE_SCROLL_TEXT);
if (clueScrollText == null)
{
return null;
}
// Remove line breaks and also the rare occasion where there are double line breaks
final String text = Text.sanitizeMultilineText(clueScrollText.getText()).toLowerCase();
final String text = Text.sanitizeMultilineText(rawText).toLowerCase();
// Early return if this is same clue as already existing one
if (clue instanceof TextClueScroll && ((TextClueScroll) clue).getText().equalsIgnoreCase(text))
@@ -534,7 +552,7 @@ public class ClueScrollPlugin extends Plugin
if (text.startsWith("i'd like to hear some music."))
{
return MusicClue.forText(clueScrollText.getText());
return MusicClue.forText(rawText);
}
if (text.contains("degrees") && text.contains("minutes"))
@@ -589,7 +607,7 @@ public class ClueScrollPlugin extends Plugin
return hotColdClue;
}
final SkillChallengeClue skillChallengeClue = SkillChallengeClue.forText(text, clueScrollText.getText());
final SkillChallengeClue skillChallengeClue = SkillChallengeClue.forText(text, rawText);
if (skillChallengeClue != null)
{
@@ -597,7 +615,7 @@ public class ClueScrollPlugin extends Plugin
}
// three step cryptic clues need unedited text to check which steps are already done
final ThreeStepCrypticClue threeStepCrypticClue = ThreeStepCrypticClue.forText(text, clueScrollText.getText());
final ThreeStepCrypticClue threeStepCrypticClue = ThreeStepCrypticClue.forText(text, rawText);
if (threeStepCrypticClue != null)
{
@@ -605,7 +623,7 @@ public class ClueScrollPlugin extends Plugin
}
// We have unknown clue, reset
log.warn("Encountered unhandled clue text: {}", clueScrollText.getText());
log.warn("Encountered unhandled clue text: {}", rawText);
resetClue(true);
return null;
}
@@ -781,6 +799,8 @@ public class ClueScrollPlugin extends Plugin
resetClue(false);
checkClueNPCs(clue, client.getCachedNPCs());
// If we have a clue, save that knowledge
// so the clue window doesn't have to be open.
this.clue = clue;
}

View File

@@ -28,6 +28,7 @@ import java.awt.Graphics2D;
import lombok.AccessLevel;
import lombok.Getter;
import lombok.Setter;
import net.runelite.api.Varbits;
import net.runelite.client.plugins.cluescrolls.ClueScrollPlugin;
import net.runelite.client.ui.overlay.components.PanelComponent;
@@ -37,6 +38,14 @@ public abstract class ClueScroll
@Getter(AccessLevel.PUBLIC)
private boolean requiresSpade;
@Setter(AccessLevel.PROTECTED)
@Getter(AccessLevel.PUBLIC)
private boolean requiresLight;
@Setter(AccessLevel.PROTECTED)
@Getter(AccessLevel.PUBLIC)
private Varbits hasFirePit;
public abstract void makeOverlayHint(PanelComponent panelComponent, ClueScrollPlugin plugin);
public abstract void makeWorldOverlayHint(Graphics2D graphics, ClueScrollPlugin plugin);

View File

@@ -27,9 +27,12 @@ package net.runelite.client.plugins.cluescrolls.clues;
import com.google.common.collect.ImmutableMap;
import java.awt.Color;
import java.awt.Graphics2D;
import javax.annotation.Nonnull;
import javax.annotation.Nullable;
import lombok.AccessLevel;
import lombok.Getter;
import lombok.NonNull;
import net.runelite.api.Varbits;
import net.runelite.api.coords.LocalPoint;
import net.runelite.api.coords.WorldPoint;
import net.runelite.client.plugins.cluescrolls.ClueScrollPlugin;
@@ -41,162 +44,184 @@ import net.runelite.client.ui.overlay.components.TitleComponent;
@Getter(AccessLevel.PUBLIC)
public class CoordinateClue extends ClueScroll implements TextClueScroll, LocationClueScroll
{
private static final ImmutableMap<WorldPoint, String> CLUES = new ImmutableMap.Builder<WorldPoint, String>()
@Getter
private static class CoordinateClueInfo
{
private final String directions;
private final boolean lightRequired;
private final Varbits lightSource;
private CoordinateClueInfo(@NonNull String directions)
{
this.directions = directions;
this.lightRequired = false;
this.lightSource = null;
}
private CoordinateClueInfo(@Nonnull String directions, boolean lightRequired, Varbits lightSource)
{
this.directions = directions;
this.lightRequired = lightRequired;
this.lightSource = lightSource;
}
}
private static final ImmutableMap<WorldPoint, CoordinateClueInfo> CLUES = new ImmutableMap.Builder<WorldPoint, CoordinateClueInfo>()
// Medium
.put(new WorldPoint(2479, 3158, 0), "South of fruit tree patch, west of Tree Gnome Village.")
.put(new WorldPoint(2887, 3154, 0), "West of Banana plantation on Karamja.")
.put(new WorldPoint(2743, 3151, 0), "Entrance of Brimhaven dungeon.")
.put(new WorldPoint(3184, 3150, 0), "South of Lumbridge Swamp.")
.put(new WorldPoint(3217, 3177, 0), "East of Lumbridge Swamp.")
.put(new WorldPoint(3007, 3144, 0), "Near the entrance to the Asgarnian Ice Dungeon, south of Port Sarim (AIQ).")
.put(new WorldPoint(2896, 3119, 0), "Near Karambwan fishing spot (DKP).")
.put(new WorldPoint(2697, 3207, 0), "Centre of Moss Giant Island, west of Brimhaven.")
.put(new WorldPoint(2679, 3110, 0), "North of Hazelmere's house (CLS).")
.put(new WorldPoint(3510, 3074, 0), "East of Uzer (DLQ).")
.put(new WorldPoint(3160, 3251, 0), "West of trapdoor leading to H.A.M Hideout.")
.put(new WorldPoint(2643, 3252, 0), "South of Ardougne Zoo, North of Tower of Life (DJP).")
.put(new WorldPoint(2322, 3061, 0), "South-west of Castle wars (BKP).")
.put(new WorldPoint(2875, 3046, 0), "North of nature altar, north of Shilo Village (CKR).")
.put(new WorldPoint(2849, 3033, 0), "West of nature altar, north of Shilo Village (CKR).")
.put(new WorldPoint(2848, 3296, 0), "North of Crandor island.")
.put(new WorldPoint(2583, 2990, 0), "Feldip Hills, south-east of Gu'Thanoth (AKS).")
.put(new WorldPoint(3179, 3344, 0), "In the cow pen north of the Lumbridge windmill.")
.put(new WorldPoint(2383, 3370, 0), "West of the outpost")
.put(new WorldPoint(3312, 3375, 0), "North-west of Exam Centre, on the hill.")
.put(new WorldPoint(3121, 3384, 0), "North-east of Draynor Manor, near River Lum.")
.put(new WorldPoint(3430, 3388, 0), "West of Mort Myre Swamp (BKR).")
.put(new WorldPoint(2920, 3403, 0), "South-east of Taverley, near Lady of the Lake.")
.put(new WorldPoint(2594, 2899, 0), "South-east of Feldip Hills, by the crimson swifts (AKS).")
.put(new WorldPoint(2387, 3435, 0), "West of Tree Gnome Stronghold, near the pen containing terrorbirds.")
.put(new WorldPoint(2512, 3467, 0), "Baxtorian Falls (Bring rope).")
.put(new WorldPoint(2381, 3468, 0), "West of Tree Gnome Stronghold, north of the pen with terrorbirds.")
.put(new WorldPoint(3005, 3475, 0), "Ice Mountain, west of Edgeville.")
.put(new WorldPoint(2585, 3505, 0), "By the shore line north of the Coal Trucks.")
.put(new WorldPoint(3443, 3515, 0), "South of Slayer Tower (CKS).")
.put(new WorldPoint(2416, 3516, 0), "Tree Gnome Stronghold, west of Grand Tree, near swamp.")
.put(new WorldPoint(3429, 3523, 0), "South of Slayer Tower (CKS).")
.put(new WorldPoint(2363, 3531, 0), "North-east of Eagles' Peak (AKQ).")
.put(new WorldPoint(2919, 3535, 0), "East of Burthorpe pub.")
.put(new WorldPoint(3548, 3560, 0), "Inside Fenkenstrain's Castle.")
.put(new WorldPoint(1456, 3620, 0), "Graveyard west of Shayzien (DJR).")
.put(new WorldPoint(2735, 3638, 0), "East of Rellekka, north-west of Golden Apple Tree (AJR).")
.put(new WorldPoint(2681, 3653, 0), "Rellekka, in the garden of the south-east house.")
.put(new WorldPoint(2537, 3881, 0), "Miscellania (CIP).")
.put(new WorldPoint(2828, 3234, 0), "Southern coast of Crandor.")
.put(new WorldPoint(1247, 3726, 0), "Just inside the Farming Guild")
.put(new WorldPoint(3770, 3898, 0), "On the small island north-east of Fossil Island's mushroom forest.")
.put(new WorldPoint(2479, 3158, 0), new CoordinateClueInfo("South of fruit tree patch, west of Tree Gnome Village."))
.put(new WorldPoint(2887, 3154, 0), new CoordinateClueInfo("West of Banana plantation on Karamja."))
.put(new WorldPoint(2743, 3151, 0), new CoordinateClueInfo("Entrance of Brimhaven dungeon."))
.put(new WorldPoint(3184, 3150, 0), new CoordinateClueInfo("South of Lumbridge Swamp."))
.put(new WorldPoint(3217, 3177, 0), new CoordinateClueInfo("East of Lumbridge Swamp."))
.put(new WorldPoint(3007, 3144, 0), new CoordinateClueInfo("Near the entrance to the Asgarnian Ice Dungeon, south of Port Sarim (AIQ)."))
.put(new WorldPoint(2896, 3119, 0), new CoordinateClueInfo("Near Karambwan fishing spot (DKP)."))
.put(new WorldPoint(2697, 3207, 0), new CoordinateClueInfo("Centre of Moss Giant Island, west of Brimhaven."))
.put(new WorldPoint(2679, 3110, 0), new CoordinateClueInfo("North of Hazelmere's house (CLS)."))
.put(new WorldPoint(3510, 3074, 0), new CoordinateClueInfo("East of Uzer (DLQ)."))
.put(new WorldPoint(3160, 3251, 0), new CoordinateClueInfo("West of trapdoor leading to H.A.M Hideout."))
.put(new WorldPoint(2643, 3252, 0), new CoordinateClueInfo("South of Ardougne Zoo, North of Tower of Life (DJP)."))
.put(new WorldPoint(2322, 3061, 0), new CoordinateClueInfo("South-west of Castle wars (BKP)."))
.put(new WorldPoint(2875, 3046, 0), new CoordinateClueInfo("North of nature altar, north of Shilo Village (CKR)."))
.put(new WorldPoint(2849, 3033, 0), new CoordinateClueInfo("West of nature altar, north of Shilo Village (CKR)."))
.put(new WorldPoint(2848, 3296, 0), new CoordinateClueInfo("North of Crandor island."))
.put(new WorldPoint(2583, 2990, 0), new CoordinateClueInfo("Feldip Hills, south-east of Gu'Thanoth (AKS)."))
.put(new WorldPoint(3179, 3344, 0), new CoordinateClueInfo("In the cow pen north of the Lumbridge windmill."))
.put(new WorldPoint(2383, 3370, 0), new CoordinateClueInfo("West of the outpost"))
.put(new WorldPoint(3312, 3375, 0), new CoordinateClueInfo("North-west of Exam Centre, on the hill."))
.put(new WorldPoint(3121, 3384, 0), new CoordinateClueInfo("North-east of Draynor Manor, near River Lum."))
.put(new WorldPoint(3430, 3388, 0), new CoordinateClueInfo("West of Mort Myre Swamp (BKR)."))
.put(new WorldPoint(2920, 3403, 0), new CoordinateClueInfo("South-east of Taverley, near Lady of the Lake."))
.put(new WorldPoint(2594, 2899, 0), new CoordinateClueInfo("South-east of Feldip Hills, by the crimson swifts (AKS)."))
.put(new WorldPoint(2387, 3435, 0), new CoordinateClueInfo("West of Tree Gnome Stronghold, near the pen containing terrorbirds."))
.put(new WorldPoint(2512, 3467, 0), new CoordinateClueInfo("Baxtorian Falls (Bring rope)."))
.put(new WorldPoint(2381, 3468, 0), new CoordinateClueInfo("West of Tree Gnome Stronghold, north of the pen with terrorbirds."))
.put(new WorldPoint(3005, 3475, 0), new CoordinateClueInfo("Ice Mountain, west of Edgeville."))
.put(new WorldPoint(2585, 3505, 0), new CoordinateClueInfo("By the shore line north of the Coal Trucks."))
.put(new WorldPoint(3443, 3515, 0), new CoordinateClueInfo("South of Slayer Tower (CKS)."))
.put(new WorldPoint(2416, 3516, 0), new CoordinateClueInfo("Tree Gnome Stronghold, west of Grand Tree, near swamp."))
.put(new WorldPoint(3429, 3523, 0), new CoordinateClueInfo("South of Slayer Tower (CKS)."))
.put(new WorldPoint(2363, 3531, 0), new CoordinateClueInfo("North-east of Eagles' Peak (AKQ)."))
.put(new WorldPoint(2919, 3535, 0), new CoordinateClueInfo("East of Burthorpe pub."))
.put(new WorldPoint(3548, 3560, 0), new CoordinateClueInfo("Inside Fenkenstrain's Castle."))
.put(new WorldPoint(1456, 3620, 0), new CoordinateClueInfo("Graveyard west of Shayzien (DJR)."))
.put(new WorldPoint(2735, 3638, 0), new CoordinateClueInfo("East of Rellekka, north-west of Golden Apple Tree (AJR)."))
.put(new WorldPoint(2681, 3653, 0), new CoordinateClueInfo("Rellekka, in the garden of the south-east house."))
.put(new WorldPoint(2537, 3881, 0), new CoordinateClueInfo("Miscellania (CIP)."))
.put(new WorldPoint(2828, 3234, 0), new CoordinateClueInfo("Southern coast of Crandor."))
.put(new WorldPoint(1247, 3726, 0), new CoordinateClueInfo("Just inside the Farming Guild"))
.put(new WorldPoint(3770, 3898, 0), new CoordinateClueInfo("On the small island north-east of Fossil Island's mushroom forest."))
// Hard
.put(new WorldPoint(2209, 3161, 0), "North-east of Tyras Camp (BJS).")
.put(new WorldPoint(2181, 3206, 0), "South of Iorwerth Camp.")
.put(new WorldPoint(3081, 3209, 0), "Small Island (CLP).")
.put(new WorldPoint(3399, 3246, 0), "Behind the Duel Arena.")
.put(new WorldPoint(2699, 3251, 0), "Little island (AIR).")
.put(new WorldPoint(3546, 3251, 0), "North-east of Burgh de Rott.")
.put(new WorldPoint(3544, 3256, 0), "North-east of Burgh de Rott.")
.put(new WorldPoint(2841, 3267, 0), "Crandor island.")
.put(new WorldPoint(3168, 3041, 0), "Bedabin Camp.")
.put(new WorldPoint(2542, 3031, 0), "Gu'Tanoth, may require 20gp.")
.put(new WorldPoint(2581, 3030, 0), "Gu'Tanoth island, enter cave north-west of Feldip Hills (AKS).")
.put(new WorldPoint(2961, 3024, 0), "Ship yard (DKP).")
.put(new WorldPoint(2339, 3311, 0), "East of Prifddinas on Arandar mountain pass.")
.put(new WorldPoint(3440, 3341, 0), "Nature Spirit's grotto (BIP).")
.put(new WorldPoint(2763, 2974, 0), "Cairn Isle, west of Shilo Village (CKR).")
.put(new WorldPoint(3138, 2969, 0), "West of Bandit Camp in Kharidian Desert.")
.put(new WorldPoint(2924, 2963, 0), "On the southern part of eastern Karamja.")
.put(new WorldPoint(2838, 2914, 0), "Kharazi Jungle, near water pool (CKR).")
.put(new WorldPoint(3441, 3419, 0), "Mort Myre Swamp (BKR).")
.put(new WorldPoint(2950, 2902, 0), "South-east of Kharazi Jungle.")
.put(new WorldPoint(2775, 2891, 0), "South-west of Kharazi Jungle.")
.put(new WorldPoint(3113, 3602, 0), "Wilderness. North of Edgeville (level 11).")
.put(new WorldPoint(2892, 3675, 0), "On the summit of Trollheim.")
.put(new WorldPoint(3168, 3677, 0), "Wilderness. Graveyard of Shadows.")
.put(new WorldPoint(2853, 3690, 0), "Entrance to the troll Stronghold.")
.put(new WorldPoint(3305, 3692, 0), "Wilderness. West of eastern green dragon.")
.put(new WorldPoint(3055, 3696, 0), "Wilderness. Bandit Camp.")
.put(new WorldPoint(3302, 3696, 0), "Wilderness. West of eastern green dragon.")
.put(new WorldPoint(1479, 3696, 0), "Lizardman Canyon (DJR).")
.put(new WorldPoint(2712, 3732, 0), "North-east of Rellekka (DKS).")
.put(new WorldPoint(2970, 3749, 0), "Wilderness. Forgotten Cemetery.")
.put(new WorldPoint(3094, 3764, 0), "Wilderness. Mining site north of Bandit Camp.")
.put(new WorldPoint(3311, 3769, 0), "Wilderness. North of Venenatis.")
.put(new WorldPoint(1460, 3782, 0), "Lovakengj, near burning man.")
.put(new WorldPoint(3244, 3792, 0), "Wilderness. South-east of Lava Dragon Isle by some Chaos Dwarves.")
.put(new WorldPoint(3140, 3804, 0), "Wilderness. North of Ruins.")
.put(new WorldPoint(2946, 3819, 0), "Wilderness. Chaos Temple (level 38).")
.put(new WorldPoint(3771, 3825, 0), "Fossil Island. East of Museum Camp.")
.put(new WorldPoint(3013, 3846, 0), "Wilderness. West of Lava Maze, before KBD's lair.")
.put(new WorldPoint(3058, 3884, 0), "Wilderness. Near runite ore north of Lava Maze.")
.put(new WorldPoint(3290, 3889, 0), "Wilderness. Demonic Ruins.")
.put(new WorldPoint(3770, 3897, 0), "Small Island north of Fossil Island.")
.put(new WorldPoint(2505, 3899, 0), "Small Island north-west of Miscellania (AJS).")
.put(new WorldPoint(3285, 3942, 0), "Wilderness. Rogues' Castle.")
.put(new WorldPoint(3159, 3959, 0), "Wilderness. North of Deserted Keep, west of Resource Area.")
.put(new WorldPoint(3039, 3960, 0), "Wilderness. Pirates' Hideout.")
.put(new WorldPoint(2987, 3963, 0), "Wilderness. West of Wilderness Agility Course.")
.put(new WorldPoint(3189, 3963, 0), "Wilderness. North of Resource Area, near magic axe hut.")
.put(new WorldPoint(2341, 3697, 0), "North-east of the Piscatoris Fishing Colony bank.")
.put(new WorldPoint(3143, 3774, 0), "In level 32 Wilderness, by the black chinchompa hunting area.")
.put(new WorldPoint(2992, 3941, 0), "Wilderness Agility Course, past the log balance.")
.put(new WorldPoint(2209, 3161, 0), new CoordinateClueInfo("North-east of Tyras Camp (BJS)."))
.put(new WorldPoint(2181, 3206, 0), new CoordinateClueInfo("South of Iorwerth Camp."))
.put(new WorldPoint(3081, 3209, 0), new CoordinateClueInfo("Small Island (CLP)."))
.put(new WorldPoint(3399, 3246, 0), new CoordinateClueInfo("Behind the Duel Arena."))
.put(new WorldPoint(2699, 3251, 0), new CoordinateClueInfo("Little island (AIR)."))
.put(new WorldPoint(3546, 3251, 0), new CoordinateClueInfo("North-east of Burgh de Rott."))
.put(new WorldPoint(3544, 3256, 0), new CoordinateClueInfo("North-east of Burgh de Rott."))
.put(new WorldPoint(2841, 3267, 0), new CoordinateClueInfo("Crandor island."))
.put(new WorldPoint(3168, 3041, 0), new CoordinateClueInfo("Bedabin Camp."))
.put(new WorldPoint(2542, 3031, 0), new CoordinateClueInfo("Gu'Tanoth, may require 20gp."))
.put(new WorldPoint(2581, 3030, 0), new CoordinateClueInfo("Gu'Tanoth island, enter cave north-west of Feldip Hills (AKS)."))
.put(new WorldPoint(2961, 3024, 0), new CoordinateClueInfo("Ship yard (DKP)."))
.put(new WorldPoint(2339, 3311, 0), new CoordinateClueInfo("East of Prifddinas on Arandar mountain pass."))
.put(new WorldPoint(3440, 3341, 0), new CoordinateClueInfo("Nature Spirit's grotto (BIP)."))
.put(new WorldPoint(2763, 2974, 0), new CoordinateClueInfo("Cairn Isle, west of Shilo Village (CKR)."))
.put(new WorldPoint(3138, 2969, 0), new CoordinateClueInfo("West of Bandit Camp in Kharidian Desert."))
.put(new WorldPoint(2924, 2963, 0), new CoordinateClueInfo("On the southern part of eastern Karamja."))
.put(new WorldPoint(2838, 2914, 0), new CoordinateClueInfo("Kharazi Jungle, near water pool (CKR)."))
.put(new WorldPoint(3441, 3419, 0), new CoordinateClueInfo("Mort Myre Swamp (BKR)."))
.put(new WorldPoint(2950, 2902, 0), new CoordinateClueInfo("South-east of Kharazi Jungle."))
.put(new WorldPoint(2775, 2891, 0), new CoordinateClueInfo("South-west of Kharazi Jungle."))
.put(new WorldPoint(3113, 3602, 0), new CoordinateClueInfo("Wilderness. North of Edgeville (level 11)."))
.put(new WorldPoint(2892, 3675, 0), new CoordinateClueInfo("On the summit of Trollheim."))
.put(new WorldPoint(3168, 3677, 0), new CoordinateClueInfo("Wilderness. Graveyard of Shadows."))
.put(new WorldPoint(2853, 3690, 0), new CoordinateClueInfo("Entrance to the troll Stronghold."))
.put(new WorldPoint(3305, 3692, 0), new CoordinateClueInfo("Wilderness. West of eastern green dragon."))
.put(new WorldPoint(3055, 3696, 0), new CoordinateClueInfo("Wilderness. Bandit Camp."))
.put(new WorldPoint(3302, 3696, 0), new CoordinateClueInfo("Wilderness. West of eastern green dragon."))
.put(new WorldPoint(1479, 3696, 0), new CoordinateClueInfo("Lizardman Canyon (DJR)."))
.put(new WorldPoint(2712, 3732, 0), new CoordinateClueInfo("North-east of Rellekka (DKS)."))
.put(new WorldPoint(2970, 3749, 0), new CoordinateClueInfo("Wilderness. Forgotten Cemetery."))
.put(new WorldPoint(3094, 3764, 0), new CoordinateClueInfo("Wilderness. Mining site north of Bandit Camp."))
.put(new WorldPoint(3311, 3769, 0), new CoordinateClueInfo("Wilderness. North of Venenatis."))
.put(new WorldPoint(1460, 3782, 0), new CoordinateClueInfo("Lovakengj, near burning man."))
.put(new WorldPoint(3244, 3792, 0), new CoordinateClueInfo("Wilderness. South-east of Lava Dragon Isle by some Chaos Dwarves."))
.put(new WorldPoint(3140, 3804, 0), new CoordinateClueInfo("Wilderness. North of Ruins."))
.put(new WorldPoint(2946, 3819, 0), new CoordinateClueInfo("Wilderness. Chaos Temple (level 38)."))
.put(new WorldPoint(3771, 3825, 0), new CoordinateClueInfo("Fossil Island. East of Museum Camp."))
.put(new WorldPoint(3013, 3846, 0), new CoordinateClueInfo("Wilderness. West of Lava Maze, before KBD's lair."))
.put(new WorldPoint(3058, 3884, 0), new CoordinateClueInfo("Wilderness. Near runite ore north of Lava Maze."))
.put(new WorldPoint(3290, 3889, 0), new CoordinateClueInfo("Wilderness. Demonic Ruins."))
.put(new WorldPoint(3770, 3897, 0), new CoordinateClueInfo("Small Island north of Fossil Island."))
.put(new WorldPoint(2505, 3899, 0), new CoordinateClueInfo("Small Island north-west of Miscellania (AJS)."))
.put(new WorldPoint(3285, 3942, 0), new CoordinateClueInfo("Wilderness. Rogues' Castle."))
.put(new WorldPoint(3159, 3959, 0), new CoordinateClueInfo("Wilderness. North of Deserted Keep, west of Resource Area."))
.put(new WorldPoint(3039, 3960, 0), new CoordinateClueInfo("Wilderness. Pirates' Hideout."))
.put(new WorldPoint(2987, 3963, 0), new CoordinateClueInfo("Wilderness. West of Wilderness Agility Course."))
.put(new WorldPoint(3189, 3963, 0), new CoordinateClueInfo("Wilderness. North of Resource Area, near magic axe hut."))
.put(new WorldPoint(2341, 3697, 0), new CoordinateClueInfo("North-east of the Piscatoris Fishing Colony bank."))
.put(new WorldPoint(3143, 3774, 0), new CoordinateClueInfo("In level 32 Wilderness, by the black chinchompa hunting area."))
.put(new WorldPoint(2992, 3941, 0), new CoordinateClueInfo("Wilderness Agility Course, past the log balance."))
// Elite
.put(new WorldPoint(2357, 3151, 0), "Lletya.")
.put(new WorldPoint(3587, 3180, 0), "Meiyerditch.")
.put(new WorldPoint(2820, 3078, 0), "Tai Bwo Wannai. Hardwood Grove.")
.put(new WorldPoint(3811, 3060, 0), "Small island north-east of Mos Le'Harmless.")
.put(new WorldPoint(2180, 3282, 0), "North of Iorwerth Camp.")
.put(new WorldPoint(2870, 2997, 0), "North-east of Shilo Village.")
.put(new WorldPoint(3302, 2988, 0), "On top of a cliff to the west of Pollnivneach.")
.put(new WorldPoint(2511, 2980, 0), "Just south of Gu'Tanoth, west of gnome glider.")
.put(new WorldPoint(2732, 3372, 0), "Legends' Guild.")
.put(new WorldPoint(3573, 3425, 0), "North of Dessous's tomb from Desert Treasure.")
.put(new WorldPoint(3828, 2848, 0), "East of Harmony Island.")
.put(new WorldPoint(3225, 2838, 0), "South of Desert Treasure pyramid.")
.put(new WorldPoint(1773, 3510, 0), "Ruins north of the Hosidius mine.")
.put(new WorldPoint(3822, 3562, 0), "North-east of Dragontooth Island.")
.put(new WorldPoint(3603, 3564, 0), "North of the wrecked ship, outside of Port Phasmatys.")
.put(new WorldPoint(2936, 2721, 0), "Eastern shore of Crash Island.")
.put(new WorldPoint(2697, 2705, 0), "South-west of Ape Atoll.")
.put(new WorldPoint(2778, 3678, 0), "Mountain Camp.")
.put(new WorldPoint(2827, 3740, 0), "West of the entrance to the Ice Path, where the Troll child resides.")
.put(new WorldPoint(2359, 3799, 0), "Neitiznot.")
.put(new WorldPoint(2194, 3807, 0), "Pirates' Cove.")
.put(new WorldPoint(2700, 3808, 0), "Northwestern part of the Trollweiss and Rellekka Hunter area (DKS).")
.put(new WorldPoint(3215, 3835, 0), "Wilderness. Lava Dragon Isle.")
.put(new WorldPoint(3369, 3894, 0), "Wilderness. Fountain of Rune.")
.put(new WorldPoint(2065, 3923, 0), "Outside the western wall on Lunar Isle.")
.put(new WorldPoint(3188, 3933, 0), "Wilderness. Resource Area.")
.put(new WorldPoint(2997, 3953, 0), "Wilderness. Inside Agility Training Area.")
.put(new WorldPoint(3380, 3963, 0), "Wilderness. North of Volcano.")
.put(new WorldPoint(3051, 3736, 0), "East of the Wilderness Obelisk in 28 Wilderness.")
.put(new WorldPoint(2316, 3814, 0), "West of Neitiznot, near the bridge.")
.put(new WorldPoint(2872, 3937, 0), "Weiss.")
.put(new WorldPoint(2484, 4016, 0), "Northeast corner of the Island of Stone.")
.put(new WorldPoint(2357, 3151, 0), new CoordinateClueInfo("Lletya."))
.put(new WorldPoint(3587, 3180, 0), new CoordinateClueInfo("Meiyerditch."))
.put(new WorldPoint(2820, 3078, 0), new CoordinateClueInfo("Tai Bwo Wannai. Hardwood Grove."))
.put(new WorldPoint(3811, 3060, 0), new CoordinateClueInfo("Small island north-east of Mos Le'Harmless.", true, Varbits.FIRE_PIT_MOS_LE_HARMLESS))
.put(new WorldPoint(2180, 3282, 0), new CoordinateClueInfo("North of Iorwerth Camp."))
.put(new WorldPoint(2870, 2997, 0), new CoordinateClueInfo("North-east of Shilo Village."))
.put(new WorldPoint(3302, 2988, 0), new CoordinateClueInfo("On top of a cliff to the west of Pollnivneach."))
.put(new WorldPoint(2511, 2980, 0), new CoordinateClueInfo("Just south of Gu'Tanoth, west of gnome glider."))
.put(new WorldPoint(2732, 3372, 0), new CoordinateClueInfo("Legends' Guild."))
.put(new WorldPoint(3573, 3425, 0), new CoordinateClueInfo("North of Dessous's tomb from Desert Treasure."))
.put(new WorldPoint(3828, 2848, 0), new CoordinateClueInfo("East of Harmony Island."))
.put(new WorldPoint(3225, 2838, 0), new CoordinateClueInfo("South of Desert Treasure pyramid."))
.put(new WorldPoint(1773, 3510, 0), new CoordinateClueInfo("Ruins north of the Hosidius mine."))
.put(new WorldPoint(3822, 3562, 0), new CoordinateClueInfo("North-east of Dragontooth Island."))
.put(new WorldPoint(3603, 3564, 0), new CoordinateClueInfo("North of the wrecked ship, outside of Port Phasmatys."))
.put(new WorldPoint(2936, 2721, 0), new CoordinateClueInfo("Eastern shore of Crash Island."))
.put(new WorldPoint(2697, 2705, 0), new CoordinateClueInfo("South-west of Ape Atoll."))
.put(new WorldPoint(2778, 3678, 0), new CoordinateClueInfo("Mountain Camp."))
.put(new WorldPoint(2827, 3740, 0), new CoordinateClueInfo("West of the entrance to the Ice Path, where the Troll child resides."))
.put(new WorldPoint(2359, 3799, 0), new CoordinateClueInfo("Neitiznot."))
.put(new WorldPoint(2194, 3807, 0), new CoordinateClueInfo("Pirates' Cove."))
.put(new WorldPoint(2700, 3808, 0), new CoordinateClueInfo("Northwestern part of the Trollweiss and Rellekka Hunter area (DKS)."))
.put(new WorldPoint(3215, 3835, 0), new CoordinateClueInfo("Wilderness. Lava Dragon Isle."))
.put(new WorldPoint(3369, 3894, 0), new CoordinateClueInfo("Wilderness. Fountain of Rune."))
.put(new WorldPoint(2065, 3923, 0), new CoordinateClueInfo("Outside the western wall on Lunar Isle."))
.put(new WorldPoint(3188, 3933, 0), new CoordinateClueInfo("Wilderness. Resource Area."))
.put(new WorldPoint(2997, 3953, 0), new CoordinateClueInfo("Wilderness. Inside Agility Training Area."))
.put(new WorldPoint(3380, 3963, 0), new CoordinateClueInfo("Wilderness. North of Volcano."))
.put(new WorldPoint(3051, 3736, 0), new CoordinateClueInfo("East of the Wilderness Obelisk in 28 Wilderness."))
.put(new WorldPoint(2316, 3814, 0), new CoordinateClueInfo("West of Neitiznot, near the bridge."))
.put(new WorldPoint(2872, 3937, 0), new CoordinateClueInfo("Weiss."))
.put(new WorldPoint(2484, 4016, 0), new CoordinateClueInfo("Northeast corner of the Island of Stone."))
// Master
.put(new WorldPoint(2178, 3209, 0), "South of Iorwerth Camp.")
.put(new WorldPoint(2155, 3100, 0), "South of Port Tyras (BJS).")
.put(new WorldPoint(2217, 3092, 0), "Poison Waste island (DLR).")
.put(new WorldPoint(3830, 3060, 0), "Small island located north-east of Mos Le'Harmless.")
.put(new WorldPoint(2834, 3271, 0), "Crandor island.")
.put(new WorldPoint(2732, 3284, 0), "Witchaven.")
.put(new WorldPoint(3622, 3320, 0), "Meiyerditch. Outside mine.")
.put(new WorldPoint(2303, 3328, 0), "East of Prifddinas.")
.put(new WorldPoint(3570, 3405, 0), "North of Dessous's tomb from Desert Treasure.")
.put(new WorldPoint(2840, 3423, 0), "Water Obelisk Island.")
.put(new WorldPoint(3604, 3564, 0), "North of the wrecked ship, outside of Port Phasmatys (ALQ).")
.put(new WorldPoint(3085, 3569, 0), "Wilderness. Obelisk of Air.")
.put(new WorldPoint(2934, 2727, 0), "Eastern shore of Crash Island.")
.put(new WorldPoint(1451, 3695, 0), "West side of Lizardman Canyon with Lizardman shaman.")
.put(new WorldPoint(2538, 3739, 0), "Waterbirth Island. Bring a pet rock and rune thrownaxe.")
.put(new WorldPoint(1698, 3792, 0), "Arceuus church.")
.put(new WorldPoint(2951, 3820, 0), "Wilderness. Chaos Temple (level 38).")
.put(new WorldPoint(2202, 3825, 0), "Pirates' Cove, between Lunar Isle and Rellekka.")
.put(new WorldPoint(1761, 3853, 0), "Arceuus essence mine (CIS).")
.put(new WorldPoint(2090, 3863, 0), "South of Lunar Isle, west of Astral altar.")
.put(new WorldPoint(1442, 3878, 0), "Sulphur Mine.")
.put(new WorldPoint(3380, 3929, 0), "Wilderness. Near Volcano.")
.put(new WorldPoint(3188, 3939, 0), "Wilderness. Resource Area.")
.put(new WorldPoint(3304, 3941, 0), "Wilderness. East of Rogues' Castle.")
.put(new WorldPoint(2994, 3961, 0), "Wilderness. Inside Agility Training Area.")
.put(new WorldPoint(1248, 3751, 0), "In the north wing of the Farming Guild.")
.put(new WorldPoint(2178, 3209, 0), new CoordinateClueInfo("South of Iorwerth Camp."))
.put(new WorldPoint(2155, 3100, 0), new CoordinateClueInfo("South of Port Tyras (BJS)."))
.put(new WorldPoint(2217, 3092, 0), new CoordinateClueInfo("Poison Waste island (DLR)."))
.put(new WorldPoint(3830, 3060, 0), new CoordinateClueInfo("Small island located north-east of Mos Le'Harmless.", true, Varbits.FIRE_PIT_MOS_LE_HARMLESS))
.put(new WorldPoint(2834, 3271, 0), new CoordinateClueInfo("Crandor island."))
.put(new WorldPoint(2732, 3284, 0), new CoordinateClueInfo("Witchaven."))
.put(new WorldPoint(3622, 3320, 0), new CoordinateClueInfo("Meiyerditch. Outside mine."))
.put(new WorldPoint(2303, 3328, 0), new CoordinateClueInfo("East of Prifddinas."))
.put(new WorldPoint(3570, 3405, 0), new CoordinateClueInfo("North of Dessous's tomb from Desert Treasure."))
.put(new WorldPoint(2840, 3423, 0), new CoordinateClueInfo("Water Obelisk Island."))
.put(new WorldPoint(3604, 3564, 0), new CoordinateClueInfo("North of the wrecked ship, outside of Port Phasmatys (ALQ)."))
.put(new WorldPoint(3085, 3569, 0), new CoordinateClueInfo("Wilderness. Obelisk of Air."))
.put(new WorldPoint(2934, 2727, 0), new CoordinateClueInfo("Eastern shore of Crash Island."))
.put(new WorldPoint(1451, 3695, 0), new CoordinateClueInfo("West side of Lizardman Canyon with Lizardman shaman."))
.put(new WorldPoint(2538, 3739, 0), new CoordinateClueInfo("Waterbirth Island. Bring a pet rock and rune thrownaxe."))
.put(new WorldPoint(1698, 3792, 0), new CoordinateClueInfo("Arceuus church."))
.put(new WorldPoint(2951, 3820, 0), new CoordinateClueInfo("Wilderness. Chaos Temple (level 38)."))
.put(new WorldPoint(2202, 3825, 0), new CoordinateClueInfo("Pirates' Cove, between Lunar Isle and Rellekka."))
.put(new WorldPoint(1761, 3853, 0), new CoordinateClueInfo("Arceuus essence mine (CIS)."))
.put(new WorldPoint(2090, 3863, 0), new CoordinateClueInfo("South of Lunar Isle, west of Astral altar."))
.put(new WorldPoint(1442, 3878, 0), new CoordinateClueInfo("Sulphur Mine."))
.put(new WorldPoint(3380, 3929, 0), new CoordinateClueInfo("Wilderness. Near Volcano."))
.put(new WorldPoint(3188, 3939, 0), new CoordinateClueInfo("Wilderness. Resource Area."))
.put(new WorldPoint(3304, 3941, 0), new CoordinateClueInfo("Wilderness. East of Rogues' Castle."))
.put(new WorldPoint(2994, 3961, 0), new CoordinateClueInfo("Wilderness. Inside Agility Training Area."))
.put(new WorldPoint(1248, 3751, 0), new CoordinateClueInfo("In the north wing of the Farming Guild."))
.build();
private final String text;
@@ -212,6 +237,13 @@ public class CoordinateClue extends ClueScroll implements TextClueScroll, Locati
this.text = text;
this.location = location;
this.mirrorLocation = mirrorLocation;
final CoordinateClueInfo clueInfo = CLUES.get(location);
if (clueInfo != null)
{
setHasFirePit(clueInfo.getLightSource());
setRequiresLight(clueInfo.lightRequired);
}
setRequiresSpade(true);
}
@@ -233,12 +265,12 @@ public class CoordinateClue extends ClueScroll implements TextClueScroll, Locati
{
panelComponent.getChildren().add(TitleComponent.builder().text("Coordinate Clue").build());
String solution = CLUES.get(location);
final CoordinateClueInfo solution = CLUES.get(location);
if (solution != null)
{
panelComponent.getChildren().add(LineComponent.builder()
.left(solution)
.left(solution.getDirections())
.build());
panelComponent.getChildren().add(LineComponent.builder().build());
}

View File

@@ -135,7 +135,7 @@ public class CrypticClue extends ClueScroll implements TextClueScroll, NpcClueSc
new CrypticClue("If you look closely enough, it seems that the archers have lost more than their needles.", HAYSTACK, new WorldPoint(2672, 3416, 0), "Search the haystack by the south corner of the Rangers' Guild"),
new CrypticClue("Search the crate in the left-hand tower of Lumbridge Castle.", CRATE_357, new WorldPoint(3228, 3212, 1), "Located on the first floor of the southern tower at the Lumbridge Castle entrance."),
new CrypticClue("'Small shoe.' Often found with rod on mushroom.", "Gnome trainer", new WorldPoint(2476, 3428, 0), "Talk to any Gnome trainer in the agility area of the Tree Gnome Stronghold."),
new CrypticClue("I live in a deserted crack collecting soles.", "Genie", new WorldPoint(3371, 9320, 0), "Enter the crack west of Nardah Rug merchant, and talk to the Genie. You'll need a light source and a rope."),
new CrypticClue("I live in a deserted crack collecting soles.", "Genie", new WorldPoint(3371, 9320, 0), "Enter the crack west of Nardah Rug merchant, and talk to the Genie. You'll need a light source and a rope.", true),
new CrypticClue("46 is my number. My body is the colour of burnt orange and crawls among those with eight. Three mouths I have, yet I cannot eat. My blinking blue eye hides my grave.", new WorldPoint(3170, 3885, 0), "Sapphire respawn in the Spider's Nest, lvl 46 Wilderness. Dig under the sapphire spawn."),
new CrypticClue("Green is the colour of my death as the winter-guise, I swoop towards the ground.", new WorldPoint(2780, 3783, 0), "Players need to slide down to where Trollweiss grows on Trollweiss Mountain."),
new CrypticClue("Talk to a party-goer in Falador.", "Lucy", new WorldPoint(3046, 3382, 0), "Lucy is the bartender on the first floor of the party room."),
@@ -167,7 +167,7 @@ public class CrypticClue extends ClueScroll implements TextClueScroll, NpcClueSc
new CrypticClue("Search the drawers in Falador's chain mail shop.", DRAWERS, new WorldPoint(2969, 3311, 0), "Wayne's Chains - Chainmail Specialist store at the southern Falador walls."),
new CrypticClue("Talk to the barber in the Falador barber shop.", "Hairdresser", new WorldPoint(2945, 3379, 0), "The Hairdresser can be found in the barber shop, north of the west Falador bank."),
new CrypticClue("Often sought out by scholars of histories past, find me where words of wisdom speak volumes.", "Examiner", new WorldPoint(3362, 3341, 0), "Speak to an examiner at the Exam Centre."),
new CrypticClue("Generally speaking, his nose was very bent.", "General Bentnoze", new WorldPoint(2957, 3511, 0), "Talk to General Bentnoze"),
new CrypticClue("Generally speaking, his nose was very bent.", "General Bentnoze", new WorldPoint(2957, 3511, 0), "Talk to General Bentnoze in the Goblin Village north of Falador."),
new CrypticClue("Search the bush at the digsite centre.", BUSH_2357, new WorldPoint(3345, 3378, 0), "The bush is on the east side of the first pathway towards the digsite from the Exam Centre."),
new CrypticClue("Someone watching the fights in the Duel Arena is your next destination.", "Jeed", new WorldPoint(3360, 3242, 0), "Talk to Jeed, found on the upper floors, at the Duel Arena."),
new CrypticClue("It seems to have reached the end of the line, and it's still empty.", MINE_CART_6045, new WorldPoint(3041, 9820, 0), "Search the carts in the northern part of the Dwarven Mine."),
@@ -349,6 +349,12 @@ public class CrypticClue extends ClueScroll implements TextClueScroll, NpcClueSc
this(text, npc, -1, location, solution, "");
}
private CrypticClue(String text, String npc, WorldPoint location, String solution, boolean requiresLight)
{
this(text, npc, location, solution);
setRequiresLight(requiresLight);
}
private CrypticClue(String text, int objectId, WorldPoint location, String solution, String questionText)
{
this(text, null, objectId, location, solution, questionText);

View File

@@ -41,6 +41,7 @@ import net.runelite.api.ItemID;
import static net.runelite.api.ItemID.*;
import net.runelite.api.Perspective;
import net.runelite.api.ScriptID;
import net.runelite.api.Varbits;
import net.runelite.api.coords.LocalPoint;
import net.runelite.api.coords.WorldPoint;
import static net.runelite.client.plugins.cluescrolls.ClueScrollOverlay.TITLED_CONTENT_COLOR;
@@ -114,7 +115,7 @@ public class EmoteClue extends ClueScroll implements TextClueScroll, LocationClu
new EmoteClue("Dance at the crossroads north of Draynor. Equip an iron chain body, a sapphire ring and a longbow.", "Draynor Village", CROSSROADS_NORTH_OF_DRAYNOR_VILLAGE, new WorldPoint(3109, 3294, 0), DANCE, item(IRON_CHAINBODY), item(SAPPHIRE_RING), item(LONGBOW)),
new EmoteClue("Dance in the Party Room. Equip a steel full helmet, steel platebody and an iron plateskirt.", "Falador Party Room", OUTSIDE_THE_FALADOR_PARTY_ROOM, new WorldPoint(3045, 3376, 0), DANCE, item(STEEL_FULL_HELM), item(STEEL_PLATEBODY), item(IRON_PLATESKIRT)),
new EmoteClue("Dance in the shack in Lumbridge Swamp. Equip a bronze dagger, iron full helmet and a gold ring.", "Lumbridge swamp", NEAR_A_SHED_IN_LUMBRIDGE_SWAMP, new WorldPoint(3203, 3169, 0), DANCE, item(BRONZE_DAGGER), item(IRON_FULL_HELM), item(GOLD_RING)),
new EmoteClue("Dance in the dark caves beneath Lumbridge Swamp. Blow a kiss before you talk to me. Equip an air staff, Bronze full helm and an amulet of power.", "Lumbridge swamp", LUMBRIDGE_SWAMP_CAVES, new WorldPoint(3168, 9571, 0), DANCE, BLOW_KISS, item(STAFF_OF_AIR), item(BRONZE_FULL_HELM), item(AMULET_OF_POWER)),
new EmoteClue("Dance in the dark caves beneath Lumbridge Swamp. Blow a kiss before you talk to me. Equip an air staff, Bronze full helm and an amulet of power.", "Lumbridge swamp caves", LUMBRIDGE_SWAMP_CAVES, new WorldPoint(3168, 9571, 0), DANCE, BLOW_KISS, Varbits.FIRE_PIT_LUMBRIDGE_SWAMP, item(STAFF_OF_AIR), item(BRONZE_FULL_HELM), item(AMULET_OF_POWER)),
new EmoteClue("Dance at the cat-doored pyramid in Sophanem. Beware of double agents! Equip a ring of life, an uncharged amulet of glory and an adamant two-handed sword.", "Pyramid Of Sophanem", OUTSIDE_THE_GREAT_PYRAMID_OF_SOPHANEM, new WorldPoint(3294, 2781, 0), DANCE, item(RING_OF_LIFE), item(AMULET_OF_GLORY), item(ADAMANT_2H_SWORD)),
new EmoteClue("Dance in the centre of Canifis. Bow before you talk to me. Equip a green gnome robe top, mithril plate legs and an iron two-handed sword.", "Canifis", CENTRE_OF_CANIFIS, new WorldPoint(3492, 3488, 0), DANCE, BOW, item(GREEN_ROBE_TOP), item(MITHRIL_PLATELEGS), item(IRON_2H_SWORD)),
new EmoteClue("Dance in the King Black Dragon's lair. Beware of double agents! Equip a black dragonhide body, black dragonhide vambs and a black dragon mask.", "King black dragon's lair", KING_BLACK_DRAGONS_LAIR, new WorldPoint(2271, 4680, 0), DANCE, item(BLACK_DHIDE_BODY), item(BLACK_DHIDE_VAMB), item(BLACK_DRAGON_MASK)),
@@ -211,6 +212,13 @@ public class EmoteClue extends ClueScroll implements TextClueScroll, LocationClu
this.itemRequirements = itemRequirements;
}
private EmoteClue(String text, String locationName, @Nullable STASHUnit stashUnit, WorldPoint location, Emote firstEmote, Emote secondEmote, @Nonnull Varbits firePit, @Nonnull ItemRequirement... itemRequirements)
{
this(text, locationName, stashUnit, location, firstEmote, secondEmote, itemRequirements);
setRequiresLight(true);
setHasFirePit(firePit);
}
@Override
public void makeOverlayHint(PanelComponent panelComponent, ClueScrollPlugin plugin)
{

View File

@@ -43,18 +43,18 @@ import static net.runelite.client.plugins.cluescrolls.clues.hotcold.HotColdArea.
public enum HotColdLocation
{
ASGARNIA_WARRIORS(new WorldPoint(2860, 3562, 0), ASGARNIA, "North of the Warriors' Guild in Burthorpe."),
ASGARNIA_JATIX(new WorldPoint(2914, 3429, 0), ASGARNIA, "East of Jatix's Herblore Shop in Taverley."),
ASGARNIA_JATIX(new WorldPoint(2915, 3425, 0), ASGARNIA, "East of Jatix's Herblore Shop in Taverley."),
ASGARNIA_BARB(new WorldPoint(3036, 3439, 0), ASGARNIA, "West of Barbarian Village."),
ASGARNIA_MIAZRQA(new WorldPoint(2973, 3489, 0), ASGARNIA, "North of Miazrqa's tower, outside Goblin Village."),
ASGARNIA_COW(new WorldPoint(3033, 3308, 0), ASGARNIA, "In the cow pen north of Sarah's Farming Shop."),
ASGARNIA_PARTY_ROOM(new WorldPoint(3026, 3363, 0), ASGARNIA, "Outside the Falador Party Room."),
ASGARNIA_CRAFT_GUILD(new WorldPoint(2917, 3295, 0), ASGARNIA, "Outside the Crafting Guild cow pen."),
ASGARNIA_RIMMINGTON(new WorldPoint(2978, 3241, 0), ASGARNIA, "In the centre of the Rimmington mine."),
ASGARNIA_MUDSKIPPER(new WorldPoint(2984, 3109, 0), ASGARNIA, "Mudskipper Point, on the starfish in the south-west corner."),
ASGARNIA_MUDSKIPPER(new WorldPoint(2987, 3110, 0), ASGARNIA, "Mudskipper Point, near the starfish in the south-west corner."),
ASGARNIA_TROLL(new WorldPoint(2910, 3616, 0), ASGARNIA, "The Troll arena, where the player fights Dad during the Troll Stronghold quest. Bring climbing boots if travelling from Burthorpe."),
DESERT_GENIE(new WorldPoint(3364, 2910, 0), DESERT, "West of Nardah genie cave."),
DESERT_ALKHARID_MINE(new WorldPoint(3282, 3270, 0), DESERT, "West of Al Kharid mine."),
DESERT_MENAPHOS_GATE(new WorldPoint(3224, 2816, 0), DESERT, "North of Menaphos gate."),
DESERT_MENAPHOS_GATE(new WorldPoint(3223, 2820, 0), DESERT, "North of Menaphos gate."),
DESERT_BEDABIN_CAMP(new WorldPoint(3164, 3050, 0), DESERT, "Bedabin Camp, dig around the north tent."),
DESERT_UZER(new WorldPoint(3431, 3106, 0), DESERT, "West of Uzer."),
DESERT_POLLNIVNEACH(new WorldPoint(3287, 2975, 0), DESERT, "West of Pollnivneach."),
@@ -62,59 +62,59 @@ public enum HotColdLocation
DESERT_SHANTY(new WorldPoint(3294, 3106, 0), DESERT, "South-west of Shantay Pass."),
DRAYNOR_MANOR_MUSHROOMS(true, new WorldPoint(3096, 3379, 0), MISTHALIN, "Patch of mushrooms just northwest of Draynor Manor"),
DRAYNOR_WHEAT_FIELD(true, new WorldPoint(3120, 3282, 0), MISTHALIN, "Inside the wheat field next to Draynor Village"),
FELDIP_HILLS_JIGGIG(new WorldPoint(2413, 3055, 0), FELDIP_HILLS, "West of Jiggig, east of the fairy ring bkp."),
FELDIP_HILLS_SW(new WorldPoint(2582, 2895, 0), FELDIP_HILLS, "West of the southeasternmost lake in Feldip Hills."),
FELDIP_HILLS_GNOME_GLITER(new WorldPoint(2553, 2972, 0), FELDIP_HILLS, "East of the gnome glider (Lemantolly Undri)."),
FELDIP_HILLS_JIGGIG(new WorldPoint(2409, 3053, 0), FELDIP_HILLS, "West of Jiggig, east of the fairy ring bkp."),
FELDIP_HILLS_SW(new WorldPoint(2586, 2897, 0), FELDIP_HILLS, "West of the southeasternmost lake in Feldip Hills."),
FELDIP_HILLS_GNOME_GLITER(new WorldPoint(2555, 2972, 0), FELDIP_HILLS, "East of the gnome glider (Lemantolly Undri)."),
FELDIP_HILLS_RANTZ(new WorldPoint(2611, 2946, 0), FELDIP_HILLS, "South of Rantz, six steps west of the empty glass bottles."),
FELDIP_HILLS_SOUTH(new WorldPoint(2487, 3005, 0), FELDIP_HILLS, "South of Jiggig."),
FELDIP_HILLS_RED_CHIN(new WorldPoint(2532, 2900, 0), FELDIP_HILLS, "Outside the red chinchompa hunting ground entrance, south of the Hunting expert's hut."),
FELDIP_HILLS_SE(new WorldPoint(2567, 2916, 0), FELDIP_HILLS, "South-east of the ∩-shaped lake, near the icon."),
FELDIP_HILLS_CW_BALLOON(new WorldPoint(2452, 3108, 0), FELDIP_HILLS, "Directly west of the Castle Wars balloon."),
FREMENNIK_PROVINCE_MTN_CAMP(new WorldPoint(2804, 3672, 0), FREMENNIK_PROVINCE, "At the Mountain Camp."),
FREMENNIK_PROVINCE_MTN_CAMP(new WorldPoint(2800, 3669, 0), FREMENNIK_PROVINCE, "At the Mountain Camp."),
FREMENNIK_PROVINCE_RELLEKKA_HUNTER(new WorldPoint(2724, 3783, 0), FREMENNIK_PROVINCE, "At the Rellekka Hunter area, near the icon."),
FREMENNIK_PROVINCE_KELGADRIM_ENTRANCE(new WorldPoint(2715, 3689, 0), FREMENNIK_PROVINCE, "West of the Keldagrim entrance mine."),
FREMENNIK_PROVINCE_SW(new WorldPoint(2605, 3648, 0), FREMENNIK_PROVINCE, "Outside the fence in the south-western corner of Rellekka."),
FREMENNIK_PROVINCE_LIGHTHOUSE(new WorldPoint(2589, 3598, 0), FREMENNIK_PROVINCE, "South-east of the Lighthouse."),
FREMENNIK_PROVINCE_ETCETERIA_CASTLE(new WorldPoint(2614, 3867, 0), FREMENNIK_PROVINCE, "Inside Etceteria's castle, in the southern staircase."),
FREMENNIK_PROVINCE_MISC_COURTYARD(new WorldPoint(2529, 3867, 0), FREMENNIK_PROVINCE, "Outside Miscellania's courtyard."),
FREMENNIK_PROVINCE_FREMMY_ISLES_MINE(new WorldPoint(2378, 3849, 0), FREMENNIK_PROVINCE, "Central Fremennik Isles mine."),
FREMENNIK_PROVINCE_LIGHTHOUSE(new WorldPoint(2585, 3601, 0), FREMENNIK_PROVINCE, "South-east of the Lighthouse."),
FREMENNIK_PROVINCE_ETCETERIA_CASTLE(new WorldPoint(2617, 3862, 0), FREMENNIK_PROVINCE, "South-east of Etceteria's castle."),
FREMENNIK_PROVINCE_MISC_COURTYARD(new WorldPoint(2527, 3868, 0), FREMENNIK_PROVINCE, "Outside Miscellania's courtyard."),
FREMENNIK_PROVINCE_FREMMY_ISLES_MINE(new WorldPoint(2374, 3850, 0), FREMENNIK_PROVINCE, "Central Fremennik Isles mine."),
FREMENNIK_PROVINCE_WEST_ISLES_MINE(new WorldPoint(2313, 3854, 0), FREMENNIK_PROVINCE, "West Fremennik Isles mine."),
FREMENNIK_PROVINCE_WEST_JATIZSO_ENTRANCE(new WorldPoint(2391, 3813, 0), FREMENNIK_PROVINCE, "West of the Jatizso mine entrance."),
FREMENNIK_PROVINCE_PIRATES_COVE(new WorldPoint(2210, 3814, 0), FREMENNIK_PROVINCE, "Pirates' Cove"),
FREMENNIK_PROVINCE_ASTRAL_ALTER(new WorldPoint(2147, 3862, 0), FREMENNIK_PROVINCE, "Astral altar"),
FREMENNIK_PROVINCE_LUNAR_VILLAGE(new WorldPoint(2087, 3915, 0), FREMENNIK_PROVINCE, "Lunar Isle, inside the village."),
FREMENNIK_PROVINCE_LUNAR_VILLAGE(new WorldPoint(2084, 3916, 0), FREMENNIK_PROVINCE, "Lunar Isle, inside the village."),
FREMENNIK_PROVINCE_LUNAR_NORTH(new WorldPoint(2106, 3949, 0), FREMENNIK_PROVINCE, "Lunar Isle, north of the village."),
ICE_MOUNTAIN(true, new WorldPoint(3007, 3475, 0), MISTHALIN, "Atop Ice Mountain"),
KANDARIN_SINCLAR_MANSION(new WorldPoint(2726, 3588, 0), KANDARIN, "North-west of the Sinclair Mansion, near the log balance shortcut."),
KANDARIN_SINCLAR_MANSION(new WorldPoint(2730, 3588, 0), KANDARIN, "North-west of the Sinclair Mansion, near the log balance shortcut."),
KANDARIN_CATHERBY(new WorldPoint(2774, 3433, 0), KANDARIN, "Catherby, between the bank and the beehives, near small rock formation."),
KANDARIN_GRAND_TREE(new WorldPoint(2444, 3503, 0), KANDARIN, "Grand Tree, just east of the terrorchick gnome enclosure."),
KANDARIN_GRAND_TREE(new WorldPoint(2448, 3503, 0), KANDARIN, "Grand Tree, just east of the terrorchick gnome enclosure."),
KANDARIN_SEERS(new WorldPoint(2735, 3486, 0), KANDARIN, "Between the Seers' Village bank and Camelot."),
KANDARIN_MCGRUBORS_WOOD(new WorldPoint(2653, 3485, 0), KANDARIN, "McGrubor's Wood"),
KANDARIN_FISHING_BUILD(new WorldPoint(2586, 3372, 0), KANDARIN, "South of Fishing Guild"),
KANDARIN_WITCHHAVEN(new WorldPoint(2708, 3304, 0), KANDARIN, "Outside Witchaven, west of Jeb, Holgart, and Caroline."),
KANDARIN_NECRO_TOWER(new WorldPoint(2669, 3242, 0), KANDARIN, "Ground floor inside the Necromancer Tower. Easily accessed by using fairy ring code djp."),
KANDARIN_FIGHT_ARENA(new WorldPoint(2587, 3134, 0), KANDARIN, "South of the Fight Arena, north-west of the Nightmare Zone."),
KANDARIN_NECRO_TOWER(new WorldPoint(2667, 3241, 0), KANDARIN, "Ground floor inside the Necromancer Tower. Easily accessed by using fairy ring code djp."),
KANDARIN_FIGHT_ARENA(new WorldPoint(2587, 3135, 0), KANDARIN, "South of the Fight Arena, north-west of the Nightmare Zone."),
KANDARIN_TREE_GNOME_VILLAGE(new WorldPoint(2526, 3160, 0), KANDARIN, "Tree Gnome Village, near the general store icon."),
KANDARIN_GRAVE_OF_SCORPIUS(new WorldPoint(2464, 3228, 0), KANDARIN, "Grave of Scorpius"),
KANDARIN_KHAZARD_BATTLEFIELD(new WorldPoint(2518, 3249, 0), KANDARIN, "Khazard Battlefield, in the small ruins south of tracker gnome 2."),
KANDARIN_WEST_ARDY(new WorldPoint(2533, 3320, 0), KANDARIN, "West Ardougne, near the staircase outside the Civic Office."),
KANDARIN_WEST_ARDY(new WorldPoint(2535, 3322, 0), KANDARIN, "West Ardougne, near the staircase outside the Civic Office."),
KANDARIN_SW_TREE_GNOME_STRONGHOLD(new WorldPoint(2411, 3431, 0), KANDARIN, "South-west Tree Gnome Stronghold"),
KANDARIN_OUTPOST(new WorldPoint(2458, 3364, 0), KANDARIN, "South of the Tree Gnome Stronghold, north-east of the Outpost."),
KANDARIN_BAXTORIAN_FALLS(new WorldPoint(2534, 3479, 0), KANDARIN, "South-east of Almera's house on Baxtorian Falls."),
KANDARIN_BA_AGILITY_COURSE(new WorldPoint(2536, 3546, 0), KANDARIN, "Inside the Barbarian Agility Course. Completion of Alfred Grimhand's Barcrawl is required."),
KANDARIN_BA_AGILITY_COURSE(new WorldPoint(2540, 3548, 0), KANDARIN, "Inside the Barbarian Agility Course. Completion of Alfred Grimhand's Barcrawl is required."),
KARAMJA_MUSA_POINT(new WorldPoint(2914, 3168, 0), KARAMJA, "Musa Point, banana plantation."),
KARAMJA_BRIMHAVEN_FRUIT_TREE(new WorldPoint(2783, 3214, 0), KARAMJA, "Brimhaven, east of the fruit tree patch."),
KARAMJA_BRIMHAVEN_FRUIT_TREE(new WorldPoint(2782, 3215, 0), KARAMJA, "Brimhaven, east of the fruit tree patch."),
KARAMJA_WEST_BRIMHAVEN(new WorldPoint(2721, 3169, 0), KARAMJA, "West of Brimhaven."),
KARAMJA_GLIDER(new WorldPoint(2966, 2975, 0), KARAMJA, "West of the gnome glider."),
KARAMJA_KHARAZI_NE(new WorldPoint(2904, 2925, 0), KARAMJA, "North-eastern part of Kharazi Jungle."),
KARAMJA_KHARAZI_SW(new WorldPoint(2783, 2898, 0), KARAMJA, "South-western part of Kharazi Jungle."),
KARAMJA_CRASH_ISLAND(new WorldPoint(2910, 2737, 0), KARAMJA, "Northern part of Crash Island."),
KARAMJA_CRASH_ISLAND(new WorldPoint(2909, 2737, 0), KARAMJA, "Northern part of Crash Island."),
LUMBRIDGE_COW_FIELD(true, new WorldPoint(3174, 3336, 0), MISTHALIN, "Cow field north of Lumbridge"),
MISTHALIN_VARROCK_STONE_CIRCLE(new WorldPoint(3225, 3355, 0), MISTHALIN, "South of the stone circle near Varrock's entrance."),
MISTHALIN_LUMBRIDGE(new WorldPoint(3238, 3169, 0), MISTHALIN, "Just north-west of the Lumbridge Fishing tutor."),
MISTHALIN_LUMBRIDGE_2(new WorldPoint(3170, 3278, 0), MISTHALIN, "North of the pond between Lumbridge and Draynor Village."),
MISTHALIN_GERTUDES(new WorldPoint(3158, 3421, 0), MISTHALIN, "North-east of Gertrude's house west of Varrock."),
MISTHALIN_DRAYNOR_BANK(new WorldPoint(3096, 3235, 0), MISTHALIN, "South of Draynor Village bank."),
MISTHALIN_DRAYNOR_BANK(new WorldPoint(3098, 3234, 0), MISTHALIN, "South of Draynor Village bank."),
MISTHALIN_LUMBER_YARD(new WorldPoint(3303, 3483, 0), MISTHALIN, "South of Lumber Yard, east of Assistant Serf."),
MORYTANIA_BURGH_DE_ROTT(new WorldPoint(3545, 3253, 0), MORYTANIA, "In the north-east area of Burgh de Rott, by the reverse-L-shaped ruins."),
MORYTANIA_PORT_PHASMATYS(new WorldPoint(3613, 3485, 0), MORYTANIA, "West of Port Phasmatys, south-east of fairy ring."),
@@ -124,22 +124,22 @@ public enum HotColdLocation
MORYTANIA_MAUSOLEUM(new WorldPoint(3499, 3539, 0), MORYTANIA, "South of the Mausoleum."),
MORYTANIA_MOS_LES_HARMLESS(new WorldPoint(3744, 3041, 0), MORYTANIA, "Northern area of Mos Le'Harmless, between the lakes."),
MORYTANIA_MOS_LES_HARMLESS_BAR(new WorldPoint(3670, 2974, 0), MORYTANIA, "Near Mos Le'Harmless southern bar."),
MORYTANIA_DRAGONTOOTH_NORTH(new WorldPoint(3813, 3567, 0), MORYTANIA, "Northern part of Dragontooth Island."),
MORYTANIA_DRAGONTOOTH_NORTH(new WorldPoint(3811, 3569, 0), MORYTANIA, "Northern part of Dragontooth Island."),
MORYTANIA_DRAGONTOOTH_SOUTH(new WorldPoint(3803, 3532, 0), MORYTANIA, "Southern part of Dragontooth Island."),
NORTHEAST_OF_AL_KHARID_MINE(true, new WorldPoint(3332, 3313, 0), MISTHALIN, "Northeast of Al Kharid Mine"),
WESTERN_PROVINCE_EAGLES_PEAK(new WorldPoint(2297, 3530, 0), WESTERN_PROVINCE, "North-west of Eagles' Peak."),
WESTERN_PROVINCE_PISCATORIS(new WorldPoint(2337, 3689, 0), WESTERN_PROVINCE, "Piscatoris Fishing Colony"),
WESTERN_PROVINCE_EAGLES_PEAK(new WorldPoint(2297, 3529, 0), WESTERN_PROVINCE, "North-west of Eagles' Peak."),
WESTERN_PROVINCE_PISCATORIS(new WorldPoint(2334, 3685, 0), WESTERN_PROVINCE, "Piscatoris Fishing Colony"),
WESTERN_PROVINCE_PISCATORIS_HUNTER_AREA(new WorldPoint(2359, 3564, 0), WESTERN_PROVINCE, "Eastern part of Piscatoris Hunter area, south-west of the Falconry."),
WESTERN_PROVINCE_ARANDAR(new WorldPoint(2366, 3318, 0), WESTERN_PROVINCE, "South-west of the crystal gate to Arandar."),
WESTERN_PROVINCE_ARANDAR(new WorldPoint(2370, 3319, 0), WESTERN_PROVINCE, "South-west of the crystal gate to Arandar."),
WESTERN_PROVINCE_ELF_CAMP_EAST(new WorldPoint(2270, 3244, 0), WESTERN_PROVINCE, "East of Iorwerth Camp."),
WESTERN_PROVINCE_ELF_CAMP_NW(new WorldPoint(2174, 3280, 0), WESTERN_PROVINCE, "North-west of Iorwerth Camp."),
WESTERN_PROVINCE_LLETYA(new WorldPoint(2335, 3166, 0), WESTERN_PROVINCE, "In Lletya."),
WESTERN_PROVINCE_LLETYA(new WorldPoint(2337, 3166, 0), WESTERN_PROVINCE, "In Lletya."),
WESTERN_PROVINCE_TYRAS(new WorldPoint(2204, 3157, 0), WESTERN_PROVINCE, "Near Tyras Camp."),
WESTERN_PROVINCE_ZULANDRA(new WorldPoint(2196, 3057, 0), WESTERN_PROVINCE, "The northern house at Zul-Andra."),
WILDERNESS_5(new WorldPoint(3173, 3556, 0), WILDERNESS, "North of the Grand Exchange, level 5 Wilderness."),
WILDERNESS_12(new WorldPoint(3038, 3612, 0), WILDERNESS, "South-east of the Dark Warriors' Fortress, level 12 Wilderness."),
WILDERNESS_20(new WorldPoint(3225, 3676, 0), WILDERNESS, "East of the Corporeal Beast's lair, level 20 Wilderness."),
WILDERNESS_27(new WorldPoint(3174, 3735, 0), WILDERNESS, "Inside the Ruins north of the Graveyard of Shadows, level 27 Wilderness."),
WILDERNESS_27(new WorldPoint(3174, 3736, 0), WILDERNESS, "Inside the Ruins north of the Graveyard of Shadows, level 27 Wilderness."),
WILDERNESS_28(new WorldPoint(3374, 3734, 0), WILDERNESS, "East of Venenatis' nest, level 28 Wilderness."),
WILDERNESS_32(new WorldPoint(3311, 3773, 0), WILDERNESS, "North of Venenatis' nest, level 32 Wilderness."),
WILDERNESS_35(new WorldPoint(3153, 3795, 0), WILDERNESS, "East of the Wilderness canoe exit, level 35 Wilderness."),
@@ -151,18 +151,18 @@ public enum HotColdLocation
ZEAH_BLASTMINE_NORTH(new WorldPoint(1488, 3881, 0), ZEAH, "Northern part of the Lovakengj blast mine."),
ZEAH_LOVAKITE_FURNACE(new WorldPoint(1507, 3819, 0), ZEAH, "Next to the lovakite furnace in Lovakengj."),
ZEAH_LOVAKENGJ_MINE(new WorldPoint(1477, 3779, 0), ZEAH, "Next to mithril rock in the Lovakengj mine."),
ZEAH_SULPHR_MINE(new WorldPoint(1428, 3866, 0), ZEAH, "Western entrance in the Lovakengj sulphur mine."),
ZEAH_SULPHR_MINE(new WorldPoint(1428, 3869, 0), ZEAH, "Western entrance in the Lovakengj sulphur mine."),
ZEAH_SHAYZIEN_BANK(new WorldPoint(1517, 3603, 0), ZEAH, "South-east of the bank in Shayzien."),
ZEAH_OVERPASS(new WorldPoint(1467, 3714, 0), ZEAH, "Overpass between Lovakengj and Shayzien."),
ZEAH_LIZARDMAN(new WorldPoint(1493, 3694, 0), ZEAH, "Within Lizardman Canyon, east of the ladder. Requires 5% favour with Shayzien."),
ZEAH_COMBAT_RING(new WorldPoint(1557, 3580, 0), ZEAH, "Shayzien, south-east of the Combat Ring."),
ZEAH_LIZARDMAN(new WorldPoint(1490, 3698, 0), ZEAH, "Within Lizardman Canyon, east of the ladder. Requires 5% favour with Shayzien."),
ZEAH_COMBAT_RING(new WorldPoint(1559, 3582, 0), ZEAH, "Shayzien, south-east of the Combat Ring."),
ZEAH_SHAYZIEN_BANK_2(new WorldPoint(1494, 3622, 0), ZEAH, "North-west of the bank in Shayzien."),
ZEAH_LIBRARY(new WorldPoint(1601, 3842, 0), ZEAH, "North-west of the Arceuus Library."),
ZEAH_LIBRARY(new WorldPoint(1603, 3843, 0), ZEAH, "North-west of the Arceuus Library."),
ZEAH_HOUSECHURCH(new WorldPoint(1682, 3792, 0), ZEAH, "By the entrance to the Arceuus church."),
ZEAH_DARK_ALTAR(new WorldPoint(1699, 3879, 0), ZEAH, "West of the Dark Altar."),
ZEAH_ARCEUUS_HOUSE(new WorldPoint(1708, 3701, 0), ZEAH, "By the southern entrance to Arceuus."),
ZEAH_ARCEUUS_HOUSE(new WorldPoint(1710, 3700, 0), ZEAH, "By the southern entrance to Arceuus."),
ZEAH_ESSENCE_MINE(new WorldPoint(1762, 3852, 0), ZEAH, "By the Arceuus essence mine."),
ZEAH_ESSENCE_MINE_NE(new WorldPoint(1772, 3866, 0), ZEAH, "North-east of the Arceuus essence mine."),
ZEAH_ESSENCE_MINE_NE(new WorldPoint(1773, 3867, 0), ZEAH, "North-east of the Arceuus essence mine."),
ZEAH_PISCARILUS_MINE(new WorldPoint(1768, 3705, 0), ZEAH, "South of the Piscarilius mine."),
ZEAH_GOLDEN_FIELD_TAVERN(new WorldPoint(1718, 3647, 0), ZEAH, "South of The Golden Field tavern in the northern area of Hosidius."),
ZEAH_MESS_HALL(new WorldPoint(1658, 3621, 0), ZEAH, "East of the Mess hall."),

View File

@@ -103,8 +103,10 @@ public class HotColdSolver
possibleLocations.removeIf(entry -> isFirstPointCloserRect(lastWorldPoint, worldPoint, entry.getRect()));
break;
case SAME:
// I couldn't figure out a clean implementation for this case
// not necessary for quickly determining final location
// eliminate spots which are absolutely colder or warmer (as they would not yield a SAME temperature change)
possibleLocations.removeIf(entry ->
isFirstPointCloserRect(worldPoint, lastWorldPoint, entry.getRect())
|| isFirstPointCloserRect(lastWorldPoint, worldPoint, entry.getRect()));
}
}
@@ -123,7 +125,7 @@ public class HotColdSolver
* @see WorldPoint#distanceTo2D
*/
@VisibleForTesting
private static boolean isFirstPointCloserRect(final WorldPoint firstPoint, final WorldPoint secondPoint, final Rectangle rect)
static boolean isFirstPointCloserRect(final WorldPoint firstPoint, final WorldPoint secondPoint, final Rectangle rect)
{
final WorldPoint nePoint = new WorldPoint((rect.x + rect.width), (rect.y + rect.height), 0);
@@ -161,7 +163,7 @@ public class HotColdSolver
* @see WorldPoint#distanceTo2D
*/
@VisibleForTesting
private static boolean isFirstPointCloser(final WorldPoint firstPoint, final WorldPoint secondPoint, final WorldPoint worldPoint)
static boolean isFirstPointCloser(final WorldPoint firstPoint, final WorldPoint secondPoint, final WorldPoint worldPoint)
{
return firstPoint.distanceTo2D(worldPoint) < secondPoint.distanceTo2D(worldPoint);
}

View File

@@ -41,6 +41,7 @@ import java.awt.event.MouseEvent;
import java.awt.image.BufferedImage;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import java.text.DecimalFormat;
import java.util.ArrayList;
import java.util.EnumSet;
import java.util.HashMap;
@@ -88,6 +89,7 @@ import net.runelite.client.config.ConfigTitleSection;
import net.runelite.client.config.Keybind;
import net.runelite.client.config.ModifierlessKeybind;
import net.runelite.client.config.Range;
import net.runelite.client.config.Units;
import net.runelite.client.eventbus.Subscribe;
import net.runelite.client.events.PluginChanged;
import net.runelite.client.plugins.PluginManager;
@@ -543,6 +545,7 @@ class ConfigPanel extends PluginPanel
{
int value = Integer.parseInt(configManager.getConfiguration(cd.getGroup().value(), cid.getItem().keyName()));
Units units = cid.getUnits();
Range range = cid.getRange();
int min = 0, max = Integer.MAX_VALUE;
if (range != null)
@@ -558,12 +561,27 @@ class ConfigPanel extends PluginPanel
{
JLabel sliderValueLabel = new JLabel();
JSlider slider = new JSlider(min, max, value);
sliderValueLabel.setText(String.valueOf(slider.getValue()));
if (units != null)
{
sliderValueLabel.setText(slider.getValue() + " " + units.value());
}
else
{
sliderValueLabel.setText(String.valueOf(slider.getValue()));
}
slider.setPreferredSize(new Dimension(80, 25));
slider.setBackground(Color.WHITE);
slider.addChangeListener((l) ->
{
sliderValueLabel.setText(String.valueOf(slider.getValue()));
if (units != null)
{
sliderValueLabel.setText(slider.getValue() + " " + units.value());
}
else
{
sliderValueLabel.setText(String.valueOf(slider.getValue()));
}
if (!slider.getValueIsAdjusting())
{
changeConfiguration(slider, cd, cid);
@@ -597,7 +615,14 @@ class ConfigPanel extends PluginPanel
{
changeConfiguration(spinner, cd, cid);
sliderValueLabel.setText(String.valueOf(spinner.getValue()));
if (units != null)
{
sliderValueLabel.setText(spinner.getValue() + " " + units.value());
}
else
{
sliderValueLabel.setText(String.valueOf(spinner.getValue()));
}
slider.setValue((Integer) spinner.getValue());
subPanel.add(sliderValueLabel, BorderLayout.WEST);
@@ -641,6 +666,15 @@ class ConfigPanel extends PluginPanel
spinnerTextField.setColumns(SPINNER_FIELD_WIDTH);
spinner.addChangeListener(ce -> changeConfiguration(spinner, cd, cid));
if (units != null)
{
DecimalFormat df = ((JSpinner.NumberEditor) spinner.getEditor()).getFormat();
df.setPositiveSuffix(units.value());
df.setNegativeSuffix(units.value());
// Force update the spinner to have it add the units initially
spinnerTextField.setValue(value);
}
item.add(spinner, BorderLayout.EAST);
}
}
@@ -760,6 +794,7 @@ class ConfigPanel extends PluginPanel
JPanel dimensionPanel = new JPanel();
dimensionPanel.setLayout(new BorderLayout());
Units units = cid.getUnits();
String str = configManager.getConfiguration(cd.getGroup().value(), cid.getItem().keyName());
String[] splitStr = str.split("x");
int width = Integer.parseInt(splitStr[0]);
@@ -771,12 +806,30 @@ class ConfigPanel extends PluginPanel
JFormattedTextField widthSpinnerTextField = ((JSpinner.DefaultEditor) widthEditor).getTextField();
widthSpinnerTextField.setColumns(4);
if (units != null)
{
DecimalFormat df = ((JSpinner.NumberEditor) widthSpinner.getEditor()).getFormat();
df.setPositiveSuffix(units.value());
df.setNegativeSuffix(units.value());
// Force update the spinner to have it add the units initially
widthSpinnerTextField.setValue(width);
}
SpinnerModel heightModel = new SpinnerNumberModel(height, 0, Integer.MAX_VALUE, 1);
JSpinner heightSpinner = new JSpinner(heightModel);
Component heightEditor = heightSpinner.getEditor();
JFormattedTextField heightSpinnerTextField = ((JSpinner.DefaultEditor) heightEditor).getTextField();
heightSpinnerTextField.setColumns(4);
if (units != null)
{
DecimalFormat df = ((JSpinner.NumberEditor) heightSpinner.getEditor()).getFormat();
df.setPositiveSuffix(units.value());
df.setNegativeSuffix(units.value());
// Force update the spinner to have it add the units initially
heightSpinnerTextField.setValue(height);
}
ChangeListener listener = e ->
configManager.setConfiguration(cd.getGroup().value(), cid.getItem().keyName(), widthSpinner.getValue() + "x" + heightSpinner.getValue());

View File

@@ -28,6 +28,7 @@ package net.runelite.client.plugins.cooking;
import net.runelite.client.config.Config;
import net.runelite.client.config.ConfigGroup;
import net.runelite.client.config.ConfigItem;
import net.runelite.client.config.Units;
@ConfigGroup("cooking")
public interface CookingConfig extends Config
@@ -35,9 +36,10 @@ public interface CookingConfig extends Config
@ConfigItem(
position = 1,
keyName = "statTimeout",
name = "Reset stats (minutes)",
name = "Reset stats",
description = "Configures the time until the session resets and the overlay is hidden (0 = Disable feature)"
)
@Units(Units.MINUTES)
default int statTimeout()
{
return 5;

View File

@@ -35,6 +35,7 @@ import net.runelite.client.config.ConfigItem;
import net.runelite.client.config.ConfigTitleSection;
import net.runelite.client.config.Range;
import net.runelite.client.config.Title;
import net.runelite.client.config.Units;
@ConfigGroup("Cox")
@@ -220,6 +221,7 @@ public interface CoxConfig extends Config
description = "Change the Size of the Olm Infobox.",
titleSection = "olmTitle"
)
@Units(Units.PIXELS)
default int prayAgainstOlmSize()
{
return 40;
@@ -390,6 +392,7 @@ public interface CoxConfig extends Config
description = "Text Size for Timers.",
titleSection = "text"
)
@Units(Units.POINTS)
default int textSize()
{
return 14;

View File

@@ -25,10 +25,12 @@
package net.runelite.client.plugins.customcursor;
import java.awt.image.BufferedImage;
import javax.annotation.Nullable;
import lombok.AccessLevel;
import lombok.Getter;
import net.runelite.client.util.ImageUtil;
@Getter(AccessLevel.PUBLIC)
public enum CustomCursor
{
RS3_GOLD("RS3 Gold", "cursor-rs3-gold.png"),
@@ -42,12 +44,19 @@ public enum CustomCursor
MOUSE("Mouse", "cursor-mouse.png"),
SARADOMIN_GODSWORD("Saradomin Godsword", "cursor-saradomin-godsword.png"),
ZAMORAK_GODSWORD("Zamorak Godsword", "cursor-zamorak-godsword.png"),
SKILL_SPECS("Skill Specs", "cursor-skill-specs.png");
SKILL_SPECS("Skill Specs", "cursor-skill-specs.png"),
CUSTOM_IMAGE("Custom Image");
private final String name;
@Getter(AccessLevel.PUBLIC)
@Nullable
private final BufferedImage cursorImage;
CustomCursor(String name)
{
this.name = name;
this.cursorImage = null;
}
CustomCursor(final String name, final String icon)
{
this.name = name;

View File

@@ -25,7 +25,10 @@
package net.runelite.client.plugins.customcursor;
import com.google.inject.Provides;
import java.awt.image.BufferedImage;
import java.io.File;
import java.io.IOException;
import javax.imageio.ImageIO;
import javax.inject.Inject;
import javax.inject.Singleton;
import javax.sound.sampled.AudioInputStream;
@@ -35,6 +38,7 @@ import javax.sound.sampled.FloatControl;
import javax.sound.sampled.LineUnavailableException;
import javax.sound.sampled.UnsupportedAudioFileException;
import lombok.extern.slf4j.Slf4j;
import net.runelite.client.RuneLite;
import net.runelite.client.config.ConfigManager;
import net.runelite.client.eventbus.Subscribe;
import net.runelite.client.events.ConfigChanged;
@@ -53,6 +57,8 @@ import net.runelite.client.ui.ClientUI;
@Singleton
public class CustomCursorPlugin extends Plugin
{
private static final File CUSTOM_IMAGE_FILE = new File(RuneLite.RUNELITE_DIR, "cursor.png");
@Inject
private ClientUI clientUI;
@@ -125,6 +131,34 @@ public class CustomCursorPlugin extends Plugin
skillSpecsRage.start();
}
}
else if (selectedCursor == CustomCursor.CUSTOM_IMAGE)
{
if (CUSTOM_IMAGE_FILE.exists())
{
try
{
BufferedImage image;
synchronized (ImageIO.class)
{
image = ImageIO.read(CUSTOM_IMAGE_FILE);
}
clientUI.setCursor(image, selectedCursor.getName());
}
catch (Exception e)
{
log.error("error setting custom cursor", e);
clientUI.resetCursor();
}
}
else
{
clientUI.resetCursor();
}
return;
}
assert selectedCursor.getCursorImage() != null;
clientUI.setCursor(selectedCursor.getCursorImage(), selectedCursor.getName());
clientUI.setCursor(selectedCursor.getCursorImage(), selectedCursor.toString());
}

View File

@@ -27,16 +27,18 @@ package net.runelite.client.plugins.discord;
import net.runelite.client.config.Config;
import net.runelite.client.config.ConfigGroup;
import net.runelite.client.config.ConfigItem;
import net.runelite.client.config.Units;
@ConfigGroup("discord")
public interface DiscordConfig extends Config
{
@ConfigItem(
keyName = "actionTimeout",
name = "Action timeout (minutes)",
name = "Action timeout",
description = "Configures after how long of not updating status will be reset (in minutes)",
position = 0
)
@Units(Units.MINUTES)
default int actionTimeout()
{
return 5;

View File

@@ -8,6 +8,7 @@ import net.runelite.client.config.Config;
import net.runelite.client.config.ConfigGroup;
import net.runelite.client.config.ConfigItem;
import net.runelite.client.config.Range;
import net.runelite.client.config.Units;
@ConfigGroup("drop")
public interface DropPartyConfig extends Config
@@ -70,6 +71,7 @@ public interface DropPartyConfig extends Config
name = "Text Size",
description = "Text Size for Timers."
)
@Units(Units.POINTS)
default int textSize()
{
return 18;

View File

@@ -28,6 +28,7 @@ import java.awt.Color;
import net.runelite.client.config.Config;
import net.runelite.client.config.ConfigGroup;
import net.runelite.client.config.ConfigItem;
import net.runelite.client.config.Units;
@ConfigGroup("xpdrop")
public interface XpDropConfig extends Config
@@ -89,6 +90,7 @@ public interface XpDropConfig extends Config
description = "Configures how many ticks should pass between fake XP drops, 0 to disable",
position = 4
)
@Units(Units.TICKS)
default int fakeXpDropDelay()
{
return 0;

View File

@@ -33,6 +33,7 @@ import net.runelite.client.config.ConfigItem;
import net.runelite.client.config.ConfigTitleSection;
import net.runelite.client.config.Range;
import net.runelite.client.config.Title;
import net.runelite.client.config.Units;
@ConfigGroup("fightcave")
public interface FightCaveConfig extends Config
@@ -106,6 +107,7 @@ public interface FightCaveConfig extends Config
description = "Text Size for Timers.",
titleSection = "text"
)
@Units(Units.POINTS)
default int textSize()
{
return 32;

View File

@@ -28,6 +28,7 @@ import java.awt.Color;
import net.runelite.client.config.Config;
import net.runelite.client.config.ConfigGroup;
import net.runelite.client.config.ConfigItem;
import net.runelite.client.config.Units;
@ConfigGroup("fishing")
public interface FishingConfig extends Config
@@ -112,9 +113,10 @@ public interface FishingConfig extends Config
@ConfigItem(
position = 7,
keyName = "statTimeout",
name = "Reset stats (minutes)",
name = "Reset stats",
description = "The time until fishing session data is reset in minutes."
)
@Units(Units.MINUTES)
default int statTimeout()
{
return 5;

View File

@@ -28,6 +28,7 @@ import net.runelite.client.config.Config;
import net.runelite.client.config.ConfigGroup;
import net.runelite.client.config.ConfigItem;
import net.runelite.client.config.Range;
import net.runelite.client.config.Units;
@ConfigGroup(FpsPlugin.CONFIG_GROUP_KEY)
public interface FpsConfig extends Config
@@ -54,6 +55,7 @@ public interface FpsConfig extends Config
description = "Desired max global frames per second",
position = 2
)
@Units(Units.FPS)
default int maxFps()
{
return 50;
@@ -80,6 +82,7 @@ public interface FpsConfig extends Config
description = "Desired max frames per second for unfocused",
position = 4
)
@Units(Units.FPS)
default int maxFpsUnfocused()
{
return 50;

View File

@@ -1,170 +0,0 @@
/*
* Copyright (c) 2019, ganom <https://github.com/Ganom>
* Copyright (c) 2019, pklite <https://github.com/pklite/pklite>
* 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.freezetimers;
import net.runelite.client.config.Config;
import net.runelite.client.config.ConfigGroup;
import net.runelite.client.config.ConfigItem;
import net.runelite.client.config.ConfigTitleSection;
import net.runelite.client.config.Range;
import net.runelite.client.config.Title;
@ConfigGroup("freezetimers")
public interface FreezeTimersConfig extends Config
{
@ConfigTitleSection(
keyName = "timersTitle",
name = "Timers",
description = "",
position = 1
)
default Title timersTitle()
{
return new Title();
}
@ConfigItem(
keyName = "showOverlay",
name = "Show Players",
description = "Configure if the player overlay should be shown",
position = 2,
titleSection = "timersTitle"
)
default boolean showPlayers()
{
return true;
}
@ConfigItem(
keyName = "showNpcs",
name = "Show NPCs",
description = "Configure if the npc overlay should be shown",
position = 3,
titleSection = "timersTitle"
)
default boolean showNpcs()
{
return false;
}
@ConfigItem(
keyName = "FreezeTimers",
name = "Show Freeze Timers",
description = "Toggle overlay for Freeze timers",
position = 4,
titleSection = "timersTitle"
)
default boolean FreezeTimers()
{
return true;
}
@ConfigItem(
keyName = "TB",
name = "Show TB Timers",
description = "Toggle overlay for TB timers",
position = 5,
titleSection = "timersTitle"
)
default boolean TB()
{
return true;
}
@ConfigItem(
keyName = "Veng",
name = "Show Veng Timers",
description = "Toggle overlay for Veng timers",
position = 6,
titleSection = "timersTitle"
)
default boolean Veng()
{
return true;
}
@ConfigTitleSection(
keyName = "overlayTitle",
name = "Overlay",
description = "",
position = 7
)
default Title overlayTitle()
{
return new Title();
}
@ConfigItem(
keyName = "xoffset",
name = "X Offset",
description = "Increasing this will push further away from model. Does not apply to text timers.",
position = 8,
titleSection = "overlayTitle"
)
default int offset()
{
return 20;
}
@ConfigItem(
keyName = "noImage",
name = "Text Timers",
description = "Remove Images from Timers",
position = 9,
titleSection = "overlayTitle"
)
default boolean noImage()
{
return false;
}
@ConfigItem(
keyName = "fontStyle",
name = "Font Style",
description = "Bold/Italics/Plain",
position = 10,
titleSection = "overlayTitle"
)
default FontStyle fontStyle()
{
return FontStyle.BOLD;
}
@Range(
min = 9,
max = 14
)
@ConfigItem(
keyName = "textSize",
name = "Text Size",
description = "Text Size for Timers.",
position = 11,
titleSection = "overlayTitle"
)
default int textSize()
{
return 11;
}
}

View File

@@ -1,303 +0,0 @@
/*
* Copyright (c) 2019, ganom <https://github.com/Ganom>
* Copyright (c) 2019, kyle <https://github.com/kyleeld>
* Copyright (c) 2019, pklite <https://github.com/pklite/pklite>
* 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.freezetimers;
import java.awt.Color;
import static java.awt.Color.WHITE;
import java.awt.Dimension;
import java.awt.Font;
import java.awt.Graphics2D;
import java.awt.image.BufferedImage;
import javax.inject.Inject;
import javax.inject.Singleton;
import net.runelite.api.Actor;
import net.runelite.api.Client;
import net.runelite.api.Point;
import net.runelite.client.ui.FontManager;
import net.runelite.client.ui.overlay.Overlay;
import net.runelite.client.ui.overlay.OverlayLayer;
import net.runelite.client.ui.overlay.OverlayPosition;
import net.runelite.client.ui.overlay.OverlayPriority;
import net.runelite.client.ui.overlay.OverlayUtil;
import net.runelite.client.util.ImageUtil;
@Singleton
public class FreezeTimersOverlay extends Overlay
{
private final FreezeTimersPlugin plugin;
private final Client client;
private final Font timerFont = FontManager.getRunescapeBoldFont().deriveFont(14.0f);
private final BufferedImage FREEZE_IMAGE = ImageUtil.getResourceStreamFromClass(getClass(), "freeze.png");
private final BufferedImage FREEZE_IMMUNE_IMAGE = ImageUtil.getResourceStreamFromClass(getClass(), "freezeimmune.png");
private final BufferedImage TB_IMAGE = ImageUtil.getResourceStreamFromClass(getClass(), "teleblock.png");
private final BufferedImage TB_IMMUNE_IMAGE = ImageUtil.getResourceStreamFromClass(getClass(), "teleblockimmune.png");
private final BufferedImage VENG_IMAGE = ImageUtil.getResourceStreamFromClass(getClass(), "veng.png");
private final Timers timers;
@Inject
public FreezeTimersOverlay(final FreezeTimersPlugin plugin, final Client client, final Timers timers)
{
this.plugin = plugin;
this.client = client;
this.timers = timers;
setPriority(OverlayPriority.HIGHEST);
setPosition(OverlayPosition.DYNAMIC);
setLayer(OverlayLayer.UNDER_WIDGETS);
}
@Override
public Dimension render(Graphics2D graphics)
{
if (plugin.isShowPlayers())
{
client.getPlayers().forEach((p) -> renderOverlayFor(graphics, p));
}
if (plugin.isShowNpcs())
{
client.getNpcs().forEach((npc) -> renderOverlayFor(graphics, npc));
}
return null;
}
private void renderOverlayFor(Graphics2D g, Actor actor)
{
if (timers.areAllTimersZero(actor))
{
return;
}
int overlaysDrawn = 0;
if (drawFreezeOverlay(g, actor, overlaysDrawn) && plugin.isFreezeTimers())
{
overlaysDrawn++;
}
if (drawTBOverlay(g, actor, overlaysDrawn) && plugin.isTB())
{
overlaysDrawn++;
}
if (drawVengOverlay(g, actor, overlaysDrawn) && plugin.isVeng())
{
overlaysDrawn++;
}
}
private boolean drawFreezeOverlay(Graphics2D g, Actor actor, int overlaysDrawn)
{
final long currentTick = System.currentTimeMillis();
if (timers.getTimerReApply(actor, TimerType.FREEZE) <= currentTick)
{
return false;
}
long finishedAt;
BufferedImage image;
if (timers.getTimerEnd(actor, TimerType.FREEZE) > currentTick)
{
finishedAt = timers.getTimerEnd(actor, TimerType.FREEZE);
image = FREEZE_IMAGE;
}
else
{
finishedAt = timers.getTimerReApply(actor, TimerType.FREEZE);
image = FREEZE_IMMUNE_IMAGE;
}
final String text = processTickCounter(finishedAt);
final Point poi = actor.getCanvasTextLocation(g, text, 0);
if (poi == null)
{
return false;
}
final Point fixedPoint = new Point(poi.getX(), poi.getY());
if (plugin.isNoImage())
{
if (image == FREEZE_IMAGE)
{
OverlayUtil.renderTextLocation(g, text, plugin.getTextSize(), plugin.getFontStyle().getFont(), Color.WHITE, fixedPoint, false, 0);
}
else
{
OverlayUtil.renderTextLocation(g, text, plugin.getTextSize(), plugin.getFontStyle().getFont(), Color.YELLOW, fixedPoint, false, 0);
}
}
else
{
renderActorText(g, actor, text, overlaysDrawn, image);
}
return true;
}
private boolean drawTBOverlay(Graphics2D g, Actor actor, int overlaysDrawn)
{
final long currentTick = System.currentTimeMillis();
if (!plugin.isTB())
{
return false;
}
if (timers.getTimerReApply(actor, TimerType.TELEBLOCK) <= currentTick)
{
return false;
}
long finishedAt;
BufferedImage image;
if (timers.getTimerEnd(actor, TimerType.TELEBLOCK) > currentTick)
{
finishedAt = timers.getTimerEnd(actor, TimerType.TELEBLOCK);
image = TB_IMAGE;
}
else
{
finishedAt = timers.getTimerReApply(actor, TimerType.TELEBLOCK);
image = TB_IMMUNE_IMAGE;
}
final String text = processTickCounter(finishedAt);
final Point poi = actor.getCanvasTextLocation(g, text, 0);
if (poi == null)
{
return false;
}
final Point fixedPoint = new Point(poi.getX() + 20, poi.getY());
if (plugin.isNoImage())
{
if (timers.getTimerReApply(actor, TimerType.FREEZE) <= currentTick)
{
OverlayUtil.renderTextLocation(g, text, plugin.getTextSize(), plugin.getFontStyle().getFont(), Color.CYAN, poi, false, 0);
}
else
{
OverlayUtil.renderTextLocation(g, " | " + text, plugin.getTextSize(), plugin.getFontStyle().getFont(), Color.CYAN, fixedPoint, false, 0);
}
if (timers.getTimerReApply(actor, TimerType.VENG) >= currentTick)
{
OverlayUtil.renderTextLocation(g, " | " + text, plugin.getTextSize(), plugin.getFontStyle().getFont(), Color.CYAN, fixedPoint, false, 0);
}
}
else
{
renderActorText(g, actor, text, overlaysDrawn, image);
}
return true;
}
private boolean drawVengOverlay(Graphics2D g, Actor actor, int overlaysDrawn)
{
final long currentTick = System.currentTimeMillis();
if (!plugin.isVeng())
{
return false;
}
if (timers.getTimerEnd(actor, TimerType.VENG) <= currentTick)
{
return false;
}
final long finishedAt = timers.getTimerEnd(actor, TimerType.VENG);
final String text = processTickCounter(finishedAt);
final Point poi = actor.getCanvasTextLocation(g, text, 0);
if (poi == null)
{
return false;
}
final Point fixedPoint = new Point(poi.getX() - 20, poi.getY());
if (plugin.isNoImage())
{
if (timers.getTimerEnd(actor, TimerType.FREEZE) <= currentTick)
{
OverlayUtil.renderTextLocation(g, text, plugin.getTextSize(), plugin.getFontStyle().getFont(), Color.RED, poi, false, 0);
}
if (timers.getTimerEnd(actor, TimerType.FREEZE) >= currentTick)
{
OverlayUtil.renderTextLocation(g, text + " | ", plugin.getTextSize(), plugin.getFontStyle().getFont(), Color.RED, fixedPoint, false, 0);
}
if (timers.getTimerEnd(actor, TimerType.TELEBLOCK) >= currentTick)
{
OverlayUtil.renderTextLocation(g, text + " | ", plugin.getTextSize(), plugin.getFontStyle().getFont(), Color.RED, fixedPoint, false, 0);
}
}
else
{
renderActorText(g, actor, text, overlaysDrawn, VENG_IMAGE);
}
return true;
}
private void renderActorText(Graphics2D g, Actor actor, String text, int overlaysDrawn, BufferedImage image)
{
final int yOffset = (overlaysDrawn * 18);
g.setFont(timerFont);
g.setColor(WHITE);
final int xOffset = plugin.getOffset();
renderActorTextAndImage(g, actor, text, Color.WHITE, image, yOffset,
xOffset);
}
private void renderImageLocation(Graphics2D graphics, Point imgLoc, BufferedImage image)
{
final int x = imgLoc.getX();
final int y = imgLoc.getY();
graphics.drawImage(image, x, y, null);
}
private void renderActorTextAndImage(Graphics2D graphics, Actor actor, String text, Color color, BufferedImage image, int yOffset, int xOffset)
{
Point textLocation = new Point(actor.getCanvasImageLocation(image, 0).getX() + xOffset, actor.getCanvasImageLocation(image, 0).getY() + yOffset);
renderImageLocation(graphics, textLocation, image);
xOffset = image.getWidth() + 1;
yOffset = (image.getHeight() - (int) graphics.getFontMetrics().getStringBounds(text, graphics).getHeight());
textLocation = new Point(textLocation.getX() + xOffset, textLocation.getY() + image.getHeight() - yOffset);
OverlayUtil.renderTextLocation(graphics, textLocation, text, color);
}
private String processTickCounter(long finishedAt)
{
final long currentTick = System.currentTimeMillis();
final long tickDifference = finishedAt - currentTick;
long seconds = tickDifference / 1000;
seconds++;
final int minutes = (int) (seconds / 60);
seconds = seconds % 60;
String text = seconds > 9 ? seconds + "" : "0" + seconds;
if (minutes > 0)
{
text = minutes + ":" + text;
}
return text + "";
}
}

View File

@@ -1,270 +0,0 @@
/*
* Copyright (c) 2019, ganom <https://github.com/Ganom>
* Copyright (c) 2019, pklite <https://github.com/pklite/pklite>
* 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.freezetimers;
import com.google.inject.Provides;
import java.util.EnumSet;
import java.util.List;
import javax.inject.Inject;
import javax.inject.Singleton;
import lombok.AccessLevel;
import lombok.Getter;
import net.runelite.api.Actor;
import net.runelite.api.ChatMessageType;
import net.runelite.api.Client;
import net.runelite.api.NPC;
import net.runelite.api.Player;
import net.runelite.api.WorldType;
import net.runelite.api.coords.WorldPoint;
import net.runelite.api.events.ChatMessage;
import net.runelite.api.events.GameTick;
import net.runelite.api.events.NpcDespawned;
import net.runelite.api.events.PlayerDeath;
import net.runelite.api.events.SpotAnimationChanged;
import net.runelite.client.config.ConfigManager;
import net.runelite.client.eventbus.Subscribe;
import net.runelite.client.events.ConfigChanged;
import net.runelite.client.plugins.Plugin;
import net.runelite.client.plugins.PluginDescriptor;
import net.runelite.client.plugins.PluginType;
import net.runelite.client.plugins.multiindicators.MapLocations;
import net.runelite.client.ui.overlay.OverlayManager;
import net.runelite.client.util.PvPUtil;
import org.apache.commons.lang3.ArrayUtils;
@PluginDescriptor(
name = "Freeze Timers",
description = "Shows a freeze timer overlay on players",
tags = {"freeze", "timers", "barrage", "teleblock", "pklite"},
type = PluginType.PVP,
enabledByDefault = false
)
@Singleton
public class FreezeTimersPlugin extends Plugin
{
private static final int VORKATH_REGION = 9023;
@Inject
private Client client;
@Inject
private OverlayManager overlayManager;
@Inject
private Timers timers;
@Inject
private PrayerTracker prayerTracker;
@Inject
private FreezeTimersOverlay overlay;
@Inject
private FreezeTimersConfig config;
@Getter(AccessLevel.PACKAGE)
private boolean showPlayers;
@Getter(AccessLevel.PACKAGE)
private boolean showNpcs;
@Getter(AccessLevel.PACKAGE)
private boolean FreezeTimers;
@Getter(AccessLevel.PACKAGE)
private boolean TB;
@Getter(AccessLevel.PACKAGE)
private boolean Veng;
@Getter(AccessLevel.PACKAGE)
private int offset;
@Getter(AccessLevel.PACKAGE)
private boolean noImage;
@Getter(AccessLevel.PACKAGE)
private FontStyle fontStyle;
@Getter(AccessLevel.PACKAGE)
private int textSize;
public void startUp()
{
updateConfig();
overlayManager.add(overlay);
}
public void shutDown()
{
overlayManager.remove(overlay);
}
@Provides
public FreezeTimersConfig getConfig(ConfigManager configManager)
{
return configManager.getConfig(FreezeTimersConfig.class);
}
@Subscribe
public void onSpotAnimationChanged(SpotAnimationChanged graphicChanged)
{
final int oldGraphic = prayerTracker.getSpotanimLastTick(graphicChanged.getActor());
final int newGraphic = graphicChanged.getActor().getSpotAnimation();
if (oldGraphic == newGraphic)
{
return;
}
final PlayerSpellEffect effect = PlayerSpellEffect.getFromSpotAnim(newGraphic);
if (effect == PlayerSpellEffect.NONE)
{
return;
}
final long currentTime = System.currentTimeMillis();
if (timers.getTimerReApply(graphicChanged.getActor(), effect.getType()) > currentTime)
{
return;
}
long length = effect.getTimerLengthTicks();
if (effect.isHalvable() && prayerTracker.getPrayerIconLastTick(graphicChanged.getActor()) == 2)
{
length /= 2;
}
timers.setTimerEnd(graphicChanged.getActor(), effect.getType(),
currentTime + length);
}
@Subscribe
public void onGameTick(GameTick tickEvent)
{
prayerTracker.gameTick();
List<Actor> teleblocked = timers.getAllActorsOnTimer(TimerType.TELEBLOCK);
if (!teleblocked.isEmpty())
{
final EnumSet<WorldType> worldTypes = client.getWorldType();
for (Actor actor : teleblocked)
{
final WorldPoint actorLoc = actor.getWorldLocation();
if (!WorldType.isAllPvpWorld(worldTypes) && (actorLoc.getY() < 3525 || PvPUtil.getWildernessLevelFrom(actorLoc) <= 0))
{
timers.setTimerReApply(actor, TimerType.TELEBLOCK, System.currentTimeMillis());
}
else if (WorldType.isPvpWorld(worldTypes) &&
MapLocations.getPvpSafeZones(actorLoc.getPlane()).contains(actorLoc.getX(), actorLoc.getY()))
{
timers.setTimerReApply(actor, TimerType.TELEBLOCK, System.currentTimeMillis());
}
else if (WorldType.isDeadmanWorld(worldTypes) &&
MapLocations.getDeadmanSafeZones(actorLoc.getPlane()).contains(actorLoc.getX(), actorLoc.getY()))
{
timers.setTimerReApply(actor, TimerType.TELEBLOCK, System.currentTimeMillis());
}
}
}
}
@Subscribe
private void onPlayerDeath(PlayerDeath event)
{
final Player localPlayer = client.getLocalPlayer();
final long currentTime = System.currentTimeMillis();
for (TimerType type : TimerType.values())
{
if (timers.getTimerReApply(localPlayer, type) <= currentTime)
{
continue;
}
timers.setTimerReApply(localPlayer, type, currentTime);
}
}
@Subscribe
public void onNpcDespawned(NpcDespawned event)
{
if (!isAtVorkath())
{
return;
}
final NPC npc = event.getNpc();
if (npc.getName() == null)
{
return;
}
if (npc.getName().equals("Zombified Spawn"))
{
timers.setTimerReApply(client.getLocalPlayer(), TimerType.FREEZE,
System.currentTimeMillis());
}
}
@Subscribe
public void onChatMessage(ChatMessage event)
{
if (event.getType() != ChatMessageType.GAMEMESSAGE
|| !event.getMessage().contains("Your Tele Block has been removed"))
{
return;
}
timers.setTimerReApply(client.getLocalPlayer(), TimerType.TELEBLOCK, System.currentTimeMillis());
}
private boolean isAtVorkath()
{
return ArrayUtils.contains(client.getMapRegions(), VORKATH_REGION);
}
@Subscribe
private void onConfigChanged(ConfigChanged event)
{
if (event.getGroup().equals("freezetimers"))
{
updateConfig();
}
}
private void updateConfig()
{
this.showPlayers = config.showPlayers();
this.showNpcs = config.showNpcs();
this.FreezeTimers = config.FreezeTimers();
this.TB = config.TB();
this.Veng = config.Veng();
this.offset = config.offset();
this.noImage = config.noImage();
this.fontStyle = config.fontStyle();
this.textSize = config.textSize();
}
}

View File

@@ -1,71 +0,0 @@
/*
* Copyright (c) 2019, ganom <https://github.com/Ganom>
* Copyright (c) 2019, pklite <https://github.com/pklite/pklite>
* 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.freezetimers;
import lombok.AccessLevel;
import lombok.AllArgsConstructor;
import lombok.Getter;
@AllArgsConstructor
public enum PlayerSpellEffect
{
BIND("Bind", 181, 4800, false, 0, TimerType.FREEZE),
SNARE("Snare", 180, 9600, false, 1, TimerType.FREEZE),
ENTANGLE("Entangle", 179, 14400, false, 2, TimerType.FREEZE),
RUSH("Ice Rush", 361, 4800, false, 3, TimerType.FREEZE),
BURST("Ice Burst", 363, 9600, false, 4, TimerType.FREEZE),
BLITZ("Ice Blitz", 367, 14400, false, 5, TimerType.FREEZE),
BARRAGE("Ice Barrage", 369, 19200, false, 6, TimerType.FREEZE),
TELEBLOCK("Teleblock", 345, 300000, true, 7, TimerType.TELEBLOCK),
VENG("Vengeance", 726, 30000, false, 8, TimerType.VENG),
VENG_OTHER("Vengeance Other", 725, 30000, false, 9, TimerType.VENG),
NONE("Nothing", -69, 420, true, 9999, TimerType.THIS_SHIT_BROKE);
@Getter(AccessLevel.PACKAGE)
private final String name;
@Getter(AccessLevel.PACKAGE)
private final int spotAnimId;
@Getter(AccessLevel.PACKAGE)
private final int timerLengthTicks;
@Getter(AccessLevel.PACKAGE)
private boolean halvable;
@Getter(AccessLevel.PACKAGE)
private final int spriteIdx;
@Getter(AccessLevel.PACKAGE)
private final TimerType type;
static PlayerSpellEffect getFromSpotAnim(int spotAnim)
{
for (PlayerSpellEffect effect : values())
{
if (effect.getSpotAnimId() == spotAnim)
{
return effect;
}
}
return NONE;
}
}

View File

@@ -1,85 +0,0 @@
/*
* Copyright (c) 2019, pklite <https://github.com/pklite/pklite>
* 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.freezetimers;
import java.util.HashMap;
import java.util.Map;
import javax.inject.Inject;
import javax.inject.Singleton;
import lombok.extern.slf4j.Slf4j;
import net.runelite.api.Actor;
import net.runelite.api.Client;
import net.runelite.api.NPC;
import net.runelite.api.Player;
@Slf4j
@Singleton
class PrayerTracker
{
@Inject
private Client client;
private final Map<Actor, HashMap<String, Integer>> lastTick = new HashMap<>();
private final Map<Actor, HashMap<String, Integer>> newTick = new HashMap<>();
public void gameTick()
{
lastTick.clear();
lastTick.putAll(newTick);
newTick.clear();
for (Player p : client.getPlayers())
{
processActor(p);
}
for (NPC npc : client.getNpcs())
{
processActor(npc);
}
}
private void processActor(Actor actor)
{
if (!newTick.containsKey(actor))
{
newTick.put(actor, new HashMap<>());
}
if (actor instanceof Player)
{
newTick.get(actor).put("PrayerIcon", ((Player) actor).getOverheadIcon() == null ? -1 : ((Player) actor).getOverheadIcon().ordinal());
}
newTick.get(actor).put("SpotAnim", actor.getSpotAnimation());
}
int getPrayerIconLastTick(Actor p)
{
return lastTick.getOrDefault(p, new HashMap<>()).getOrDefault("PrayerIcon", -1337);
}
int getSpotanimLastTick(Actor p)
{
return lastTick.getOrDefault(p, new HashMap<>()).getOrDefault("SpotAnim", -1337);
}
}

View File

@@ -1,122 +0,0 @@
/*
* Copyright (c) 2019, pklite <https://github.com/pklite/pklite>
* 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.freezetimers;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import javax.inject.Singleton;
import lombok.extern.slf4j.Slf4j;
import net.runelite.api.Actor;
@Slf4j
@Singleton
class Timers
{
private final Map<Actor, HashMap<TimerType, Long>> timerMap = new HashMap<>();
void setTimerEnd(Actor actor, TimerType type, long n)
{
if (!timerMap.containsKey(actor))
{
timerMap.put(actor, new HashMap<>());
}
timerMap.get(actor).put(type, n + type.getImmunityTime());
}
void setTimerReApply(Actor actor, TimerType type, long n)
{
if (!timerMap.containsKey(actor))
{
timerMap.put(actor, new HashMap<>());
}
timerMap.get(actor).put(type, n);
}
long getTimerEnd(Actor actor, TimerType type)
{
if (!timerMap.containsKey(actor))
{
return 0;
}
return timerMap.get(actor).getOrDefault(type, (long) type.getImmunityTime()) - type.getImmunityTime();
}
long getTimerReApply(Actor actor, TimerType type)
{
if (!timerMap.containsKey(actor))
{
return 0;
}
return timerMap.get(actor).getOrDefault(type, (long) 0);
}
List<Actor> getAllActorsOnTimer(TimerType type)
{
final List<Actor> actors = new ArrayList<>();
final Iterator<Actor> it = timerMap.keySet().iterator();
while (it.hasNext())
{
final Actor actor = it.next();
for (TimerType timerType : TimerType.values())
{
if (getTimerReApply(actor, timerType) > System.currentTimeMillis())
{
break;
}
it.remove();
break;
}
final long end = getTimerReApply(actor, type);
if (end > System.currentTimeMillis())
{
actors.add(actor);
}
}
return actors;
}
boolean areAllTimersZero(Actor actor)
{
for (TimerType type : TimerType.values())
{
if (getTimerReApply(actor, type) > System.currentTimeMillis())
{
return false;
}
}
return true;
}
}

View File

@@ -35,6 +35,7 @@ import net.runelite.client.config.ConfigItem;
import net.runelite.client.config.ConfigTitleSection;
import net.runelite.client.config.Range;
import net.runelite.client.config.Title;
import net.runelite.client.config.Units;
@ConfigGroup("Gauntlet")
@@ -282,6 +283,7 @@ public interface GauntletConfig extends Config
description = " change the size of Projectile icons.",
titleSection = "boss"
)
@Units(Units.PIXELS)
default int projectileIconSize()
{
return 20;

View File

@@ -32,6 +32,7 @@ import net.runelite.client.config.ConfigGroup;
import net.runelite.client.config.ConfigItem;
import net.runelite.client.config.ConfigTitleSection;
import net.runelite.client.config.Title;
import net.runelite.client.config.Units;
import net.runelite.client.plugins.grounditems.config.ItemHighlightMode;
import net.runelite.client.plugins.grounditems.config.MenuHighlightMode;
import net.runelite.client.plugins.grounditems.config.PriceDisplayMode;
@@ -152,6 +153,7 @@ public interface GroundItemsConfig extends Config
position = 9,
titleSection = "highlightedTitle"
)
@Units(Units.GP)
default int getHighlightOverValue()
{
return 0;
@@ -231,6 +233,7 @@ public interface GroundItemsConfig extends Config
position = 15,
titleSection = "hiddenTitle"
)
@Units(Units.GP)
default int getHideUnderValue()
{
return 0;
@@ -338,6 +341,7 @@ public interface GroundItemsConfig extends Config
position = 24,
titleSection = "lowValueTitle"
)
@Units(Units.GP)
default int lowValuePrice()
{
return 20000;
@@ -386,6 +390,7 @@ public interface GroundItemsConfig extends Config
position = 28,
titleSection = "mediumValueTitle"
)
@Units(Units.GP)
default int mediumValuePrice()
{
return 100000;
@@ -434,6 +439,7 @@ public interface GroundItemsConfig extends Config
position = 32,
titleSection = "highValueTitle"
)
@Units(Units.GP)
default int highValuePrice()
{
return 1000000;
@@ -482,6 +488,7 @@ public interface GroundItemsConfig extends Config
position = 36,
titleSection = "insaneValueTitle"
)
@Units(Units.GP)
default int insaneValuePrice()
{
return 10000000;
@@ -600,6 +607,7 @@ public interface GroundItemsConfig extends Config
position = 46,
titleSection = "miscTitle"
)
@Units(Units.MILLISECONDS)
default int doubleTapDelay()
{
return 250;

View File

@@ -33,6 +33,7 @@ import net.runelite.client.config.Config;
import net.runelite.client.config.ConfigGroup;
import net.runelite.client.config.ConfigItem;
import net.runelite.client.config.Range;
import net.runelite.client.config.Units;
@ConfigGroup("groundMarker")
public interface GroundMarkerConfig extends Config
@@ -279,6 +280,7 @@ public interface GroundMarkerConfig extends Config
name = "Minimap opacity",
description = "The opacity of the minimap markers"
)
@Units(Units.PERCENT)
default int minimapOverlayOpacity()
{
return 100;

View File

@@ -28,6 +28,7 @@ import net.runelite.client.config.Config;
import net.runelite.client.config.ConfigGroup;
import net.runelite.client.config.ConfigItem;
import net.runelite.client.config.ConfigSection;
import net.runelite.client.config.Units;
@ConfigGroup("idlenotifier")
public interface IdleNotifierConfig extends Config
@@ -144,10 +145,11 @@ public interface IdleNotifierConfig extends Config
@ConfigItem(
keyName = "timeout",
name = "Idle Notification Delay (ms)",
name = "Idle Notification Delay",
description = "The notification delay after the player is idle",
position = 11
)
@Units(Units.MILLISECONDS)
default int getIdleNotificationDelay()
{
return 5000;
@@ -203,6 +205,7 @@ public interface IdleNotifierConfig extends Config
description = "The amount of remaining oxygen to send a notification at. A value of 0 will disable notification.",
position = 16
)
@Units(Units.PERCENT)
default int getOxygenThreshold()
{
return 0;
@@ -214,6 +217,7 @@ public interface IdleNotifierConfig extends Config
description = "The amount of spec energy reached to send a notification at. A value of 0 will disable notification.",
position = 17
)
@Units(Units.PERCENT)
default int getSpecEnergyThreshold()
{
return 0;

View File

@@ -782,6 +782,11 @@ public class IdleNotifierPlugin extends Plugin
{
lastInteract = null;
lastInteracting = null;
// prevent animation notifications from firing too
lastAnimation = IDLE;
lastAnimating = null;
return true;
}
}
@@ -869,6 +874,11 @@ public class IdleNotifierPlugin extends Plugin
{
lastAnimation = IDLE;
lastAnimating = null;
// prevent interaction notifications from firing too
lastInteract = null;
lastInteracting = null;
return true;
}
}

View File

@@ -72,4 +72,14 @@ public interface InterfaceStylesConfig extends Config
{
return false;
}
@ConfigItem(
keyName = "alwaysStack",
name = "Always stack bottom bar",
description = "Always stack the bottom bar in resizable"
)
default boolean alwaysStack()
{
return false;
}
}

View File

@@ -39,6 +39,7 @@ import net.runelite.api.SpriteID;
import net.runelite.api.events.BeforeMenuRender;
import net.runelite.api.events.GameStateChanged;
import net.runelite.api.events.PostHealthBar;
import net.runelite.api.events.ScriptCallbackEvent;
import net.runelite.api.events.WidgetPositioned;
import net.runelite.api.widgets.Widget;
import net.runelite.api.widgets.WidgetInfo;
@@ -117,6 +118,17 @@ public class InterfaceStylesPlugin extends Plugin
}
}
@Subscribe
public void onScriptCallbackEvent(ScriptCallbackEvent event)
{
if ("forceStackStones".equals(event.getEventName()) && config.alwaysStack())
{
int[] intStack = client.getIntStack();
int intStackSize = client.getIntStackSize();
intStack[intStackSize - 1] = 1;
}
}
@Subscribe
private void onWidgetPositioned(WidgetPositioned widgetPositioned)
{

View File

@@ -30,6 +30,7 @@ import net.runelite.client.config.Config;
import net.runelite.client.config.ConfigGroup;
import net.runelite.client.config.ConfigItem;
import net.runelite.client.config.Range;
import net.runelite.client.config.Units;
@ConfigGroup("inventorygrid")
public interface InventoryGridConfig extends Config
@@ -74,6 +75,7 @@ public interface InventoryGridConfig extends Config
position = 4
)
@Range(min = 100)
@Units(Units.MILLISECONDS)
default int dragDelay()
{
return 100;

View File

@@ -102,7 +102,7 @@ class InventoryGridOverlay extends Overlay
{
WidgetItem targetWidgetItem = inventoryWidget.getWidgetItem(i);
final Rectangle bounds = targetWidgetItem.getCanvasBounds();
final Rectangle bounds = targetWidgetItem.getCanvasBounds(false);
boolean inBounds = bounds.contains(mousePoint);
if (plugin.isShowItem() && inBounds)

View File

@@ -45,7 +45,11 @@ public interface InventoryTagsConfig extends Config
FIVE("5"),
SIX("6"),
SEVEN("7"),
EIGHT("8");
EIGHT("8"),
NINE("9"),
TEN("10"),
ELEVEN("11"),
TWELVE("12");
private final String name;
@@ -79,7 +83,7 @@ public interface InventoryTagsConfig extends Config
description = "Color of the Tag",
hidden = true,
unhide = "amount",
unhideValue = "1 || 2 || 3 || 4 || 5 || 6 || 7 || 8"
unhideValue = "1 || 2 || 3 || 4 || 5 || 6 || 7 || 8 || 9 || 10 || 11 || 12"
)
default Color getGroup1Color()
{
@@ -93,7 +97,7 @@ public interface InventoryTagsConfig extends Config
description = "Color of the Tag",
hidden = true,
unhide = "amount",
unhideValue = "2 || 3 || 4 || 5 || 6 || 7 || 8"
unhideValue = "2 || 3 || 4 || 5 || 6 || 7 || 8 || 9 || 10 || 11 || 12"
)
default Color getGroup2Color()
{
@@ -107,7 +111,7 @@ public interface InventoryTagsConfig extends Config
description = "Color of the Tag",
hidden = true,
unhide = "amount",
unhideValue = "3 || 4 || 5 || 6 || 7 || 8"
unhideValue = "3 || 4 || 5 || 6 || 7 || 8 || 9 || 10 || 11 || 12"
)
default Color getGroup3Color()
{
@@ -121,7 +125,7 @@ public interface InventoryTagsConfig extends Config
description = "Color of the Tag",
hidden = true,
unhide = "amount",
unhideValue = "4 || 5 || 6 || 7 || 8"
unhideValue = "4 || 5 || 6 || 7 || 8 || 9 || 10 || 11 || 12"
)
default Color getGroup4Color()
{
@@ -135,7 +139,7 @@ public interface InventoryTagsConfig extends Config
description = "Color of the Tag",
hidden = true,
unhide = "amount",
unhideValue = "5 || 6 || 7 || 8"
unhideValue = "5 || 6 || 7 || 8 || 9 || 10 || 11 || 12"
)
default Color getGroup5Color()
{
@@ -149,7 +153,7 @@ public interface InventoryTagsConfig extends Config
description = "Color of the Tag",
hidden = true,
unhide = "amount",
unhideValue = "6 || 7 || 8"
unhideValue = "6 || 7 || 8 || 9 || 10 || 11 || 12"
)
default Color getGroup6Color()
{
@@ -163,7 +167,7 @@ public interface InventoryTagsConfig extends Config
description = "Color of the Tag",
hidden = true,
unhide = "amount",
unhideValue = "7 || 8"
unhideValue = "7 || 8 || 9 || 10 || 11 || 12"
)
default Color getGroup7Color()
{
@@ -177,10 +181,66 @@ public interface InventoryTagsConfig extends Config
description = "Color of the Tag",
hidden = true,
unhide = "amount",
unhideValue = "8"
unhideValue = "8 || 9 || 10 || 11 || 12"
)
default Color getGroup8Color()
{
return new Color(104, 105, 255);
}
@ConfigItem(
position = 9,
keyName = "groupColor9",
name = "Group 9 Color",
description = "Color of the Tag",
hidden = true,
unhide = "amount",
unhideValue = "9 || 10 || 11 || 12"
)
default Color getGroup9Color()
{
return new Color(255, 81, 0);
}
@ConfigItem(
position = 10,
keyName = "groupColor10",
name = "Group 10 Color",
description = "Color of the Tag",
hidden = true,
unhide = "amount",
unhideValue = "10 || 11 || 12"
)
default Color getGroup10Color()
{
return new Color(255, 107, 229);
}
@ConfigItem(
position = 11,
keyName = "groupColor11",
name = "Group 11 Color",
description = "Color of the Tag",
hidden = true,
unhide = "amount",
unhideValue = "11 || 12"
)
default Color getGroup11Color()
{
return new Color(121, 255, 157);
}
@ConfigItem(
position = 12,
keyName = "groupColor12",
name = "Group 12 Color",
description = "Color of the Tag",
hidden = true,
unhide = "amount",
unhideValue = "12"
)
default Color getGroup12Color()
{
return new Color(65, 61, 64);
}
}

View File

@@ -69,6 +69,10 @@ public class InventoryTagsPlugin extends Plugin
private static final String SETNAME_GROUP_6 = "Group 6";
private static final String SETNAME_GROUP_7 = "Group 7";
private static final String SETNAME_GROUP_8 = "Group 8";
private static final String SETNAME_GROUP_9 = "Group 9";
private static final String SETNAME_GROUP_10 = "Group 10";
private static final String SETNAME_GROUP_11 = "Group 11";
private static final String SETNAME_GROUP_12 = "Group 12";
private static final String CONFIGURE = "Configure";
@@ -90,8 +94,8 @@ public class InventoryTagsPlugin extends Plugin
private static final WidgetMenuOption RESIZABLE_BOTTOM_LINE_INVENTORY_TAB_SAVE = new WidgetMenuOption(SAVE,
MENU_TARGET, WidgetInfo.RESIZABLE_VIEWPORT_BOTTOM_LINE_INVENTORY_TAB);
private static final List<String> GROUPS = ImmutableList.of(SETNAME_GROUP_8, SETNAME_GROUP_7, SETNAME_GROUP_6,
SETNAME_GROUP_5, SETNAME_GROUP_4, SETNAME_GROUP_3, SETNAME_GROUP_2, SETNAME_GROUP_1);
private static final List<String> GROUPS = ImmutableList.of(SETNAME_GROUP_12, SETNAME_GROUP_11, SETNAME_GROUP_10, SETNAME_GROUP_9,
SETNAME_GROUP_8, SETNAME_GROUP_7, SETNAME_GROUP_6, SETNAME_GROUP_5, SETNAME_GROUP_4, SETNAME_GROUP_3, SETNAME_GROUP_2, SETNAME_GROUP_1);
@Inject
private ConfigManager configManager;
@@ -119,6 +123,10 @@ public class InventoryTagsPlugin extends Plugin
private Color group6Color;
private Color group7Color;
private Color group8Color;
private Color group9Color;
private Color group10Color;
private Color group11Color;
private Color group12Color;
@Provides
InventoryTagsConfig provideConfig(ConfigManager configManager)
@@ -265,6 +273,14 @@ public class InventoryTagsPlugin extends Plugin
return this.group7Color;
case SETNAME_GROUP_8:
return this.group8Color;
case SETNAME_GROUP_9:
return this.group9Color;
case SETNAME_GROUP_10:
return this.group10Color;
case SETNAME_GROUP_11:
return this.group11Color;
case SETNAME_GROUP_12:
return this.group12Color;
}
return null;
}
@@ -316,5 +332,9 @@ public class InventoryTagsPlugin extends Plugin
this.group6Color = config.getGroup6Color();
this.group7Color = config.getGroup7Color();
this.group8Color = config.getGroup8Color();
this.group9Color = config.getGroup9Color();
this.group10Color = config.getGroup10Color();
this.group11Color = config.getGroup11Color();
this.group12Color = config.getGroup12Color();
}
}

View File

@@ -26,6 +26,7 @@ package net.runelite.client.plugins.kingdomofmiscellania;
import net.runelite.client.config.Config;
import net.runelite.client.config.ConfigGroup;
import net.runelite.client.config.ConfigItem;
import net.runelite.client.config.Units;
@ConfigGroup("kingdomofmiscellania")
public interface KingdomConfig extends Config
@@ -59,6 +60,7 @@ public interface KingdomConfig extends Config
description = "Sends a message to your chatbox when your kingdom's coffer is below the threshold. Leave at 0 to disable.",
position = 2
)
@Units(Units.GP)
default int notifyCofferThreshold()
{
return 0;

View File

@@ -63,6 +63,7 @@ import net.runelite.client.ui.components.PluginErrorPanel;
import net.runelite.client.util.ColorUtil;
import net.runelite.client.util.ImageUtil;
import net.runelite.client.util.QuantityFormatter;
import net.runelite.client.util.SwingUtil;
import net.runelite.http.api.loottracker.LootTrackerClient;
@Slf4j
@@ -575,8 +576,7 @@ class LootTrackerPanel extends PluginPanel
*/
public void rebuild()
{
logsContainer.removeAll();
SwingUtil.fastRemoveAll(logsContainer);
boxes.clear();
int start = 0;
records.sort(lootRecordSortType);

View File

@@ -1217,7 +1217,6 @@ public class LootTrackerPlugin extends Plugin
config.setIgnoredItems(Text.toCSV(ignoredItemSet));
this.getIgnoredItems = Text.toCSV(ignoredItemSet);
panel.updateIgnoredRecords();
}
boolean isIgnored(String name)

View File

@@ -29,6 +29,7 @@ import net.runelite.client.config.Config;
import net.runelite.client.config.ConfigGroup;
import net.runelite.client.config.ConfigItem;
import net.runelite.client.config.Range;
import net.runelite.client.config.Units;
@ConfigGroup("metronome")
public interface MetronomePluginConfiguration extends Config
@@ -38,6 +39,7 @@ public interface MetronomePluginConfiguration extends Config
name = "Tick count",
description = "Configures the number of game ticks between metronome sounds"
)
@Units(Units.TICKS)
default int tickCount()
{
return 1;
@@ -58,6 +60,7 @@ public interface MetronomePluginConfiguration extends Config
name = "Tock every nth \"tick\"",
description = "Configures how many \"ticks\" between each \"tock\""
)
@Units(Units.TICKS)
default int tockNumber()
{
return 2;
@@ -102,6 +105,7 @@ public interface MetronomePluginConfiguration extends Config
name = "Volume modification",
description = "Configures tick/tock volume; only effects custom sounds."
)
@Units(Units.PERCENT)
default int volume()
{
return 35;

View File

@@ -30,6 +30,7 @@ import net.runelite.client.config.Config;
import net.runelite.client.config.ConfigGroup;
import net.runelite.client.config.ConfigItem;
import net.runelite.client.config.Range;
import net.runelite.client.config.Units;
@ConfigGroup("mining")
public interface MiningConfig extends Config
@@ -104,6 +105,7 @@ public interface MiningConfig extends Config
name = "Progress pie diameter",
description = "Configures how big the progress pie is"
)
@Units(Units.PIXELS)
default int progressPieDiameter()
{
return 30;

View File

@@ -28,6 +28,7 @@ package net.runelite.client.plugins.motherlode;
import net.runelite.client.config.Config;
import net.runelite.client.config.ConfigGroup;
import net.runelite.client.config.ConfigItem;
import net.runelite.client.config.Units;
@ConfigGroup("motherlode")
public interface MotherlodeConfig extends Config
@@ -54,9 +55,10 @@ public interface MotherlodeConfig extends Config
@ConfigItem(
keyName = "statTimeout",
name = "Reset stats (minutes)",
name = "Reset stats",
description = "Configures the time until statistics are reset"
)
@Units(Units.MINUTES)
default int statTimeout()
{
return 5;

View File

@@ -28,6 +28,7 @@ import java.awt.Color;
import net.runelite.client.config.Config;
import net.runelite.client.config.ConfigGroup;
import net.runelite.client.config.ConfigItem;
import net.runelite.client.config.Units;
@ConfigGroup("npcindicators")
public interface NpcIndicatorsConfig extends Config
@@ -124,7 +125,8 @@ public interface NpcIndicatorsConfig extends Config
position = 7,
keyName = "showRespawnTimer",
name = "Show respawn timer",
description = "Show respawn timer of tagged NPCs")
description = "Show respawn timer of tagged NPCs"
)
default boolean showRespawnTimer()
{
return false;
@@ -134,7 +136,8 @@ public interface NpcIndicatorsConfig extends Config
position = 7,
keyName = "notifyOnRespawn",
name = "Notify on Respawn",
description = "Enable notification on respawn")
description = "Enable notification on respawn"
)
default boolean getNotifyOnRespawn()
{
return false;
@@ -144,7 +147,9 @@ public interface NpcIndicatorsConfig extends Config
position = 8,
keyName = "notifyOnRespawnDelay",
name = "Notification Delay",
description = "Notify when NPC is x ms from respawning")
description = "Notify when NPC is x ms from respawning"
)
@Units(Units.MILLISECONDS)
default int getNotifyOnRespawnDelay()
{
return -1;

View File

@@ -33,6 +33,7 @@ import net.runelite.client.config.ConfigItem;
import net.runelite.client.config.ConfigTitleSection;
import net.runelite.client.config.Range;
import net.runelite.client.config.Title;
import net.runelite.client.config.Units;
@ConfigGroup("objectindicators")
public interface ObjectIndicatorsConfig extends Config
@@ -109,6 +110,7 @@ public interface ObjectIndicatorsConfig extends Config
description = "Configures the opacity/alpha of object marker",
titleSection = "colorTitle"
)
@Units(Units.PERCENT)
default int objectMarkerAlpha()
{
return 100;

View File

@@ -27,6 +27,7 @@ package net.runelite.client.plugins.performancestats;
import net.runelite.client.config.Config;
import net.runelite.client.config.ConfigGroup;
import net.runelite.client.config.ConfigItem;
import net.runelite.client.config.Units;
@ConfigGroup("performancestats")
public interface PerformanceStatsConfig extends Config
@@ -34,9 +35,10 @@ public interface PerformanceStatsConfig extends Config
@ConfigItem(
position = 0,
keyName = "submitTimeout",
name = "Submit Timeout (seconds)",
name = "Submit Timeout",
description = "Submits after this many seconds of inactivity"
)
@Units(Units.SECONDS)
default int submitTimeout()
{
return 30;

View File

@@ -27,6 +27,7 @@ import net.runelite.client.config.Config;
import net.runelite.client.config.ConfigGroup;
import net.runelite.client.config.ConfigItem;
import net.runelite.client.config.Range;
import net.runelite.client.config.Units;
@ConfigGroup("playerscouter")
public interface PlayerScouterConfig extends Config
@@ -116,6 +117,7 @@ public interface PlayerScouterConfig extends Config
description = "Minimum value for the item to be posted on discord.",
position = 6
)
@Units(Units.GP)
default int minimumValue()
{
return 1000;
@@ -157,6 +159,7 @@ public interface PlayerScouterConfig extends Config
description = "Minimum amount of ticks before the player can be scouted again. (1 tick = 600ms)",
position = 9
)
@Units(Units.TICKS)
default int timeout()
{
return 500;

View File

@@ -27,6 +27,7 @@ package net.runelite.client.plugins.poison;
import net.runelite.client.config.Config;
import net.runelite.client.config.ConfigGroup;
import net.runelite.client.config.ConfigItem;
import net.runelite.client.config.Units;
@ConfigGroup(PoisonConfig.GROUP)
public interface PoisonConfig extends Config
@@ -81,6 +82,7 @@ public interface PoisonConfig extends Config
description = "The size the time left text for other players/npc's will be",
position = 3
)
@Units(Units.POINTS)
default int fontSize()
{
return 8;

View File

@@ -29,6 +29,7 @@ import net.runelite.client.config.ConfigGroup;
import net.runelite.client.config.ConfigItem;
import net.runelite.client.config.ConfigTitleSection;
import net.runelite.client.config.Title;
import net.runelite.client.config.Units;
@ConfigGroup("pyramidplunder")
public interface PyramidPlunderConfig extends Config
@@ -133,6 +134,7 @@ public interface PyramidPlunderConfig extends Config
description = "Recolor time left(s)",
titleSection = "warningsTitle"
)
@Units(Units.SECONDS)
default int firstWarningTime()
{
return 90;
@@ -145,6 +147,7 @@ public interface PyramidPlunderConfig extends Config
description = "Recolor time left(s)",
titleSection = "warningsTitle"
)
@Units(Units.SECONDS)
default int secondWarningTime()
{
return 30;

View File

@@ -31,6 +31,7 @@ import java.awt.Graphics2D;
import javax.inject.Singleton;
import lombok.AccessLevel;
import lombok.Getter;
import lombok.NonNull;
import net.runelite.client.ui.overlay.Overlay;
import net.runelite.client.ui.overlay.OverlayLayer;
import net.runelite.client.ui.overlay.OverlayPosition;
@@ -43,7 +44,7 @@ public class ScreenMarkerOverlay extends Overlay
private final ScreenMarker marker;
private final ScreenMarkerRenderable screenMarkerRenderable;
ScreenMarkerOverlay(final ScreenMarker marker)
ScreenMarkerOverlay(@NonNull ScreenMarker marker)
{
this.marker = marker;
this.screenMarkerRenderable = new ScreenMarkerRenderable();

View File

@@ -36,6 +36,7 @@ import java.awt.image.BufferedImage;
import java.time.Instant;
import java.util.ArrayList;
import java.util.List;
import java.util.Objects;
import java.util.stream.Collectors;
import java.util.stream.Stream;
import javax.inject.Inject;
@@ -188,9 +189,10 @@ public class ScreenMarkerPlugin extends Plugin
public void finishCreation(boolean aborted)
{
if (!aborted && currentMarker != null)
ScreenMarker marker = currentMarker;
if (!aborted && marker != null)
{
final ScreenMarkerOverlay screenMarkerOverlay = new ScreenMarkerOverlay(currentMarker);
final ScreenMarkerOverlay screenMarkerOverlay = new ScreenMarkerOverlay(marker);
screenMarkerOverlay.setPreferredLocation(overlay.getBounds().getLocation());
screenMarkerOverlay.setPreferredSize(overlay.getBounds().getSize());
@@ -258,6 +260,6 @@ public class ScreenMarkerPlugin extends Plugin
{
}.getType());
return screenMarkerData.stream().map(ScreenMarkerOverlay::new);
return screenMarkerData.stream().filter(Objects::nonNull).map(ScreenMarkerOverlay::new);
}
}

View File

@@ -28,6 +28,7 @@ import net.runelite.client.config.Config;
import net.runelite.client.config.ConfigGroup;
import net.runelite.client.config.ConfigItem;
import net.runelite.client.config.Keybind;
import net.runelite.client.util.ImageUploadStyle;
@ConfigGroup("screenshot")
public interface ScreenshotConfig extends Config
@@ -115,9 +116,9 @@ public interface ScreenshotConfig extends Config
description = "Configures whether or not screenshots are uploaded to Imgur, or placed on your clipboard",
position = 7
)
default UploadStyle uploadScreenshot()
default ImageUploadStyle uploadScreenshot()
{
return UploadStyle.NEITHER;
return ImageUploadStyle.NEITHER;
}
@ConfigItem(

View File

@@ -32,26 +32,17 @@ import com.google.inject.Provides;
import java.awt.Desktop;
import java.awt.Graphics;
import java.awt.Image;
import java.awt.Toolkit;
import java.awt.TrayIcon;
import java.awt.datatransfer.Clipboard;
import java.awt.datatransfer.StringSelection;
import java.awt.image.BufferedImage;
import java.io.File;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.lang.reflect.InvocationTargetException;
import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.time.LocalDate;
import java.util.Date;
import java.util.EnumSet;
import java.util.concurrent.ScheduledExecutorService;
import java.util.function.Consumer;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import javax.imageio.ImageIO;
import javax.inject.Inject;
import javax.inject.Singleton;
import javax.swing.SwingUtilities;
@@ -66,7 +57,6 @@ import net.runelite.api.Player;
import net.runelite.api.Point;
import net.runelite.api.SpriteID;
import net.runelite.api.Varbits;
import net.runelite.api.WorldType;
import net.runelite.api.events.ChatMessage;
import net.runelite.api.events.GameStateChanged;
import net.runelite.api.events.GameTick;
@@ -96,24 +86,14 @@ import net.runelite.client.input.KeyManager;
import net.runelite.client.plugins.Plugin;
import net.runelite.client.plugins.PluginDescriptor;
import net.runelite.client.plugins.PluginType;
import net.runelite.client.plugins.screenshot.imgur.ImageUploadRequest;
import net.runelite.client.plugins.screenshot.imgur.ImageUploadResponse;
import net.runelite.client.ui.ClientToolbar;
import net.runelite.client.ui.ClientUI;
import net.runelite.client.ui.DrawManager;
import net.runelite.client.ui.NavigationButton;
import net.runelite.client.ui.overlay.OverlayManager;
import net.runelite.client.util.HotkeyListener;
import net.runelite.client.util.ImageCapture;
import net.runelite.client.util.ImageUtil;
import net.runelite.http.api.RuneLiteAPI;
import okhttp3.Call;
import okhttp3.Callback;
import okhttp3.HttpUrl;
import okhttp3.MediaType;
import okhttp3.Request;
import okhttp3.RequestBody;
import okhttp3.Response;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
@PluginDescriptor(
@@ -126,10 +106,6 @@ import org.jetbrains.annotations.Nullable;
@Singleton
public class ScreenshotPlugin extends Plugin
{
private static final String IMGUR_CLIENT_ID = "30d71e5f6860809";
private static final HttpUrl IMGUR_IMAGE_UPLOAD_URL = HttpUrl.parse("https://api.imgur.com/3/image");
private static final MediaType JSON = MediaType.parse("application/json");
private static final DateFormat TIME_FORMAT = new SimpleDateFormat("yyyy-MM-dd_HH-mm-ss");
private static final Pattern NUMBER_PATTERN = Pattern.compile("([0-9]+)");
@@ -196,6 +172,9 @@ public class ScreenshotPlugin extends Plugin
@Inject
private SpriteManager spriteManager;
@Inject
private ImageCapture imageCapture;
@Getter(AccessLevel.PACKAGE)
private BufferedImage reportButton;
@@ -206,7 +185,7 @@ public class ScreenshotPlugin extends Plugin
@Override
public void hotkeyPressed()
{
takeScreenshot(format(new Date()));
takeScreenshot("");
}
};
@@ -220,7 +199,6 @@ public class ScreenshotPlugin extends Plugin
private boolean screenshotLevels;
private boolean screenshotKingdom;
private boolean screenshotPet;
private UploadStyle uploadScreenshot;
private boolean screenshotKills;
private boolean screenshotBossKills;
private boolean screenshotFriendDeath;
@@ -253,7 +231,7 @@ public class ScreenshotPlugin extends Plugin
.tab(false)
.tooltip("Take screenshot")
.icon(iconImage)
.onClick(() -> takeScreenshot(format(new Date())))
.onClick(() -> takeScreenshot(""))
.popup(ImmutableMap
.<String, Runnable>builder()
.put("Open screenshot folder...", () ->
@@ -353,7 +331,7 @@ public class ScreenshotPlugin extends Plugin
{
final Player player = playerLootReceived.getPlayer();
final String name = player.getName();
String fileName = "Kill " + name + " " + format(new Date());
String fileName = "Kill " + name;
takeScreenshot(fileName);
}
}
@@ -421,7 +399,7 @@ public class ScreenshotPlugin extends Plugin
if (this.screenshotPet && PET_MESSAGES.stream().anyMatch(chatMessage::contains))
{
String fileName = "Pet " + format(new Date());
String fileName = "Pet";
takeScreenshot(fileName);
}
@@ -443,7 +421,7 @@ public class ScreenshotPlugin extends Plugin
if (m.matches())
{
String valuableDropName = m.group(1);
String fileName = "Valuable drop " + valuableDropName + " " + format(new Date());
String fileName = "Valuable drop " + valuableDropName;
takeScreenshot(fileName);
}
}
@@ -454,7 +432,7 @@ public class ScreenshotPlugin extends Plugin
if (m.matches())
{
String untradeableDropName = m.group(1);
String fileName = "Untradeable drop " + untradeableDropName + " " + format(new Date());
String fileName = "Untradeable drop " + untradeableDropName;
takeScreenshot(fileName);
}
}
@@ -703,135 +681,7 @@ public class ScreenshotPlugin extends Plugin
// Draw the game onto the screenshot
graphics.drawImage(image, gameOffsetX, gameOffsetY, null);
File playerFolder;
if (client.getLocalPlayer() != null && client.getLocalPlayer().getName() != null)
{
final EnumSet<WorldType> worldTypes = client.getWorldType();
String playerDir = client.getLocalPlayer().getName();
if (worldTypes.contains(WorldType.DEADMAN))
{
playerDir += "-Deadman";
}
else if (worldTypes.contains(WorldType.LEAGUE))
{
playerDir += "-League";
}
playerFolder = new File(SCREENSHOT_DIR, playerDir);
}
else
{
playerFolder = SCREENSHOT_DIR;
}
playerFolder.mkdirs();
if (subdirectory != null)
{
//uhh just tried to do this as workaround, not sure if it's the best idea tho
File actualplayerFolder = new File(playerFolder, subdirectory);
actualplayerFolder.mkdir();
playerFolder = actualplayerFolder;
}
try
{
File screenshotFile = new File(playerFolder, fileName + ".png");
// To make sure that screenshots don't get overwritten, check if file exists,
// and if it does create file with same name and suffix.
int i = 1;
while (screenshotFile.exists())
{
screenshotFile = new File(playerFolder, fileName + String.format("(%d)", i++) + ".png");
}
ImageIO.write(screenshot, "PNG", screenshotFile);
UploadStyle uploadStyle = this.uploadScreenshot;
if (uploadStyle == UploadStyle.IMGUR)
{
uploadScreenshot(screenshotFile);
}
else if (uploadStyle == UploadStyle.CLIPBOARD)
{
Clipboard clipboard = Toolkit.getDefaultToolkit().getSystemClipboard();
TransferableBufferedImage transferableBufferedImage = new TransferableBufferedImage(screenshot);
clipboard.setContents(transferableBufferedImage, null);
if (this.notifyWhenTaken)
{
notifier.notify("A screenshot was saved and inserted into your clipboard!", TrayIcon.MessageType.INFO);
}
}
else if (this.notifyWhenTaken)
{
notifier.notify("A screenshot was saved to " + screenshotFile, TrayIcon.MessageType.INFO);
}
}
catch (IOException ex)
{
log.warn("error writing screenshot", ex);
}
}
/**
* Uploads a screenshot to the Imgur image-hosting service,
* and copies the image link to the clipboard.
*
* @param screenshotFile Image file to upload.
* @throws IOException Thrown if the file cannot be read.
*/
/**
* Uploads a screenshot to the Imgur image-hosting service,
* and copies the image link to the clipboard.
*
* @param screenshotFile Image file to upload.
* @throws IOException Thrown if the file cannot be read.
*/
private void uploadScreenshot(File screenshotFile) throws IOException
{
String json = RuneLiteAPI.GSON.toJson(new ImageUploadRequest(screenshotFile));
Request request = new Request.Builder()
.url(IMGUR_IMAGE_UPLOAD_URL)
.addHeader("Authorization", "Client-ID " + IMGUR_CLIENT_ID)
.post(RequestBody.create(JSON, json))
.build();
RuneLiteAPI.CLIENT.newCall(request).enqueue(new Callback()
{
@Override
public void onFailure(@NotNull Call call, @NotNull IOException ex)
{
log.warn("error uploading screenshot", ex);
}
@Override
public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException
{
try (InputStream in = response.body().byteStream())
{
ImageUploadResponse imageUploadResponse = RuneLiteAPI.GSON
.fromJson(new InputStreamReader(in), ImageUploadResponse.class);
if (imageUploadResponse.isSuccess())
{
String link = imageUploadResponse.getData().getLink();
StringSelection selection = new StringSelection(link);
Clipboard clipboard = Toolkit.getDefaultToolkit().getSystemClipboard();
clipboard.setContents(selection, selection);
if (notifyWhenTaken)
{
notifier.notify("A screenshot was uploaded and inserted into your clipboard!", TrayIcon.MessageType.INFO);
}
}
}
}
});
imageCapture.takeScreenshot(screenshot, fileName, config.notifyWhenTaken(), config.uploadScreenshot());
}
@VisibleForTesting
@@ -890,7 +740,6 @@ public class ScreenshotPlugin extends Plugin
this.screenshotLevels = config.screenshotLevels();
this.screenshotKingdom = config.screenshotKingdom();
this.screenshotPet = config.screenshotPet();
this.uploadScreenshot = config.uploadScreenshot();
this.screenshotKills = config.screenshotKills();
this.screenshotBossKills = config.screenshotBossKills();
this.screenshotFriendDeath = config.screenshotFriendDeath();

View File

@@ -29,6 +29,7 @@ import java.awt.Color;
import net.runelite.client.config.Config;
import net.runelite.client.config.ConfigGroup;
import net.runelite.client.config.ConfigItem;
import net.runelite.client.config.Units;
@ConfigGroup("slayer")
public interface SlayerConfig extends Config
@@ -70,9 +71,10 @@ public interface SlayerConfig extends Config
@ConfigItem(
position = 4,
keyName = "statTimeout",
name = "InfoBox Expiry (minutes)",
name = "InfoBox Expiry",
description = "Set the time until the InfoBox expires"
)
@Units(Units.MINUTES)
default int statTimeout()
{
return 5;

View File

@@ -65,6 +65,8 @@ class SlayerOverlay extends WidgetItemOverlay
ItemID.RED_SLAYER_HELMET_I,
ItemID.TURQUOISE_SLAYER_HELMET,
ItemID.TURQUOISE_SLAYER_HELMET_I,
ItemID.TWISTED_SLAYER_HELMET,
ItemID.TWISTED_SLAYER_HELMET_I,
ItemID.HYDRA_SLAYER_HELMET,
ItemID.HYDRA_SLAYER_HELMET_I,
ItemID.SLAYER_RING_ETERNAL,

View File

@@ -27,6 +27,7 @@ package net.runelite.client.plugins.smelting;
import net.runelite.client.config.Config;
import net.runelite.client.config.ConfigGroup;
import net.runelite.client.config.ConfigItem;
import net.runelite.client.config.Units;
@ConfigGroup("smelting")
public interface SmeltingConfig extends Config
@@ -34,9 +35,10 @@ public interface SmeltingConfig extends Config
@ConfigItem(
position = 1,
keyName = "statTimeout",
name = "Reset stats (minutes)",
name = "Reset stats",
description = "The time it takes for the current smelting session to be reset"
)
@Units(Units.MINUTES)
default int statTimeout()
{
return 5;

View File

@@ -27,6 +27,7 @@ package net.runelite.client.plugins.spellbook;
import net.runelite.client.config.Config;
import net.runelite.client.config.ConfigGroup;
import net.runelite.client.config.ConfigItem;
import net.runelite.client.config.Units;
@ConfigGroup("spellbook")
public interface SpellbookConfig extends Config
@@ -70,6 +71,7 @@ public interface SpellbookConfig extends Config
description = "Size (in px) of spells. Normal mobile size is 40px, use common sense for this setting",
position = 4
)
@Units(Units.PIXELS)
default int size()
{
return 40;

View File

@@ -27,6 +27,7 @@ package net.runelite.client.plugins.statusbars;
import net.runelite.client.config.Config;
import net.runelite.client.config.ConfigGroup;
import net.runelite.client.config.ConfigItem;
import net.runelite.client.config.Units;
import net.runelite.client.plugins.statusbars.config.BarMode;
@ConfigGroup("statusbars")
@@ -101,9 +102,10 @@ public interface StatusBarsConfig extends Config
@ConfigItem(
position = 7,
keyName = "hideStatusBarDelay",
name = "Delay (seconds)",
name = "Delay",
description = "Number of seconds after combat to hide the status bars."
)
@Units(Units.SECONDS)
default int hideStatusBarDelay()
{
return 3;

View File

@@ -30,6 +30,7 @@ import net.runelite.client.config.ConfigGroup;
import net.runelite.client.config.ConfigItem;
import net.runelite.client.config.ConfigTitleSection;
import net.runelite.client.config.Title;
import net.runelite.client.config.Units;
@ConfigGroup("statusorbs")
public interface StatusOrbsConfig extends Config
@@ -83,11 +84,12 @@ public interface StatusOrbsConfig extends Config
@ConfigItem(
keyName = "notifyBeforeHpRegenDuration",
name = "Hitpoint Regen Notification (seconds)",
name = "Hitpoint Regen Notification",
description = "Notify approximately when your next hitpoint is about to regen. A value of 0 will disable notification.",
titleSection = "hp",
position = 4
)
@Units(Units.SECONDS)
default int getNotifyBeforeHpRegenSeconds()
{
return 0;

View File

@@ -28,6 +28,7 @@ package net.runelite.client.plugins.stretchedmode;
import net.runelite.client.config.Config;
import net.runelite.client.config.ConfigGroup;
import net.runelite.client.config.ConfigItem;
import net.runelite.client.config.Units;
@ConfigGroup("stretchedmode")
public interface StretchedModeConfig extends Config
@@ -64,9 +65,10 @@ public interface StretchedModeConfig extends Config
@ConfigItem(
keyName = "scalingFactor",
name = "Resizable Scaling (%)",
name = "Resizable Scaling",
description = "In resizable mode, the game is reduced in size this much before it's stretched."
)
@Units(Units.PERCENT)
default int scalingFactor()
{
return 50;

View File

@@ -33,6 +33,7 @@ import net.runelite.client.config.ConfigGroup;
import net.runelite.client.config.ConfigItem;
import net.runelite.client.config.ConfigSection;
import net.runelite.client.config.Range;
import net.runelite.client.config.Units;
@ConfigGroup("thieving")
public interface ThievingConfig extends Config
@@ -40,9 +41,10 @@ public interface ThievingConfig extends Config
@ConfigItem(
position = 1,
keyName = "statTimeout",
name = "Reset stats (minutes)",
name = "Reset stats",
description = "Change the time until the thieving session is reset and the overlay is hidden"
)
@Units(Units.MINUTES)
default int statTimeout()
{
return 5;

View File

@@ -27,6 +27,7 @@ package net.runelite.client.plugins.timetracking;
import net.runelite.client.config.Config;
import net.runelite.client.config.ConfigGroup;
import net.runelite.client.config.ConfigItem;
import net.runelite.client.config.Units;
@ConfigGroup("timetracking")
public interface TimeTrackingConfig extends Config
@@ -72,10 +73,11 @@ public interface TimeTrackingConfig extends Config
@ConfigItem(
keyName = "defaultTimerMinutes",
name = "Default Time (Minutes)",
name = "Default Time",
description = "The default time for the timer in minutes",
position = 4
)
@Units(Units.MINUTES)
default int defaultTimerMinutes()
{
return 5;

View File

@@ -1,5 +1,5 @@
/*
* Copyright (c) 2018, Lotto <https://github.com/devLotto>
* Copyright (c) 2020, Henry Darnell <hjdarnel@gmail.com>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -22,23 +22,23 @@
* (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.screenshot.imgur;
package net.runelite.client.plugins.wiki;
import java.io.File;
import java.io.IOException;
import java.nio.file.Files;
import java.util.Base64;
import lombok.Data;
import net.runelite.client.config.Config;
import net.runelite.client.config.ConfigGroup;
import net.runelite.client.config.ConfigItem;
@Data
public class ImageUploadRequest
@ConfigGroup(WikiPlugin.CONFIG_GROUP_KEY)
public interface WikiConfig extends Config
{
private final String image;
private final String type;
public ImageUploadRequest(File imageFile) throws IOException
@ConfigItem(
keyName = "leftClickSearch",
name = "Left Click Search",
description = "Swap left-click on the Wiki button to Search",
position = 1
)
default boolean leftClickSearch()
{
this.image = Base64.getEncoder().encodeToString(Files.readAllBytes(imageFile.toPath()));
this.type = "base64";
return false;
}
}

View File

@@ -24,6 +24,7 @@
*/
package net.runelite.client.plugins.wiki;
import com.google.inject.Provides;
import javax.inject.Inject;
import javax.inject.Provider;
import lombok.extern.slf4j.Slf4j;
@@ -48,7 +49,9 @@ import net.runelite.api.widgets.WidgetInfo;
import net.runelite.api.widgets.WidgetPositionMode;
import net.runelite.api.widgets.WidgetType;
import net.runelite.client.callback.ClientThread;
import net.runelite.client.config.ConfigManager;
import net.runelite.client.eventbus.Subscribe;
import net.runelite.client.events.ConfigChanged;
import net.runelite.client.game.ItemManager;
import net.runelite.client.game.SpriteManager;
import net.runelite.client.plugins.Plugin;
@@ -86,6 +89,9 @@ public class WikiPlugin extends Plugin
@Inject
private SpriteManager spriteManager;
@Inject
private WikiConfig config;
@Inject
private ClientThread clientThread;
@@ -102,6 +108,14 @@ public class WikiPlugin extends Plugin
private boolean wikiSelected = false;
static final String CONFIG_GROUP_KEY = "wiki";
@Provides
WikiConfig getConfig(ConfigManager configManager)
{
return configManager.getConfig(WikiConfig.class);
}
@Override
public void startUp()
{
@@ -111,29 +125,32 @@ public class WikiPlugin extends Plugin
@Override
public void shutDown()
{
clientThread.invokeLater(() ->
clientThread.invokeLater(this::removeWidgets);
}
private void removeWidgets()
{
Widget minimapOrbs = client.getWidget(WidgetInfo.MINIMAP_ORBS);
if (minimapOrbs == null)
{
Widget minimapOrbs = client.getWidget(WidgetInfo.MINIMAP_ORBS);
if (minimapOrbs == null)
{
return;
}
Widget[] children = minimapOrbs.getChildren();
if (children == null || children.length < 1)
{
return;
}
children[0] = null;
return;
}
Widget[] children = minimapOrbs.getChildren();
if (children == null || children.length < 1)
{
return;
}
children[0] = null;
Widget vanilla = client.getWidget(WidgetInfo.MINIMAP_WIKI_BANNER);
if (vanilla != null)
{
vanilla.setHidden(false);
}
Widget vanilla = client.getWidget(WidgetInfo.MINIMAP_WIKI_BANNER);
if (vanilla != null)
{
vanilla.setHidden(false);
}
onDeselect();
client.setSpellSelected(false);
});
onDeselect();
client.setSpellSelected(false);
}
@Subscribe
@@ -178,14 +195,17 @@ public class WikiPlugin extends Plugin
icon.setSpriteId(SpriteID.WIKI_SELECTED);
client.setAllWidgetsAreOpTargetable(true);
});
icon.setAction(5, "Search"); // Start at option 5 so the target op is ontop
final int searchIndex = config.leftClickSearch() ? 4 : 5;
icon.setAction(searchIndex, "Search");
icon.setOnOpListener((JavaScriptCallback) ev ->
{
if (ev.getOp() == 6)
if (ev.getOp() == searchIndex + 1)
{
openSearchInput();
}
});
// This doesn't always run because we cancel the menuop
icon.setOnTargetLeaveListener((JavaScriptCallback) ev -> onDeselect());
icon.revalidate();
@@ -200,6 +220,19 @@ public class WikiPlugin extends Plugin
}
}
@Subscribe
public void onConfigChanged(ConfigChanged event)
{
if (event.getGroup().equals(CONFIG_GROUP_KEY))
{
clientThread.invokeLater(() ->
{
removeWidgets();
addWidgets();
});
}
}
private void onDeselect()
{
client.setAllWidgetsAreOpTargetable(false);

View File

@@ -30,6 +30,7 @@ import net.runelite.client.config.Config;
import net.runelite.client.config.ConfigGroup;
import net.runelite.client.config.ConfigItem;
import net.runelite.client.config.Range;
import net.runelite.client.config.Units;
import net.runelite.client.plugins.wintertodt.config.WintertodtNotifyMode;
@ConfigGroup("wintertodt")
@@ -66,6 +67,7 @@ public interface WintertodtConfig extends Config
@Range(
max = 60
)
@Units(Units.SECONDS)
default int roundNotification()
{
return 5;

View File

@@ -311,8 +311,8 @@ public class WintertodtPlugin extends Plugin
chatMessageManager.update(messageNode);
client.refreshChat();
// all actions except woodcutting are interrupted from damage
if (currentActivity != WintertodtActivity.WOODCUTTING)
// all actions except woodcutting and idle are interrupted from damage
if (currentActivity != WintertodtActivity.WOODCUTTING && currentActivity != WintertodtActivity.IDLE)
{
wasInterrupted = true;
}

View File

@@ -27,6 +27,7 @@ package net.runelite.client.plugins.woodcutting;
import net.runelite.client.config.Config;
import net.runelite.client.config.ConfigGroup;
import net.runelite.client.config.ConfigItem;
import net.runelite.client.config.Units;
@ConfigGroup("woodcutting")
public interface WoodcuttingConfig extends Config
@@ -34,9 +35,10 @@ public interface WoodcuttingConfig extends Config
@ConfigItem(
position = 1,
keyName = "statTimeout",
name = "Reset stats (minutes)",
name = "Reset stats",
description = "Configures the time until statistic is reset. Also configures when tree indicator is hidden"
)
@Units(Units.MINUTES)
default int statTimeout()
{
return 5;

View File

@@ -29,6 +29,7 @@ import net.runelite.client.config.Alpha;
import net.runelite.client.config.Config;
import net.runelite.client.config.ConfigGroup;
import net.runelite.client.config.ConfigItem;
import net.runelite.client.config.Units;
@ConfigGroup("xpglobes")
public interface XpGlobesConfig extends Config
@@ -152,6 +153,7 @@ public interface XpGlobesConfig extends Config
description = "Change the stroke width of the progress arc",
position = 10
)
@Units(Units.PIXELS)
default int progressArcStrokeWidth()
{
return 2;
@@ -163,6 +165,7 @@ public interface XpGlobesConfig extends Config
description = "Change the size of the xp orbs",
position = 11
)
@Units(Units.PIXELS)
default int xpOrbSize()
{
return 40;
@@ -174,6 +177,7 @@ public interface XpGlobesConfig extends Config
description = "Change the duration the xp orbs are visible",
position = 12
)
@Units(Units.SECONDS)
default int xpOrbDuration()
{
return 10;

View File

@@ -28,6 +28,7 @@ import lombok.AllArgsConstructor;
import net.runelite.client.config.Config;
import net.runelite.client.config.ConfigGroup;
import net.runelite.client.config.ConfigItem;
import net.runelite.client.config.Units;
@ConfigGroup("xpTracker")
public interface XpTrackerConfig extends Config
@@ -87,6 +88,7 @@ public interface XpTrackerConfig extends Config
name = "Auto pause after",
description = "Configures how many minutes passes before pausing a skill while in game and there's no XP, 0 means disabled"
)
@Units(Units.MINUTES)
default int pauseSkillAfter()
{
return 0;

View File

@@ -1,5 +1,5 @@
/*
* Copyright (c) 2019, pklite <https://github.com/pklite/pklite>
* Copyright (c) 2020, Alexsuperfly <alexsuperfly@users.noreply.github.com>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -10,6 +10,7 @@
* 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
@@ -21,23 +22,33 @@
* (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.freezetimers;
package net.runelite.client.plugins.xpupdater;
import lombok.AccessLevel;
import lombok.Getter;
import net.runelite.client.config.ConfigGroup;
import net.runelite.client.config.ConfigItem;
public enum TimerType
@ConfigGroup("xpupdater")
public interface XpUpdaterConfig
{
FREEZE(3000),
VENG(0),
TELEBLOCK(45000),
THIS_SHIT_BROKE(-1);
@Getter(AccessLevel.PACKAGE)
private final int immunityTime;
TimerType(int immunityTime)
@ConfigItem(
position = 1,
keyName = "cml",
name = "Crystal Math Labs",
description = "Automatically updates your stats on crystalmathlabs.com when you log out"
)
default boolean cml()
{
this.immunityTime = immunityTime;
return false;
}
@ConfigItem(
position = 2,
keyName = "templeosrs",
name = "TempleOSRS",
description = "Automatically updates your stats on templeosrs.com when you log out"
)
default boolean templeosrs()
{
return false;
}
}

View File

@@ -1,5 +1,6 @@
/*
* Copyright (c) 2018, Adam <Adam@sigterm.info>
* Copyright (c) 2020, Alexsuperfly <alexsuperfly@users.noreply.github.com>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -22,18 +23,19 @@
* (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.crystalmathlabs;
package net.runelite.client.plugins.xpupdater;
import java.io.IOException;
import java.util.Objects;
import javax.inject.Inject;
import javax.inject.Singleton;
import com.google.inject.Provides;
import lombok.extern.slf4j.Slf4j;
import net.runelite.api.Client;
import net.runelite.api.GameState;
import net.runelite.api.Player;
import net.runelite.api.events.GameStateChanged;
import net.runelite.api.events.GameTick;
import net.runelite.client.config.ConfigManager;
import net.runelite.client.eventbus.EventBus;
import net.runelite.client.plugins.Plugin;
import net.runelite.client.plugins.PluginDescriptor;
@@ -48,15 +50,14 @@ import okhttp3.Response;
import org.jetbrains.annotations.NotNull;
@PluginDescriptor(
name = "Crystal Math Labs",
description = "Automatically updates your stats on Crystal Math Labs when you log out",
tags = {"cml", "external", "integration"},
name = "XP Updater",
description = "Automatically updates your stats on external xptrackers when you log out",
tags = {"cml", "templeosrs", "temple", "external", "integration"},
enabledByDefault = false,
type = PluginType.MISCELLANEOUS
)
@Slf4j
@Singleton
public class CrystalMathLabs extends Plugin
public class XpUpdaterPlugin extends Plugin
{
/**
* Amount of EXP that must be gained for an update to be submitted.
@@ -65,7 +66,7 @@ public class CrystalMathLabs extends Plugin
@Inject
private Client client;
@Inject
private EventBus eventBus;
@@ -73,22 +74,31 @@ public class CrystalMathLabs extends Plugin
private boolean fetchXp;
private long lastXp;
@Inject
private XpUpdaterConfig config;
@Provides
XpUpdaterConfig getConfig(ConfigManager configManager)
{
return configManager.getConfig(XpUpdaterConfig.class);
}
@Override
protected void startUp()
{
fetchXp = true;
eventBus.subscribe(GameStateChanged.class, this, this::onGameStateChanged);
eventBus.subscribe(GameTick.class, this, this::onGameTick);
}
@Override
protected void shutDown()
{
eventBus.unregister(this);
}
private void onGameStateChanged(GameStateChanged gameStateChanged)
public void onGameStateChanged(GameStateChanged gameStateChanged)
{
GameState state = gameStateChanged.getGameState();
if (state == GameState.LOGGED_IN)
@@ -118,7 +128,7 @@ public class CrystalMathLabs extends Plugin
}
}
private void onGameTick(GameTick gameTick)
public void onGameTick(GameTick gameTick)
{
if (fetchXp)
{
@@ -132,33 +142,67 @@ public class CrystalMathLabs extends Plugin
String reformedUsername = username.replace(" ", "_");
OkHttpClient httpClient = RuneLiteAPI.CLIENT;
HttpUrl httpUrl = new HttpUrl.Builder()
.scheme("https")
.host("crystalmathlabs.com")
.addPathSegment("tracker")
.addPathSegment("api.php")
.addQueryParameter("type", "update")
.addQueryParameter("player", reformedUsername)
.build();
Request request = new Request.Builder()
.header("User-Agent", "RuneLite")
.url(httpUrl)
.build();
httpClient.newCall(request).enqueue(new Callback()
if (config.cml())
{
@Override
public void onFailure(@NotNull Call call, @NotNull IOException e)
{
log.warn("Error submitting CML update, caused by {}.", e.getMessage());
}
HttpUrl url = new HttpUrl.Builder()
.scheme("https")
.host("crystalmathlabs.com")
.addPathSegment("tracker")
.addPathSegment("api.php")
.addQueryParameter("type", "update")
.addQueryParameter("player", reformedUsername)
.build();
@Override
public void onResponse(@NotNull Call call, @NotNull Response response)
Request request = new Request.Builder()
.header("User-Agent", "OpenOSRS")
.url(url)
.build();
httpClient.newCall(request).enqueue(new Callback()
{
response.close();
}
});
@Override
public void onFailure(@NotNull Call call, @NotNull IOException e)
{
log.warn("Error submitting CML update, caused by {}.", e.getMessage());
}
@Override
public void onResponse(@NotNull Call call, @NotNull Response response)
{
response.close();
}
});
}
if (config.templeosrs())
{
HttpUrl url = new HttpUrl.Builder()
.scheme("https")
.host("templeosrs.com")
.addPathSegment("php")
.addPathSegment("add_datapoint.php")
.addQueryParameter("player", reformedUsername)
.build();
Request request = new Request.Builder()
.header("User-Agent", "OpenOSRS")
.url(url)
.build();
httpClient.newCall(request).enqueue(new Callback()
{
@Override
public void onFailure(@NotNull Call call, @NotNull IOException e)
{
log.warn("Error submitting TempleOSRS update, caused by {}.", e.getMessage());
}
@Override
public void onResponse(@NotNull Call call, @NotNull Response response)
{
response.close();
}
});
}
}
}
}

View File

@@ -612,6 +612,35 @@ public class ClientUI
{
OSXUtil.requestFocus();
}
// The workaround for Windows is to minimise and then un-minimise the client to bring
// it to the front because java.awt.Window#toFront doesn't work reliably.
// See https://stackoverflow.com/questions/309023/how-to-bring-a-window-to-the-front/7435722#7435722
else if (OSType.getOSType() == OSType.Windows && !frame.isFocused())
{
SwingUtilities.invokeLater(() ->
{
if ((frame.getExtendedState() & JFrame.MAXIMIZED_BOTH) == JFrame.MAXIMIZED_BOTH)
{
frame.setExtendedState(JFrame.ICONIFIED);
frame.setExtendedState(JFrame.MAXIMIZED_BOTH);
}
else
{
// If the client is snapped to the top and bottom edges of the screen, setExtendedState will
// will reset it so setSize and setLocation ensure that the client doesn't move or resize.
// It is done this way because Windows does not support JFrame.MAXIMIZED_VERT
int x = frame.getLocation().x;
int y = frame.getLocation().y;
int width = frame.getWidth();
int height = frame.getHeight();
frame.setExtendedState(JFrame.ICONIFIED);
frame.setExtendedState(JFrame.NORMAL);
frame.setLocation(x, y);
frame.setSize(width, height);
}
});
}
frame.requestFocus();
giveClientFocus();

View File

@@ -26,6 +26,7 @@ package net.runelite.client.ui.overlay;
import java.awt.Dimension;
import java.awt.Graphics2D;
import java.awt.Rectangle;
import java.util.Arrays;
import java.util.HashSet;
import java.util.List;
@@ -61,6 +62,8 @@ public abstract class WidgetItemOverlay extends Overlay
public Dimension render(Graphics2D graphics)
{
final List<WidgetItem> itemWidgets = overlayManager.getItemWidgets();
final Rectangle originalClipBounds = graphics.getClipBounds();
Widget curClipParent = null;
for (WidgetItem widgetItem : itemWidgets)
{
Widget widget = widgetItem.getWidget();
@@ -74,6 +77,29 @@ public abstract class WidgetItemOverlay extends Overlay
continue;
}
Widget parent = widget.getParent();
Rectangle parentBounds = parent.getBounds();
Rectangle itemCanvasBounds = widgetItem.getCanvasBounds();
boolean shouldClip;
shouldClip = itemCanvasBounds.y < parentBounds.y && itemCanvasBounds.y + itemCanvasBounds.height >= parentBounds.y;
shouldClip |= itemCanvasBounds.y < parentBounds.y + parentBounds.height && itemCanvasBounds.y + itemCanvasBounds.height >= parentBounds.y + parentBounds.height;
shouldClip |= itemCanvasBounds.x < parentBounds.x && (itemCanvasBounds.x + itemCanvasBounds.width) >= parentBounds.x;
shouldClip |= itemCanvasBounds.x < parentBounds.x + parentBounds.width && itemCanvasBounds.x + itemCanvasBounds.width >= parentBounds.x + parentBounds.width;
if (shouldClip)
{
if (curClipParent != parent)
{
graphics.setClip(parentBounds);
curClipParent = parent;
}
}
else if (curClipParent != null && curClipParent != parent)
{
graphics.setClip(originalClipBounds);
curClipParent = null;
}
renderItemOverlay(graphics, widgetItem.getId(), widgetItem);
}
return null;

View File

@@ -32,6 +32,8 @@ import java.util.List;
import javax.inject.Inject;
import javax.inject.Singleton;
import net.runelite.api.Client;
import net.runelite.client.config.RuneLiteConfig;
import net.runelite.client.config.TooltipPositionType;
import net.runelite.client.ui.overlay.Overlay;
import net.runelite.client.ui.overlay.OverlayLayer;
import net.runelite.client.ui.overlay.OverlayPosition;
@@ -41,16 +43,19 @@ import net.runelite.client.ui.overlay.components.TooltipComponent;
@Singleton
public class TooltipOverlay extends Overlay
{
private static final int OFFSET = 24;
private static final int UNDER_OFFSET = 24;
private static final int ABOVE_OFFSET = -20;
private static final int PADDING = 2;
private final TooltipManager tooltipManager;
private final Client client;
private final RuneLiteConfig runeLiteConfig;
@Inject
private TooltipOverlay(Client client, TooltipManager tooltipManager)
private TooltipOverlay(Client client, TooltipManager tooltipManager, final RuneLiteConfig runeLiteConfig)
{
this.client = client;
this.tooltipManager = tooltipManager;
this.runeLiteConfig = runeLiteConfig;
setPosition(OverlayPosition.TOOLTIP);
setPriority(OverlayPriority.HIGHEST);
setLayer(OverlayLayer.ALWAYS_ON_TOP);
@@ -81,7 +86,8 @@ public class TooltipOverlay extends Overlay
{
final Rectangle clientCanvasBounds = new Rectangle(client.getRealDimensions());
final net.runelite.api.Point mouseCanvasPosition = client.getMouseCanvasPosition();
final Point mousePosition = new Point(mouseCanvasPosition.getX(), mouseCanvasPosition.getY() + OFFSET);
final int offset = runeLiteConfig.tooltipPosition() == TooltipPositionType.UNDER_CURSOR ? UNDER_OFFSET : ABOVE_OFFSET;
final Point mousePosition = new Point(mouseCanvasPosition.getX(), mouseCanvasPosition.getY() + offset);
final Rectangle bounds = new Rectangle(getBounds());
bounds.setLocation(mousePosition);
@@ -94,7 +100,7 @@ public class TooltipOverlay extends Overlay
if (boundsY > clientY)
{
graphics.translate(0, -bounds.height - OFFSET);
graphics.translate(0, -bounds.height - offset);
}
if (boundsX > clientX)
@@ -113,7 +119,7 @@ public class TooltipOverlay extends Overlay
if (newBounds.contains(mousePosition))
{
mousePosition.move(mouseCanvasPosition.getX(), mouseCanvasPosition.getY() + OFFSET + newBounds.height);
mousePosition.move(mouseCanvasPosition.getX(), mouseCanvasPosition.getY() + offset + newBounds.height);
}
tooltipComponent.setPosition(mousePosition);

View File

@@ -0,0 +1,244 @@
/*
* Copyright (c) 2018, Lotto <https://github.com/devLotto>
* Copyright (c) 2019, Alexsuperfly <https://github.com/Alexsuperfly>
* 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.util;
import java.awt.Toolkit;
import java.awt.TrayIcon;
import java.awt.datatransfer.Clipboard;
import java.awt.datatransfer.StringSelection;
import java.awt.image.BufferedImage;
import java.io.File;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.nio.file.Files;
import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.Base64;
import java.util.Date;
import java.util.EnumSet;
import javax.imageio.ImageIO;
import javax.inject.Inject;
import javax.inject.Singleton;
import lombok.Data;
import lombok.extern.slf4j.Slf4j;
import net.runelite.api.Client;
import net.runelite.api.GameState;
import net.runelite.api.WorldType;
import net.runelite.client.Notifier;
import static net.runelite.client.RuneLite.SCREENSHOT_DIR;
import net.runelite.client.RuneLiteProperties;
import net.runelite.http.api.RuneLiteAPI;
import okhttp3.Call;
import okhttp3.Callback;
import okhttp3.HttpUrl;
import okhttp3.MediaType;
import okhttp3.Request;
import okhttp3.RequestBody;
import okhttp3.Response;
@Slf4j
@Singleton
public class ImageCapture
{
private static final DateFormat TIME_FORMAT = new SimpleDateFormat("yyyy-MM-dd_HH-mm-ss");
private static final HttpUrl IMGUR_IMAGE_UPLOAD_URL = HttpUrl.parse("https://api.imgur.com/3/image");
private static final MediaType JSON = MediaType.parse("application/json");
@Inject
private Client client;
@Inject
private Notifier notifier;
/**
* Saves a screenshot of the client window to the screenshot folder as a PNG,
* and optionally uploads it to an image-hosting service.
*
* @param screenshot BufferedImage to capture.
* @param fileName Filename to use, without file extension.
* @param notify Send a notification to the system tray when the image is captured.
* @param imageUploadStyle which method to use to upload the screenshot (Imgur or directly to clipboard).
*/
public void takeScreenshot(BufferedImage screenshot, String fileName, boolean notify, ImageUploadStyle imageUploadStyle)
{
if (client.getGameState() == GameState.LOGIN_SCREEN)
{
// Prevent the screenshot from being captured
log.info("Login screenshot prevented");
return;
}
File playerFolder;
if (client.getLocalPlayer() != null && client.getLocalPlayer().getName() != null)
{
final EnumSet<WorldType> worldTypes = client.getWorldType();
String playerDir = client.getLocalPlayer().getName();
if (worldTypes.contains(WorldType.DEADMAN))
{
playerDir += "-Deadman";
}
else if (worldTypes.contains(WorldType.LEAGUE))
{
playerDir += "-League";
}
playerFolder = new File(SCREENSHOT_DIR, playerDir);
}
else
{
playerFolder = SCREENSHOT_DIR;
}
playerFolder.mkdirs();
fileName += " " + format(new Date());
try
{
File screenshotFile = new File(playerFolder, fileName + ".png");
// To make sure that screenshots don't get overwritten, check if file exists,
// and if it does create file with same name and suffix.
int i = 1;
while (screenshotFile.exists())
{
screenshotFile = new File(playerFolder, fileName + String.format("(%d)", i++) + ".png");
}
ImageIO.write(screenshot, "PNG", screenshotFile);
if (imageUploadStyle == ImageUploadStyle.IMGUR)
{
uploadScreenshot(screenshotFile, notify);
}
else if (imageUploadStyle == ImageUploadStyle.CLIPBOARD)
{
Clipboard clipboard = Toolkit.getDefaultToolkit().getSystemClipboard();
TransferableBufferedImage transferableBufferedImage = new TransferableBufferedImage(screenshot);
clipboard.setContents(transferableBufferedImage, null);
if (notify)
{
notifier.notify("A screenshot was saved and inserted into your clipboard!", TrayIcon.MessageType.INFO);
}
}
else if (notify)
{
notifier.notify("A screenshot was saved to " + screenshotFile, TrayIcon.MessageType.INFO);
}
}
catch (IOException ex)
{
log.warn("error writing screenshot", ex);
}
}
/**
* Uploads a screenshot to the Imgur image-hosting service,
* and copies the image link to the clipboard.
*
* @param screenshotFile Image file to upload.
* @throws IOException Thrown if the file cannot be read.
*/
private void uploadScreenshot(File screenshotFile, boolean notify) throws IOException
{
String json = RuneLiteAPI.GSON.toJson(new ImageUploadRequest(screenshotFile));
Request request = new Request.Builder()
.url(IMGUR_IMAGE_UPLOAD_URL)
.addHeader("Authorization", "Client-ID " + RuneLiteProperties.getImgurClientId())
.post(RequestBody.create(JSON, json))
.build();
RuneLiteAPI.CLIENT.newCall(request).enqueue(new Callback()
{
@Override
public void onFailure(Call call, IOException ex)
{
log.warn("error uploading screenshot", ex);
}
@Override
public void onResponse(Call call, Response response) throws IOException
{
try (InputStream in = response.body().byteStream())
{
ImageUploadResponse imageUploadResponse = RuneLiteAPI.GSON
.fromJson(new InputStreamReader(in), ImageUploadResponse.class);
if (imageUploadResponse.isSuccess())
{
String link = imageUploadResponse.getData().getLink();
StringSelection selection = new StringSelection(link);
Clipboard clipboard = Toolkit.getDefaultToolkit().getSystemClipboard();
clipboard.setContents(selection, selection);
if (notify)
{
notifier.notify("A screenshot was uploaded and inserted into your clipboard!", TrayIcon.MessageType.INFO);
}
}
}
}
});
}
private static String format(Date date)
{
synchronized (TIME_FORMAT)
{
return TIME_FORMAT.format(date);
}
}
@Data
private static class ImageUploadResponse
{
private Data data;
private boolean success;
@lombok.Data
private static class Data
{
private String link;
}
}
@Data
private static class ImageUploadRequest
{
private final String image;
private final String type;
ImageUploadRequest(File imageFile) throws IOException
{
this.image = Base64.getEncoder().encodeToString(Files.readAllBytes(imageFile.toPath()));
this.type = "base64";
}
}
}

View File

@@ -1,5 +1,5 @@
/*
* Copyright (c) 2018, Lotto <https://github.com/devLotto>
* Copyright (c) 2019, Alexsuperfly <https://github.com/Alexsuperfly>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -22,19 +22,12 @@
* (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.screenshot.imgur;
import lombok.Data;
package net.runelite.client.util;
@Data
public class ImageUploadResponse
public enum ImageUploadStyle
{
private Data data;
private boolean success;
@lombok.Data
public static class Data
{
private String link;
}
}
NEITHER,
IMGUR,
CLIPBOARD
}

View File

@@ -28,12 +28,16 @@ import java.awt.AWTException;
import java.awt.BorderLayout;
import java.awt.Color;
import java.awt.Component;
import java.awt.Container;
import java.awt.Dimension;
import java.awt.EventQueue;
import java.awt.Font;
import java.awt.Frame;
import java.awt.Image;
import java.awt.Insets;
import java.awt.SecondaryLoop;
import java.awt.SystemTray;
import java.awt.Toolkit;
import java.awt.TrayIcon;
import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;
@@ -58,6 +62,7 @@ import javax.swing.JOptionPane;
import javax.swing.JPanel;
import javax.swing.JPopupMenu;
import javax.swing.LookAndFeel;
import javax.swing.SwingUtilities;
import javax.swing.ToolTipManager;
import javax.swing.UIManager;
import javax.swing.UnsupportedLookAndFeelException;
@@ -472,4 +477,54 @@ public class SwingUtil
{
button.addItemListener(l -> button.setToolTipText(button.isSelected() ? on : off));
}
/**
* Removes all of a component's children faster than calling removeAll() on it in many cases
*/
public static void fastRemoveAll(Container c)
{
// If we are not on the EDT this will deadlock, in addition to being totally unsafe
assert SwingUtilities.isEventDispatchThread();
// when a component is removed it has to be resized for some reason, but only if it's valid
// so we make sure to invalidate everything before removing it
c.invalidate();
for (int i = 0; i < c.getComponentCount(); i++)
{
Component ic = c.getComponent(i);
// removeAll and removeNotify are both recursive, so we have to recurse before them
if (ic instanceof Container)
{
fastRemoveAll((Container) ic);
}
// each removeNotify needs to remove anything from the event queue that is for that widget
// this however requires taking a lock, and is moderately slow, so we just execute all of
// those events with a secondary event loop
pumpPendingEvents();
// call removeNotify early; this is most of the work in removeAll, and generates events that
// the next secondaryLoop will pickup
ic.removeNotify();
}
// Actually remove anything
c.removeAll();
}
/**
* Run any events currently in the event queue
*/
public static void pumpPendingEvents()
{
EventQueue eq = Toolkit.getDefaultToolkit().getSystemEventQueue();
if (eq.peekEvent() != null)
{
SecondaryLoop l = eq.createSecondaryLoop();
SwingUtilities.invokeLater(l::exit);
l.enter();
}
}
}

View File

@@ -24,7 +24,7 @@
* 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.screenshot;
package net.runelite.client.util;
import java.awt.datatransfer.DataFlavor;
import java.awt.datatransfer.Transferable;

View File

@@ -1348,7 +1348,8 @@
23815,
23816,
23817,
24253
24253,
24493
],
"radimus notes": [
714,
@@ -2458,6 +2459,7 @@
22519,
22520,
24367,
24418,
24426
],
"empty cup": [
@@ -2923,7 +2925,8 @@
20282,
23171,
23173,
23417
23417,
24494
],
"challenge scroll": [
2842,

Binary file not shown.

Before

Width:  |  Height:  |  Size: 195 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 492 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 216 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 251 B

Some files were not shown because too many files have changed in this diff Show More