diff --git a/runelite-api/runelite-api.gradle.kts b/runelite-api/runelite-api.gradle.kts index 1d6aaa1af8..5f6d276d02 100644 --- a/runelite-api/runelite-api.gradle.kts +++ b/runelite-api/runelite-api.gradle.kts @@ -36,6 +36,7 @@ dependencies { implementation(group = "com.google.guava", name = "guava", version = "30.1.1-jre") implementation(group = "org.apache.commons", name = "commons-text", version = "1.9") implementation(group = "org.slf4j", name = "slf4j-api", version = "1.7.32") + implementation(group = "org.jetbrains", name = "annotations", version = "22.0.0") testImplementation(group = "junit", name = "junit", version = "4.12") } \ No newline at end of file diff --git a/runelite-api/src/main/java/net/runelite/api/AnimationID.java b/runelite-api/src/main/java/net/runelite/api/AnimationID.java index 59c61ab497..ab4928ccb6 100644 --- a/runelite-api/src/main/java/net/runelite/api/AnimationID.java +++ b/runelite-api/src/main/java/net/runelite/api/AnimationID.java @@ -204,6 +204,12 @@ public final class AnimationID public static final int LEAGUE_HOME_TELEPORT_4 = 8803; public static final int LEAGUE_HOME_TELEPORT_5 = 8805; public static final int LEAGUE_HOME_TELEPORT_6 = 8807; + public static final int SHATTERED_LEAGUE_HOME_TELEPORT_1 = 9209; + public static final int SHATTERED_LEAGUE_HOME_TELEPORT_2 = 9210; + public static final int SHATTERED_LEAGUE_HOME_TELEPORT_3 = 9211; + public static final int SHATTERED_LEAGUE_HOME_TELEPORT_4 = 9212; + public static final int SHATTERED_LEAGUE_HOME_TELEPORT_5 = 9213; + public static final int SHATTERED_LEAGUE_HOME_TELEPORT_6 = 9214; public static final int RAID_LIGHT_ANIMATION = 3101; public static final int LOOTBEAM_ANIMATION = 9260; diff --git a/runelite-api/src/main/java/net/runelite/api/Client.java b/runelite-api/src/main/java/net/runelite/api/Client.java index d64f25fc5e..b3c4ba9a6b 100644 --- a/runelite-api/src/main/java/net/runelite/api/Client.java +++ b/runelite-api/src/main/java/net/runelite/api/Client.java @@ -35,6 +35,7 @@ import javax.annotation.Nonnull; import javax.annotation.Nullable; import net.runelite.api.annotations.VisibleForExternalPlugins; import net.runelite.api.clan.ClanChannel; +import net.runelite.api.clan.ClanID; import net.runelite.api.clan.ClanSettings; import net.runelite.api.coords.LocalPoint; import net.runelite.api.coords.WorldPoint; @@ -42,9 +43,11 @@ import net.runelite.api.events.PlayerChanged; import net.runelite.api.hooks.Callbacks; import net.runelite.api.hooks.DrawCallbacks; import net.runelite.api.vars.AccountType; +import net.runelite.api.widgets.ItemQuantityMode; import net.runelite.api.widgets.Widget; import net.runelite.api.widgets.WidgetInfo; import org.slf4j.Logger; +import org.intellij.lang.annotations.MagicConstant; /** * Represents the RuneScape client. @@ -440,7 +443,7 @@ public interface Client extends GameEngine * @return the created sprite */ @Nullable - SpritePixels createItemSprite(int itemId, int quantity, int border, int shadowColor, int stackable, boolean noted, int scale); + SpritePixels createItemSprite(int itemId, int quantity, int border, int shadowColor, @MagicConstant(valuesFromClass = ItemQuantityMode.class) int stackable, boolean noted, int scale); /** * Loads and creates the sprite images of the passed archive and file IDs. @@ -944,7 +947,7 @@ public interface Client extends GameEngine * * @return the widget flags table */ - HashTable getWidgetFlags(); + HashTable getWidgetFlags(); /** * Gets the widget node component table. @@ -2274,7 +2277,7 @@ public interface Client extends GameEngine * @return * @see KeyCode */ - boolean isKeyPressed(int keycode); + boolean isKeyPressed(@MagicConstant(valuesFromClass = KeyCode.class) int keycode); int getFollowerIndex(); @@ -2375,7 +2378,7 @@ public interface Client extends GameEngine * @see net.runelite.api.clan.ClanID */ @Nullable - ClanChannel getClanChannel(int clanId); + ClanChannel getClanChannel(@MagicConstant(valuesFromClass = ClanID.class) int clanId); /** * Get clan settings by id @@ -2384,7 +2387,7 @@ public interface Client extends GameEngine * @see net.runelite.api.clan.ClanID */ @Nullable - ClanSettings getClanSettings(int clanId); + ClanSettings getClanSettings(@MagicConstant(valuesFromClass = ClanID.class) int clanId); void setUnlockedFps(boolean unlock); void setUnlockedFpsTarget(int fps); diff --git a/runelite-api/src/main/java/net/runelite/api/CollisionData.java b/runelite-api/src/main/java/net/runelite/api/CollisionData.java index 5db393f743..c8ec77432b 100644 --- a/runelite-api/src/main/java/net/runelite/api/CollisionData.java +++ b/runelite-api/src/main/java/net/runelite/api/CollisionData.java @@ -24,6 +24,8 @@ */ package net.runelite.api; +import org.intellij.lang.annotations.MagicConstant; + /** * Represents tile collision data for the scene */ @@ -42,5 +44,6 @@ public interface CollisionData * @return all collision flags for the tiles in the scene * @see net.runelite.api.Constants#SCENE_SIZE */ + @MagicConstant(flagsFromClass = CollisionDataFlag.class) int[][] getFlags(); } \ No newline at end of file diff --git a/runelite-api/src/main/java/net/runelite/api/WidgetNode.java b/runelite-api/src/main/java/net/runelite/api/WidgetNode.java index 96d8c112e4..bcbb757092 100644 --- a/runelite-api/src/main/java/net/runelite/api/WidgetNode.java +++ b/runelite-api/src/main/java/net/runelite/api/WidgetNode.java @@ -1,5 +1,8 @@ package net.runelite.api; +import net.runelite.api.widgets.WidgetModalMode; +import org.intellij.lang.annotations.MagicConstant; + /** * Represents a widget as an iterable node. */ @@ -16,5 +19,6 @@ public interface WidgetNode extends Node /** * @see net.runelite.api.widgets.WidgetModalMode */ + @MagicConstant(valuesFromClass = WidgetModalMode.class) int getModalMode(); } diff --git a/runelite-api/src/main/java/net/runelite/api/events/ClanChannelChanged.java b/runelite-api/src/main/java/net/runelite/api/events/ClanChannelChanged.java index d9e3edbbff..b5943341e9 100644 --- a/runelite-api/src/main/java/net/runelite/api/events/ClanChannelChanged.java +++ b/runelite-api/src/main/java/net/runelite/api/events/ClanChannelChanged.java @@ -27,6 +27,8 @@ package net.runelite.api.events; import javax.annotation.Nullable; import lombok.Value; import net.runelite.api.clan.ClanChannel; +import net.runelite.api.clan.ClanID; +import org.intellij.lang.annotations.MagicConstant; /** * An event fired when the local player joins or leaves a clan channel. @@ -43,6 +45,7 @@ public class ClanChannelChanged * The clan id, or -1 for guest clan * @see net.runelite.api.clan.ClanID */ + @MagicConstant(valuesFromClass = ClanID.class) private int clanId; /** * Whether or not this was the guest clan channel diff --git a/runelite-api/src/main/java/net/runelite/api/events/WidgetClosed.java b/runelite-api/src/main/java/net/runelite/api/events/WidgetClosed.java index 42193b445f..b3123ec743 100644 --- a/runelite-api/src/main/java/net/runelite/api/events/WidgetClosed.java +++ b/runelite-api/src/main/java/net/runelite/api/events/WidgetClosed.java @@ -25,6 +25,8 @@ package net.runelite.api.events; import lombok.Value; +import net.runelite.api.widgets.WidgetModalMode; +import org.intellij.lang.annotations.MagicConstant; /** * Posted when an interface is about to be closed @@ -40,6 +42,7 @@ public class WidgetClosed /** * @see net.runelite.api.widgets.WidgetModalMode */ + @MagicConstant(valuesFromClass = WidgetModalMode.class) private final int modalMode; /** diff --git a/runelite-api/src/main/java/net/runelite/api/widgets/Widget.java b/runelite-api/src/main/java/net/runelite/api/widgets/Widget.java index 469d09473f..a6bda5c0d6 100644 --- a/runelite-api/src/main/java/net/runelite/api/widgets/Widget.java +++ b/runelite-api/src/main/java/net/runelite/api/widgets/Widget.java @@ -30,6 +30,8 @@ import javax.annotation.Nullable; import net.runelite.api.FontTypeFace; import net.runelite.api.Point; import net.runelite.api.SpritePixels; +import org.intellij.lang.annotations.MagicConstant; +import org.jetbrains.annotations.Range; /** * Represents an on-screen UI element that is drawn on the canvas. @@ -60,6 +62,7 @@ public interface Widget * * @see WidgetType */ + @MagicConstant(valuesFromClass = WidgetType.class) int getType(); /** @@ -67,7 +70,7 @@ public interface Widget * * @see WidgetType */ - void setType(int type); + void setType(@MagicConstant(valuesFromClass = WidgetType.class) int type); /** * Gets the type of content displayed by the widget. @@ -77,14 +80,13 @@ public interface Widget /** * Sets the type of content displayed by the widget. */ - void setContentType(int contentType); + Widget setContentType(int contentType); /** * Gets the current click configuration of the widget. * @see WidgetConfig - * - * @see WidgetConfig */ + @MagicConstant(flagsFromClass = WidgetConfig.class) int getClickMask(); /** @@ -92,7 +94,7 @@ public interface Widget * * @see WidgetConfig */ - void setClickMask(int mask); + Widget setClickMask(@MagicConstant(flagsFromClass = WidgetConfig.class) int mask); /** * Gets the parent widget, if this widget is a child. @@ -193,7 +195,7 @@ public interface Widget * * @param text the text to display */ - void setText(String text); + Widget setText(String text); /** * Gets the color as an RGB value. @@ -209,7 +211,7 @@ public interface Widget * @param textColor RGB24 color * @see java.awt.Color#getRGB() */ - void setTextColor(int textColor); + Widget setTextColor(int textColor); /** * Gets the transparency of the rectangle @@ -223,7 +225,7 @@ public interface Widget * * @param transparency 0 = fully opaque, 255 = fully transparent */ - void setOpacity(int transparency); + Widget setOpacity(int transparency); /** * Gets the name "op base" of the widget. @@ -242,12 +244,12 @@ public interface Widget * * @param name the new name */ - void setName(String name); + Widget setName(String name); /** * Gets the Model/NPC/Item ID displayed in the widget. * - * @see WidgetModelType + * @see #getModelType() */ int getModelId(); @@ -256,13 +258,14 @@ public interface Widget * * @see WidgetModelType */ - void setModelId(int id); + Widget setModelId(int id); /** * Gets the model type of the widget. * * @see WidgetModelType */ + @MagicConstant(valuesFromClass = WidgetModelType.class) int getModelType(); /** @@ -271,7 +274,7 @@ public interface Widget * @param type the new model type * @see WidgetModelType */ - void setModelType(int type); + Widget setModelType(@MagicConstant(valuesFromClass = WidgetModelType.class) int type); /** * Gets the sequence ID used to animate the model in the widget @@ -285,12 +288,13 @@ public interface Widget * * @see net.runelite.api.AnimationID */ - void setAnimationId(int animationId); + Widget setAnimationId(int animationId); /** * Gets the x rotation of the model displayed in the widget. * 0 = no rotation, 2047 = full rotation */ + @Range(from = 0, to = 2047) int getRotationX(); /** @@ -301,12 +305,13 @@ public interface Widget * * @param modelX the new model x rotation value */ - void setRotationX(int modelX); + Widget setRotationX(@Range(from = 0, to = 2047) int modelX); /** * Gets the y rotation of the model displayed in the widget. * 0 = no rotation, 2047 = full rotation */ + @Range(from = 0, to = 2047) int getRotationY(); /** @@ -317,12 +322,13 @@ public interface Widget * * @param modelY the new model y rotation value */ - void setRotationY(int modelY); + Widget setRotationY(@Range(from = 0, to = 2047) int modelY); /** * Gets the z rotation of the model displayed in the widget. * 0 = no rotation, 2047 = full rotation */ + @Range(from = 0, to = 2047) int getRotationZ(); /** @@ -333,7 +339,7 @@ public interface Widget * * @param modelZ the new model z rotation value */ - void setRotationZ(int modelZ); + Widget setRotationZ(@Range(from = 0, to = 2047) int modelZ); /** * Gets the amount zoomed in on the model displayed in the widget. @@ -345,7 +351,7 @@ public interface Widget * * @param modelZoom the new model zoom value */ - void setModelZoom(int modelZoom); + Widget setModelZoom(int modelZoom); /** * Gets the sprite ID displayed in the widget. @@ -363,7 +369,7 @@ public interface Widget /** * Sets if sprites are repeated or stretched */ - void setSpriteTiling(boolean tiling); + Widget setSpriteTiling(boolean tiling); /** * Sets the sprite ID displayed in the widget. @@ -371,7 +377,7 @@ public interface Widget * @param spriteId the sprite ID * @see net.runelite.api.SpriteID */ - void setSpriteId(int spriteId); + Widget setSpriteId(int spriteId); /** * Checks whether this widget or any of its parents are hidden. @@ -395,7 +401,7 @@ public interface Widget * * @param hidden new hidden state */ - void setHidden(boolean hidden); + Widget setHidden(boolean hidden); /** * The index of this widget in it's parent's children array @@ -485,7 +491,7 @@ public interface Widget * * @param itemId the item ID */ - void setItemId(int itemId); + Widget setItemId(int itemId); /** * Gets the quantity of the item displayed by the widget. @@ -499,7 +505,7 @@ public interface Widget * * @param quantity the quantity of the item */ - void setItemQuantity(int quantity); + Widget setItemQuantity(int quantity); /** * Checks if the passed canvas points is inside of this widget's @@ -518,7 +524,7 @@ public interface Widget /** * Sets the amount of pixels the widget is scrolled in the X axis */ - void setScrollX(int scrollX); + Widget setScrollX(int scrollX); /** * Gets the amount of pixels the widget is scrolled in the Y axis @@ -528,7 +534,7 @@ public interface Widget /** * sets the amount of pixels the widget is scrolled in the Y axis */ - void setScrollY(int scrollY); + Widget setScrollY(int scrollY); /** * Gets the size of the widget's viewport in the X axis @@ -538,7 +544,7 @@ public interface Widget /** * Sets the size of the widget's viewport in the X axis */ - void setScrollWidth(int width); + Widget setScrollWidth(int width); /** * Gets the size of the widget's viewport in the Y axis @@ -548,7 +554,7 @@ public interface Widget /** * Sets the size of the widget's viewport in the Y axis */ - void setScrollHeight(int height); + Widget setScrollHeight(int height); /** * Gets the X coordinate of this widget before being adjusted by @@ -562,7 +568,7 @@ public interface Widget * * @see #setXPositionMode(int) */ - void setOriginalX(int originalX); + Widget setOriginalX(int originalX); /** * Gets the Y coordinate of this widget before being adjusted by @@ -576,7 +582,15 @@ public interface Widget * * @see #setYPositionMode(int) */ - void setOriginalY(int originalY); + Widget setOriginalY(int originalY); + + /** + * Sets the X/Y coordinates + */ + Widget setPos(int x, int y); + Widget setPos(int x, int y, + @MagicConstant(valuesFromClass = WidgetPositionMode.class) int xMode, + @MagicConstant(valuesFromClass = WidgetPositionMode.class) int yMode); /** * Gets the height coordinate of this widget before being adjusted by @@ -590,7 +604,7 @@ public interface Widget * * @see #setHeightMode(int) */ - void setOriginalHeight(int originalHeight); + Widget setOriginalHeight(int originalHeight); /** * Gets the width coordinate of this widget before being adjusted by @@ -604,7 +618,12 @@ public interface Widget * * @see #setWidthMode(int) */ - void setOriginalWidth(int originalWidth); + Widget setOriginalWidth(int originalWidth); + + Widget setSize(int width, int height); + Widget setSize(int width, int height, + @MagicConstant(valuesFromClass = WidgetSizeMode.class) int widthMode, + @MagicConstant(valuesFromClass = WidgetSizeMode.class) int heightMode); /** * Gets the menu options available on the widget as a sparse array. @@ -615,9 +634,16 @@ public interface Widget * Creates a dynamic widget child * * @param index the index of the new widget in the children list or -1 to append to the back - * @param type the type of the widget + * @param type the {@link WidgetType} of the widget */ - Widget createChild(int index, int type); + Widget createChild(int index, @MagicConstant(valuesFromClass = WidgetType.class) int type); + + /** + * Creates a dynamic widget child at the end of the children list + * + * @param type the {@link WidgetType} of the widget + */ + Widget createChild(@MagicConstant(valuesFromClass = WidgetType.class) int type); /** * Removes all of this widget's dynamic children @@ -704,7 +730,7 @@ public interface Widget /** * Sets if the widget has any listeners. This should be called whenever a setXListener function is called */ - void setHasListener(boolean hasListener); + Widget setHasListener(boolean hasListener); /** * This is true if the widget is from an if3 interface, or is dynamically created @@ -761,7 +787,7 @@ public interface Widget * * @see net.runelite.api.FontID */ - void setFontId(int id); + Widget setFontId(int id); /** * Returns the border type of item/sprite on the widget @@ -784,7 +810,7 @@ public interface Widget /** * Sets if text should be shadowed */ - void setTextShadowed(boolean shadowed); + Widget setTextShadowed(boolean shadowed); /** * Returns the widget drag dead zone @@ -809,18 +835,21 @@ public interface Widget /** * Returns widget {@link net.runelite.api.widgets.ItemQuantityMode}. */ + @MagicConstant(valuesFromClass = ItemQuantityMode.class) int getItemQuantityMode(); /** * Sets the widget {@link net.runelite.api.widgets.ItemQuantityMode} */ - void setItemQuantityMode(int itemQuantityMode); + @MagicConstant(valuesFromClass = ItemQuantityMode.class) + Widget setItemQuantityMode(int itemQuantityMode); /** * Gets the mode that the X position is calculated from the original X position * * @see WidgetPositionMode */ + @MagicConstant(valuesFromClass = WidgetPositionMode.class) int getXPositionMode(); /** @@ -829,13 +858,14 @@ public interface Widget * * @see WidgetPositionMode */ - void setXPositionMode(int xpm); + Widget setXPositionMode(@MagicConstant(valuesFromClass = WidgetPositionMode.class) int xpm); /** * Gets the mode that the Y position is calculated from the original Y position * * @see WidgetPositionMode */ + @MagicConstant(valuesFromClass = WidgetPositionMode.class) int getYPositionMode(); /** @@ -844,7 +874,7 @@ public interface Widget * * @see WidgetPositionMode */ - void setYPositionMode(int ypm); + Widget setYPositionMode(@MagicConstant(valuesFromClass = WidgetPositionMode.class) int ypm); /** * Get the line height for this widget. @@ -858,13 +888,14 @@ public interface Widget * * @param lineHeight */ - void setLineHeight(int lineHeight); + Widget setLineHeight(int lineHeight); /** * Gets the X axis text position mode * * @see WidgetTextAlignment */ + @MagicConstant(valuesFromClass = WidgetTextAlignment.class) int getXTextAlignment(); /** @@ -872,13 +903,14 @@ public interface Widget * * @see WidgetTextAlignment */ - void setXTextAlignment(int xta); + Widget setXTextAlignment(@MagicConstant(valuesFromClass = WidgetTextAlignment.class) int xta); /** * Gets the Y axis text position mode * * @see WidgetTextAlignment */ + @MagicConstant(valuesFromClass = WidgetTextAlignment.class) int getYTextAlignment(); /** @@ -886,13 +918,14 @@ public interface Widget * * @see WidgetTextAlignment */ - void setYTextAlignment(int yta); + Widget setYTextAlignment(@MagicConstant(valuesFromClass = WidgetTextAlignment.class) int yta); /** * Gets the mode controlling widget width * * @see WidgetSizeMode */ + @MagicConstant(valuesFromClass = WidgetSizeMode.class) int getWidthMode(); /** @@ -901,13 +934,14 @@ public interface Widget * * @see WidgetSizeMode */ - void setWidthMode(int widthMode); + Widget setWidthMode(@MagicConstant(valuesFromClass = WidgetSizeMode.class) int widthMode); /** * Gets the mode controlling widget width * * @see WidgetSizeMode */ + @MagicConstant(valuesFromClass = WidgetSizeMode.class) int getHeightMode(); /** @@ -916,7 +950,7 @@ public interface Widget * * @see WidgetSizeMode */ - void setHeightMode(int heightMode); + Widget setHeightMode(@MagicConstant(valuesFromClass = WidgetSizeMode.class) int heightMode); /** * Gets the font that this widget uses @@ -931,7 +965,7 @@ public interface Widget /** * Sets if the rectangle is filled or just stroked */ - void setFilled(boolean filled); + Widget setFilled(boolean filled); /** * Verb for spell targets @@ -1012,7 +1046,7 @@ public interface Widget /** * Container this can be dragged in */ - void setDragParent(Widget dragParent); + Widget setDragParent(Widget dragParent); /** * Gets the script and arguments to be ran when one of the listened for vars changes. diff --git a/runelite-api/src/main/java/net/runelite/api/widgets/WidgetID.java b/runelite-api/src/main/java/net/runelite/api/widgets/WidgetID.java index a9714977f9..e884ccaa7b 100644 --- a/runelite-api/src/main/java/net/runelite/api/widgets/WidgetID.java +++ b/runelite-api/src/main/java/net/runelite/api/widgets/WidgetID.java @@ -844,6 +844,7 @@ public final class WidgetID { static final int LUMBRIDGE_HOME_TELEPORT = 6; static final int KOUREND_HOME_TELEPORT = 4; + static final int CATHERBY_HOME_TELEPORT = 5; } static class AncientSpellBook diff --git a/runelite-api/src/main/java/net/runelite/api/widgets/WidgetInfo.java b/runelite-api/src/main/java/net/runelite/api/widgets/WidgetInfo.java index 0c05ff3e1e..ff56762edf 100644 --- a/runelite-api/src/main/java/net/runelite/api/widgets/WidgetInfo.java +++ b/runelite-api/src/main/java/net/runelite/api/widgets/WidgetInfo.java @@ -505,6 +505,7 @@ public enum WidgetInfo SPELL_LUNAR_HOME_TELEPORT(WidgetID.SPELLBOOK_GROUP_ID, WidgetID.LunarSpellBook.LUNAR_HOME_TELEPORT), SPELL_ARCEUUS_HOME_TELEPORT(WidgetID.SPELLBOOK_GROUP_ID, WidgetID.ArceuusSpellBook.ARCEUUS_HOME_TELEPORT), SPELL_KOUREND_HOME_TELEPORT(WidgetID.SPELLBOOK_GROUP_ID, WidgetID.StandardSpellBook.KOUREND_HOME_TELEPORT), + SPELL_CATHERBY_HOME_TELEPORT(WidgetID.SPELLBOOK_GROUP_ID, WidgetID.StandardSpellBook.CATHERBY_HOME_TELEPORT), PVP_WILDERNESS_SKULL_CONTAINER(WidgetID.PVP_GROUP_ID, WidgetID.Pvp.WILDERNESS_SKULL_CONTAINER), PVP_SKULL_CONTAINER(WidgetID.PVP_GROUP_ID, WidgetID.Pvp.SKULL_CONTAINER), diff --git a/runelite-client/src/main/java/net/runelite/client/game/ItemManager.java b/runelite-client/src/main/java/net/runelite/client/game/ItemManager.java index 0c19310acc..1eaf2845c9 100644 --- a/runelite-client/src/main/java/net/runelite/client/game/ItemManager.java +++ b/runelite-client/src/main/java/net/runelite/client/game/ItemManager.java @@ -53,6 +53,7 @@ import net.runelite.api.GameState; import net.runelite.api.ItemComposition; import static net.runelite.api.ItemID.*; import net.runelite.api.SpritePixels; +import net.runelite.api.widgets.ItemQuantityMode; import net.runelite.client.callback.ClientThread; import net.runelite.client.config.RuneLiteConfig; import net.runelite.client.util.AsyncBufferedImage; @@ -425,7 +426,7 @@ public class ItemManager return false; } SpritePixels sprite = client.createItemSprite(itemId, quantity, 1, SpritePixels.DEFAULT_SHADOW_COLOR, - stackable ? 1 : 0, false, CLIENT_DEFAULT_ZOOM); + stackable ? ItemQuantityMode.ALWAYS : ItemQuantityMode.NEVER, false, CLIENT_DEFAULT_ZOOM); if (sprite == null) { return false; diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/dailytaskindicators/DailyTasksPlugin.java b/runelite-client/src/main/java/net/runelite/client/plugins/dailytaskindicators/DailyTasksPlugin.java index 8e1757b26b..aee48ee463 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/dailytaskindicators/DailyTasksPlugin.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/dailytaskindicators/DailyTasksPlugin.java @@ -210,7 +210,8 @@ public class DailyTasksPlugin extends Plugin private void checkSand(boolean dailyReset) { - if (client.getVar(Varbits.QUEST_THE_HAND_IN_THE_SAND) >= SAND_QUEST_COMPLETE + if (client.getAccountType() != AccountType.ULTIMATE_IRONMAN + && client.getVar(Varbits.QUEST_THE_HAND_IN_THE_SAND) >= SAND_QUEST_COMPLETE && (client.getVar(Varbits.DAILY_SAND_COLLECTED) == 0 || dailyReset)) { diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/grounditems/Lootbeam.java b/runelite-client/src/main/java/net/runelite/client/plugins/grounditems/Lootbeam.java index 96d7d34409..fa48aa8d47 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/grounditems/Lootbeam.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/grounditems/Lootbeam.java @@ -64,13 +64,15 @@ class Lootbeam short hsl = JagexColor.rgbToHSL(l.color.getRGB(), 1.0d); int hue = JagexColor.unpackHue(hsl); - int sat = Math.min(JagexColor.unpackSaturation(hsl) + 1, JagexColor.SATURATION_MAX); + int sat = JagexColor.unpackSaturation(hsl); int lum = JagexColor.unpackLuminance(hsl); + int satDelta = sat > 2 ? 1 : 0; return md.cloneColors() - .recolor((short) 26432, JagexColor.packHSL(hue, sat, Math.min(lum + 12, JagexColor.LUMINANCE_MAX))) - .recolor((short) 26584, JagexColor.packHSL(hue, sat - 1, Math.max(lum - 12, 0))) - .light(75, 1875, ModelData.DEFAULT_X, ModelData.DEFAULT_Y, ModelData.DEFAULT_Z); + .recolor((short) 26432, JagexColor.packHSL(hue, sat - satDelta, lum)) + .recolor((short) 26584, JagexColor.packHSL(hue, sat, Math.min(lum + 24, JagexColor.LUMINANCE_MAX))) + .light(75 + ModelData.DEFAULT_AMBIENT, 1875 + ModelData.DEFAULT_CONTRAST, + ModelData.DEFAULT_X, ModelData.DEFAULT_Y, ModelData.DEFAULT_Z); }, anim(AnimationID.LOOTBEAM_ANIMATION)), ; diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/npcunaggroarea/NpcAggroAreaConfig.java b/runelite-client/src/main/java/net/runelite/client/plugins/npcunaggroarea/NpcAggroAreaConfig.java index 6fbdbb7e08..1532d075c8 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/npcunaggroarea/NpcAggroAreaConfig.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/npcunaggroarea/NpcAggroAreaConfig.java @@ -117,4 +117,15 @@ public interface NpcAggroAreaConfig extends Config { return false; } + + @ConfigItem( + keyName = "hideIfOutOfCombat", + name = "Hide when out of combat", + description = "Hides unaggressive area lines when out of combat.", + position = 8 + ) + default boolean hideIfOutOfCombat() + { + return false; + } } diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/npcunaggroarea/NpcAggroAreaOverlay.java b/runelite-client/src/main/java/net/runelite/client/plugins/npcunaggroarea/NpcAggroAreaOverlay.java index 2e77daa25e..5aad9ce8c6 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/npcunaggroarea/NpcAggroAreaOverlay.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/npcunaggroarea/NpcAggroAreaOverlay.java @@ -34,6 +34,7 @@ import java.time.Instant; import javax.inject.Inject; import net.runelite.api.Client; import net.runelite.api.Perspective; +import net.runelite.api.Player; import net.runelite.api.Point; import net.runelite.api.coords.LocalPoint; import net.runelite.api.geometry.Geometry; @@ -70,6 +71,12 @@ class NpcAggroAreaOverlay extends Overlay return null; } + final Player localPlayer = client.getLocalPlayer(); + if (localPlayer.getHealthScale() == -1 && config.hideIfOutOfCombat()) + { + return null; + } + GeneralPath lines = plugin.getLinesToDisplay()[client.getPlane()]; if (lines == null) { diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/slayer/SlayerPlugin.java b/runelite-client/src/main/java/net/runelite/client/plugins/slayer/SlayerPlugin.java index f7913a57c5..b535ec643a 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/slayer/SlayerPlugin.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/slayer/SlayerPlugin.java @@ -565,10 +565,10 @@ public class SlayerPlugin extends Plugin log.debug("Slayer xp change delta: {}, killed npcs: {}", delta, taggedNpcsDiedPrevTick); final Task task = Task.getTask(taskName); - if (task != null && task.getMinimumKillXp() > 0) + if (task != null && task.getXpMatcher() != null) { - // Only decrement a kill if the xp drop is above the minimum threshold. This is for Tzhaar and Sire tasks. - if (delta >= task.getMinimumKillXp()) + // Only decrement a kill if the xp drop delta passes the matcher. This is for Tzhaar and Sire tasks. + if (task.getXpMatcher().test(delta)) { killed(max(taggedNpcsDiedPrevTick, 1)); } diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/slayer/Task.java b/runelite-client/src/main/java/net/runelite/client/plugins/slayer/Task.java index f6fb7dc445..37b517c4ec 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/slayer/Task.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/slayer/Task.java @@ -30,6 +30,7 @@ import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableMap; import java.util.List; import java.util.Map; +import java.util.function.IntPredicate; import javax.annotation.Nullable; import lombok.Getter; import net.runelite.api.ItemID; @@ -42,9 +43,10 @@ enum Task // Abyssal demon - 150 xp // Greater abyssal demon - 4200 xp // Abyssal sire - 450 xp - // Use 51 for minimum xp to avoid a kill triggering from killing the sire vents - ABYSSAL_DEMONS("Abyssal demons", ItemID.ABYSSAL_DEMON, 51), - ABYSSAL_SIRE("Abyssal Sire", ItemID.ABYSSAL_ORPHAN, 51), + // Reanimated abyssal - 31 xp + // Ignore 50xp drops to avoid recording a kill from sire vents + ABYSSAL_DEMONS("Abyssal demons", ItemID.ABYSSAL_DEMON, (xp) -> xp != 50), + ABYSSAL_SIRE("Abyssal Sire", ItemID.ABYSSAL_ORPHAN, (xp) -> xp != 50), ADAMANT_DRAGONS("Adamant dragons", ItemID.ADAMANT_DRAGON_MASK), ALCHEMICAL_HYDRA("Alchemical Hydra", ItemID.IKKLE_HYDRA), ANKOU("Ankou", ItemID.ANKOU_MASK), @@ -114,7 +116,7 @@ enum Task ICE_WARRIORS("Ice warriors", ItemID.MITHRIL_FULL_HELM_T, "Icelord"), INFERNAL_MAGES("Infernal mages", ItemID.INFERNAL_MAGE, "Malevolent mage"), IRON_DRAGONS("Iron dragons", ItemID.IRON_DRAGON_MASK), - JAD("TzTok-Jad", ItemID.TZREKJAD, 25250), + JAD("TzTok-Jad", ItemID.TZREKJAD, (xp) -> xp == 25250), JELLIES("Jellies", ItemID.JELLY, "Jelly"), JUNGLE_HORROR("Jungle horrors", ItemID.ENSOULED_HORROR_HEAD), KALPHITE("Kalphite", ItemID.KALPHITE_SOLDIER), @@ -183,7 +185,7 @@ enum Task WYRMS("Wyrms", ItemID.WYRM), ZILYANA("Commander Zilyana", ItemID.PET_ZILYANA), ZOMBIES("Zombies", ItemID.ZOMBIE_HEAD, "Undead"), - ZUK("TzKal-Zuk", ItemID.TZREKZUK, 101890), + ZUK("TzKal-Zuk", ItemID.TZREKZUK, (xp) -> xp == 101890), ZULRAH("Zulrah", ItemID.PET_SNAKELING); // @@ -242,7 +244,8 @@ enum Task private final String[] targetNames; private final int weaknessThreshold; private final int weaknessItem; - private final int minimumKillXp; + @Nullable + private final IntPredicate xpMatcher; static { @@ -264,7 +267,7 @@ enum Task this.weaknessThreshold = -1; this.weaknessItem = -1; this.targetNames = targetNames; - this.minimumKillXp = 0; + this.xpMatcher = null; } Task(String name, int itemSpriteId, int weaknessThreshold, int weaknessItem, String... targetNames) @@ -275,10 +278,10 @@ enum Task this.weaknessThreshold = weaknessThreshold; this.weaknessItem = weaknessItem; this.targetNames = targetNames; - this.minimumKillXp = 0; + this.xpMatcher = null; } - Task(String name, int itemSpriteId, int minimumKillXp) + Task(String name, int itemSpriteId, IntPredicate xpMatcher) { Preconditions.checkArgument(itemSpriteId >= 0); this.name = name; @@ -286,7 +289,7 @@ enum Task this.weaknessThreshold = -1; this.weaknessItem = -1; this.targetNames = new String[0]; - this.minimumKillXp = minimumKillXp; + this.xpMatcher = xpMatcher; } @Nullable diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/timers/TeleportWidget.java b/runelite-client/src/main/java/net/runelite/client/plugins/timers/TeleportWidget.java index ea3eb66b6a..762d1d19be 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/timers/TeleportWidget.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/timers/TeleportWidget.java @@ -41,7 +41,8 @@ enum TeleportWidget WidgetInfo.SPELL_EDGEVILLE_HOME_TELEPORT.getId(), WidgetInfo.SPELL_LUNAR_HOME_TELEPORT.getId(), WidgetInfo.SPELL_ARCEUUS_HOME_TELEPORT.getId(), - WidgetInfo.SPELL_KOUREND_HOME_TELEPORT.getId() + WidgetInfo.SPELL_KOUREND_HOME_TELEPORT.getId(), + WidgetInfo.SPELL_CATHERBY_HOME_TELEPORT.getId() ); private static final Collection MINIGAME_TELEPORT_IDS = ImmutableList.of( WidgetInfo.MINIGAME_TELEPORT_BUTTON.getId() diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/timers/TimersPlugin.java b/runelite-client/src/main/java/net/runelite/client/plugins/timers/TimersPlugin.java index d5309be51b..6f9efd63c4 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/timers/TimersPlugin.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/timers/TimersPlugin.java @@ -958,7 +958,8 @@ public class TimersPlugin extends Plugin && client.getLocalPlayer().getAnimation() == AnimationID.IDLE && (lastAnimation == AnimationID.BOOK_HOME_TELEPORT_5 || lastAnimation == AnimationID.COW_HOME_TELEPORT_6 - || lastAnimation == AnimationID.LEAGUE_HOME_TELEPORT_6)) + || lastAnimation == AnimationID.LEAGUE_HOME_TELEPORT_6 + || lastAnimation == AnimationID.SHATTERED_LEAGUE_HOME_TELEPORT_6)) { if (lastTeleportClicked == TeleportWidget.HOME_TELEPORT) {