we know it's gonna happen, just a question of time

This commit is contained in:
ThatGamerBlue
2021-06-29 06:59:03 +01:00
23 changed files with 1570 additions and 164 deletions

View File

@@ -25,9 +25,9 @@
object ProjectVersions {
const val launcherVersion = "2.2.0"
const val rlVersion = "1.7.13"
const val rlVersion = "1.7.13.1"
const val openosrsVersion = "4.9.0"
const val openosrsVersion = "4.9.2"
const val rsversion = 197
const val cacheversion = 165

View File

@@ -117,13 +117,19 @@ public interface Actor extends Renderable, Locatable
int getPoseFrameCycle();
/**
* Gets the orientation of the actor.
* Gets the target orientation of the actor.
*
* @return the orientation
* @see net.runelite.api.coords.Angle
*/
int getOrientation();
/**
* Gets the current orientation of the actor.
*
* @return the orientation
* @see net.runelite.api.coords.Angle
*/
int getCurrentOrientation();
/**

View File

@@ -35,7 +35,7 @@ public interface DecorativeObject extends TileObject
* Gets the convex hull of the objects model.
*
* @return the convex hull
* @see api.model.Jarvis
* @see net.runelite.api.model.Jarvis
*/
Shape getConvexHull();
Shape getConvexHull2();
@@ -43,13 +43,15 @@ public interface DecorativeObject extends TileObject
Renderable getRenderable();
Renderable getRenderable2();
Model getModel1();
Model getModel2();
int getYOffset();
/**
* Decorative object x offset. This is added to the x position of the object, and is used to
* account for walls of varying widths.
*/
int getXOffset();
int getOrientation();
/**
* Decorative object y offset. This is added to the z position of the object, and is used to
* account for walls of varying widths.
*/
int getYOffset();
}

View File

@@ -83,15 +83,14 @@ public interface GameObject extends TileObject
Renderable getRenderable();
int getRsOrientation();
Model getModel();
/**
* A bitfield containing various flags:
* object type id = bits & 0x20
* orientation (0-3) = bits >>> 6 & 3
* the bitfield may contain other flags in addition to those mentioned above
* Gets the orientation of the model in JAU.
* This is typically 0 for non-actors, since
* most object's models are oriented prior to
* lighting during scene loading. See {@link #getOrientation()}
* instead for object orientation.
*
* @see net.runelite.api.coords.Angle
*/
int getFlags();
int getModelOrientation();
}

View File

@@ -89,7 +89,7 @@ public class WidgetID
public static final int CLUE_SCROLL_REWARD_GROUP_ID = 73;
public static final int BARROWS_REWARD_GROUP_ID = 155;
public static final int RAIDS_GROUP_ID = 513;
public static final int TOB_PARTY_GROUP_ID = 28;
public static final int TOB_GROUP_ID = 28;
public static final int MOTHERLODE_MINE_GROUP_ID = 382;
public static final int EXPERIENCE_DROP_GROUP_ID = 122;
public static final int PUZZLE_BOX_GROUP_ID = 306;
@@ -225,6 +225,9 @@ public class WidgetID
static class PestControl
{
static final int KNIGHT_INFO_CONTAINER = 2;
static final int ACTIVITY_SHIELD_CONTAINER = 9;
static final int ACTIVITY_BAR = 10;
static final int ACTIVITY_PROGRESS = 12;
@@ -658,6 +661,7 @@ public class WidgetID
static class VolcanicMine
{
static final int STABILITY_INFOBOX_CONTAINER = 2;
static final int TIME_LEFT = 6;
static final int POINTS = 8;
static final int STABILITY = 10;
@@ -668,6 +672,7 @@ public class WidgetID
static final int VENT_A_STATUS = 20;
static final int VENT_B_STATUS = 21;
static final int VENT_C_STATUS = 22;
static final int VENTS_INFOBOX_CONTAINER = 26;
}
static class BarbarianAssault
@@ -711,7 +716,9 @@ public class WidgetID
static class Tob
{
static final int PARTY_INTERFACE = 5;
static final int PARTY_STATS = 7;
static final int HEALTHBAR_CONTAINER = 9;
}
static class PuzzleBox
@@ -845,7 +852,7 @@ public class WidgetID
static final int KILLDEATH_RATIO = 26;
static final int SKULL_CONTAINER = 45;
static final int SAFE_ZONE = 47;
static final int WILDERNESS_LEVEL = 49; // this can also be the Deadman Mode "Protection" text
static final int WILDERNESS_LEVEL = 50; // this can also be the Deadman Mode "Protection" text
}
static class KourendFavour
@@ -940,7 +947,7 @@ public class WidgetID
static class LmsKDA
{
static final int INFO = 7;
static final int INFO = 4;
}
static class AdventureLog
@@ -994,7 +1001,7 @@ public class WidgetID
static class TemporossStatus
{
static final int STATUS_INDICATOR = 4;
static final int STATUS_INDICATOR = 2;
}
static class DialogNotification

View File

@@ -74,6 +74,9 @@ public enum WidgetInfo
DIARY_QUEST_WIDGET_TITLE(WidgetID.DIARY_QUEST_GROUP_ID, WidgetID.Diary.DIARY_TITLE),
DIARY_QUEST_WIDGET_TEXT(WidgetID.DIARY_QUEST_GROUP_ID, WidgetID.Diary.DIARY_TEXT),
PEST_CONTROL_BOAT_INFO(WidgetID.PEST_CONTROL_BOAT_GROUP_ID, 2),
PEST_CONTROL_KNIGHT_INFO_CONTAINER(WidgetID.PEST_CONTROL_GROUP_ID, WidgetID.PestControl.KNIGHT_INFO_CONTAINER),
PEST_CONTROL_ACTIVITY_SHIELD_INFO_CONTAINER(WidgetID.PEST_CONTROL_GROUP_ID, WidgetID.PestControl.ACTIVITY_SHIELD_CONTAINER),
PEST_CONTROL_PURPLE_SHIELD(WidgetID.PEST_CONTROL_GROUP_ID, WidgetID.PestControl.PURPLE_SHIELD),
PEST_CONTROL_BLUE_SHIELD(WidgetID.PEST_CONTROL_GROUP_ID, WidgetID.PestControl.BLUE_SHIELD),
PEST_CONTROL_YELLOW_SHIELD(WidgetID.PEST_CONTROL_GROUP_ID, WidgetID.PestControl.YELLOW_SHIELD),
@@ -93,6 +96,8 @@ public enum WidgetInfo
VOLCANIC_MINE_POINTS(WidgetID.VOLCANIC_MINE_GROUP_ID, WidgetID.VolcanicMine.POINTS),
VOLCANIC_MINE_STABILITY(WidgetID.VOLCANIC_MINE_GROUP_ID, WidgetID.VolcanicMine.STABILITY),
VOLCANIC_MINE_PLAYER_COUNT(WidgetID.VOLCANIC_MINE_GROUP_ID, WidgetID.VolcanicMine.PLAYER_COUNT),
VOLCANIC_MINE_VENTS_INFOBOX_GROUP(WidgetID.VOLCANIC_MINE_GROUP_ID, WidgetID.VolcanicMine.VENTS_INFOBOX_CONTAINER),
VOLCANIC_MINE_STABILITY_INFOBOX_GROUP(WidgetID.VOLCANIC_MINE_GROUP_ID, WidgetID.VolcanicMine.STABILITY_INFOBOX_CONTAINER),
VOLCANIC_MINE_VENT_A_PERCENTAGE(WidgetID.VOLCANIC_MINE_GROUP_ID, WidgetID.VolcanicMine.VENT_A_PERCENTAGE),
VOLCANIC_MINE_VENT_B_PERCENTAGE(WidgetID.VOLCANIC_MINE_GROUP_ID, WidgetID.VolcanicMine.VENT_B_PERCENTAGE),
VOLCANIC_MINE_VENT_C_PERCENTAGE(WidgetID.VOLCANIC_MINE_GROUP_ID, WidgetID.VolcanicMine.VENT_C_PERCENTAGE),
@@ -396,6 +401,8 @@ public enum WidgetInfo
MOTHERLODE_MINE(WidgetID.MOTHERLODE_MINE_GROUP_ID, 0),
GWD_KC(WidgetID.GWD_KC_GROUP_ID, 4),
PUZZLE_BOX(WidgetID.PUZZLE_BOX_GROUP_ID, WidgetID.PuzzleBox.VISIBLE_BOX),
LIGHT_BOX(WidgetID.LIGHT_BOX_GROUP_ID, WidgetID.LightBox.LIGHT_BOX),
@@ -417,7 +424,9 @@ public enum WidgetInfo
RAIDS_POINTS_INFOBOX(WidgetID.RAIDS_GROUP_ID, WidgetID.Raids.POINTS_INFOBOX),
TOB_PARTY_STATS(WidgetID.TOB_PARTY_GROUP_ID, WidgetID.Tob.PARTY_STATS),
TOB_PARTY_INTERFACE(WidgetID.TOB_GROUP_ID, WidgetID.Tob.PARTY_INTERFACE),
TOB_PARTY_STATS(WidgetID.TOB_GROUP_ID, WidgetID.Tob.PARTY_STATS),
TOB_HEALTH_BAR(WidgetID.TOB_GROUP_ID, WidgetID.Tob.HEALTHBAR_CONTAINER),
BLAST_FURNACE_COFFER(WidgetID.BLAST_FURNACE_GROUP_ID, 2),
@@ -474,6 +483,8 @@ public enum WidgetInfo
WORLD_SWITCHER_LIST(WidgetID.WORLD_SWITCHER_GROUP_ID, WidgetID.WorldSwitcher.WORLD_LIST),
FOSSIL_ISLAND_OXYGENBAR(WidgetID.FOSSIL_ISLAND_OXYGENBAR_ID, 2),
MINIGAME_TELEPORT_BUTTON(WidgetID.MINIGAME_TAB_ID, WidgetID.Minigames.TELEPORT_BUTTON),
SPELL_LUMBRIDGE_HOME_TELEPORT(WidgetID.SPELLBOOK_GROUP_ID, WidgetID.StandardSpellBook.LUMBRIDGE_HOME_TELEPORT),
@@ -521,6 +532,8 @@ public enum WidgetInfo
GAUNTLET_TIMER_CONTAINER(WidgetID.GAUNTLET_TIMER_GROUP_ID, WidgetID.GauntletTimer.CONTAINER),
HALLOWED_SEPULCHRE_TIMER_CONTAINER(WidgetID.HALLOWED_SEPULCHRE_TIMER_GROUP_ID, WidgetID.HallowedSepulchreTimer.CONTAINER),
HEALTH_OVERLAY_BAR(WidgetID.HEALTH_OVERLAY_BAR_GROUP_ID, 4),
TRAILBLAZER_AREA_TELEPORT(WidgetID.TRAILBLAZER_AREAS_GROUP_ID, WidgetID.TrailblazerAreas.TELEPORT),
MULTICOMBAT_FIXED(WidgetID.FIXED_VIEWPORT_GROUP_ID, WidgetID.FixedViewport.MULTICOMBAT_INDICATOR),

View File

@@ -33,26 +33,27 @@ import java.time.temporal.ChronoUnit;
import java.util.ArrayList;
import java.util.Comparator;
import java.util.List;
import lombok.RequiredArgsConstructor;
import lombok.Value;
import net.runelite.api.Client;
import net.runelite.api.DecorativeObject;
import net.runelite.api.GameObject;
import net.runelite.api.GroundObject;
import net.runelite.api.ItemLayer;
import net.runelite.api.MainBufferProvider;
import net.runelite.api.Model;
import net.runelite.api.NPC;
import net.runelite.api.NPCComposition;
import net.runelite.api.Perspective;
import net.runelite.api.Player;
import net.runelite.api.ItemLayer;
import net.runelite.api.Renderable;
import net.runelite.api.TileObject;
import net.runelite.api.WallObject;
import net.runelite.api.coords.LocalPoint;
import net.runelite.client.task.Schedule;
import net.runelite.client.task.Scheduler;
@Deprecated(forRemoval = true, since = "4.9.2")
@Singleton
public class ModelOutlineRenderer
{
@@ -929,11 +930,13 @@ public class ModelOutlineRenderer
renderOutline(image, outlineWidth, innerColor, outerColor);
}
@Deprecated(forRemoval = true, since = "4.9.2")
public void drawOutline(NPC npc, int outlineWidth, Color color)
{
drawOutline(npc, outlineWidth, color, color);
}
@Deprecated(forRemoval = true, since = "4.9.2")
public void drawOutline(NPC npc, int outlineWidth, Color innerColor, Color outerColor)
{
int size = 1;
@@ -957,11 +960,13 @@ public class ModelOutlineRenderer
}
}
@Deprecated(forRemoval = true, since = "4.9.2")
public void drawOutline(Player player, int outlineWidth, Color color)
{
drawOutline(player, outlineWidth, color, color);
}
@Deprecated(forRemoval = true, since = "4.9.2")
public void drawOutline(Player player, int outlineWidth, Color innerColor, Color outerColor)
{
LocalPoint lp = player.getLocalLocation();
@@ -973,17 +978,25 @@ public class ModelOutlineRenderer
}
}
@Deprecated(forRemoval = true, since = "4.9.2")
public void drawOutline(GameObject gameObject, int outlineWidth, Color innerColor, Color outerColor)
{
LocalPoint lp = gameObject.getLocalLocation();
if (lp != null)
{
drawModelOutline(gameObject.getModel(), lp.getX(), lp.getY(),
Renderable renderable = gameObject.getRenderable();
if (renderable == null)
{
return;
}
drawModelOutline(renderable instanceof Model ? (Model) renderable : renderable.getModel(), lp.getX(), lp.getY(),
Perspective.getTileHeight(client, lp, gameObject.getPlane()),
gameObject.getRsOrientation(), outlineWidth, innerColor, outerColor);
gameObject.getModelOrientation(), outlineWidth, innerColor, outerColor);
}
}
@Deprecated(forRemoval = true, since = "4.9.2")
public void drawOutline(GroundObject groundObject, int outlineWidth, Color innerColor, Color outerColor)
{
LocalPoint lp = groundObject.getLocalLocation();
@@ -1031,23 +1044,31 @@ public class ModelOutlineRenderer
LocalPoint lp = decorativeObject.getLocalLocation();
if (lp != null)
{
Model model = decorativeObject.getModel1();
if (model != null)
Renderable renderable1 = decorativeObject.getRenderable();
if (renderable1 != null)
{
drawModelOutline(model,
lp.getX() + decorativeObject.getXOffset(),
lp.getY() + decorativeObject.getYOffset(),
Perspective.getTileHeight(client, lp, decorativeObject.getPlane()),
decorativeObject.getOrientation(), outlineWidth, innerColor, outerColor);
Model model = renderable1 instanceof Model ? (Model) renderable1 : renderable1.getModel();
if (model != null)
{
drawModelOutline(model,
lp.getX() + decorativeObject.getXOffset(),
lp.getY() + decorativeObject.getYOffset(),
Perspective.getTileHeight(client, lp, decorativeObject.getPlane()),
0, outlineWidth, innerColor, outerColor);
}
}
model = decorativeObject.getModel2();
if (model != null)
Renderable renderable2 = decorativeObject.getRenderable2();
if (renderable2 != null)
{
// Offset is not used for the second model
drawModelOutline(model, lp.getX(), lp.getY(),
Perspective.getTileHeight(client, lp, decorativeObject.getPlane()),
decorativeObject.getOrientation(), outlineWidth, innerColor, outerColor);
Model model = renderable2 instanceof Model ? (Model) renderable2 : renderable2.getModel();
if (model != null)
{
// Offset is not used for the second model
drawModelOutline(model, lp.getX(), lp.getY(),
Perspective.getTileHeight(client, lp, decorativeObject.getPlane()),
0, outlineWidth, innerColor, outerColor);
}
}
}
}
@@ -1075,11 +1096,13 @@ public class ModelOutlineRenderer
}
}
@Deprecated(forRemoval = true, since = "4.9.2")
public void drawOutline(TileObject tileObject, int outlineWidth, Color color)
{
drawOutline(tileObject, outlineWidth, color, color);
}
@Deprecated(forRemoval = true, since = "4.9.2")
public void drawOutline(TileObject tileObject,
int outlineWidth, Color innerColor, Color outerColor)
{
@@ -1107,9 +1130,9 @@ public class ModelOutlineRenderer
@Value
@RequiredArgsConstructor
class PixelDistanceAlpha
static class PixelDistanceAlpha
{
private final int outerAlpha;
private final int distArrayPos;
int outerAlpha;
int distArrayPos;
}
}

View File

@@ -171,11 +171,11 @@ public enum HotColdLocation
ZEAH_LOVAKITE_FURNACE(MASTER, new WorldPoint(1507, 3819, 0), ZEAH, "Next to the lovakite furnace in Lovakengj.", ANCIENT_WIZARDS),
ZEAH_LOVAKENGJ_MINE(MASTER, new WorldPoint(1477, 3778, 0), ZEAH, "Next to mithril rock in the Lovakengj mine.", ANCIENT_WIZARDS),
ZEAH_SULPHR_MINE(MASTER, new WorldPoint(1428, 3869, 0), ZEAH, "Western entrance in the Lovakengj sulphur mine. Facemask or Slayer Helmet recommended.", BRASSICAN_MAGE),
ZEAH_SHAYZIEN_BANK(MASTER, new WorldPoint(1498, 3627, 0), ZEAH, "South-east of the bank in Shayzien Encampment.", ANCIENT_WIZARDS),
ZEAH_SHAYZIEN_BANK(MASTER, new WorldPoint(1498, 3627, 0), ZEAH, "South-east of the bank in Shayzien Encampment.", BRASSICAN_MAGE),
ZEAH_OVERPASS(MASTER, new WorldPoint(1467, 3714, 0), ZEAH, "Overpass between Lovakengj and Shayzien.", BRASSICAN_MAGE),
ZEAH_LIZARDMAN(MASTER, new WorldPoint(1490, 3698, 0), ZEAH, "Within Lizardman Canyon, east of the ladder. Requires 5% favour with Shayzien.", ANCIENT_WIZARDS),
ZEAH_COMBAT_RING(MASTER, new WorldPoint(1557, 3624, 0), ZEAH, "Shayzien Encampment, south-east of the Combat Ring.", BRASSICAN_MAGE),
ZEAH_SHAYZIEN_BANK_2(MASTER, new WorldPoint(1490, 3602, 0), ZEAH, "North of the bank in Shayzien.", ANCIENT_WIZARDS),
ZEAH_SHAYZIEN_BANK_2(MASTER, new WorldPoint(1490, 3602, 0), ZEAH, "North of the bank in Shayzien.", BRASSICAN_MAGE),
ZEAH_LIBRARY(MASTER, new WorldPoint(1603, 3843, 0), ZEAH, "North-west of the Arceuus Library.", BRASSICAN_MAGE),
ZEAH_HOUSECHURCH(MASTER, new WorldPoint(1682, 3792, 0), ZEAH, "By the entrance to the Arceuus church.", ANCIENT_WIZARDS),
ZEAH_DARK_ALTAR(MASTER, new WorldPoint(1698, 3881, 0), ZEAH, "West of the Dark Altar.", BRASSICAN_MAGE),
@@ -184,7 +184,7 @@ public enum HotColdLocation
ZEAH_ESSENCE_MINE_NE(MASTER, new WorldPoint(1773, 3867, 0), ZEAH, "North-east of the Arceuus essence mine.", BRASSICAN_MAGE),
ZEAH_PISCARILUS_MINE(MASTER, new WorldPoint(1768, 3705, 0), ZEAH, "South of the Piscarilius mine.", ANCIENT_WIZARDS),
ZEAH_GOLDEN_FIELD_TAVERN(MASTER, new WorldPoint(1718, 3643, 0), ZEAH, "South of the gravestone in Kingstown.", BRASSICAN_MAGE),
ZEAH_MESS_HALL(MASTER, new WorldPoint(1656, 3621, 0), ZEAH, "East of the Mess hall.", ANCIENT_WIZARDS),
ZEAH_MESS_HALL(MASTER, new WorldPoint(1656, 3621, 0), ZEAH, "East of the Mess hall.", BRASSICAN_MAGE),
ZEAH_WATSONS_HOUSE(MASTER, new WorldPoint(1653, 3573, 0), ZEAH, "East of Watson's house.", BRASSICAN_MAGE),
ZEAH_VANNAHS_FARM_STORE(MASTER, new WorldPoint(1807, 3523, 0), ZEAH, "North of Tithe Farm, next to the pond.", BRASSICAN_MAGE),
ZEAH_FARMING_GUILD_W(MASTER, new WorldPoint(1208, 3736, 0), ZEAH, "West of the Farming Guild.", BRASSICAN_MAGE),

View File

@@ -40,7 +40,6 @@ import net.runelite.api.events.GameTick;
import net.runelite.api.events.ScriptPostFired;
import net.runelite.api.widgets.Widget;
import net.runelite.api.widgets.WidgetInfo;
import net.runelite.client.callback.ClientThread;
import net.runelite.client.config.ConfigManager;
import net.runelite.client.eventbus.Subscribe;
import net.runelite.client.events.ConfigChanged;
@@ -59,19 +58,11 @@ public class CombatLevelPlugin extends Plugin
private static final String CONFIG_GROUP = "combatlevel";
private static final String ATTACK_RANGE_CONFIG_KEY = "wildernessAttackLevelRange";
private static final Pattern WILDERNESS_LEVEL_PATTERN = Pattern.compile("^Level: (\\d+)$");
private static final int SKULL_CONTAINER_ADJUSTED_ORIGINAL_Y = 6;
private static final int WILDERNESS_LEVEL_TEXT_ADJUSTED_ORIGINAL_Y = 3;
private static final int MIN_COMBAT_LEVEL = 3;
private int originalWildernessLevelTextPosition = -1;
private int originalSkullContainerPosition = -1;
@Inject
private Client client;
@Inject
private ClientThread clientThread;
@Inject
private CombatLevelConfig config;
@@ -187,25 +178,10 @@ public class CombatLevelPlugin extends Plugin
return;
}
final Widget skullContainer = client.getWidget(WidgetInfo.PVP_SKULL_CONTAINER);
if (originalWildernessLevelTextPosition == -1)
{
originalWildernessLevelTextPosition = wildernessLevelWidget.getOriginalY();
}
if (originalSkullContainerPosition == -1)
{
originalSkullContainerPosition = skullContainer.getRelativeY();
}
final int wildernessLevel = Integer.parseInt(m.group(1));
final int combatLevel = client.getLocalPlayer().getCombatLevel();
wildernessLevelWidget.setText(wildernessLevelText + "<br>" + combatAttackRange(combatLevel, wildernessLevel));
wildernessLevelWidget.setOriginalY(WILDERNESS_LEVEL_TEXT_ADJUSTED_ORIGINAL_Y);
skullContainer.setOriginalY(SKULL_CONTAINER_ADJUSTED_ORIGINAL_Y);
clientThread.invoke(wildernessLevelWidget::revalidate);
clientThread.invoke(skullContainer::revalidate);
}
private void shutDownAttackLevelRange()
@@ -223,18 +199,7 @@ public class CombatLevelPlugin extends Plugin
{
wildernessLevelWidget.setText(wildernessLevelText.substring(0, wildernessLevelText.indexOf("<br>")));
}
wildernessLevelWidget.setOriginalY(originalWildernessLevelTextPosition);
clientThread.invoke(wildernessLevelWidget::revalidate);
}
originalWildernessLevelTextPosition = -1;
final Widget skullContainer = client.getWidget(WidgetInfo.PVP_SKULL_CONTAINER);
if (skullContainer != null)
{
skullContainer.setOriginalY(originalSkullContainerPosition);
clientThread.invoke(skullContainer::revalidate);
}
originalSkullContainerPosition = -1;
}
private static String combatAttackRange(final int combatLevel, final int wildernessLevel)

View File

@@ -79,8 +79,8 @@ public class AlchemyRoom extends MTARoom
private static final int IMAGE_Z_OFFSET = 150;
private static final int NUM_CUPBOARDS = 8;
private static final int INFO_ITEM_START = 8;
private static final int INFO_POINT_START = 13;
private static final int INFO_ITEM_START = 7;
private static final int INFO_POINT_START = 12;
private static final int INFO_LENGTH = 5;
private static final int BEST_POINTS = 30;

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.ConfigSection;
import net.runelite.client.config.Range;
@ConfigGroup("npcindicators")
public interface NpcIndicatorsConfig extends Config
@@ -79,6 +80,59 @@ public interface NpcIndicatorsConfig extends Config
@ConfigItem(
position = 3,
keyName = "highlightOutline",
name = "Highlight outline",
description = "Configures whether or not the model of the NPC should be highlighted by outline",
section = renderStyleSection
)
default boolean highlightOutline()
{
return false;
}
@Alpha
@ConfigItem(
position = 4,
keyName = "npcColor",
name = "Highlight Color",
description = "Color of the NPC highlight",
section = renderStyleSection
)
default Color getHighlightColor()
{
return Color.CYAN;
}
@ConfigItem(
position = 5,
keyName = "borderWidth",
name = "Border Width",
description = "Width of the highlighted NPC border",
section = renderStyleSection
)
default double borderWidth()
{
return 2;
}
@ConfigItem(
position = 6,
keyName = "outlineFeather",
name = "Outline feather",
description = "Specify between 0-4 how much of the model outline should be faded",
section = renderStyleSection
)
@Range(
min = 0,
max = 4
)
default int outlineFeather()
{
return 0;
}
@ConfigItem(
position = 7,
keyName = "npcToHighlight",
name = "NPCs to Highlight",
description = "List of NPC names to highlight"
@@ -95,31 +149,8 @@ public interface NpcIndicatorsConfig extends Config
)
void setNpcToHighlight(String npcsToHighlight);
@Alpha
@ConfigItem(
position = 4,
keyName = "npcColor",
name = "Highlight Color",
description = "Color of the NPC highlight"
)
default Color getHighlightColor()
{
return Color.CYAN;
}
@ConfigItem(
position = 5,
keyName = "borderWidth",
name = "Border Width",
description = "Width of the highlighted NPC border"
)
default double borderWidth()
{
return 2;
}
@ConfigItem(
position = 6,
position = 8,
keyName = "drawNames",
name = "Draw names above NPC",
description = "Configures whether or not NPC names should be drawn above the NPC"
@@ -130,7 +161,7 @@ public interface NpcIndicatorsConfig extends Config
}
@ConfigItem(
position = 7,
position = 9,
keyName = "drawMinimapNames",
name = "Draw names on minimap",
description = "Configures whether or not NPC names should be drawn on the minimap"
@@ -141,7 +172,7 @@ public interface NpcIndicatorsConfig extends Config
}
@ConfigItem(
position = 8,
position = 10,
keyName = "highlightMenuNames",
name = "Highlight menu names",
description = "Highlight NPC names in right click menu"
@@ -152,7 +183,7 @@ public interface NpcIndicatorsConfig extends Config
}
@ConfigItem(
position = 9,
position = 11,
keyName = "ignoreDeadNpcs",
name = "Ignore dead NPCs",
description = "Prevents highlighting NPCs after they are dead"
@@ -163,7 +194,7 @@ public interface NpcIndicatorsConfig extends Config
}
@ConfigItem(
position = 10,
position = 12,
keyName = "deadNpcMenuColor",
name = "Dead NPC menu color",
description = "Color of the NPC menus for dead NPCs"
@@ -171,7 +202,7 @@ public interface NpcIndicatorsConfig extends Config
Color deadNpcMenuColor();
@ConfigItem(
position = 11,
position = 13,
keyName = "showRespawnTimer",
name = "Show respawn timer",
description = "Show respawn timer of tagged NPCs")

View File

@@ -48,6 +48,7 @@ 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.OverlayUtil;
import net.runelite.client.ui.overlay.outline.ModelOutlineRenderer;
import net.runelite.client.util.ColorUtil;
import net.runelite.client.util.Text;
@@ -67,13 +68,16 @@ public class NpcSceneOverlay extends Overlay
private final Client client;
private final NpcIndicatorsConfig config;
private final NpcIndicatorsPlugin plugin;
private final ModelOutlineRenderer modelOutlineRenderer;
@Inject
NpcSceneOverlay(Client client, NpcIndicatorsConfig config, NpcIndicatorsPlugin plugin)
NpcSceneOverlay(Client client, NpcIndicatorsConfig config, NpcIndicatorsPlugin plugin,
ModelOutlineRenderer modelOutlineRenderer)
{
this.client = client;
this.config = config;
this.plugin = plugin;
this.modelOutlineRenderer = modelOutlineRenderer;
setPosition(OverlayPosition.DYNAMIC);
setLayer(OverlayLayer.ABOVE_SCENE);
}
@@ -181,6 +185,11 @@ public class NpcSceneOverlay extends Overlay
renderPoly(graphics, color, southWestTilePoly);
}
if (config.highlightOutline())
{
modelOutlineRenderer.drawOutline(actor, (int)config.borderWidth(), color, config.outlineFeather());
}
if (config.drawNames() && actor.getName() != null)
{
String npcName = Text.removeTags(actor.getName());

View File

@@ -30,15 +30,50 @@ 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.ConfigSection;
import net.runelite.client.config.Range;
@ConfigGroup("objectindicators")
public interface ObjectIndicatorsConfig extends Config
{
@ConfigSection(
name = "Render style",
description = "The render style of object highlighting",
position = 0
)
String renderStyleSection = "renderStyleSection";
@ConfigItem(
position = 0,
keyName = "highlightHull",
name = "Highlight hull",
description = "Configures whether or not object should be highlighted by hull",
section = renderStyleSection
)
default boolean highlightHull()
{
return true;
}
@ConfigItem(
position = 1,
keyName = "highlightOutline",
name = "Highlight outline",
description = "Configures whether or not the model of the object should be highlighted by outline",
section = renderStyleSection
)
default boolean highlightOutline()
{
return false;
}
@Alpha
@ConfigItem(
position = 2,
keyName = "markerColor",
name = "Marker color",
description = "Configures the color of object marker"
description = "Configures the color of object marker",
section = renderStyleSection
)
default Color markerColor()
{
@@ -46,6 +81,35 @@ public interface ObjectIndicatorsConfig extends Config
}
@ConfigItem(
position = 3,
keyName = "borderWidth",
name = "Border Width",
description = "Width of the marked object border",
section = renderStyleSection
)
default double borderWidth()
{
return 2;
}
@ConfigItem(
position = 4,
keyName = "outlineFeather",
name = "Outline feather",
description = "Specify between 0-4 how much of the model outline should be faded",
section = renderStyleSection
)
@Range(
min = 0,
max = 4
)
default int outlineFeather()
{
return 0;
}
@ConfigItem(
position = 5,
keyName = "rememberObjectColors",
name = "Remember color per object",
description = "Color objects using the color from time of marking"
@@ -54,14 +118,4 @@ public interface ObjectIndicatorsConfig extends Config
{
return false;
}
@ConfigItem(
keyName = "borderWidth",
name = "Border Width",
description = "Width of the marked object border"
)
default double borderWidth()
{
return 2;
}
}

View File

@@ -43,19 +43,23 @@ 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.ui.overlay.outline.ModelOutlineRenderer;
class ObjectIndicatorsOverlay extends Overlay
{
private final Client client;
private final ObjectIndicatorsConfig config;
private final ObjectIndicatorsPlugin plugin;
private final ModelOutlineRenderer modelOutlineRenderer;
@Inject
private ObjectIndicatorsOverlay(Client client, ObjectIndicatorsConfig config, ObjectIndicatorsPlugin plugin)
private ObjectIndicatorsOverlay(Client client, ObjectIndicatorsConfig config, ObjectIndicatorsPlugin plugin,
ModelOutlineRenderer modelOutlineRenderer)
{
this.client = client;
this.config = config;
this.plugin = plugin;
this.modelOutlineRenderer = modelOutlineRenderer;
setPosition(OverlayPosition.DYNAMIC);
setPriority(OverlayPriority.LOW);
setLayer(OverlayLayer.ABOVE_SCENE);
@@ -93,43 +97,56 @@ class ObjectIndicatorsOverlay extends Overlay
color = config.markerColor();
}
final Shape polygon;
Shape polygon2 = null;
if (object instanceof GameObject)
if (config.highlightHull())
{
polygon = ((GameObject) object).getConvexHull();
}
else if (object instanceof WallObject)
{
polygon = ((WallObject) object).getConvexHull();
polygon2 = ((WallObject) object).getConvexHull2();
}
else if (object instanceof DecorativeObject)
{
polygon = ((DecorativeObject) object).getConvexHull();
polygon2 = ((DecorativeObject) object).getConvexHull2();
}
else if (object instanceof GroundObject)
{
polygon = ((GroundObject) object).getConvexHull();
}
else
{
polygon = object.getCanvasTilePoly();
renderConvexHull(graphics, object, color, stroke);
}
if (polygon != null)
if (config.highlightOutline())
{
OverlayUtil.renderPolygon(graphics, polygon, color, stroke);
}
if (polygon2 != null)
{
OverlayUtil.renderPolygon(graphics, polygon2, color, stroke);
modelOutlineRenderer.drawOutline(object, (int)config.borderWidth(), color, config.outlineFeather());
}
}
return null;
}
private void renderConvexHull(Graphics2D graphics, TileObject object, Color color, Stroke stroke)
{
final Shape polygon;
Shape polygon2 = null;
if (object instanceof GameObject)
{
polygon = ((GameObject) object).getConvexHull();
}
else if (object instanceof WallObject)
{
polygon = ((WallObject) object).getConvexHull();
polygon2 = ((WallObject) object).getConvexHull2();
}
else if (object instanceof DecorativeObject)
{
polygon = ((DecorativeObject) object).getConvexHull();
polygon2 = ((DecorativeObject) object).getConvexHull2();
}
else if (object instanceof GroundObject)
{
polygon = ((GroundObject) object).getConvexHull();
}
else
{
polygon = object.getCanvasTilePoly();
}
if (polygon != null)
{
OverlayUtil.renderPolygon(graphics, polygon, color, stroke);
}
if (polygon2 != null)
{
OverlayUtil.renderPolygon(graphics, polygon2, color, stroke);
}
}
}

View File

@@ -711,7 +711,7 @@ public class TimersPlugin extends Plugin
}
else if (message.contains(RESURRECT_THRALL_MESSAGE_START) && message.endsWith(RESURRECT_THRALL_MESSAGE_END))
{
createGameTimer(RESURRECT_THRALL, duration);
createGameTimer(RESURRECT_THRALL, Duration.of(client.getBoostedSkillLevel(Skill.MAGIC), RSTimeUnit.GAME_TICKS));
}
else if (message.contains(RESURRECT_THRALL_DISAPPEAR_MESSAGE_START) && message.endsWith(RESURRECT_THRALL_DISAPPEAR_MESSAGE_END))
{

View File

@@ -42,10 +42,16 @@ public class WidgetOverlay extends Overlay
return Arrays.asList(
new WidgetOverlay(client, WidgetInfo.RESIZABLE_MINIMAP_WIDGET, OverlayPosition.CANVAS_TOP_RIGHT),
new WidgetOverlay(client, WidgetInfo.RESIZABLE_MINIMAP_STONES_WIDGET, OverlayPosition.CANVAS_TOP_RIGHT),
new WidgetOverlay(client, WidgetInfo.FOSSIL_ISLAND_OXYGENBAR, OverlayPosition.TOP_CENTER),
new XpTrackerWidgetOverlay(client, WidgetInfo.EXPERIENCE_TRACKER_WIDGET, OverlayPosition.TOP_RIGHT),
new WidgetOverlay(client, WidgetInfo.RAIDS_POINTS_INFOBOX, OverlayPosition.TOP_RIGHT),
new WidgetOverlay(client, WidgetInfo.TOB_PARTY_INTERFACE, OverlayPosition.TOP_LEFT),
new WidgetOverlay(client, WidgetInfo.TOB_PARTY_STATS, OverlayPosition.TOP_LEFT),
new WidgetOverlay(client, WidgetInfo.GWD_KC, OverlayPosition.TOP_RIGHT),
new WidgetOverlay(client, WidgetInfo.TITHE_FARM, OverlayPosition.TOP_RIGHT),
new WidgetOverlay(client, WidgetInfo.PEST_CONTROL_BOAT_INFO, OverlayPosition.TOP_LEFT),
new WidgetOverlay(client, WidgetInfo.PEST_CONTROL_KNIGHT_INFO_CONTAINER, OverlayPosition.TOP_LEFT),
new WidgetOverlay(client, WidgetInfo.PEST_CONTROL_ACTIVITY_SHIELD_INFO_CONTAINER, OverlayPosition.TOP_RIGHT),
new WidgetOverlay(client, WidgetInfo.ZEAH_MESS_HALL_COOKING_DISPLAY, OverlayPosition.TOP_LEFT),
new WidgetOverlay(client, WidgetInfo.PVP_KILLDEATH_COUNTER, OverlayPosition.TOP_LEFT),
new WidgetOverlay(client, WidgetInfo.SKOTIZO_CONTAINER, OverlayPosition.TOP_LEFT),
@@ -55,7 +61,11 @@ public class WidgetOverlay extends Overlay
new WidgetOverlay(client, WidgetInfo.LMS_KDA, OverlayPosition.TOP_RIGHT),
new WidgetOverlay(client, WidgetInfo.GAUNTLET_TIMER_CONTAINER, OverlayPosition.TOP_LEFT),
new WidgetOverlay(client, WidgetInfo.HALLOWED_SEPULCHRE_TIMER_CONTAINER, OverlayPosition.TOP_LEFT),
new WidgetOverlay(client, WidgetInfo.HEALTH_OVERLAY_BAR, OverlayPosition.TOP_CENTER),
new WidgetOverlay(client, WidgetInfo.TOB_HEALTH_BAR, OverlayPosition.TOP_CENTER),
new WidgetOverlay(client, WidgetInfo.NIGHTMARE_PILLAR_HEALTH, OverlayPosition.TOP_LEFT),
new WidgetOverlay(client, WidgetInfo.VOLCANIC_MINE_VENTS_INFOBOX_GROUP, OverlayPosition.BOTTOM_RIGHT),
new WidgetOverlay(client, WidgetInfo.VOLCANIC_MINE_STABILITY_INFOBOX_GROUP, OverlayPosition.BOTTOM_LEFT),
new WidgetOverlay(client, WidgetInfo.MULTICOMBAT_FIXED, OverlayPosition.BOTTOM_RIGHT),
new WidgetOverlay(client, WidgetInfo.MULTICOMBAT_RESIZEABLE_MODERN, OverlayPosition.CANVAS_TOP_RIGHT),
new WidgetOverlay(client, WidgetInfo.MULTICOMBAT_RESIZEABLE_CLASSIC, OverlayPosition.CANVAS_TOP_RIGHT),

View File

@@ -0,0 +1,85 @@
/*
* Copyright (c) 2021, Woox <https://github.com/wooxsolo>
* 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.ui.overlay.outline;
import java.util.Arrays;
/**
* A class which manages 1024-sized blocks of memory.
*/
class IntBlockBuffer
{
public static final int BLOCK_BITS = 10;
public static final int BLOCK_SIZE = 1 << BLOCK_BITS;
private int[] memory = new int[0];
private int[] unusedBlockIndices = new int[0];
private int unusedBlockIndicesLength;
private void increaseBlockCount()
{
int currBlockCount = memory.length >> BLOCK_BITS;
int newBlockCount = Math.max(1, currBlockCount * 2);
memory = Arrays.copyOf(memory, newBlockCount * BLOCK_SIZE);
unusedBlockIndices = Arrays.copyOf(unusedBlockIndices, newBlockCount);
for (int i = currBlockCount; i < newBlockCount; i++)
{
unusedBlockIndices[unusedBlockIndicesLength++] = i;
}
}
/**
* Retrieves the whole memory buffer.
*/
public int[] getMemory()
{
return memory;
}
/**
* Marks a new block as used.
*
* @return The index of the block.
*/
public int useNewBlock()
{
if (unusedBlockIndicesLength == 0)
{
increaseBlockCount();
}
return unusedBlockIndices[--unusedBlockIndicesLength];
}
/**
* Marks a block as unused.
*
* @param index The index of the block. The block should be in use before calling this method.
*/
public void freeBlock(int index)
{
unusedBlockIndices[unusedBlockIndicesLength++] = index;
}
}

View File

@@ -503,7 +503,7 @@ public class TimersPluginTest
public void testThrall()
{
when(timersConfig.showArceuus()).thenReturn(true);
when(client.getRealSkillLevel(Skill.MAGIC)).thenReturn(50);
when(client.getBoostedSkillLevel(Skill.MAGIC)).thenReturn(60);
ChatMessage chatMessage = new ChatMessage(null, ChatMessageType.GAMEMESSAGE, "", "<col=ef0083>You resurrect a greater zombified thrall.</col>", "", 0);
timersPlugin.onChatMessage(chatMessage);
@@ -512,6 +512,7 @@ public class TimersPluginTest
verify(infoBoxManager).addInfoBox(ibcaptor.capture());
TimerTimer infoBox = (TimerTimer) ibcaptor.getValue();
assertEquals(GameTimer.RESURRECT_THRALL, infoBox.getTimer());
assertEquals(Duration.of(60, RSTimeUnit.GAME_TICKS), infoBox.getDuration());
}
@Test

View File

@@ -1435,6 +1435,7 @@ public abstract class RSClientMixin implements RSClient
menuOptionClicked.setMenuAction(MenuAction.of(opcode));
menuOptionClicked.setId(id);
menuOptionClicked.setWidgetId(param1);
menuOptionClicked.setSelectedItemIndex(client.getSelectedItemSlot());
client.getCallbacks().post(menuOptionClicked);

View File

@@ -75,7 +75,6 @@ public abstract class RSGameObjectMixin implements RSGameObject
}
@Inject
@Override
public RSModel getModel()
{
RSRenderable renderable = getRenderable();

View File

@@ -37,7 +37,6 @@ public abstract class RSWallDecorationMixin implements RSWallDecoration
}
@Inject
@Override
public RSModel getModel1()
{
RSRenderable renderable = getRenderable();
@@ -61,7 +60,6 @@ public abstract class RSWallDecorationMixin implements RSWallDecoration
}
@Inject
@Override
public RSModel getModel2()
{
RSRenderable renderable = getRenderable2();

View File

@@ -32,7 +32,6 @@ public interface RSGameObject extends GameObject
int getHeight();
@Import("orientation")
@Override
int getRsOrientation();
@Import("tag")
@@ -40,7 +39,6 @@ public interface RSGameObject extends GameObject
long getHash();
@Import("flags")
@Override
int getFlags();
int getPlane();