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

@@ -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;
}
}