From b6e0e01f7d232a6251a84643afae3f5ef2435dbd Mon Sep 17 00:00:00 2001 From: LlemonDuck Date: Sat, 13 Nov 2021 19:41:44 -0800 Subject: [PATCH 01/10] special counter: ignore vet'ion hellhounds Prevents spec counter resetting when attacking a skeleton hellhound spawned by Vet'ion. The hellhounds are spawned at 50% HP, and are required to kill to continue the fight, so the player will continue fighting Vet'ion after they are killed. It's possible that a player may want to use a spec against the hellhounds, but I'm not aware of any reason for it. --- .../client/plugins/specialcounter/SpecialCounterPlugin.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/specialcounter/SpecialCounterPlugin.java b/runelite-client/src/main/java/net/runelite/client/plugins/specialcounter/SpecialCounterPlugin.java index 6c612efff9..b2b78e9a52 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/specialcounter/SpecialCounterPlugin.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/specialcounter/SpecialCounterPlugin.java @@ -72,7 +72,8 @@ public class SpecialCounterPlugin extends Plugin { private static final Set IGNORED_NPCS = ImmutableSet.of( NpcID.DARK_ENERGY_CORE, NpcID.ZOMBIFIED_SPAWN, NpcID.ZOMBIFIED_SPAWN_8063, - NpcID.COMBAT_DUMMY, NpcID.UNDEAD_COMBAT_DUMMY + NpcID.COMBAT_DUMMY, NpcID.UNDEAD_COMBAT_DUMMY, + NpcID.SKELETON_HELLHOUND_6613, NpcID.GREATER_SKELETON_HELLHOUND ); private static final Set RESET_ON_LEAVE_INSTANCED_REGIONS = ImmutableSet.of( From 13ecfc0a9eaf3161b979f6e9f1b6f66fa075fb51 Mon Sep 17 00:00:00 2001 From: Adam Date: Sun, 14 Nov 2021 13:41:07 -0500 Subject: [PATCH 02/10] gpu: add sync mode config This allows the additional OFF mode which has the client manage its own frame rate target without the use of vsync. On lower end systems which have a hard time delivering a frame in the vsync interval this can give a noticible performance improvement since it doesn't stall the cpu waiting for the next vblank when a frame is skipped --- .../main/java/net/runelite/api/Client.java | 1 + .../client/plugins/gpu/GpuPlugin.java | 43 ++++++++++++++----- .../client/plugins/gpu/GpuPluginConfig.java | 33 ++++++++++++++ 3 files changed, 67 insertions(+), 10 deletions(-) diff --git a/runelite-api/src/main/java/net/runelite/api/Client.java b/runelite-api/src/main/java/net/runelite/api/Client.java index 4f38b13c0c..5f1175fcdd 100644 --- a/runelite-api/src/main/java/net/runelite/api/Client.java +++ b/runelite-api/src/main/java/net/runelite/api/Client.java @@ -1953,6 +1953,7 @@ public interface Client extends GameEngine ClanSettings getClanSettings(int clanId); void setUnlockedFps(boolean unlock); + void setUnlockedFpsTarget(int fps); /** * Gets the ambient sound effects diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/gpu/GpuPlugin.java b/runelite-client/src/main/java/net/runelite/client/plugins/gpu/GpuPlugin.java index b9900a988e..b275fd7d4e 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/gpu/GpuPlugin.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/gpu/GpuPlugin.java @@ -394,9 +394,7 @@ public class GpuPlugin extends Plugin implements DrawCallbacks this.gl = glContext.getGL().getGL4(); - final boolean unlockFps = this.config.unlockFps(); - client.setUnlockedFps(unlockFps); - gl.setSwapInterval(unlockFps ? -1 : 0); + setupSyncMode(); if (log.isDebugEnabled()) { @@ -556,18 +554,43 @@ public class GpuPlugin extends Plugin implements DrawCallbacks { if (configChanged.getGroup().equals(GpuPluginConfig.GROUP)) { - if (configChanged.getKey().equals("unlockFps")) + if (configChanged.getKey().equals("unlockFps") + || configChanged.getKey().equals("vsyncMode") + || configChanged.getKey().equals("fpsTarget")) { - boolean unlockFps = Boolean.parseBoolean(configChanged.getNewValue()); - clientThread.invokeLater(() -> - { - client.setUnlockedFps(unlockFps); - invokeOnMainThread(() -> gl.setSwapInterval(unlockFps ? -1 : 0)); - }); + log.debug("Rebuilding sync mode"); + clientThread.invokeLater(() -> invokeOnMainThread(this::setupSyncMode)); } } } + private void setupSyncMode() + { + final boolean unlockFps = config.unlockFps(); + client.setUnlockedFps(unlockFps); + + // Without unlocked fps, the client manages sync on its 20ms timer + GpuPluginConfig.SyncMode syncMode = unlockFps + ? this.config.syncMode() + : GpuPluginConfig.SyncMode.OFF; + + switch (syncMode) + { + case ON: + gl.setSwapInterval(1); + client.setUnlockedFpsTarget(0); + break; + case OFF: + gl.setSwapInterval(0); + client.setUnlockedFpsTarget(config.fpsTarget()); // has no effect with unlockFps=false + break; + case ADAPTIVE: + gl.setSwapInterval(-1); + client.setUnlockedFpsTarget(0); + break; + } + } + private void initProgram() throws ShaderException { String versionHeader = OSType.getOSType() == OSType.Linux ? LINUX_VERSION_HEADER : WINDOWS_VERSION_HEADER; diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/gpu/GpuPluginConfig.java b/runelite-client/src/main/java/net/runelite/client/plugins/gpu/GpuPluginConfig.java index ff69cd80e8..3d5f1095ea 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/gpu/GpuPluginConfig.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/gpu/GpuPluginConfig.java @@ -159,4 +159,37 @@ public interface GpuPluginConfig extends Config { return false; } + + enum SyncMode + { + OFF, + ON, + ADAPTIVE + } + + @ConfigItem( + keyName = "vsyncMode", + name = "Vsync Mode", + description = "Method to synchronize frame rate with refresh rate", + position = 11 + ) + default SyncMode syncMode() + { + return SyncMode.ADAPTIVE; + } + + @ConfigItem( + keyName = "fpsTarget", + name = "FPS Target", + description = "Target FPS when unlock FPS is enabled and Vsync mode is OFF", + position = 12 + ) + @Range( + min = 1, + max = 999 + ) + default int fpsTarget() + { + return 60; + } } From 081a30056c9c744add6cf2895e9e922d5b9b340b Mon Sep 17 00:00:00 2001 From: Max Weber Date: Sun, 14 Nov 2021 13:10:26 -0700 Subject: [PATCH 03/10] avoid boxing `Comparator.comparing`s --- .../main/java/net/runelite/cache/fs/flat/FlatStorage.java | 4 ++-- .../java/net/runelite/api/geometry/RectangleUnion.java | 4 ++-- .../main/java/net/runelite/client/eventbus/EventBus.java | 4 ++-- .../runelite/client/plugins/banktags/BankTagsPlugin.java | 4 ++-- .../runelite/client/plugins/devtools/WidgetInspector.java | 4 ++-- .../runelite/client/plugins/fishing/FishingPlugin.java | 8 ++++---- .../client/plugins/itemstats/potions/SaradominBrew.java | 2 +- .../client/plugins/itemstats/potions/SuperRestore.java | 4 +++- .../plugins/itemstats/special/CastleWarsBandage.java | 2 +- .../net/runelite/client/plugins/music/MusicPlugin.java | 2 +- .../client/plugins/questlist/QuestListPlugin.java | 2 +- .../java/net/runelite/client/ui/ContainableFrame.java | 2 +- 12 files changed, 22 insertions(+), 20 deletions(-) diff --git a/cache/src/main/java/net/runelite/cache/fs/flat/FlatStorage.java b/cache/src/main/java/net/runelite/cache/fs/flat/FlatStorage.java index c8d651bcf6..9afe72785c 100644 --- a/cache/src/main/java/net/runelite/cache/fs/flat/FlatStorage.java +++ b/cache/src/main/java/net/runelite/cache/fs/flat/FlatStorage.java @@ -210,7 +210,7 @@ public class FlatStorage implements Storage @Override public void save(Store store) throws IOException { - store.getIndexes().sort(Comparator.comparing(Index::getId)); + store.getIndexes().sort(Comparator.comparingInt(Index::getId)); for (Index idx : store.getIndexes()) { String file = idx.getId() + EXTENSION; @@ -222,7 +222,7 @@ public class FlatStorage implements Storage br.printf("crc=%d\n", idx.getCrc()); br.printf("named=%b\n", idx.isNamed()); - idx.getArchives().sort(Comparator.comparing(Archive::getArchiveId)); + idx.getArchives().sort(Comparator.comparingInt(Archive::getArchiveId)); for (Archive archive : idx.getArchives()) { br.printf("id=%d\n", archive.getArchiveId()); diff --git a/runelite-api/src/main/java/net/runelite/api/geometry/RectangleUnion.java b/runelite-api/src/main/java/net/runelite/api/geometry/RectangleUnion.java index e71f80c6b1..33ae860f25 100644 --- a/runelite-api/src/main/java/net/runelite/api/geometry/RectangleUnion.java +++ b/runelite-api/src/main/java/net/runelite/api/geometry/RectangleUnion.java @@ -65,13 +65,13 @@ public class RectangleUnion boolean trace = log.isTraceEnabled(); // Sort all of the rectangles so they are ordered by their left edge - lefts.sort(Comparator.comparing(Rectangle::getX1)); + lefts.sort(Comparator.comparingInt(Rectangle::getX1)); // Again, but for the right edge // this should be relatively fast if the rectangles are similar sizes because timsort deals with partially // presorted data well List rights = new ArrayList<>(lefts); - rights.sort(Comparator.comparing(Rectangle::getX2)); + rights.sort(Comparator.comparingInt(Rectangle::getX2)); // ranges of our scan line with how many rectangles it is occluding Segments segments = new Segments(); diff --git a/runelite-client/src/main/java/net/runelite/client/eventbus/EventBus.java b/runelite-client/src/main/java/net/runelite/client/eventbus/EventBus.java index ed51aabb6e..2786e61947 100644 --- a/runelite-client/src/main/java/net/runelite/client/eventbus/EventBus.java +++ b/runelite-client/src/main/java/net/runelite/client/eventbus/EventBus.java @@ -100,7 +100,7 @@ public class EventBus { final ImmutableMultimap.Builder, Subscriber> builder = ImmutableMultimap.builder(); builder.putAll(subscribers); - builder.orderValuesBy(Comparator.comparing(Subscriber::getPriority).reversed() + builder.orderValuesBy(Comparator.comparingDouble(Subscriber::getPriority).reversed() .thenComparing(s -> s.object.getClass().getName())); for (Class clazz = object.getClass(); clazz != null; clazz = clazz.getSuperclass()) @@ -171,7 +171,7 @@ public class EventBus { final ImmutableMultimap.Builder, Subscriber> builder = ImmutableMultimap.builder(); builder.putAll(subscribers); - builder.orderValuesBy(Comparator.comparing(Subscriber::getPriority).reversed() + builder.orderValuesBy(Comparator.comparingDouble(Subscriber::getPriority).reversed() .thenComparing(s -> s.object.getClass().getName())); Subscriber sub = new Subscriber(subFn, null, priority, (Consumer) subFn); diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/banktags/BankTagsPlugin.java b/runelite-client/src/main/java/net/runelite/client/plugins/banktags/BankTagsPlugin.java index c4158abd6a..70088692c8 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/banktags/BankTagsPlugin.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/banktags/BankTagsPlugin.java @@ -546,8 +546,8 @@ public class BankTagsPlugin extends Plugin implements MouseWheelListener Widget[] containerChildren = itemContainer.getDynamicChildren(); // sort the child array as the items are not in the displayed order - Arrays.sort(containerChildren, Comparator.comparing(Widget::getOriginalY) - .thenComparing(Widget::getOriginalX)); + Arrays.sort(containerChildren, Comparator.comparingInt(Widget::getOriginalY) + .thenComparingInt(Widget::getOriginalX)); for (Widget child : containerChildren) { diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/devtools/WidgetInspector.java b/runelite-client/src/main/java/net/runelite/client/plugins/devtools/WidgetInspector.java index bb0ac5bf40..2f361bc99b 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/devtools/WidgetInspector.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/devtools/WidgetInspector.java @@ -436,9 +436,9 @@ class WidgetInspector extends DevToolsFrame parent = Stream.of(roots) .filter(w -> w.getType() == WidgetType.LAYER && w.getContentType() == 0 && !w.isSelfHidden()) - .sorted(Comparator.comparing((Widget w) -> w.getRelativeX() + w.getRelativeY()) + .sorted(Comparator.comparingInt((Widget w) -> w.getRelativeX() + w.getRelativeY()) .reversed() - .thenComparing(Widget::getId) + .thenComparingInt(Widget::getId) .reversed()) .findFirst().get(); x = 4; diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/fishing/FishingPlugin.java b/runelite-client/src/main/java/net/runelite/client/plugins/fishing/FishingPlugin.java index 66e57e7d52..8ade1cc5f1 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/fishing/FishingPlugin.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/fishing/FishingPlugin.java @@ -462,14 +462,14 @@ public class FishingPlugin extends Plugin final LocalPoint cameraPoint = new LocalPoint(client.getCameraX(), client.getCameraY()); fishingSpots.sort( - Comparator.comparing( + Comparator.comparingInt( // Negate to have the furthest first (NPC npc) -> -npc.getLocalLocation().distanceTo(cameraPoint)) // Order by position - .thenComparing(NPC::getLocalLocation, Comparator.comparing(LocalPoint::getX) - .thenComparing(LocalPoint::getY)) + .thenComparing(NPC::getLocalLocation, Comparator.comparingInt(LocalPoint::getX) + .thenComparingInt(LocalPoint::getY)) // And then by id - .thenComparing(NPC::getId) + .thenComparingInt(NPC::getId) ); } } diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/itemstats/potions/SaradominBrew.java b/runelite-client/src/main/java/net/runelite/client/plugins/itemstats/potions/SaradominBrew.java index 3a0f73d9be..2eaea550f4 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/itemstats/potions/SaradominBrew.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/itemstats/potions/SaradominBrew.java @@ -72,7 +72,7 @@ public class SaradominBrew implements Effect ).toArray(StatChange[]::new)); changes.setPositivity(Stream.of(changes.getStatChanges()) .map(sc -> sc.getPositivity()) - .max(Comparator.comparing(Enum::ordinal)).get()); + .max(Comparator.naturalOrder()).get()); return changes; } } \ No newline at end of file diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/itemstats/potions/SuperRestore.java b/runelite-client/src/main/java/net/runelite/client/plugins/itemstats/potions/SuperRestore.java index d5747bd1b8..66780c38ae 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/itemstats/potions/SuperRestore.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/itemstats/potions/SuperRestore.java @@ -68,7 +68,9 @@ public class SuperRestore implements Effect return calc.effect(client); }) ).toArray(StatChange[]::new)); - changes.setPositivity(Stream.of(changes.getStatChanges()).map(sc -> sc.getPositivity()).max(Comparator.comparing(Enum::ordinal)).get()); + changes.setPositivity(Stream.of(changes.getStatChanges()) + .map(sc -> sc.getPositivity()) + .max(Comparator.naturalOrder()).get()); return changes; } diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/itemstats/special/CastleWarsBandage.java b/runelite-client/src/main/java/net/runelite/client/plugins/itemstats/special/CastleWarsBandage.java index 19a1a63cb5..2885646fde 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/itemstats/special/CastleWarsBandage.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/itemstats/special/CastleWarsBandage.java @@ -61,7 +61,7 @@ public class CastleWarsBandage implements Effect changes.setStatChanges(new StatChange[]{hitPoints, runEnergy}); changes.setPositivity(Stream.of(changes.getStatChanges()) .map(StatChange::getPositivity) - .max(Comparator.comparing(Enum::ordinal)).get()); + .max(Comparator.naturalOrder()).get()); return changes; } diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/music/MusicPlugin.java b/runelite-client/src/main/java/net/runelite/client/plugins/music/MusicPlugin.java index 075dd1315c..f116825347 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/music/MusicPlugin.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/music/MusicPlugin.java @@ -418,7 +418,7 @@ public class MusicPlugin extends Plugin if (tracks == null) { tracks = Arrays.stream(musicList.getDynamicChildren()) - .sorted(Comparator.comparing(Widget::getRelativeY)) + .sorted(Comparator.comparingInt(Widget::getRelativeY)) .collect(Collectors.toList()); } diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/questlist/QuestListPlugin.java b/runelite-client/src/main/java/net/runelite/client/plugins/questlist/QuestListPlugin.java index 166ef3f669..6bf52d1a36 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/questlist/QuestListPlugin.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/questlist/QuestListPlugin.java @@ -336,7 +336,7 @@ public class QuestListPlugin extends Plugin { // Find all of the widgets that we care about, sorting by their Y value quests = Arrays.stream(list.getDynamicChildren()) - .sorted(Comparator.comparing(Widget::getRelativeY)) + .sorted(Comparator.comparingInt(Widget::getRelativeY)) .filter(w -> !QUEST_HEADERS.contains(w.getText())) .map(w -> new QuestWidget(w, Text.removeTags(w.getText()).toLowerCase())) .collect(Collectors.toList()); diff --git a/runelite-client/src/main/java/net/runelite/client/ui/ContainableFrame.java b/runelite-client/src/main/java/net/runelite/client/ui/ContainableFrame.java index 61ead031c5..9fee105dd4 100644 --- a/runelite-client/src/main/java/net/runelite/client/ui/ContainableFrame.java +++ b/runelite-client/src/main/java/net/runelite/client/ui/ContainableFrame.java @@ -271,7 +271,7 @@ public class ContainableFrame extends JFrame { return Arrays.stream(GraphicsEnvironment.getLocalGraphicsEnvironment().getScreenDevices()) .map(GraphicsDevice::getDefaultConfiguration) - .max(Comparator.comparing(config -> + .max(Comparator.comparingInt(config -> { Rectangle intersection = config.getBounds().intersection(getBounds()); return intersection.width * intersection.height; From 40ab68a971d65459ec32da4df15a263a969ef6ee Mon Sep 17 00:00:00 2001 From: Adam Date: Tue, 16 Nov 2021 12:32:57 -0500 Subject: [PATCH 04/10] timestamp: use steam client chat timestamp support The chat building scripts have variables now for message timestamp, so we can just assign our timestamp to those instead. --- .../runelite/cache/script/Instructions.java | 2 + .../net/runelite/cache/script/Opcodes.java | 2 + .../plugins/timestamp/TimestampPlugin.java | 49 +++---------------- .../src/main/scripts/ChatBuilder.rs2asm | 6 ++- .../src/main/scripts/ChatSplitBuilder.rs2asm | 8 +-- 5 files changed, 19 insertions(+), 48 deletions(-) diff --git a/cache/src/main/java/net/runelite/cache/script/Instructions.java b/cache/src/main/java/net/runelite/cache/script/Instructions.java index 3c7adc31ff..1e615fe93e 100644 --- a/cache/src/main/java/net/runelite/cache/script/Instructions.java +++ b/cache/src/main/java/net/runelite/cache/script/Instructions.java @@ -505,6 +505,8 @@ public class Instructions implements Opcodes add(CHAT_SETMESSAGEFILTER, "chat_setmessagefilter"); add(CHAT_GETMESSAGEFILTER, "chat_getmessagefilter"); add(WRITECONSOLE, "writeconsole"); + add(CHAT_GETHISTORYEX_BYTYPEANDLINE, "chat_gethistoryex_bytypeandline"); + add(CHAT_GETHISTORYEX_BYUID, "chat_gethistoryex_byuid"); add(GETWINDOWMODE, "getwindowmode"); add(SETWINDOWMODE, "setwindowmode"); add(GETDEFAULTWINDOWMODE, "getdefaultwindowmode"); diff --git a/cache/src/main/java/net/runelite/cache/script/Opcodes.java b/cache/src/main/java/net/runelite/cache/script/Opcodes.java index 5db3b0b495..04b942677c 100644 --- a/cache/src/main/java/net/runelite/cache/script/Opcodes.java +++ b/cache/src/main/java/net/runelite/cache/script/Opcodes.java @@ -497,6 +497,8 @@ public interface Opcodes int CHAT_SETMESSAGEFILTER = 5021; int CHAT_GETMESSAGEFILTER = 5022; int WRITECONSOLE = 5023; + int CHAT_GETHISTORYEX_BYTYPEANDLINE = 5030; + int CHAT_GETHISTORYEX_BYUID = 5031; int GETWINDOWMODE = 5306; int SETWINDOWMODE = 5307; int GETDEFAULTWINDOWMODE = 5308; diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/timestamp/TimestampPlugin.java b/runelite-client/src/main/java/net/runelite/client/plugins/timestamp/TimestampPlugin.java index 1ab3510d7e..5ea68dc7d6 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/timestamp/TimestampPlugin.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/timestamp/TimestampPlugin.java @@ -36,13 +36,11 @@ import javax.inject.Inject; import lombok.Getter; import net.runelite.api.Client; import net.runelite.api.MessageNode; -import net.runelite.api.ScriptID; import net.runelite.api.Varbits; -import net.runelite.api.events.ScriptPreFired; -import net.runelite.client.events.ConfigChanged; import net.runelite.api.events.ScriptCallbackEvent; import net.runelite.client.config.ConfigManager; import net.runelite.client.eventbus.Subscribe; +import net.runelite.client.events.ConfigChanged; import net.runelite.client.plugins.Plugin; import net.runelite.client.plugins.PluginDescriptor; import net.runelite.client.util.ColorUtil; @@ -64,8 +62,6 @@ public class TimestampPlugin extends Plugin @Getter private SimpleDateFormat formatter; - private MessageNode currentlyBuildingMessage = null; - @Provides public TimestampConfig provideConfig(final ConfigManager configManager) { @@ -102,51 +98,18 @@ public class TimestampPlugin extends Plugin } int uid = client.getIntStack()[client.getIntStackSize() - 1]; - currentlyBuildingMessage = client.getMessages().get(uid); - } + final MessageNode messageNode = client.getMessages().get(uid); + assert messageNode != null : "chat message build for unknown message"; - @Subscribe - private void onScriptPreFired(ScriptPreFired ev) - { - int numStringArgs; - int messagePrefixArg = 0; - switch (ev.getScriptId()) - { - case ScriptID.CHATBOX_BUILD_LINE_WITHOUT_USER: - numStringArgs = 1; - break; - case ScriptID.CHATBOX_BUILD_LINE_WITH_USER: - numStringArgs = 2; - break; - case ScriptID.CHATBOX_BUILD_LINE_WITH_CLAN: - numStringArgs = 3; - break; - default: - return; - } - - if (currentlyBuildingMessage == null) - { - return; - } - - MessageNode messageNode = currentlyBuildingMessage; - currentlyBuildingMessage = null; - - String[] stringStack = client.getStringStack(); - int stringArgStart = client.getStringStackSize() - numStringArgs; - - String timestamp = generateTimestamp(messageNode.getTimestamp(), ZoneId.systemDefault()) + " "; + String timestamp = generateTimestamp(messageNode.getTimestamp(), ZoneId.systemDefault()); Color timestampColour = getTimestampColour(); if (timestampColour != null) { timestamp = ColorUtil.wrapWithColorTag(timestamp, timestampColour); } - - String segment = stringStack[stringArgStart + messagePrefixArg]; - segment = timestamp + segment; - stringStack[stringArgStart + messagePrefixArg] = segment; + + client.getStringStack()[client.getStringStackSize() - 1] = timestamp; } private Color getTimestampColour() diff --git a/runelite-client/src/main/scripts/ChatBuilder.rs2asm b/runelite-client/src/main/scripts/ChatBuilder.rs2asm index 9f41e7476c..661deae39a 100644 --- a/runelite-client/src/main/scripts/ChatBuilder.rs2asm +++ b/runelite-client/src/main/scripts/ChatBuilder.rs2asm @@ -343,9 +343,9 @@ LABEL319: jump LABEL1598 LABEL323: iload 10 - 5031 + chat_gethistoryex_byuid istore 21 - sstore 18 + sstore 18 ; timestamp istore 15 sstore 15 sstore 14 @@ -390,9 +390,11 @@ LABEL341: jump LABEL1594 LABEL355: iload 10 ; message uid + sload 18 ; message timestamp sconst "chatMessageBuilding" runelite_callback pop_int ; pop uid + sstore 18 ; message timestamp iload 11 switch 1: LABEL358 diff --git a/runelite-client/src/main/scripts/ChatSplitBuilder.rs2asm b/runelite-client/src/main/scripts/ChatSplitBuilder.rs2asm index f3ae3b3796..0cdc0e3730 100644 --- a/runelite-client/src/main/scripts/ChatSplitBuilder.rs2asm +++ b/runelite-client/src/main/scripts/ChatSplitBuilder.rs2asm @@ -381,9 +381,9 @@ LABEL344: jump LABEL566 LABEL350: iload 12 - 5031 + chat_gethistoryex_byuid istore 15 - sstore 2 + sstore 2 ; timestamp istore 14 sstore 0 sstore 3 @@ -413,9 +413,11 @@ CHAT_FILTER: jump LABEL562 LABEL368: iload 12 ; message uid + sload 2 ; message timestamp sconst "chatMessageBuilding" runelite_callback - pop_int + pop_int + sstore 2 ; message timestamp iload 18 switch 3: LABEL371 From 60f920694e1c9d79c913371cb2af893d312fa8b1 Mon Sep 17 00:00:00 2001 From: Adam Date: Tue, 16 Nov 2021 12:44:08 -0500 Subject: [PATCH 05/10] timestamp: immediately apply color config changes --- .../plugins/timestamp/TimestampConfig.java | 4 +++- .../plugins/timestamp/TimestampPlugin.java | 18 ++++++++++++++++-- 2 files changed, 19 insertions(+), 3 deletions(-) diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/timestamp/TimestampConfig.java b/runelite-client/src/main/java/net/runelite/client/plugins/timestamp/TimestampConfig.java index b2229c9280..d4e73e416f 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/timestamp/TimestampConfig.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/timestamp/TimestampConfig.java @@ -29,9 +29,11 @@ import net.runelite.client.config.Config; import net.runelite.client.config.ConfigGroup; import net.runelite.client.config.ConfigItem; -@ConfigGroup("timestamp") +@ConfigGroup(TimestampConfig.GROUP) public interface TimestampConfig extends Config { + String GROUP = "timestamp"; + @ConfigItem( keyName = "opaqueTimestamp", name = "Timestamps (opaque)", diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/timestamp/TimestampPlugin.java b/runelite-client/src/main/java/net/runelite/client/plugins/timestamp/TimestampPlugin.java index 5ea68dc7d6..d65fe2e2e9 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/timestamp/TimestampPlugin.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/timestamp/TimestampPlugin.java @@ -36,8 +36,10 @@ import javax.inject.Inject; import lombok.Getter; import net.runelite.api.Client; import net.runelite.api.MessageNode; +import net.runelite.api.ScriptID; import net.runelite.api.Varbits; import net.runelite.api.events.ScriptCallbackEvent; +import net.runelite.client.callback.ClientThread; import net.runelite.client.config.ConfigManager; import net.runelite.client.eventbus.Subscribe; import net.runelite.client.events.ConfigChanged; @@ -56,6 +58,9 @@ public class TimestampPlugin extends Plugin @Inject private Client client; + @Inject + private ClientThread clientThread; + @Inject private TimestampConfig config; @@ -83,9 +88,18 @@ public class TimestampPlugin extends Plugin @Subscribe public void onConfigChanged(ConfigChanged event) { - if (event.getGroup().equals("timestamp") && event.getKey().equals("format")) + if (event.getGroup().equals(TimestampConfig.GROUP)) { - updateFormatter(); + switch (event.getKey()) + { + case "format": + updateFormatter(); + break; + case "opaqueTimestamp": + case "transparentTimestamp": + clientThread.invokeLater(() -> client.runScript(ScriptID.SPLITPM_CHANGED)); + break; + } } } From 4e13233ef7058c50e9aef9333324313f43e668d1 Mon Sep 17 00:00:00 2001 From: RuneLite Cache-Code Autoupdater Date: Tue, 16 Nov 2021 13:16:40 -0700 Subject: [PATCH 06/10] Update Scripts to 2021-11-17 --- .../main/scripts/LayoutResizableStones.hash | 2 +- .../main/scripts/LayoutResizableStones.rs2asm | 32 +++++++++---------- .../scripts/ToplevelChatboxBackground.hash | 2 +- .../scripts/ToplevelChatboxBackground.rs2asm | 2 +- 4 files changed, 19 insertions(+), 19 deletions(-) diff --git a/runelite-client/src/main/scripts/LayoutResizableStones.hash b/runelite-client/src/main/scripts/LayoutResizableStones.hash index 31a96308cd..9a1829643f 100644 --- a/runelite-client/src/main/scripts/LayoutResizableStones.hash +++ b/runelite-client/src/main/scripts/LayoutResizableStones.hash @@ -1 +1 @@ -B5F4C856AEC94322FC7E2981920A8982FE331A300DD36FA0872840B7FA5A4C01 \ No newline at end of file +030CB9830EAD6F61CFC5ED1CA60AE3434900998EFB8237E9C750321775312072 \ No newline at end of file diff --git a/runelite-client/src/main/scripts/LayoutResizableStones.rs2asm b/runelite-client/src/main/scripts/LayoutResizableStones.rs2asm index 770fbd8fce..de6ca3f0f8 100644 --- a/runelite-client/src/main/scripts/LayoutResizableStones.rs2asm +++ b/runelite-client/src/main/scripts/LayoutResizableStones.rs2asm @@ -122,7 +122,7 @@ LABEL89: LABEL96: clientclock set_varc_int 384 - invoke 2357 + invoke 1445 iconst 1 if_icmpeq LABEL102 jump LABEL106 @@ -172,7 +172,7 @@ LABEL131: LABEL138: clientclock set_varc_int 384 - invoke 2357 + invoke 1445 iconst 1 if_icmpeq LABEL144 jump LABEL148 @@ -217,15 +217,15 @@ LABEL169: jump LABEL180 LABEL176: iconst 1 - iconst 39387174 + iconst 39387162 if_sethide jump LABEL235 LABEL180: iconst 0 - iconst 39387174 + iconst 39387162 if_sethide iconst 1 - iconst 39387174 + iconst 39387162 2308 get_varbit 6255 switch @@ -235,38 +235,38 @@ LABEL180: jump LABEL213 LABEL189: iconst 1718 - iconst 39387176 + iconst 39387181 if_setgraphic iconst 1 sconst "Toggle single-tap mode" - iconst 39387174 + iconst 39387162 if_setop jump LABEL220 LABEL197: iconst 1717 - iconst 39387176 + iconst 39387181 if_setgraphic iconst 1 sconst "Toggle tap-to-drop mode" - iconst 39387174 + iconst 39387162 if_setop jump LABEL220 LABEL205: iconst 1716 - iconst 39387176 + iconst 39387181 if_setgraphic iconst 1 sconst "Show Keyboard" - iconst 39387174 + iconst 39387162 if_setop jump LABEL220 LABEL213: iconst 1715 - iconst 39387176 + iconst 39387181 if_setgraphic iconst 1 sconst "" - iconst 39387174 + iconst 39387162 if_setop LABEL220: get_varbit 6255 @@ -280,18 +280,18 @@ LABEL224: jump LABEL232 LABEL228: iconst 155 - iconst 39387176 + iconst 39387181 if_settrans jump LABEL235 LABEL232: iconst 0 - iconst 39387176 + iconst 39387181 if_settrans LABEL235: invoke 2581 get_varbit 6254 invoke 633 - iconst 39387165 + iconst 39387173 if_sethide invoke 2526 pop_int diff --git a/runelite-client/src/main/scripts/ToplevelChatboxBackground.hash b/runelite-client/src/main/scripts/ToplevelChatboxBackground.hash index ea2bd47d4f..e928cac148 100644 --- a/runelite-client/src/main/scripts/ToplevelChatboxBackground.hash +++ b/runelite-client/src/main/scripts/ToplevelChatboxBackground.hash @@ -1 +1 @@ -1BB0517CD647510451A0AF5FC160252892F4C3627BED106FEDEE44E62027A2D4 \ No newline at end of file +CAF61FF2A3131623A421CCCC68914587A69044768DEB79432DA8A85937283F7B \ No newline at end of file diff --git a/runelite-client/src/main/scripts/ToplevelChatboxBackground.rs2asm b/runelite-client/src/main/scripts/ToplevelChatboxBackground.rs2asm index b5ceb426f6..9d9a3c7001 100644 --- a/runelite-client/src/main/scripts/ToplevelChatboxBackground.rs2asm +++ b/runelite-client/src/main/scripts/ToplevelChatboxBackground.rs2asm @@ -221,7 +221,7 @@ LABEL183: if_icmpeq LABEL189 jump LABEL417 LABEL189: - invoke 2357 + invoke 1445 iconst 1 if_icmpeq LABEL193 jump LABEL267 From 2f3564e6e02f19c6481a4be0f6bdd358c0f84e84 Mon Sep 17 00:00:00 2001 From: RuneLite Cache-Code Autoupdater Date: Tue, 16 Nov 2021 13:16:40 -0700 Subject: [PATCH 07/10] Update Item IDs to 2021-11-17 --- .../src/main/java/net/runelite/api/ItemID.java | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) 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 5fbd2f3188..6f749b7a1f 100644 --- a/runelite-api/src/main/java/net/runelite/api/ItemID.java +++ b/runelite-api/src/main/java/net/runelite/api/ItemID.java @@ -1933,13 +1933,13 @@ public final class ItemID public static final int RUNE_SPEARKP = 3175; public static final int DRAGON_SPEARKP = 3176; public static final int LEFTHANDED_BANANA = 3177; - public static final int MONKEY_BONES = 3179; - public static final int MONKEY_BONES_3180 = 3180; - public static final int MONKEY_BONES_3181 = 3181; - public static final int MONKEY_BONES_3182 = 3182; - public static final int MONKEY_BONES_3183 = 3183; - public static final int MONKEY_BONES_3185 = 3185; - public static final int MONKEY_BONES_3186 = 3186; + public static final int SMALL_NINJA_MONKEY_BONES = 3179; + public static final int MEDIUM_NINJA_MONKEY_BONES = 3180; + public static final int GORILLA_BONES = 3181; + public static final int BEARDED_GORILLA_BONES = 3182; + public static final int MONKEY_BONES = 3183; + public static final int SMALL_ZOMBIE_MONKEY_BONES = 3185; + public static final int LARGE_ZOMBIE_MONKEY_BONES = 3186; public static final int BONES_3187 = 3187; public static final int CLEANING_CLOTH = 3188; public static final int BRONZE_HALBERD = 3190; From 6efccf834c7565401653d3e350ef6b950d78cfa5 Mon Sep 17 00:00:00 2001 From: RuneLite Cache-Code Autoupdater Date: Tue, 16 Nov 2021 13:16:40 -0700 Subject: [PATCH 08/10] Update Item variations to 2021-11-17 --- runelite-client/src/main/resources/item_variations.json | 9 --------- 1 file changed, 9 deletions(-) diff --git a/runelite-client/src/main/resources/item_variations.json b/runelite-client/src/main/resources/item_variations.json index 0e8acac8c1..083b901710 100644 --- a/runelite-client/src/main/resources/item_variations.json +++ b/runelite-client/src/main/resources/item_variations.json @@ -3126,15 +3126,6 @@ 3157, 3159 ], - "monkey bones": [ - 3179, - 3180, - 3181, - 3182, - 3183, - 3185, - 3186 - ], "barrel bomb": [ 3218, 3219 From 49749e5873e60831154d0626bcce49ed32bfd4a3 Mon Sep 17 00:00:00 2001 From: Runelite auto updater Date: Wed, 17 Nov 2021 11:55:58 +0000 Subject: [PATCH 09/10] Release 1.8.3 --- cache-client/pom.xml | 2 +- cache-updater/pom.xml | 2 +- cache/pom.xml | 2 +- http-api/pom.xml | 2 +- http-service/pom.xml | 2 +- pom.xml | 4 ++-- runelite-api/pom.xml | 2 +- runelite-client/pom.xml | 2 +- runelite-jshell/pom.xml | 2 +- runelite-script-assembler-plugin/pom.xml | 2 +- 10 files changed, 11 insertions(+), 11 deletions(-) diff --git a/cache-client/pom.xml b/cache-client/pom.xml index 8ab9d7c9bb..acc09961e1 100644 --- a/cache-client/pom.xml +++ b/cache-client/pom.xml @@ -29,7 +29,7 @@ net.runelite runelite-parent - 1.8.3-SNAPSHOT + 1.8.3 cache-client diff --git a/cache-updater/pom.xml b/cache-updater/pom.xml index aa21916a0b..a6551bd2ef 100644 --- a/cache-updater/pom.xml +++ b/cache-updater/pom.xml @@ -28,7 +28,7 @@ net.runelite runelite-parent - 1.8.3-SNAPSHOT + 1.8.3 Cache Updater diff --git a/cache/pom.xml b/cache/pom.xml index a1fe40bd78..2869d91f80 100644 --- a/cache/pom.xml +++ b/cache/pom.xml @@ -29,7 +29,7 @@ net.runelite runelite-parent - 1.8.3-SNAPSHOT + 1.8.3 cache diff --git a/http-api/pom.xml b/http-api/pom.xml index 7209c702cc..1872665da8 100644 --- a/http-api/pom.xml +++ b/http-api/pom.xml @@ -28,7 +28,7 @@ net.runelite runelite-parent - 1.8.3-SNAPSHOT + 1.8.3 Web API diff --git a/http-service/pom.xml b/http-service/pom.xml index 6fadc2eeaa..799c265781 100644 --- a/http-service/pom.xml +++ b/http-service/pom.xml @@ -28,7 +28,7 @@ net.runelite runelite-parent - 1.8.3-SNAPSHOT + 1.8.3 Web Service diff --git a/pom.xml b/pom.xml index cd07b0ef98..7b3971a698 100644 --- a/pom.xml +++ b/pom.xml @@ -28,7 +28,7 @@ net.runelite runelite-parent - 1.8.3-SNAPSHOT + 1.8.3 pom RuneLite @@ -61,7 +61,7 @@ https://github.com/runelite/runelite scm:git:git://github.com/runelite/runelite scm:git:git@github.com:runelite/runelite - HEAD + runelite-parent-1.8.3 diff --git a/runelite-api/pom.xml b/runelite-api/pom.xml index 165be23929..1595998bfa 100644 --- a/runelite-api/pom.xml +++ b/runelite-api/pom.xml @@ -29,7 +29,7 @@ net.runelite runelite-parent - 1.8.3-SNAPSHOT + 1.8.3 runelite-api diff --git a/runelite-client/pom.xml b/runelite-client/pom.xml index c1f6796433..ddc875b827 100644 --- a/runelite-client/pom.xml +++ b/runelite-client/pom.xml @@ -29,7 +29,7 @@ net.runelite runelite-parent - 1.8.3-SNAPSHOT + 1.8.3 client diff --git a/runelite-jshell/pom.xml b/runelite-jshell/pom.xml index 99fd4a79bc..f409d398bd 100644 --- a/runelite-jshell/pom.xml +++ b/runelite-jshell/pom.xml @@ -30,7 +30,7 @@ net.runelite runelite-parent - 1.8.3-SNAPSHOT + 1.8.3 jshell diff --git a/runelite-script-assembler-plugin/pom.xml b/runelite-script-assembler-plugin/pom.xml index 1c75301eae..d6a895d9c3 100644 --- a/runelite-script-assembler-plugin/pom.xml +++ b/runelite-script-assembler-plugin/pom.xml @@ -29,7 +29,7 @@ net.runelite runelite-parent - 1.8.3-SNAPSHOT + 1.8.3 script-assembler-plugin From 48b12dcf67856d83fe97bc2abb7923fbbad4dc8a Mon Sep 17 00:00:00 2001 From: Runelite auto updater Date: Wed, 17 Nov 2021 11:56:06 +0000 Subject: [PATCH 10/10] Bump for 1.8.4-SNAPSHOT --- cache-client/pom.xml | 2 +- cache-updater/pom.xml | 2 +- cache/pom.xml | 2 +- http-api/pom.xml | 2 +- http-service/pom.xml | 2 +- pom.xml | 4 ++-- runelite-api/pom.xml | 2 +- runelite-client/pom.xml | 2 +- runelite-jshell/pom.xml | 2 +- runelite-script-assembler-plugin/pom.xml | 2 +- 10 files changed, 11 insertions(+), 11 deletions(-) diff --git a/cache-client/pom.xml b/cache-client/pom.xml index acc09961e1..eee1614e44 100644 --- a/cache-client/pom.xml +++ b/cache-client/pom.xml @@ -29,7 +29,7 @@ net.runelite runelite-parent - 1.8.3 + 1.8.4-SNAPSHOT cache-client diff --git a/cache-updater/pom.xml b/cache-updater/pom.xml index a6551bd2ef..6e1d543063 100644 --- a/cache-updater/pom.xml +++ b/cache-updater/pom.xml @@ -28,7 +28,7 @@ net.runelite runelite-parent - 1.8.3 + 1.8.4-SNAPSHOT Cache Updater diff --git a/cache/pom.xml b/cache/pom.xml index 2869d91f80..50163f1c6c 100644 --- a/cache/pom.xml +++ b/cache/pom.xml @@ -29,7 +29,7 @@ net.runelite runelite-parent - 1.8.3 + 1.8.4-SNAPSHOT cache diff --git a/http-api/pom.xml b/http-api/pom.xml index 1872665da8..3e6f07b598 100644 --- a/http-api/pom.xml +++ b/http-api/pom.xml @@ -28,7 +28,7 @@ net.runelite runelite-parent - 1.8.3 + 1.8.4-SNAPSHOT Web API diff --git a/http-service/pom.xml b/http-service/pom.xml index 799c265781..248bc5f3fa 100644 --- a/http-service/pom.xml +++ b/http-service/pom.xml @@ -28,7 +28,7 @@ net.runelite runelite-parent - 1.8.3 + 1.8.4-SNAPSHOT Web Service diff --git a/pom.xml b/pom.xml index 7b3971a698..1eb07f1c35 100644 --- a/pom.xml +++ b/pom.xml @@ -28,7 +28,7 @@ net.runelite runelite-parent - 1.8.3 + 1.8.4-SNAPSHOT pom RuneLite @@ -61,7 +61,7 @@ https://github.com/runelite/runelite scm:git:git://github.com/runelite/runelite scm:git:git@github.com:runelite/runelite - runelite-parent-1.8.3 + HEAD diff --git a/runelite-api/pom.xml b/runelite-api/pom.xml index 1595998bfa..752a56d924 100644 --- a/runelite-api/pom.xml +++ b/runelite-api/pom.xml @@ -29,7 +29,7 @@ net.runelite runelite-parent - 1.8.3 + 1.8.4-SNAPSHOT runelite-api diff --git a/runelite-client/pom.xml b/runelite-client/pom.xml index ddc875b827..df93eb8065 100644 --- a/runelite-client/pom.xml +++ b/runelite-client/pom.xml @@ -29,7 +29,7 @@ net.runelite runelite-parent - 1.8.3 + 1.8.4-SNAPSHOT client diff --git a/runelite-jshell/pom.xml b/runelite-jshell/pom.xml index f409d398bd..6016943c61 100644 --- a/runelite-jshell/pom.xml +++ b/runelite-jshell/pom.xml @@ -30,7 +30,7 @@ net.runelite runelite-parent - 1.8.3 + 1.8.4-SNAPSHOT jshell diff --git a/runelite-script-assembler-plugin/pom.xml b/runelite-script-assembler-plugin/pom.xml index d6a895d9c3..1ec4f39f5c 100644 --- a/runelite-script-assembler-plugin/pom.xml +++ b/runelite-script-assembler-plugin/pom.xml @@ -29,7 +29,7 @@ net.runelite runelite-parent - 1.8.3 + 1.8.4-SNAPSHOT script-assembler-plugin