diff --git a/buildSrc/src/main/kotlin/Dependencies.kt b/buildSrc/src/main/kotlin/Dependencies.kt index 32ec9b482a..d4d70c557c 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.26" - const val openosrsVersion = "3.4.4" + const val openosrsVersion = "3.4.5" const val rsversion = 191 const val cacheversion = 165 diff --git a/runelite-api/src/main/java/net/runelite/api/NullItemID.java b/runelite-api/src/main/java/net/runelite/api/NullItemID.java index a41a2c6c30..aba4e37dc2 100644 --- a/runelite-api/src/main/java/net/runelite/api/NullItemID.java +++ b/runelite-api/src/main/java/net/runelite/api/NullItemID.java @@ -13262,5 +13262,6 @@ public final class NullItemID public static final int NULL_24881 = 24881; public static final int NULL_24883 = 24883; public static final int NULL_24943 = 24943; + public static final int NULL_24945 = 24945; /* This file is automatically generated. Do not edit. */ } diff --git a/runelite-api/src/main/java/net/runelite/api/ObjectID.java b/runelite-api/src/main/java/net/runelite/api/ObjectID.java index 49d79afafc..7073e724e2 100644 --- a/runelite-api/src/main/java/net/runelite/api/ObjectID.java +++ b/runelite-api/src/main/java/net/runelite/api/ObjectID.java @@ -20622,5 +20622,7 @@ public final class ObjectID public static final int DOOR_40325 = 40325; public static final int ROPE_40330 = 40330; public static final int BLOCKAGE_40331 = 40331; + public static final int CRUMBLING_WALL_40355 = 40355; + public static final int ROCKS_40356 = 40356; /* This file is automatically generated. Do not edit. */ } diff --git a/runelite-api/src/main/java/net/runelite/api/Quest.java b/runelite-api/src/main/java/net/runelite/api/Quest.java index 71235e2c54..27d9a88942 100644 --- a/runelite-api/src/main/java/net/runelite/api/Quest.java +++ b/runelite-api/src/main/java/net/runelite/api/Quest.java @@ -178,6 +178,7 @@ public enum Quest SONG_OF_THE_ELVES(603, "Song of the Elves"), THE_FREMENNIK_EXILES(718, "The Fremennik Exiles"), SINS_OF_THE_FATHER(1276, "Sins of the Father"), + A_PORCINE_OF_INTEREST(1690, "A Porcine of Interest"), //Miniquests ENTER_THE_ABYSS(319, "Enter the Abyss"), @@ -192,7 +193,8 @@ public enum Quest LAIR_OF_TARN_RAZORLOR(328, "Lair of Tarn Razorlor"), FAMILY_PEST(329, "Family Pest"), THE_MAGE_ARENA_II(330, "The Mage Arena II"), - IN_SEARCH_OF_KNOWLEDGE(602, "In Search of Knowledge"); + IN_SEARCH_OF_KNOWLEDGE(602, "In Search of Knowledge"), + DADDYS_HOME(1688, "Daddy's Home"); @Getter private final int id; diff --git a/runelite-client/src/main/java/net/runelite/client/game/ItemManager.java b/runelite-client/src/main/java/net/runelite/client/game/ItemManager.java index 109ffcdade..303b2cb09f 100644 --- a/runelite-client/src/main/java/net/runelite/client/game/ItemManager.java +++ b/runelite-client/src/main/java/net/runelite/client/game/ItemManager.java @@ -519,7 +519,7 @@ public class ItemManager */ private BufferedImage loadItemOutline(final int itemId, final int itemQuantity, final Color outlineColor) { - final Sprite itemSprite = client.createItemSprite(itemId, itemQuantity, 1, 0, 0, true, 710); + final Sprite itemSprite = client.createItemSprite(itemId, itemQuantity, 1, 0, 0, false, Constants.CLIENT_DEFAULT_ZOOM); return itemSprite.toBufferedOutline(outlineColor); } 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 b91e3deeaa..a8d9d8aedf 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 @@ -25,11 +25,21 @@ package net.runelite.client.ui; import java.awt.Frame; +import java.awt.GraphicsConfiguration; +import java.awt.GraphicsDevice; +import java.awt.GraphicsEnvironment; +import java.awt.Insets; import java.awt.Rectangle; +import java.awt.Toolkit; +import java.util.Arrays; +import java.util.Comparator; import javax.swing.JFrame; import lombok.Setter; +import lombok.extern.slf4j.Slf4j; import net.runelite.client.config.ExpandResizeType; +import net.runelite.client.util.OSType; +@Slf4j public class ContainableFrame extends JFrame { public enum Mode @@ -39,6 +49,23 @@ public class ContainableFrame extends JFrame NEVER } + private static boolean jdk8231564; + + static + { + try + { + String javaVersion = System.getProperty("java.version"); + String[] s = javaVersion.split("\\."); + int major = Integer.parseInt(s[0]), minor = Integer.parseInt(s[1]), patch = Integer.parseInt(s[2]); + jdk8231564 = major > 11 || (major == 11 && minor > 0) || (major == 11 && minor == 0 && patch >= 8); + } + catch (Exception ex) + { + log.error("error checking java version", ex); + } + } + private static final int SCREEN_EDGE_CLOSE_DISTANCE = 40; @Setter @@ -200,6 +227,97 @@ public class ContainableFrame extends JFrame expandedClientOppositeDirection = false; } + /** + * Due to Java bug JDK-4737788, maximizing an undecorated frame causes it to cover the taskbar. + * As a workaround, Substance calls this method when the window is maximized to manually set the + * bounds, but its calculation ignores high-DPI scaling. We're overriding it to correctly calculate + * the maximized bounds. + */ + @Override + public void setMaximizedBounds(Rectangle bounds) + { + if (OSType.getOSType() == OSType.MacOS) + { + // OSX seems to correctly handle DPI scaling already + super.setMaximizedBounds(bounds); + } + else + { + super.setMaximizedBounds(getWindowAreaBounds()); + } + } + + /** + * Finds the {@link GraphicsConfiguration} of the display the window is currently on. If it's on more than + * one screen, returns the one it's most on (largest area of intersection) + */ + private GraphicsConfiguration getCurrentDisplayConfiguration() + { + return Arrays.stream(GraphicsEnvironment.getLocalGraphicsEnvironment().getScreenDevices()) + .map(GraphicsDevice::getDefaultConfiguration) + .max(Comparator.comparing(config -> + { + Rectangle intersection = config.getBounds().intersection(getBounds()); + return intersection.width * intersection.height; + })) + .orElseGet(this::getGraphicsConfiguration); + } + + /** + * Calculates the bounds of the window area of the screen. + *
+ * The bounds returned by {@link GraphicsEnvironment#getMaximumWindowBounds} are incorrectly calculated on + * high-DPI screens. + */ + private Rectangle getWindowAreaBounds() + { + log.trace("Current bounds: {}", getBounds()); + for (GraphicsDevice device : GraphicsEnvironment.getLocalGraphicsEnvironment().getScreenDevices()) + { + log.trace("Device: {} bounds {}", device, device.getDefaultConfiguration().getBounds()); + } + + GraphicsConfiguration config = getCurrentDisplayConfiguration(); + // get screen bounds + Rectangle bounds = config.getBounds(); + log.trace("Chosen device: {} bounds {}", config, bounds); + + // transform bounds to dpi-independent coordinates + if (!jdk8231564) + { + // JDK-8231564 fixed setMaximizedBounds to scale the bounds, so this must only be done on <11.0.8 + bounds = config.getDefaultTransform().createTransformedShape(bounds).getBounds(); + log.trace("Transformed bounds {}", bounds); + } + + // subtract insets (taskbar, etc.) + Insets insets = Toolkit.getDefaultToolkit().getScreenInsets(config); + if (!jdk8231564) + { + // Prior to JDK-8231564, WFramePeer expects the bounds to be relative to the current monitor instead of the + // primary display. + bounds.x = bounds.y = 0; + } + else + { + // The insets from getScreenInsets are not scaled, we must convert them to DPI scaled pixels on 11.0.8 due + // to JDK-8231564 which expects the bounds to be in DPI-aware pixels. + double scaleX = config.getDefaultTransform().getScaleX(); + double scaleY = config.getDefaultTransform().getScaleY(); + insets.top /= scaleY; + insets.bottom /= scaleY; + insets.left /= scaleX; + insets.right /= scaleX; + } + bounds.x += insets.left; + bounds.y += insets.top; + bounds.height -= (insets.bottom + insets.top); + bounds.width -= (insets.right + insets.left); + + log.trace("Final bounds: {}", bounds); + return bounds; + } + /** * Force minimum size of frame to be it's layout manager's minimum size */