diff --git a/config/checkstyle/checkstyle.xml b/config/checkstyle/checkstyle.xml index 35ebf4519b..ec4798b4ab 100644 --- a/config/checkstyle/checkstyle.xml +++ b/config/checkstyle/checkstyle.xml @@ -47,6 +47,11 @@ + + + + + diff --git a/deobfuscator/src/main/java/net/runelite/asm/execution/StackContext.java b/deobfuscator/src/main/java/net/runelite/asm/execution/StackContext.java index 4c23091a0d..fa0d1a9e08 100644 --- a/deobfuscator/src/main/java/net/runelite/asm/execution/StackContext.java +++ b/deobfuscator/src/main/java/net/runelite/asm/execution/StackContext.java @@ -92,7 +92,7 @@ public class StackContext return list; // remove from the stack things this instruction read - for (StackContext ctx : pushed.getPops()) + for (StackContext ctx : pushed.getPops()) list.addAll(ctx.removeStack()); return list; diff --git a/deobfuscator/src/main/java/net/runelite/deob/deobfuscators/IllegalStateExceptions.java b/deobfuscator/src/main/java/net/runelite/deob/deobfuscators/IllegalStateExceptions.java index 29670a92b2..260933e0dd 100644 --- a/deobfuscator/src/main/java/net/runelite/deob/deobfuscators/IllegalStateExceptions.java +++ b/deobfuscator/src/main/java/net/runelite/deob/deobfuscators/IllegalStateExceptions.java @@ -151,7 +151,7 @@ public class IllegalStateExceptions implements Deobfuscator @Override public void run(ClassGroup group) - { + { findInteresting(group); Execution execution = new Execution(group); diff --git a/deobfuscator/src/main/java/net/runelite/deob/deobfuscators/arithmetic/Encryption.java b/deobfuscator/src/main/java/net/runelite/deob/deobfuscators/arithmetic/Encryption.java index 0ffe6e78ef..ca7a47c331 100644 --- a/deobfuscator/src/main/java/net/runelite/deob/deobfuscators/arithmetic/Encryption.java +++ b/deobfuscator/src/main/java/net/runelite/deob/deobfuscators/arithmetic/Encryption.java @@ -30,7 +30,7 @@ import java.util.Map; import net.runelite.asm.pool.Field; class Encryption -{ +{ private final Map fields = new HashMap<>(); void addPair(Pair pair) diff --git a/deobfuscator/src/main/java/net/runelite/deob/deobfuscators/arithmetic/MultiplicationDeobfuscator.java b/deobfuscator/src/main/java/net/runelite/deob/deobfuscators/arithmetic/MultiplicationDeobfuscator.java index e26e7ec366..6dac266a32 100644 --- a/deobfuscator/src/main/java/net/runelite/deob/deobfuscators/arithmetic/MultiplicationDeobfuscator.java +++ b/deobfuscator/src/main/java/net/runelite/deob/deobfuscators/arithmetic/MultiplicationDeobfuscator.java @@ -293,7 +293,7 @@ public class MultiplicationDeobfuscator implements Deobfuscator Collection ins = ctx.getFrame().getMethodCtx().getInstructonContexts(ctx.getInstruction()); for (InstructionContext i : ins) - { + { if (sctx == null) { if (!i.equals(ctx)) diff --git a/deobfuscator/src/main/java/net/runelite/deob/deobfuscators/mapping/MappingExecutorUtil.java b/deobfuscator/src/main/java/net/runelite/deob/deobfuscators/mapping/MappingExecutorUtil.java index f2fe61b188..23e9899db4 100644 --- a/deobfuscator/src/main/java/net/runelite/deob/deobfuscators/mapping/MappingExecutorUtil.java +++ b/deobfuscator/src/main/java/net/runelite/deob/deobfuscators/mapping/MappingExecutorUtil.java @@ -50,7 +50,7 @@ import net.runelite.asm.execution.Variables; import net.runelite.asm.signature.Signature; public class MappingExecutorUtil -{ +{ public static ParallelExecutorMapping map(Method m1, Method m2) { ClassGroup group1 = m1.getClassFile().getGroup(); diff --git a/deobfuscator/src/test/java/net/runelite/deob/deobfuscators/UnusedParametersTest.java b/deobfuscator/src/test/java/net/runelite/deob/deobfuscators/UnusedParametersTest.java index 12f2113dca..584c96315a 100644 --- a/deobfuscator/src/test/java/net/runelite/deob/deobfuscators/UnusedParametersTest.java +++ b/deobfuscator/src/test/java/net/runelite/deob/deobfuscators/UnusedParametersTest.java @@ -61,7 +61,7 @@ public class UnusedParametersTest @Test public void testRun() - { + { RenameUnique r = new RenameUnique(); r.run(group); r = null; diff --git a/runelite-api/src/main/java/net/runelite/api/Experience.java b/runelite-api/src/main/java/net/runelite/api/Experience.java index d83a61c97b..6fa91919dc 100644 --- a/runelite-api/src/main/java/net/runelite/api/Experience.java +++ b/runelite-api/src/main/java/net/runelite/api/Experience.java @@ -127,8 +127,8 @@ public class Experience private static double getMeleeRangeOrMagicCombatLevelContribution(int attackLevel, int strengthLevel, int magicLevel, int rangeLevel) { double melee = 0.325 * (attackLevel + strengthLevel); - double range = 0.325 * (Math.floor(rangeLevel / 2) + rangeLevel); - double magic = 0.325 * (Math.floor(magicLevel / 2) + magicLevel); + double range = 0.325 * (rangeLevel / 2 + rangeLevel); + double magic = 0.325 * (magicLevel / 2 + magicLevel); return Math.max(melee, Math.max(range, magic)); } @@ -152,7 +152,7 @@ public class Experience int defenceLevel, int hitpointsLevel, int magicLevel, int rangeLevel, int prayerLevel) { - double base = 0.25 * (defenceLevel + hitpointsLevel + Math.floor(prayerLevel / 2)); + double base = 0.25 * (defenceLevel + hitpointsLevel + (prayerLevel / 2)); double typeContribution = getMeleeRangeOrMagicCombatLevelContribution(attackLevel, strengthLevel, magicLevel, rangeLevel); diff --git a/runelite-api/src/main/java/net/runelite/api/ItemID.java b/runelite-api/src/main/java/net/runelite/api/ItemID.java index ab79bdef54..c31e9a430f 100644 --- a/runelite-api/src/main/java/net/runelite/api/ItemID.java +++ b/runelite-api/src/main/java/net/runelite/api/ItemID.java @@ -11142,7 +11142,7 @@ public final class ItemID public static final int CRYSTAL_SHIELD = 23991; public static final int CRYSTAL_SHIELD_INACTIVE = 23993; public static final int BLADE_OF_SAELDOR = 23995; - public static final int BLADE_OF_SAELDOR_23996 = 23996; + public static final int BLADE_OF_SAELDOR_23996 = 23996; public static final int BLADE_OF_SAELDOR_INACTIVE = 23997; public static final int BLADE_OF_SAELDOR_INACTIVE_23999 = 23999; public static final int CRYSTAL_GRAIL = 24000; diff --git a/runelite-api/src/main/java/net/runelite/api/ScriptID.java b/runelite-api/src/main/java/net/runelite/api/ScriptID.java index 8fd2255bdf..e3cf90cdd8 100644 --- a/runelite-api/src/main/java/net/runelite/api/ScriptID.java +++ b/runelite-api/src/main/java/net/runelite/api/ScriptID.java @@ -270,5 +270,37 @@ public final class ScriptID */ @ScriptArguments(integer = 2) public static final int TOPLEVEL_RESIZE = 909; + + /** + * Called when the friends list is updated + * + */ + @ScriptArguments(integer = 9) + public static final int FRIENDS_UPDATE = 631; + + /** + * Called when the ignore list is updated + * + */ + @ScriptArguments(integer = 7) + public static final int IGNORE_UPDATE = 630; } diff --git a/runelite-api/src/main/java/net/runelite/api/Varbits.java b/runelite-api/src/main/java/net/runelite/api/Varbits.java index 8f13fbed2c..e89de82111 100644 --- a/runelite-api/src/main/java/net/runelite/api/Varbits.java +++ b/runelite-api/src/main/java/net/runelite/api/Varbits.java @@ -499,6 +499,34 @@ public enum Varbits */ OXYGEN_LEVEL(5811), + /** + * Drift net status + * + * Expected values + * 0 = Unset + * 1 = Set up + * 2 = Caught some fish + * 3 = Full + */ + NORTH_NET_STATUS(5812), + SOUTH_NET_STATUS(5814), + + /** + * Drift net catch count + */ + NORTH_NET_CATCH_COUNT(5813), + SOUTH_NET_CATCH_COUNT(5815), + + /** + * Drift net collect interface + * + * Expected values: + * 0 = Not open + * 1 = North interface open + * 2 = South interface open + */ + DRIFT_NET_COLLECT(5933), + /** * Corp beast damage */ 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 6e4fd27860..69c5fcabfa 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 @@ -249,11 +249,27 @@ public class WidgetID static class FriendList { static final int TITLE = 3; + static final int FULL_CONTAINER = 5; + static final int SORT_BY_NAME_BUTTON = 7; + static final int SORT_BY_LAST_WORLD_CHANGE_BUTTON = 8; + static final int SORT_BY_WORLD_BUTTON = 9; + static final int LEGACY_SORT_BUTTON = 10; + static final int NAMES_CONTAINER = 11; + static final int SCROLL_BAR = 12; + static final int LOADING_TEXT = 13; + static final int PREVIOUS_NAME_HOLDER = 18; } static class IgnoreList { static final int TITLE = 3; + static final int FULL_CONTAINER = 5; + static final int SORT_BY_NAME_BUTTON = 7; + static final int LEGACY_SORT_BUTTON = 8; + static final int NAMES_CONTAINER = 9; + static final int SCROLL_BAR = 10; + static final int LOADING_TEXT = 11; + static final int PREVIOUS_NAME_HOLDER = 16; } static class ClanChat 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 b422ac7f03..3498aefcdc 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 @@ -123,8 +123,24 @@ public enum WidgetInfo VOLCANIC_MINE_VENT_C_STATUS(WidgetID.VOLCANIC_MINE_GROUP_ID, WidgetID.VolcanicMine.VENT_C_STATUS), FRIEND_CHAT_TITLE(WidgetID.FRIENDS_LIST_GROUP_ID, WidgetID.FriendList.TITLE), + FRIEND_LIST_FULL_CONTAINER(WidgetID.FRIENDS_LIST_GROUP_ID, WidgetID.FriendList.FULL_CONTAINER), + FRIEND_LIST_SORT_BY_NAME_BUTTON(WidgetID.FRIENDS_LIST_GROUP_ID, WidgetID.FriendList.SORT_BY_NAME_BUTTON), + FRIEND_LIST_SORT_BY_LAST_WORLD_CHANGE_BUTTON(WidgetID.FRIENDS_LIST_GROUP_ID, WidgetID.FriendList.SORT_BY_LAST_WORLD_CHANGE_BUTTON), + FRIEND_LIST_SORT_BY_WORLD_BUTTON(WidgetID.FRIENDS_LIST_GROUP_ID, WidgetID.FriendList.SORT_BY_WORLD_BUTTON), + FRIEND_LIST_LEGACY_SORT_BUTTON(WidgetID.FRIENDS_LIST_GROUP_ID, WidgetID.FriendList.LEGACY_SORT_BUTTON), + FRIEND_LIST_NAMES_CONTAINER(WidgetID.FRIENDS_LIST_GROUP_ID, WidgetID.FriendList.NAMES_CONTAINER), + FRIEND_LIST_SCROLL_BAR(WidgetID.FRIENDS_LIST_GROUP_ID, WidgetID.FriendList.SCROLL_BAR), + FRIEND_LIST_LOADING_TEXT(WidgetID.FRIENDS_LIST_GROUP_ID, WidgetID.FriendList.LOADING_TEXT), + FRIEND_LIST_PREVIOUS_NAME_HOLDER(WidgetID.FRIENDS_LIST_GROUP_ID, WidgetID.FriendList.PREVIOUS_NAME_HOLDER), IGNORE_TITLE(WidgetID.IGNORE_LIST_GROUP_ID, WidgetID.IgnoreList.TITLE), + IGNORE_FULL_CONTAINER(WidgetID.IGNORE_LIST_GROUP_ID, WidgetID.IgnoreList.FULL_CONTAINER), + IGNORE_SORT_BY_NAME_BUTTON(WidgetID.IGNORE_LIST_GROUP_ID, WidgetID.IgnoreList.SORT_BY_NAME_BUTTON), + IGNORE_LEGACY_SORT_BUTTON(WidgetID.IGNORE_LIST_GROUP_ID, WidgetID.IgnoreList.LEGACY_SORT_BUTTON), + IGNORE_NAMES_CONTAINER(WidgetID.IGNORE_LIST_GROUP_ID, WidgetID.IgnoreList.NAMES_CONTAINER), + IGNORE_SCROLL_BAR(WidgetID.IGNORE_LIST_GROUP_ID, WidgetID.IgnoreList.SCROLL_BAR), + IGNORE_LOADING_TEXT(WidgetID.IGNORE_LIST_GROUP_ID, WidgetID.IgnoreList.LOADING_TEXT), + IGNORE_PREVIOUS_NAME_HOLDER(WidgetID.IGNORE_LIST_GROUP_ID, WidgetID.IgnoreList.PREVIOUS_NAME_HOLDER), EXPLORERS_RING_ALCH_INVENTORY(WidgetID.EXPLORERS_RING_ALCH_GROUP_ID, WidgetID.ExplorersRing.INVENTORY), diff --git a/runelite-client/src/main/java/net/runelite/client/ui/overlay/components/LineComponent.java b/runelite-client/src/main/java/net/runelite/client/ui/overlay/components/LineComponent.java index f6c2f5e77c..754b0f441c 100644 --- a/runelite-client/src/main/java/net/runelite/client/ui/overlay/components/LineComponent.java +++ b/runelite-client/src/main/java/net/runelite/client/ui/overlay/components/LineComponent.java @@ -35,6 +35,7 @@ import java.awt.Rectangle; import lombok.Builder; import lombok.Getter; import lombok.Setter; +import net.runelite.api.util.Text; @Setter @Builder @@ -73,6 +74,7 @@ public class LineComponent implements LayoutableRenderableEntity int y = baseY; final int leftFullWidth = getLineWidth(left, metrics); final int rightFullWidth = getLineWidth(right, metrics); + final TextComponent textComponent = new TextComponent(); if (preferredSize.width < leftFullWidth + rightFullWidth) { @@ -92,30 +94,24 @@ public class LineComponent implements LayoutableRenderableEntity for (int i = 0; i < lineCount; i++) { - String leftText = ""; - String rightText = ""; - if (i < leftSplitLines.length) { - leftText = leftSplitLines[i]; + final String leftText = leftSplitLines[i]; + textComponent.setPosition(new Point(x, y)); + textComponent.setText(leftText); + textComponent.setColor(leftColor); + textComponent.render(graphics); } if (i < rightSplitLines.length) { - rightText = rightSplitLines[i]; + final String rightText = rightSplitLines[i]; + textComponent.setPosition(new Point(x + preferredSize.width - getLineWidth(rightText, metrics), y)); + textComponent.setText(rightText); + textComponent.setColor(rightColor); + textComponent.render(graphics); } - final TextComponent leftLineComponent = new TextComponent(); - leftLineComponent.setPosition(new Point(x, y)); - leftLineComponent.setText(leftText); - leftLineComponent.setColor(leftColor); - leftLineComponent.render(graphics); - - final TextComponent rightLineComponent = new TextComponent(); - rightLineComponent.setPosition(new Point(x + leftSmallWidth + rightSmallWidth - getLineWidth(rightText, metrics), y)); - rightLineComponent.setText(rightText); - rightLineComponent.setColor(rightColor); - rightLineComponent.render(graphics); y += metrics.getHeight(); } @@ -125,17 +121,22 @@ public class LineComponent implements LayoutableRenderableEntity return dimension; } - final TextComponent leftLineComponent = new TextComponent(); - leftLineComponent.setPosition(new Point(x, y)); - leftLineComponent.setText(left); - leftLineComponent.setColor(leftColor); - leftLineComponent.render(graphics); + if (!left.isEmpty()) + { + textComponent.setPosition(new Point(x, y)); + textComponent.setText(left); + textComponent.setColor(leftColor); + textComponent.render(graphics); + } + + if (!right.isEmpty()) + { + textComponent.setPosition(new Point(x + preferredSize.width - rightFullWidth, y)); + textComponent.setText(right); + textComponent.setColor(rightColor); + textComponent.render(graphics); + } - final TextComponent rightLineComponent = new TextComponent(); - rightLineComponent.setPosition(new Point(x + preferredSize.width - getLineWidth(right, metrics), y)); - rightLineComponent.setText(right); - rightLineComponent.setColor(rightColor); - rightLineComponent.render(graphics); y += metrics.getHeight(); final Dimension dimension = new Dimension(preferredSize.width, y - baseY); @@ -146,7 +147,7 @@ public class LineComponent implements LayoutableRenderableEntity private static int getLineWidth(final String line, final FontMetrics metrics) { - return metrics.stringWidth(TextComponent.textWithoutColTags(line)); + return metrics.stringWidth(Text.removeTags(line)); } private static String[] lineBreakText(String text, int maxWidth, FontMetrics metrics) diff --git a/runelite-client/src/main/java/net/runelite/client/ui/overlay/components/PanelComponent.java b/runelite-client/src/main/java/net/runelite/client/ui/overlay/components/PanelComponent.java index 33e19c9c11..bbdac78011 100644 --- a/runelite-client/src/main/java/net/runelite/client/ui/overlay/components/PanelComponent.java +++ b/runelite-client/src/main/java/net/runelite/client/ui/overlay/components/PanelComponent.java @@ -167,8 +167,14 @@ public class PanelComponent implements LayoutableRenderableEntity } // Remove last child gap - totalWidth -= gap.x; - totalHeight -= gap.y; + if (orientation == ComponentOrientation.HORIZONTAL) + { + totalWidth -= gap.x; + } + else // VERTICAL + { + totalHeight -= gap.y; + } // Cache children bounds childDimensions.setSize(totalWidth, totalHeight); diff --git a/runelite-client/src/main/java/net/runelite/client/ui/overlay/components/TextComponent.java b/runelite-client/src/main/java/net/runelite/client/ui/overlay/components/TextComponent.java index c5c65893c0..77375541bc 100644 --- a/runelite-client/src/main/java/net/runelite/client/ui/overlay/components/TextComponent.java +++ b/runelite-client/src/main/java/net/runelite/client/ui/overlay/components/TextComponent.java @@ -35,6 +35,7 @@ import java.awt.Shape; import java.awt.font.GlyphVector; import java.util.regex.Pattern; import lombok.Setter; +import net.runelite.api.util.Text; import net.runelite.client.ui.overlay.RenderableEntity; @Setter @@ -42,32 +43,26 @@ public class TextComponent implements RenderableEntity { private static final String COL_TAG_REGEX = "()"; private static final Pattern COL_TAG_PATTERN_W_LOOKAHEAD = Pattern.compile("(?=" + COL_TAG_REGEX + ")"); - private static final Pattern COL_TAG_PATTERN = Pattern.compile(COL_TAG_REGEX); private String text; private Point position = new Point(); private Color color = Color.WHITE; private Color borderColor = Color.BLACK; - public static String textWithoutColTags(String text) - { - return COL_TAG_PATTERN.matcher(text).replaceAll(""); - } - @Override public Dimension render(Graphics2D graphics) { final FontMetrics fontMetrics = graphics.getFontMetrics(); - if (COL_TAG_PATTERN.matcher(text).find()) + if (COL_TAG_PATTERN_W_LOOKAHEAD.matcher(text).find()) { final String[] parts = COL_TAG_PATTERN_W_LOOKAHEAD.split(text); int x = position.x; for (String textSplitOnCol : parts) { - final String textWithoutCol = textWithoutColTags(textSplitOnCol); - final String colColor = textSplitOnCol.substring(textSplitOnCol.indexOf('=') + 1, textSplitOnCol.indexOf('>')); + final String textWithoutCol = Text.removeTags(textSplitOnCol); + final String colColor = textSplitOnCol.substring(textSplitOnCol.indexOf("=") + 1, textSplitOnCol.indexOf(">")); renderText(graphics, x, position.y, textWithoutCol, Color.decode("#" + colColor), borderColor); diff --git a/runelite-client/src/main/java/net/runelite/client/ui/overlay/components/TooltipComponent.java b/runelite-client/src/main/java/net/runelite/client/ui/overlay/components/TooltipComponent.java index 2179a6a5b6..cd917c38a8 100644 --- a/runelite-client/src/main/java/net/runelite/client/ui/overlay/components/TooltipComponent.java +++ b/runelite-client/src/main/java/net/runelite/client/ui/overlay/components/TooltipComponent.java @@ -34,10 +34,9 @@ import java.awt.Rectangle; import java.util.regex.Pattern; import lombok.Setter; import net.runelite.api.IndexedSprite; -import net.runelite.client.ui.overlay.RenderableEntity; @Setter -public class TooltipComponent implements RenderableEntity +public class TooltipComponent implements LayoutableRenderableEntity { private static final Pattern BR = Pattern.compile("
"); private static final int OFFSET = 4; @@ -225,4 +224,21 @@ public class TooltipComponent implements RenderableEntity } } } -} \ No newline at end of file + + @Override + public Rectangle getBounds() + { + return null; + } + + @Override + public void setPreferredLocation(Point position) + { + this.position = position; + } + + @Override + public void setPreferredSize(Dimension dimension) + { + } +} diff --git a/runelite-client/src/main/java/net/runelite/client/ui/overlay/components/table/TableComponent.java b/runelite-client/src/main/java/net/runelite/client/ui/overlay/components/table/TableComponent.java index 376876e3a5..2e6fb2de63 100644 --- a/runelite-client/src/main/java/net/runelite/client/ui/overlay/components/table/TableComponent.java +++ b/runelite-client/src/main/java/net/runelite/client/ui/overlay/components/table/TableComponent.java @@ -39,6 +39,7 @@ import javax.annotation.Nullable; import lombok.Getter; import lombok.NonNull; import lombok.Setter; +import net.runelite.api.util.Text; import net.runelite.client.ui.overlay.components.ComponentConstants; import net.runelite.client.ui.overlay.components.LayoutableRenderableEntity; import net.runelite.client.ui.overlay.components.TextComponent; @@ -255,7 +256,7 @@ public class TableComponent implements LayoutableRenderableEntity private static int getTextWidth(final FontMetrics metrics, final String cell) { - return metrics.stringWidth(TextComponent.textWithoutColTags(cell)); + return metrics.stringWidth(Text.removeTags(cell)); } private static String[] lineBreakText(final String text, final int maxWidth, final FontMetrics metrics) diff --git a/runelite-client/src/main/java/net/runelite/client/ui/overlay/tooltip/Tooltip.java b/runelite-client/src/main/java/net/runelite/client/ui/overlay/tooltip/Tooltip.java index f0c3700850..50974ada31 100644 --- a/runelite-client/src/main/java/net/runelite/client/ui/overlay/tooltip/Tooltip.java +++ b/runelite-client/src/main/java/net/runelite/client/ui/overlay/tooltip/Tooltip.java @@ -24,12 +24,22 @@ */ package net.runelite.client.ui.overlay.tooltip; -import lombok.AllArgsConstructor; import lombok.Data; +import net.runelite.client.ui.overlay.components.LayoutableRenderableEntity; @Data -@AllArgsConstructor public class Tooltip { - private final String text; + private String text; + private LayoutableRenderableEntity component; + + public Tooltip(final String text) + { + this.text = text; + } + + public Tooltip(final LayoutableRenderableEntity component) + { + this.component = component; + } } diff --git a/runelite-client/src/main/java/net/runelite/client/ui/overlay/tooltip/TooltipOverlay.java b/runelite-client/src/main/java/net/runelite/client/ui/overlay/tooltip/TooltipOverlay.java index 314adffee0..f808fa49f2 100644 --- a/runelite-client/src/main/java/net/runelite/client/ui/overlay/tooltip/TooltipOverlay.java +++ b/runelite-client/src/main/java/net/runelite/client/ui/overlay/tooltip/TooltipOverlay.java @@ -38,6 +38,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.OverlayPriority; +import net.runelite.client.ui.overlay.components.LayoutableRenderableEntity; import net.runelite.client.ui.overlay.components.TooltipComponent; @Singleton @@ -97,12 +98,22 @@ public class TooltipOverlay extends Overlay for (Tooltip tooltip : tooltips) { - final TooltipComponent tooltipComponent = new TooltipComponent(); - tooltipComponent.setModIcons(client.getModIcons()); - tooltipComponent.setText(tooltip.getText()); - tooltipComponent.setPosition(new Point(tooltipX, tooltipY + newBounds.height)); + final LayoutableRenderableEntity entity; - final Dimension dimension = tooltipComponent.render(graphics); + if (tooltip.getComponent() != null) + { + entity = tooltip.getComponent(); + } + else + { + final TooltipComponent tooltipComponent = new TooltipComponent(); + tooltipComponent.setModIcons(client.getModIcons()); + tooltipComponent.setText(tooltip.getText()); + entity = tooltipComponent; + } + + entity.setPreferredLocation(new Point(tooltipX, tooltipY + newBounds.height)); + final Dimension dimension = entity.render(graphics); // Create incremental tooltip newBounds newBounds.height += dimension.height + PADDING; diff --git a/runelite-client/src/main/scripts/FriendUpdate.hash b/runelite-client/src/main/scripts/FriendUpdate.hash new file mode 100644 index 0000000000..78f935d1bb --- /dev/null +++ b/runelite-client/src/main/scripts/FriendUpdate.hash @@ -0,0 +1 @@ +6DC2945220E60445B7857ECFB97908E0B28FF0E96E533BB8DC8293DC68A986C2 \ No newline at end of file diff --git a/runelite-client/src/main/scripts/FriendUpdate.rs2asm b/runelite-client/src/main/scripts/FriendUpdate.rs2asm new file mode 100644 index 0000000000..69cb250b31 --- /dev/null +++ b/runelite-client/src/main/scripts/FriendUpdate.rs2asm @@ -0,0 +1,571 @@ +.id 125 +.int_stack_count 9 +.string_stack_count 0 +.int_var_count 16 +.string_var_count 2 +; callback "friend_cc_settext" +; Fired just before the client pops the name off the stack +; Modified by the friendnotes plugin to show the icon +; callback "friend_cc_setposition" +; Fired just before the client sets the position of "friend changed their name" icon +; Modified by the friendnotes plugin to offset the name changed icon + iload 1 + iconst 2 + iconst 3 + iconst 2 + sconst "Sort by name" + iload 0 + iload 1 + iload 2 + iload 3 + iload 4 + iload 5 + iload 6 + iload 7 + iload 8 + invoke 1669 + iload 2 + iconst 8 + iconst 9 + iconst 9 + sconst "Sort by last world change" + iload 0 + iload 1 + iload 2 + iload 3 + iload 4 + iload 5 + iload 6 + iload 7 + iload 8 + invoke 1669 + iload 3 + iconst 4 + iconst 5 + iconst 4 + sconst "Sort by world" + iload 0 + iload 1 + iload 2 + iload 3 + iload 4 + iload 5 + iload 6 + iload 7 + iload 8 + invoke 1669 + iload 4 + iconst 0 + iconst 1 + iconst 0 + sconst "Legacy sort" + iload 0 + iload 1 + iload 2 + iload 3 + iload 4 + iload 5 + iload 6 + iload 7 + iload 8 + invoke 1669 + iload 5 + cc_deleteall + iconst 0 + istore 9 + iconst 0 + istore 10 + sconst "" + sstore 0 + sconst "" + sstore 1 + iconst 0 + istore 11 + iconst 0 + istore 12 + iconst 15 + istore 13 + iconst -1 + istore 14 + friend_count + istore 15 + iload 15 + iconst -2 + if_icmple LABEL84 + jump LABEL105 +LABEL84: + get_varbit 8119 + iconst 1 + if_icmpeq LABEL88 + jump LABEL95 +LABEL88: + sconst "Loading friends list" + sconst "
" + sconst "Please wait..." + join_string 3 + iload 7 + if_settext + jump LABEL101 +LABEL95: + sconst "You must set a name" + sconst "
" + sconst "before using this." + join_string 3 + iload 7 + if_settext +LABEL101: + iconst 1 + iload 0 + if_sethide + jump LABEL468 +LABEL105: + iload 15 + iconst -1 + if_icmpeq LABEL109 + jump LABEL130 +LABEL109: + get_varbit 8119 + iconst 1 + if_icmpeq LABEL113 + jump LABEL120 +LABEL113: + sconst "Loading friends list" + sconst "
" + sconst "Please wait..." + join_string 3 + iload 7 + if_settext + jump LABEL126 +LABEL120: + sconst "You must set a name" + sconst "
" + sconst "before using this." + join_string 3 + iload 7 + if_settext +LABEL126: + iconst 1 + iload 0 + if_sethide + jump LABEL468 +LABEL130: + invoke 1972 + istore 14 + iload 14 + iconst 1 + if_icmpeq LABEL136 + jump LABEL141 +LABEL136: + iconst 8 + iconst 5 + iload 13 + scale + istore 13 +LABEL141: + sconst "" + iload 7 + if_settext + iconst 0 + iload 0 + if_sethide + 3628 + get_varc_int 183 + switch + 1: LABEL151 + 2: LABEL154 + 3: LABEL159 + 4: LABEL174 + 5: LABEL194 + 8: LABEL164 + 9: LABEL169 + jump LABEL213 +LABEL151: + iconst 0 + 3629 + jump LABEL213 +LABEL154: + iconst 1 + 3633 + iconst 1 + 3630 + jump LABEL213 +LABEL159: + iconst 1 + 3633 + iconst 0 + 3630 + jump LABEL213 +LABEL164: + iconst 1 + 3633 + iconst 1 + 3632 + jump LABEL213 +LABEL169: + iconst 1 + 3633 + iconst 0 + 3632 + jump LABEL213 +LABEL174: + iconst 1 + 3633 + iconst 1 + 3636 + iconst 1 + 3631 + get_varc_int 205 + switch + 3: LABEL185 + 8: LABEL188 + 9: LABEL191 + iconst 1 + 3630 + jump LABEL193 +LABEL185: + iconst 0 + 3630 + jump LABEL193 +LABEL188: + iconst 1 + 3632 + jump LABEL193 +LABEL191: + iconst 0 + 3632 +LABEL193: + jump LABEL213 +LABEL194: + iconst 1 + 3633 + iconst 1 + 3636 + iconst 0 + 3631 + get_varc_int 205 + switch + 3: LABEL205 + 8: LABEL208 + 9: LABEL211 + iconst 1 + 3630 + jump LABEL213 +LABEL205: + iconst 0 + 3630 + jump LABEL213 +LABEL208: + iconst 1 + 3632 + jump LABEL213 +LABEL211: + iconst 0 + 3632 +LABEL213: + 3639 +LABEL214: + iload 9 + iload 15 + if_icmplt LABEL218 + jump LABEL460 +LABEL218: + iload 9 + friend_getname + sstore 1 + sstore 0 + iload 5 + iconst 4 + iload 10 + cc_create + iload 10 + iconst 1 + add + istore 10 + sload 0 + sconst "friend_cc_settext" + runelite_callback + cc_settext + iconst 0 + iload 13 + iconst 1 + iconst 0 + cc_setsize + iconst 0 + iload 12 + iconst 1 + iconst 0 + cc_setposition + iconst 16777215 + cc_setcolour + iconst 495 + cc_settextfont + iconst 0 + iconst 1 + iconst 0 + cc_settextalign + iconst 1 + cc_settextshadow + sconst "" + sload 0 + sconst "" + join_string 3 + cc_setopbase + iload 9 + friend_getworld + istore 11 + iload 11 + iconst 0 + if_icmpne LABEL264 + jump LABEL271 +LABEL264: + iconst 1 + sconst "Message" + cc_setop + iconst 2 + sconst "" + cc_setop + jump LABEL277 +LABEL271: + iconst 1 + sconst "" + cc_setop + iconst 2 + sconst "Message" + cc_setop +LABEL277: + iconst 3 + sconst "Delete" + cc_setop + iload 5 + iconst 5 + iload 10 + cc_create 1 + iload 10 + iconst 1 + add + istore 10 + iconst 14 + iconst 14 + iconst 0 + iconst 0 + cc_setsize 1 + sload 0 + iconst 190 + iconst 495 + parawidth + iconst 3 + add + iload 12 + iload 13 + iconst 14 + sub + iconst 2 + div + add + iconst 0 + iconst 0 + sconst "friend_cc_setposition" + runelite_callback + cc_setposition 1 + iconst 1093 + cc_setgraphic 1 + iconst 3355443 + cc_setgraphicshadow 1 + sload 1 + string_length + iconst 0 + if_icmpgt LABEL318 + jump LABEL367 +LABEL318: + iload 14 + iconst 1 + if_icmpeq LABEL322 + jump LABEL336 +LABEL322: + iconst 10 + sconst "Reveal previous name" + cc_setop + iconst 126 + iconst -2147483644 + sconst "event_opbase" + iconst -2147483645 + cc_getid + cc_getid 1 + sload 1 + sload 0 + sconst "isIiiss" + cc_setonop + jump LABEL364 +LABEL336: + sconst "Previous name:" + sconst "
" + sload 1 + join_string 3 + sstore 1 + iconst 526 + iconst -2147483645 + iconst -2147483643 + iload 8 + sload 1 + iconst 25 + iconst 190 + sconst "IiIsii" + cc_setonmouserepeat + iconst 40 + iload 8 + sconst "I" + cc_setonmouseleave + iconst 126 + iconst -2147483644 + sconst "event_opbase" + iconst -1 + iconst -1 + iconst -1 + sconst "null" + sconst "null" + sconst "isIiiss" + cc_setonop +LABEL364: + iconst 0 + cc_sethide 1 + jump LABEL383 +LABEL367: + iconst 40 + iload 8 + sconst "I" + cc_setonmouseover + iconst 1 + cc_sethide 1 + iconst 126 + iconst -2147483644 + sconst "event_opbase" + iconst -1 + iconst -1 + iconst -1 + sconst "null" + sconst "null" + sconst "isIiiss" + cc_setonop +LABEL383: + iload 5 + iconst 4 + iload 10 + cc_create + iload 10 + iconst 1 + add + istore 10 + iconst 0 + iload 13 + iconst 1 + iconst 0 + cc_setsize + iconst 0 + iload 12 + iconst 1 + iconst 0 + cc_setposition + iconst 495 + cc_settextfont + iconst 2 + iconst 1 + iconst 0 + cc_settextalign + iconst 1 + cc_settextshadow + iload 11 + iconst 0 + if_icmpeq LABEL413 + jump LABEL418 +LABEL413: + sconst "Offline" + cc_settext + iconst 16711680 + cc_setcolour + jump LABEL451 +LABEL418: + iload 11 + map_world + if_icmpeq LABEL422 + jump LABEL430 +LABEL422: + sconst "World " + iload 11 + tostring + join_string 2 + cc_settext + iconst 901389 + cc_setcolour + jump LABEL451 +LABEL430: + iload 11 + iconst 5000 + if_icmpgt LABEL434 + jump LABEL443 +LABEL434: + sconst "" + sconst "Classic " + iload 11 + iconst 5000 + sub + tostring + join_string 3 + cc_settext + jump LABEL449 +LABEL443: + sconst "" + sconst "World " + iload 11 + tostring + join_string 3 + cc_settext +LABEL449: + iconst 16776960 + cc_setcolour +LABEL451: + iload 9 + iconst 1 + add + iload 12 + iload 13 + add + istore 12 + istore 9 + jump LABEL214 +LABEL460: + iload 15 + iconst 1 + if_icmpge LABEL464 + jump LABEL468 +LABEL464: + iload 12 + iconst 5 + add + istore 12 +LABEL468: + iload 12 + iload 5 + if_getheight + if_icmpgt LABEL473 + jump LABEL482 +LABEL473: + iconst 0 + iload 12 + iload 5 + if_setscrollsize + iload 6 + iload 5 + get_varc_int 9 + invoke 72 + jump LABEL490 +LABEL482: + iconst 0 + iconst 0 + iload 5 + if_setscrollsize + iload 6 + iload 5 + iconst 0 + invoke 72 +LABEL490: + return diff --git a/runelite-client/src/main/scripts/IgnoreUpdate.hash b/runelite-client/src/main/scripts/IgnoreUpdate.hash new file mode 100644 index 0000000000..b10226b2e6 --- /dev/null +++ b/runelite-client/src/main/scripts/IgnoreUpdate.hash @@ -0,0 +1 @@ +256A38E234D9D44532175F4C98AA923327EE050E23D122573426D94FBF15936E \ No newline at end of file diff --git a/runelite-client/src/main/scripts/IgnoreUpdate.rs2asm b/runelite-client/src/main/scripts/IgnoreUpdate.rs2asm new file mode 100644 index 0000000000..a99a72a2f1 --- /dev/null +++ b/runelite-client/src/main/scripts/IgnoreUpdate.rs2asm @@ -0,0 +1,330 @@ +.id 129 +.int_stack_count 7 +.string_stack_count 0 +.int_var_count 13 +.string_var_count 2 +; callback "ignore_cc_settext" +; Fired just before the client pops the name off the stack +; Modified by the friendnotes plugin to show the icon +; callback "ignore_cc_setposition" +; Fired just before the client sets the position of "ignored person changed their name" icon +; Modified by the friendnotes plugin to offset the name changed icon + iload 1 + iconst 2 + iconst 3 + sconst "Sort by name" + iload 0 + iload 1 + iload 2 + iload 3 + iload 4 + iload 5 + iload 6 + invoke 1653 + iload 2 + iconst 0 + iconst 1 + sconst "Legacy sort" + iload 0 + iload 1 + iload 2 + iload 3 + iload 4 + iload 5 + iload 6 + invoke 1653 + iload 3 + cc_deleteall + iconst 0 + istore 7 + iconst 0 + istore 8 + sconst "" + sstore 0 + sconst "" + sstore 1 + iconst 0 + istore 9 + iconst 15 + istore 10 + iconst -1 + istore 11 + ignore_count + istore 12 + iload 12 + iconst 0 + if_icmplt LABEL46 + jump LABEL67 +LABEL46: + get_varbit 8119 + iconst 1 + if_icmpeq LABEL50 + jump LABEL57 +LABEL50: + sconst "Loading ignore list" + sconst "
" + sconst "Please wait..." + join_string 3 + iload 5 + if_settext + jump LABEL63 +LABEL57: + sconst "You must set a name" + sconst "
" + sconst "before using this." + join_string 3 + iload 5 + if_settext +LABEL63: + iconst 1 + iload 0 + if_sethide + jump LABEL263 +LABEL67: + invoke 1972 + istore 11 + iload 11 + iconst 1 + if_icmpeq LABEL73 + jump LABEL78 +LABEL73: + iconst 8 + iconst 5 + iload 10 + scale + istore 10 +LABEL78: + sconst "" + iload 5 + if_settext + iconst 0 + iload 0 + if_sethide + 3640 + get_varc_int 184 + switch + 1: LABEL88 + 2: LABEL91 + 3: LABEL94 + jump LABEL96 +LABEL88: + iconst 0 + 3641 + jump LABEL96 +LABEL91: + iconst 1 + 3642 + jump LABEL96 +LABEL94: + iconst 0 + 3642 +LABEL96: + 3643 +LABEL97: + iload 7 + iload 12 + if_icmplt LABEL101 + jump LABEL255 +LABEL101: + iload 7 + ignore_getname + sstore 1 + sstore 0 + iload 3 + iconst 4 + iload 8 + cc_create + iload 8 + iconst 1 + add + istore 8 + sload 0 + sconst "ignore_cc_settext" + runelite_callback + cc_settext + iconst 0 + iload 10 + iconst 1 + iconst 0 + cc_setsize + iconst 0 + iload 9 + iconst 1 + iconst 0 + cc_setposition + iconst 16777215 + cc_setcolour + iconst 495 + cc_settextfont + iconst 0 + iconst 1 + iconst 0 + cc_settextalign + iconst 1 + cc_settextshadow + sconst "" + sload 0 + sconst "" + join_string 3 + cc_setopbase + iconst 1 + sconst "Delete" + cc_setop + iload 3 + iconst 5 + iload 8 + cc_create 1 + iload 8 + iconst 1 + add + istore 8 + iconst 14 + iconst 14 + iconst 0 + iconst 0 + cc_setsize 1 + sload 0 + iconst 190 + iconst 495 + parawidth + iconst 3 + add + iload 9 + iload 10 + iconst 14 + sub + iconst 2 + div + add + iconst 0 + iconst 0 + sconst "ignore_cc_setposition" + runelite_callback + cc_setposition 1 + iconst 1093 + cc_setgraphic 1 + iconst 3355443 + cc_setgraphicshadow 1 + sload 1 + string_length + iconst 0 + if_icmpgt LABEL181 + jump LABEL230 +LABEL181: + iload 11 + iconst 1 + if_icmpeq LABEL185 + jump LABEL199 +LABEL185: + iconst 10 + sconst "Reveal previous name" + cc_setop + iconst 130 + iconst -2147483644 + sconst "event_opbase" + iconst -2147483645 + cc_getid + cc_getid 1 + sload 1 + sload 0 + sconst "isIiiss" + cc_setonop + jump LABEL227 +LABEL199: + sconst "Previous name:" + sconst "
" + sload 1 + join_string 3 + sstore 1 + iconst 526 + iconst -2147483645 + iconst -2147483643 + iload 6 + sload 1 + iconst 25 + iconst 190 + sconst "IiIsii" + cc_setonmouserepeat + iconst 40 + iload 6 + sconst "I" + cc_setonmouseleave + iconst 130 + iconst -2147483644 + sconst "event_opbase" + iconst -1 + iconst -1 + iconst -1 + sconst "null" + sconst "null" + sconst "isIiiss" + cc_setonop +LABEL227: + iconst 0 + cc_sethide 1 + jump LABEL246 +LABEL230: + iconst 40 + iload 6 + sconst "I" + cc_setonmouseover + iconst 1 + cc_sethide 1 + iconst 130 + iconst -2147483644 + sconst "event_opbase" + iconst -1 + iconst -1 + iconst -1 + sconst "null" + sconst "null" + sconst "isIiiss" + cc_setonop +LABEL246: + iload 7 + iconst 1 + add + iload 9 + iload 10 + add + istore 9 + istore 7 + jump LABEL97 +LABEL255: + iload 12 + iconst 1 + if_icmpge LABEL259 + jump LABEL263 +LABEL259: + iload 9 + iconst 5 + add + istore 9 +LABEL263: + iload 9 + iload 3 + if_getheight + if_icmpgt LABEL268 + jump LABEL278 +LABEL268: + iconst 0 + iload 9 + iload 3 + if_setscrollsize + iload 4 + iload 3 + iload 3 + if_getscrolly + invoke 72 + jump LABEL286 +LABEL278: + iconst 0 + iconst 0 + iload 3 + if_setscrollsize + iload 4 + iload 3 + iconst 0 + invoke 72 +LABEL286: + return