diff --git a/buildSrc/src/main/kotlin/Dependencies.kt b/buildSrc/src/main/kotlin/Dependencies.kt index f7392fd147..542f07ca71 100644 --- a/buildSrc/src/main/kotlin/Dependencies.kt +++ b/buildSrc/src/main/kotlin/Dependencies.kt @@ -27,7 +27,7 @@ object ProjectVersions { const val launcherVersion = "2.2.0" const val rlVersion = "1.6.15" - const val openosrsVersion = "3.3.2" + const val openosrsVersion = "3.3.3" const val rsversion = 189 const val cacheversion = 165 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 674b94baf2..5800134495 100644 --- a/runelite-api/src/main/java/net/runelite/api/ScriptID.java +++ b/runelite-api/src/main/java/net/runelite/api/ScriptID.java @@ -317,4 +317,16 @@ public final class ScriptID */ @ScriptArguments(integer = 1) public static final int PVP_WIDGET_BUILDER = 388; + + /** + * Called to build the combat interface + */ + @ScriptArguments + public static final int COMBAT_INTERFACE_SETUP = 420; + + /** + * Called to build the toplevel interface + */ + @ScriptArguments(integer = 2) + public static final int TOPLEVEL_REDRAW = 907; } 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 ead6a62dd1..fe4fc32221 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 @@ -324,8 +324,8 @@ public class WidgetID static final int DEPOSIT_EQUIPMENT = 43; static final int INCINERATOR = 45; static final int INCINERATOR_CONFIRM = 46; - static final int EQUIPMENT_CONTENT_CONTAINER = 67; - static final int EQUIPMENT_BUTTON = 108; + static final int EQUIPMENT_CONTENT_CONTAINER = 68; + static final int EQUIPMENT_BUTTON = 109; } static class GrandExchange @@ -1282,6 +1282,7 @@ public class WidgetID // Also used for many other interfaces! static class BankPin { + static final int CONTAINER = 0; static final int TOP_LEFT_TEXT = 2; static final int FIRST_ENTERED = 3; static final int SECOND_ENTERED = 4; 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 db618eede3..89a2d73399 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 @@ -165,6 +165,7 @@ public enum WidgetInfo BANK_ITEM_COUNT_TOP(WidgetID.BANK_GROUP_ID, WidgetID.Bank.ITEM_COUNT_TOP), BANK_ITEM_COUNT_BAR(WidgetID.BANK_GROUP_ID, WidgetID.Bank.ITEM_COUNT_BAR), BANK_ITEM_COUNT_BOTTOM(WidgetID.BANK_GROUP_ID, WidgetID.Bank.ITEM_COUNT_BOTTOM), + BANK_PIN_CONTAINER(WidgetID.BANK_PIN_GROUP_ID, WidgetID.BankPin.CONTAINER), GRAND_EXCHANGE_WINDOW_CONTAINER(WidgetID.GRAND_EXCHANGE_GROUP_ID, WidgetID.GrandExchange.WINDOW_CONTAINER), GRAND_EXCHANGE_OFFER_CONTAINER(WidgetID.GRAND_EXCHANGE_GROUP_ID, WidgetID.GrandExchange.OFFER_CONTAINER), diff --git a/runelite-client/src/main/java/net/runelite/client/config/RuneLiteConfig.java b/runelite-client/src/main/java/net/runelite/client/config/RuneLiteConfig.java index b41814525c..428ceeef6e 100644 --- a/runelite-client/src/main/java/net/runelite/client/config/RuneLiteConfig.java +++ b/runelite-client/src/main/java/net/runelite/client/config/RuneLiteConfig.java @@ -24,12 +24,14 @@ */ package net.runelite.client.config; +import java.awt.Color; import java.awt.Dimension; import java.awt.event.InputEvent; import java.awt.event.KeyEvent; import net.runelite.api.Constants; import net.runelite.client.Notifier; import net.runelite.client.ui.ContainableFrame; +import net.runelite.client.ui.overlay.components.ComponentConstants; @ConfigGroup(RuneLiteConfig.GROUP_NAME) public interface RuneLiteConfig extends Config @@ -348,11 +350,24 @@ public interface RuneLiteConfig extends Config return true; } + @ConfigItem( + keyName = "overlayBackgroundColor", + name = "Overlay Color", + description = "Configures the background color of infoboxes and overlays", + position = 27, + titleSection = "overlayTitle" + ) + @Alpha + default Color overlayBackgroundColor() + { + return ComponentConstants.STANDARD_BACKGROUND_COLOR; + } + @ConfigTitleSection( keyName = "infoboxTitle", name = "Infoboxes", description = "", - position = 27 + position = 28 ) default Title infoboxTitle() { @@ -363,7 +378,7 @@ public interface RuneLiteConfig extends Config keyName = "infoBoxVertical", name = "Display infoboxes vertically", description = "Toggles the infoboxes to display vertically", - position = 28, + position = 29, titleSection = "infoboxTitle" ) default boolean infoBoxVertical() diff --git a/runelite-client/src/main/java/net/runelite/client/ui/overlay/OverlayManager.java b/runelite-client/src/main/java/net/runelite/client/ui/overlay/OverlayManager.java index 638c2a7d49..972907096f 100644 --- a/runelite-client/src/main/java/net/runelite/client/ui/overlay/OverlayManager.java +++ b/runelite-client/src/main/java/net/runelite/client/ui/overlay/OverlayManager.java @@ -47,6 +47,7 @@ import net.runelite.client.config.ConfigGroup; import net.runelite.client.config.ConfigManager; import net.runelite.client.config.RuneLiteConfig; import net.runelite.client.eventbus.EventBus; +import net.runelite.client.events.ConfigChanged; import net.runelite.client.events.OverlayMenuClicked; import net.runelite.client.events.PluginChanged; @@ -104,15 +105,28 @@ public class OverlayManager private final ConfigManager configManager; private final EventBus eventBus; + private final RuneLiteConfig runeLiteConfig; @Inject - private OverlayManager(final ConfigManager configManager, final EventBus eventBus) + private OverlayManager(final ConfigManager configManager, final EventBus eventBus, final RuneLiteConfig runeLiteConfig) { this.configManager = configManager; this.eventBus = eventBus; + this.runeLiteConfig = runeLiteConfig; eventBus.subscribe(PluginChanged.class, this, this::onPluginChanged); eventBus.subscribe(MenuOptionClicked.class, this, this::onMenuOptionClicked); + eventBus.subscribe(ConfigChanged.class, this, this::onConfigChanged); + } + + public void onConfigChanged(final ConfigChanged event) + { + if (!RuneLiteConfig.GROUP_NAME.equals(event.getGroup()) || !"overlayBackgroundColor".equals(event.getKey())) + { + return; + } + + overlays.forEach(this::updateOverlayConfig); } private void onPluginChanged(final PluginChanged event) @@ -169,12 +183,15 @@ public class OverlayManager // Add is always true overlays.add(overlay); loadOverlay(overlay); + updateOverlayConfig(overlay); + // WidgetItemOverlays have a reference to the overlay manager in order to get the WidgetItems // for each frame. if (overlay instanceof WidgetItemOverlay) { ((WidgetItemOverlay) overlay).setOverlayManager(this); } + rebuildOverlayLayers(); return true; } @@ -302,6 +319,15 @@ public class OverlayManager overlay.setPreferredPosition(position); } + private void updateOverlayConfig(final Overlay overlay) + { + if (overlay instanceof OverlayPanel) + { + // Update preferred color for overlay panels based on configuration + ((OverlayPanel) overlay).setPreferredColor(runeLiteConfig.overlayBackgroundColor()); + } + } + private void saveOverlayLocation(final Overlay overlay) { final String key = overlay.getName() + OVERLAY_CONFIG_PREFERRED_LOCATION; diff --git a/runelite-client/src/main/java/net/runelite/client/ui/overlay/OverlayPanel.java b/runelite-client/src/main/java/net/runelite/client/ui/overlay/OverlayPanel.java index 4ccbdebc70..6d749b765f 100644 --- a/runelite-client/src/main/java/net/runelite/client/ui/overlay/OverlayPanel.java +++ b/runelite-client/src/main/java/net/runelite/client/ui/overlay/OverlayPanel.java @@ -24,6 +24,7 @@ */ package net.runelite.client.ui.overlay; +import java.awt.Color; import java.awt.Dimension; import java.awt.Graphics2D; import lombok.Getter; @@ -49,6 +50,11 @@ public abstract class OverlayPanel extends Overlay */ private boolean dynamicFont = false; + /** + * Preferred color used for panel component background + */ + private Color preferredColor = null; + protected OverlayPanel() { super(); @@ -83,6 +89,13 @@ public abstract class OverlayPanel extends Overlay } } + final Color oldBackgroundColor = panelComponent.getBackgroundColor(); + + if (getPreferredColor() != null && ComponentConstants.STANDARD_BACKGROUND_COLOR.equals(oldBackgroundColor)) + { + panelComponent.setBackgroundColor(getPreferredColor()); + } + final Dimension dimension = panelComponent.render(graphics); if (clearChildren) @@ -91,6 +104,7 @@ public abstract class OverlayPanel extends Overlay } panelComponent.setPreferredSize(oldSize); + panelComponent.setBackgroundColor(oldBackgroundColor); return dimension; } } 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 8446f25ca5..9c5a4ac86e 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 @@ -31,7 +31,6 @@ import java.awt.Point; import java.awt.Rectangle; import java.util.ArrayList; import java.util.List; -import javax.annotation.Nullable; import lombok.Getter; import lombok.Setter; import net.runelite.client.ui.overlay.components.table.TableComponent; @@ -49,7 +48,7 @@ public class PanelComponent implements LayoutableRenderableEntity private Dimension preferredSize = new Dimension(ComponentConstants.STANDARD_WIDTH, 0); @Setter - @Nullable + @Getter private Color backgroundColor = ComponentConstants.STANDARD_BACKGROUND_COLOR; @Getter diff --git a/runelite-client/src/main/java/net/runelite/client/ui/overlay/infobox/InfoBoxOverlay.java b/runelite-client/src/main/java/net/runelite/client/ui/overlay/infobox/InfoBoxOverlay.java index b917a38e6b..c04da4b6ee 100644 --- a/runelite-client/src/main/java/net/runelite/client/ui/overlay/infobox/InfoBoxOverlay.java +++ b/runelite-client/src/main/java/net/runelite/client/ui/overlay/infobox/InfoBoxOverlay.java @@ -111,6 +111,7 @@ public class InfoBoxOverlay extends OverlayPanel infoBoxComponent.setImage(box.getScaledImage()); infoBoxComponent.setTooltip(box.getTooltip()); infoBoxComponent.setPreferredSize(new Dimension(config.infoBoxSize(), config.infoBoxSize())); + infoBoxComponent.setBackgroundColor(config.overlayBackgroundColor()); panelComponent.getChildren().add(infoBoxComponent); } diff --git a/runelite-client/src/main/scripts/BankSearchLayout.hash b/runelite-client/src/main/scripts/BankSearchLayout.hash index 0f68a772dc..eb4360c955 100644 --- a/runelite-client/src/main/scripts/BankSearchLayout.hash +++ b/runelite-client/src/main/scripts/BankSearchLayout.hash @@ -1 +1 @@ -9E3153DE24555E18FA425035D1C8929EECE4C44E6CFEA11CA186B7DA0AE830AF \ No newline at end of file +D32D30CB1B79698A15B3314C3782659FF25382008857E7CEB07CA17C1CD5E62A \ No newline at end of file diff --git a/runelite-client/src/main/scripts/BankSearchLayout.rs2asm b/runelite-client/src/main/scripts/BankSearchLayout.rs2asm index fe791a94b8..6a8373826f 100644 --- a/runelite-client/src/main/scripts/BankSearchLayout.rs2asm +++ b/runelite-client/src/main/scripts/BankSearchLayout.rs2asm @@ -65,6 +65,15 @@ LABEL36: iload 17 iload 13 if_sethide + iload 16 + invoke 3369 + iconst 3368 + iload 16 + iconst 1141 + iconst 1 + sconst "IY" + iload 16 + if_setonvartransmit iconst 441 iconst 0 iconst 0 @@ -79,14 +88,14 @@ LABEL36: if_setposition get_varbit 8352 iconst 1 - if_icmpeq LABEL58 - jump LABEL85 -LABEL58: + if_icmpeq LABEL67 + jump LABEL94 +LABEL67: get_varbit 5364 iconst 0 - if_icmpeq LABEL62 - jump LABEL85 -LABEL62: + if_icmpeq LABEL71 + jump LABEL94 +LABEL71: iload 12 if_getx iload 12 @@ -109,51 +118,51 @@ LABEL62: iconst 0 iload 4 if_setsize - jump LABEL121 -LABEL85: + jump LABEL130 +LABEL94: get_varbit 8352 iconst 0 - if_icmpeq LABEL89 - jump LABEL100 -LABEL89: + if_icmpeq LABEL98 + jump LABEL109 +LABEL98: get_varbit 5364 iconst 1 - if_icmpeq LABEL93 - jump LABEL100 -LABEL93: + if_icmpeq LABEL102 + jump LABEL109 +LABEL102: iconst 37 iconst 37 iconst 1 iconst 0 iload 4 if_setsize - jump LABEL121 -LABEL100: + jump LABEL130 +LABEL109: get_varbit 8352 iconst 1 - if_icmpeq LABEL104 - jump LABEL115 -LABEL104: + if_icmpeq LABEL113 + jump LABEL124 +LABEL113: get_varbit 5364 iconst 1 - if_icmpeq LABEL108 - jump LABEL115 -LABEL108: + if_icmpeq LABEL117 + jump LABEL124 +LABEL117: iconst 74 iconst 37 iconst 1 iconst 0 iload 4 if_setsize - jump LABEL121 -LABEL115: + jump LABEL130 +LABEL124: iconst 0 iconst 37 iconst 1 iconst 0 iload 4 if_setsize -LABEL121: +LABEL130: iconst 1 iload 10 if_sethide @@ -163,52 +172,52 @@ LABEL121: istore 18 get_varbit 4170 iconst 3 - if_icmpeq LABEL132 - jump LABEL165 -LABEL132: + if_icmpeq LABEL141 + jump LABEL174 +LABEL141: get_varbit 4171 iconst 0 - if_icmpgt LABEL160 + if_icmpgt LABEL169 get_varbit 4172 iconst 0 - if_icmpgt LABEL160 + if_icmpgt LABEL169 get_varbit 4173 iconst 0 - if_icmpgt LABEL160 + if_icmpgt LABEL169 get_varbit 4174 iconst 0 - if_icmpgt LABEL160 + if_icmpgt LABEL169 get_varbit 4175 iconst 0 - if_icmpgt LABEL160 + if_icmpgt LABEL169 get_varbit 4176 iconst 0 - if_icmpgt LABEL160 + if_icmpgt LABEL169 get_varbit 4177 iconst 0 - if_icmpgt LABEL160 + if_icmpgt LABEL169 get_varbit 4178 iconst 0 - if_icmpgt LABEL160 + if_icmpgt LABEL169 get_varbit 4179 iconst 0 - if_icmpgt LABEL160 - jump LABEL163 -LABEL160: + if_icmpgt LABEL169 + jump LABEL172 +LABEL169: iconst 0 istore 18 - jump LABEL165 -LABEL163: + jump LABEL174 +LABEL172: iconst 1 istore 18 -LABEL165: +LABEL174: iconst 0 istore 19 iload 18 iconst 1 - if_icmpeq LABEL171 - jump LABEL195 -LABEL171: + if_icmpeq LABEL180 + jump LABEL204 +LABEL180: iconst 1 iload 8 if_sethide @@ -232,8 +241,8 @@ LABEL171: iconst 0 iload 1 if_setposition - jump LABEL216 -LABEL195: + jump LABEL225 +LABEL204: iconst 0 iload 8 if_sethide @@ -255,7 +264,7 @@ LABEL195: iconst 0 iload 1 if_setposition -LABEL216: +LABEL225: iload 3 iload 2 invoke 231 @@ -267,28 +276,28 @@ LABEL216: multiply add istore 21 -LABEL227: +LABEL236: iload 20 iload 21 - if_icmple LABEL231 - jump LABEL244 -LABEL231: + if_icmple LABEL240 + jump LABEL253 +LABEL240: iload 2 iload 20 cc_find iconst 1 - if_icmpeq LABEL237 - jump LABEL239 -LABEL237: + if_icmpeq LABEL246 + jump LABEL248 +LABEL246: iconst 1 cc_sethide -LABEL239: +LABEL248: iload 20 iconst 1 add istore 20 - jump LABEL227 -LABEL244: + jump LABEL236 +LABEL253: iconst 0 istore 20 iconst 8 @@ -328,47 +337,47 @@ LABEL244: sstore 0 get_varbit 4150 iconst 0 - if_icmple LABEL288 + if_icmple LABEL297 get_varbit 4150 iconst 9 - if_icmpgt LABEL288 - jump LABEL741 -LABEL288: + if_icmpgt LABEL297 + jump LABEL750 +LABEL297: iload 20 iconst 816 - if_icmplt LABEL292 - jump LABEL317 -LABEL292: + if_icmplt LABEL301 + jump LABEL326 +LABEL301: iload 2 iload 20 cc_find iconst 1 - if_icmpeq LABEL298 - jump LABEL300 -LABEL298: + if_icmpeq LABEL307 + jump LABEL309 +LABEL307: iconst 1 cc_sethide -LABEL300: +LABEL309: iconst 95 iload 20 inv_getobj iconst -1 - if_icmpne LABEL306 - jump LABEL312 -LABEL306: + if_icmpne LABEL315 + jump LABEL321 +LABEL315: iload 29 iconst 1 add iload 20 istore 30 istore 29 -LABEL312: +LABEL321: iload 20 iconst 1 add istore 20 - jump LABEL288 -LABEL317: + jump LABEL297 +LABEL326: get_varbit 4171 get_varbit 4172 add @@ -389,14 +398,14 @@ LABEL317: istore 31 iload 31 iconst 0 - if_icmple LABEL339 - jump LABEL343 -LABEL339: + if_icmple LABEL348 + jump LABEL352 +LABEL348: iconst 816 iconst 1 sub istore 30 -LABEL343: +LABEL352: iconst 0 ; Scroll height variable iconst 0 ; Compare variable iconst 0 ; @@ -431,9 +440,9 @@ CONTINUE_SEARCH: istore 20 get_varbit 4171 iconst 0 - if_icmpgt LABEL370 - jump LABEL400 -LABEL370: + if_icmpgt LABEL379 + jump LABEL409 +LABEL379: iconst 1 iload 2 iload 28 @@ -464,12 +473,12 @@ LABEL370: get_varbit 4171 add istore 20 -LABEL400: +LABEL409: get_varbit 4172 iconst 0 - if_icmpgt LABEL404 - jump LABEL434 -LABEL404: + if_icmpgt LABEL413 + jump LABEL443 +LABEL413: iconst 2 iload 2 iload 28 @@ -500,12 +509,12 @@ LABEL404: get_varbit 4172 add istore 20 -LABEL434: +LABEL443: get_varbit 4173 iconst 0 - if_icmpgt LABEL438 - jump LABEL468 -LABEL438: + if_icmpgt LABEL447 + jump LABEL477 +LABEL447: iconst 3 iload 2 iload 28 @@ -536,12 +545,12 @@ LABEL438: get_varbit 4173 add istore 20 -LABEL468: +LABEL477: get_varbit 4174 iconst 0 - if_icmpgt LABEL472 - jump LABEL502 -LABEL472: + if_icmpgt LABEL481 + jump LABEL511 +LABEL481: iconst 4 iload 2 iload 28 @@ -572,12 +581,12 @@ LABEL472: get_varbit 4174 add istore 20 -LABEL502: +LABEL511: get_varbit 4175 iconst 0 - if_icmpgt LABEL506 - jump LABEL536 -LABEL506: + if_icmpgt LABEL515 + jump LABEL545 +LABEL515: iconst 5 iload 2 iload 28 @@ -608,12 +617,12 @@ LABEL506: get_varbit 4175 add istore 20 -LABEL536: +LABEL545: get_varbit 4176 iconst 0 - if_icmpgt LABEL540 - jump LABEL570 -LABEL540: + if_icmpgt LABEL549 + jump LABEL579 +LABEL549: iconst 6 iload 2 iload 28 @@ -644,12 +653,12 @@ LABEL540: get_varbit 4176 add istore 20 -LABEL570: +LABEL579: get_varbit 4177 iconst 0 - if_icmpgt LABEL574 - jump LABEL604 -LABEL574: + if_icmpgt LABEL583 + jump LABEL613 +LABEL583: iconst 7 iload 2 iload 28 @@ -680,12 +689,12 @@ LABEL574: get_varbit 4177 add istore 20 -LABEL604: +LABEL613: get_varbit 4178 iconst 0 - if_icmpgt LABEL608 - jump LABEL638 -LABEL608: + if_icmpgt LABEL617 + jump LABEL647 +LABEL617: iconst 8 iload 2 iload 28 @@ -716,12 +725,12 @@ LABEL608: get_varbit 4178 add istore 20 -LABEL638: +LABEL647: get_varbit 4179 iconst 0 - if_icmpgt LABEL642 - jump LABEL672 -LABEL642: + if_icmpgt LABEL651 + jump LABEL681 +LABEL651: iconst 9 iload 2 iload 28 @@ -752,21 +761,21 @@ LABEL642: get_varbit 4179 add istore 20 -LABEL672: +LABEL681: invoke 514 iconst 1 - if_icmpeq LABEL676 - jump LABEL717 -LABEL676: + if_icmpeq LABEL685 + jump LABEL726 +LABEL685: get_varc_string 359 ; Skip truncating of varcstr 22 by not calling 280 - lowercase ; instead get the var directly and lowercase it + invoke 280; instead get the var directly and lowercase it sstore 0 sload 0 string_length iconst 0 - if_icmpgt LABEL683 - jump LABEL702 -LABEL683: + if_icmpgt LABEL692 + jump LABEL711 +LABEL692: sconst "Showing items: " sconst "