From ff6e12a542f9bd9998fb0b4ea2c3acc2467095cd Mon Sep 17 00:00:00 2001 From: Hydrox6 Date: Tue, 20 Jul 2021 13:13:51 +0100 Subject: [PATCH 1/7] client: update various wordings to use "signed in/out" for RL accounts --- .../java/net/runelite/client/account/SessionManager.java | 4 ++-- .../runelite/client/plugins/account/AccountPlugin.java | 6 +++--- .../java/net/runelite/client/plugins/info/InfoPanel.java | 8 ++++---- .../client/plugins/loottracker/LootTrackerConfig.java | 2 +- 4 files changed, 10 insertions(+), 10 deletions(-) diff --git a/runelite-client/src/main/java/net/runelite/client/account/SessionManager.java b/runelite-client/src/main/java/net/runelite/client/account/SessionManager.java index 4b6bf1674e..93c1f8f584 100644 --- a/runelite-client/src/main/java/net/runelite/client/account/SessionManager.java +++ b/runelite-client/src/main/java/net/runelite/client/account/SessionManager.java @@ -186,7 +186,7 @@ public class SessionManager } catch (IOException ex) { - log.warn("Unable to logout of session", ex); + log.warn("Unable to sign out of session", ex); } accountSession = null; // No more account @@ -225,7 +225,7 @@ public class SessionManager @Subscribe public void onLoginResponse(LoginResponse loginResponse) { - log.debug("Now logged in as {}", loginResponse.getUsername()); + log.debug("Now signed in as {}", loginResponse.getUsername()); AccountSession session = getAccountSession(); session.setUsername(loginResponse.getUsername()); diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/account/AccountPlugin.java b/runelite-client/src/main/java/net/runelite/client/plugins/account/AccountPlugin.java index 501537654e..2cb1c66ded 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/account/AccountPlugin.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/account/AccountPlugin.java @@ -75,14 +75,14 @@ public class AccountPlugin extends Plugin loginButton = NavigationButton.builder() .tab(false) .icon(LOGIN_IMAGE) - .tooltip("Log in to RuneLite") + .tooltip("Sign in to RuneLite") .onClick(this::loginClick) .build(); logoutButton = NavigationButton.builder() .tab(false) .icon(LOGOUT_IMAGE) - .tooltip("Log out of RuneLite") + .tooltip("Sign out of RuneLite") .onClick(this::logoutClick) .build(); @@ -113,7 +113,7 @@ public class AccountPlugin extends Plugin private void logoutClick() { if (JOptionPane.YES_OPTION == JOptionPane.showConfirmDialog(null, - "Are you sure you want to log out from RuneLite?", "Logout Confirmation", + "Are you sure you want to sign out of RuneLite?", "Sign Out Confirmation", JOptionPane.YES_NO_OPTION)) { executor.execute(sessionManager::logout); diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/info/InfoPanel.java b/runelite-client/src/main/java/net/runelite/client/plugins/info/InfoPanel.java index 5b4df7fe2e..76d543d3fb 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/info/InfoPanel.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/info/InfoPanel.java @@ -184,7 +184,7 @@ public class InfoPanel extends PluginPanel syncPanel = buildLinkPanel(IMPORT_ICON, "Import signed-out", "settings", () -> { final int result = JOptionPane.showOptionDialog(syncPanel, - "This will overwrite your settings with settings from your local profile, which
is the profile used when not logged into RuneLite with a RuneLite account.", + "This will overwrite your settings with settings from your local profile, which
is the profile used when not signed into RuneLite with a RuneLite account.", "Are you sure?", JOptionPane.YES_NO_OPTION, JOptionPane.WARNING_MESSAGE, null, new String[]{"Yes", "No"}, "No"); @@ -298,14 +298,14 @@ public class InfoPanel extends PluginPanel { emailLabel.setContentType("text/plain"); emailLabel.setText(name); - loggedLabel.setText("Logged in as"); + loggedLabel.setText("Signed in as"); actionsContainer.add(syncPanel, 0); } else { emailLabel.setContentType("text/html"); - emailLabel.setText("Login to sync settings to the cloud."); - loggedLabel.setText("Not logged in"); + emailLabel.setText("Sign in to sync settings to the cloud."); + loggedLabel.setText("Not signed in"); actionsContainer.remove(syncPanel); } } diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/loottracker/LootTrackerConfig.java b/runelite-client/src/main/java/net/runelite/client/plugins/loottracker/LootTrackerConfig.java index abf9234a5e..983cfb45a9 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/loottracker/LootTrackerConfig.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/loottracker/LootTrackerConfig.java @@ -92,7 +92,7 @@ public interface LootTrackerConfig extends Config @ConfigItem( keyName = "syncPanel", name = "Synchronize panel contents", - description = "Synchronize your local loot tracker with your server data (requires being logged in).
" + + description = "Synchronize your local loot tracker with your server data (requires being signed in).
" + " This means the panel is filled with portions of your remote data on startup
" + " and deleting data in the panel also deletes it on the server." ) From ed5ae02bc39b620098954cf50d67f52a21227bcc Mon Sep 17 00:00:00 2001 From: Adam Date: Wed, 25 Aug 2021 09:15:26 -0400 Subject: [PATCH 2/7] world hopper: set activity tooltip on world list --- .../runelite/client/plugins/worldhopper/WorldTableRow.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/worldhopper/WorldTableRow.java b/runelite-client/src/main/java/net/runelite/client/plugins/worldhopper/WorldTableRow.java index 6c9a6b9ef2..cc0278ee5a 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/worldhopper/WorldTableRow.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/worldhopper/WorldTableRow.java @@ -311,8 +311,13 @@ class WorldTableRow extends JPanel JPanel column = new JPanel(new BorderLayout()); column.setBorder(new EmptyBorder(0, 5, 0, 5)); - activityField = new JLabel(world.getActivity()); + String activity = world.getActivity(); + activityField = new JLabel(activity); activityField.setFont(FontManager.getRunescapeSmallFont()); + if (activity != null && activity.length() > 16) + { + activityField.setToolTipText(activity); + } column.add(activityField, BorderLayout.WEST); From 6723fb3205e4a5a784be0c33a17c721ce4e12a99 Mon Sep 17 00:00:00 2001 From: Adam Date: Thu, 26 Aug 2021 22:26:02 -0400 Subject: [PATCH 3/7] overlay: only layout widget overlays if the preferred location is set With the new steam client updates, the client tries to aggressively move around several of the widget overlay components, including xp tracker, and several hp bars. This tends to fight with the layouting we already do with the widgets. This changes the widgets to only be layouted if the overlay has a preferred location or position set. Otherwise, it will offset the snap corner bounds by where the client has positione the widget. It is still possible to get the client ui to fight the widget overlay by moving the overlays around manually, but it should no longer happen in the default positioning of the widgets. --- .../runelite/client/ui/overlay/Overlay.java | 5 +--- .../client/ui/overlay/OverlayManager.java | 5 +++- .../client/ui/overlay/OverlayRenderer.java | 24 ++++++++--------- .../client/ui/overlay/OverlayUtil.java | 26 +++++++++---------- .../client/ui/overlay/WidgetOverlay.java | 9 +++---- 5 files changed, 34 insertions(+), 35 deletions(-) diff --git a/runelite-client/src/main/java/net/runelite/client/ui/overlay/Overlay.java b/runelite-client/src/main/java/net/runelite/client/ui/overlay/Overlay.java index 14197b90a1..c852f32b53 100644 --- a/runelite-client/src/main/java/net/runelite/client/ui/overlay/Overlay.java +++ b/runelite-client/src/main/java/net/runelite/client/ui/overlay/Overlay.java @@ -121,10 +121,7 @@ public abstract class Overlay implements LayoutableRenderableEntity return null; } - public void reset() + public void revalidate() { - setPreferredPosition(null); - setPreferredSize(null); - setPreferredLocation(null); } } 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 21cb834ca1..bea3f9d280 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 @@ -289,8 +289,11 @@ public class OverlayManager */ public synchronized void resetOverlay(final Overlay overlay) { - overlay.reset(); + overlay.setPreferredPosition(null); + overlay.setPreferredSize(null); + overlay.setPreferredLocation(null); saveOverlay(overlay); + overlay.revalidate(); } synchronized void rebuildOverlayLayers() diff --git a/runelite-client/src/main/java/net/runelite/client/ui/overlay/OverlayRenderer.java b/runelite-client/src/main/java/net/runelite/client/ui/overlay/OverlayRenderer.java index d70b043911..463e05725e 100644 --- a/runelite-client/src/main/java/net/runelite/client/ui/overlay/OverlayRenderer.java +++ b/runelite-client/src/main/java/net/runelite/client/ui/overlay/OverlayRenderer.java @@ -272,25 +272,18 @@ public class OverlayRenderer extends MouseAdapter implements KeyListener final Dimension dimension = bounds.getSize(); final Point preferredLocation = overlay.getPreferredLocation(); Point location; + Rectangle snapCorner = null; // If the final position is not modified, layout it if (overlayPosition != OverlayPosition.DETACHED && (preferredLocation == null || overlay.getPreferredPosition() != null)) { - final Rectangle snapCorner = snapCorners.forPosition(overlayPosition); + snapCorner = snapCorners.forPosition(overlayPosition); final Point translation = OverlayUtil.transformPosition(overlayPosition, dimension); // offset from corner // Target x/y to draw the overlay - int destX = (int) snapCorner.getX() + translation.x; - int destY = (int) snapCorner.getY() + translation.y; + int destX = snapCorner.x + translation.x; + int destY = snapCorner.y + translation.y; // Clamp the target position to ensure it is on screen or within parent bounds location = clampOverlayLocation(destX, destY, dimension.width, dimension.height, overlay); - // Diff final position to target position in order to add it to the snap corner padding. The - // overlay effectively takes up the difference of (clamped location - target location) in - // addition to its normal dimensions. - int dX = location.x - destX; - int dY = location.y - destY; - final Point padding = OverlayUtil.padPosition(overlayPosition, dimension, PADDING); // overlay size + fixed padding - // translate corner for padding and any difference due to the position clamping - snapCorner.translate(padding.x + dX, padding.y + dY); } else { @@ -307,6 +300,12 @@ public class OverlayRenderer extends MouseAdapter implements KeyListener safeRender(client, overlay, layer, graphics, location); + // Adjust snap corner based on where the overlay was drawn + if (snapCorner != null && bounds.width + bounds.height > 0) + { + OverlayUtil.shiftSnapCorner(overlayPosition, snapCorner, bounds, PADDING); + } + // Restore graphics2d properties prior to drawing bounds graphics.setTransform(transform); graphics.setStroke(stroke); @@ -665,7 +664,7 @@ public class OverlayRenderer extends MouseAdapter implements KeyListener { OverlayPosition position = snapCorners.fromBounds(snapCorner); - if (position == currentManagedOverlay.getPosition()) + if (position == getCorrectedOverlayPosition(currentManagedOverlay)) { // overlay moves back to default position position = null; @@ -673,6 +672,7 @@ public class OverlayRenderer extends MouseAdapter implements KeyListener currentManagedOverlay.setPreferredPosition(position); currentManagedOverlay.setPreferredLocation(null); // from dragging + currentManagedOverlay.revalidate(); break; } } diff --git a/runelite-client/src/main/java/net/runelite/client/ui/overlay/OverlayUtil.java b/runelite-client/src/main/java/net/runelite/client/ui/overlay/OverlayUtil.java index 1caa3a7c01..26497ab43d 100644 --- a/runelite-client/src/main/java/net/runelite/client/ui/overlay/OverlayUtil.java +++ b/runelite-client/src/main/java/net/runelite/client/ui/overlay/OverlayUtil.java @@ -30,6 +30,7 @@ import java.awt.Color; import java.awt.Dimension; import java.awt.Graphics2D; import java.awt.Polygon; +import java.awt.Rectangle; import java.awt.RenderingHints; import java.awt.Shape; import java.awt.Stroke; @@ -201,33 +202,32 @@ public class OverlayUtil graphics.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON); } - public static java.awt.Point padPosition(OverlayPosition position, Dimension dimension, final int padding) + static void shiftSnapCorner(OverlayPosition overlayPosition, Rectangle snapCorner, Rectangle bounds, int padding) { - final java.awt.Point result = new java.awt.Point(); - - switch (position) + // translate corner for padding and also based on where the overlay bounds are now + int sX = snapCorner.x, sY = snapCorner.y; + switch (overlayPosition) { - case DYNAMIC: - case TOOLTIP: - break; case BOTTOM_LEFT: - result.x += dimension.width + (dimension.width == 0 ? 0 : padding); + sX = bounds.x + bounds.width + padding; break; case BOTTOM_RIGHT: - result.x -= dimension.width + (dimension.width == 0 ? 0 : padding); + sX = bounds.x - padding; break; case TOP_LEFT: case TOP_CENTER: case CANVAS_TOP_RIGHT: case TOP_RIGHT: - result.y += dimension.height + (dimension.height == 0 ? 0 : padding); + sY = bounds.y + bounds.height + padding; break; case ABOVE_CHATBOX_RIGHT: - result.y -= dimension.height + (dimension.height == 0 ? 0 : padding); + sY = bounds.y - padding; break; + default: + throw new IllegalArgumentException(); } - - return result; + snapCorner.x = sX; + snapCorner.y = sY; } public static java.awt.Point transformPosition(OverlayPosition position, Dimension dimension) diff --git a/runelite-client/src/main/java/net/runelite/client/ui/overlay/WidgetOverlay.java b/runelite-client/src/main/java/net/runelite/client/ui/overlay/WidgetOverlay.java index 67d20cf8bd..43a1faf32e 100644 --- a/runelite-client/src/main/java/net/runelite/client/ui/overlay/WidgetOverlay.java +++ b/runelite-client/src/main/java/net/runelite/client/ui/overlay/WidgetOverlay.java @@ -121,9 +121,9 @@ public class WidgetOverlay extends Overlay assert widget != null; final Rectangle bounds = getBounds(); - // OverlayRenderer sets the overlay bounds to the preferred location if one is set prior to calling render() - // for detached overlays. - if (getPosition() != OverlayPosition.DETACHED || getPreferredLocation() != null) + // OverlayRenderer sets the overlay bounds to where it would like the overlay to render at prior to calling + // render(). If the overlay has a preferred location or position set we update the widget position to that. + if (getPreferredLocation() != null || getPreferredPosition() != null) { // The widget relative pos is relative to the parent widget.setRelativeX(bounds.x - parent.x); @@ -188,9 +188,8 @@ public class WidgetOverlay extends Overlay } @Override - public void reset() + public void revalidate() { - super.reset(); // Revalidate must be called on the client thread, so defer til next frame revalidate = true; } From a772eebf094af95a7195167f0cf778085d5683d3 Mon Sep 17 00:00:00 2001 From: Adam Date: Fri, 27 Aug 2021 14:12:15 -0400 Subject: [PATCH 4/7] world hopper: bubble up mouse events from activity label This fixes hopping and mouseover on the activity label not working --- .../plugins/worldhopper/WorldTableRow.java | 33 +++++++++++++++++++ 1 file changed, 33 insertions(+) diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/worldhopper/WorldTableRow.java b/runelite-client/src/main/java/net/runelite/client/plugins/worldhopper/WorldTableRow.java index cc0278ee5a..29ba121129 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/worldhopper/WorldTableRow.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/worldhopper/WorldTableRow.java @@ -317,6 +317,39 @@ class WorldTableRow extends JPanel if (activity != null && activity.length() > 16) { activityField.setToolTipText(activity); + // Pass up events - https://stackoverflow.com/a/14932443 + activityField.addMouseListener(new MouseAdapter() + { + @Override + public void mouseClicked(MouseEvent e) + { + dispatchEvent(e); + } + + @Override + public void mousePressed(MouseEvent e) + { + dispatchEvent(e); + } + + @Override + public void mouseReleased(MouseEvent e) + { + dispatchEvent(e); + } + + @Override + public void mouseEntered(MouseEvent e) + { + dispatchEvent(e); + } + + @Override + public void mouseExited(MouseEvent e) + { + dispatchEvent(e); + } + }); } column.add(activityField, BorderLayout.WEST); From f1df57f9dd7574707469b944cbfef6900c461b80 Mon Sep 17 00:00:00 2001 From: Max Weber Date: Sun, 29 Aug 2021 15:36:52 -0600 Subject: [PATCH 5/7] timetracking: don't load notification icons for every panel --- .../client/plugins/timetracking/TimeablePanel.java | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/timetracking/TimeablePanel.java b/runelite-client/src/main/java/net/runelite/client/plugins/timetracking/TimeablePanel.java index 1a8b23a8fa..8903a0b715 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/timetracking/TimeablePanel.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/timetracking/TimeablePanel.java @@ -46,6 +46,9 @@ import net.runelite.client.util.SwingUtil; @Getter public class TimeablePanel extends JPanel { + private static final ImageIcon NOTIFY_ICON = new ImageIcon(ImageUtil.loadImageResource(TimeTrackingPlugin.class, "notify_icon.png")); + private static final ImageIcon NOTIFY_SELECTED_ICON = new ImageIcon(ImageUtil.loadImageResource(TimeTrackingPlugin.class, "notify_selected_icon.png")); + private final T timeable; private final JLabel icon = new JLabel(); private final JLabel farmingContractIcon = new JLabel(); @@ -84,13 +87,10 @@ public class TimeablePanel extends JPanel infoPanel.add(text); infoPanel.add(estimate); - ImageIcon notifyIcon = new ImageIcon(ImageUtil.loadImageResource(TimeTrackingPlugin.class, "notify_icon.png")); - ImageIcon notifySelectedIcon = new ImageIcon(ImageUtil.loadImageResource(TimeTrackingPlugin.class, "notify_selected_icon.png")); - notifyButton.setPreferredSize(new Dimension(30, 16)); notifyButton.setBorder(new EmptyBorder(0, 0, 0, 10)); - notifyButton.setIcon(notifyIcon); - notifyButton.setSelectedIcon(notifySelectedIcon); + notifyButton.setIcon(NOTIFY_ICON); + notifyButton.setSelectedIcon(NOTIFY_SELECTED_ICON); SwingUtil.removeButtonDecorations(notifyButton); SwingUtil.addModalTooltip(notifyButton, "Disable notifications", "Enable notifications"); From 49c24f2651449f395f9ac2eba77dd339465b75c9 Mon Sep 17 00:00:00 2001 From: SkylerPIlot Date: Sun, 29 Aug 2021 19:29:03 -0700 Subject: [PATCH 6/7] skill calculator: Add Morytania diary shade exp bonus --- .../plugins/skillcalculator/skill_prayer.json | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/runelite-client/src/main/resources/net/runelite/client/plugins/skillcalculator/skill_prayer.json b/runelite-client/src/main/resources/net/runelite/client/plugins/skillcalculator/skill_prayer.json index 292fab6b8f..6a0ef8a98f 100644 --- a/runelite-client/src/main/resources/net/runelite/client/plugins/skillcalculator/skill_prayer.json +++ b/runelite-client/src/main/resources/net/runelite/client/plugins/skillcalculator/skill_prayer.json @@ -11,6 +11,10 @@ { "name": "Chaos Altar (700%)", "value": 6 + }, + { + "name": "Morytania Diary 3 Shades(150%)", + "value": 0.5 } ], "actions": [ @@ -184,8 +188,7 @@ "level": 1, "icon": 3396, "name": "Loar Remains", - "xp": 33, - "ignoreBonus": true + "xp": 33 }, { "level": 1, @@ -239,8 +242,7 @@ "level": 1, "icon": 3398, "name": "Phrin Remains", - "xp": 46.5, - "ignoreBonus": true + "xp": 46.5 }, { "level": 1, @@ -252,8 +254,7 @@ "level": 1, "icon": 3400, "name": "Riyl Remains", - "xp": 59.5, - "ignoreBonus": true + "xp": 59.5 }, { "level": 1, @@ -277,8 +278,7 @@ "level": 1, "icon": 3402, "name": "Asyn Remains", - "xp": 82.5, - "ignoreBonus": true + "xp": 82.5 }, { "level": 1, @@ -290,8 +290,7 @@ "level": 1, "icon": 3404, "name": "Fiyr Remains", - "xp": 84, - "ignoreBonus": true + "xp": 84 }, { "level": 1, From 8b5f4fe8dee0a45f4895dda5c575b86802020196 Mon Sep 17 00:00:00 2001 From: SkylerPIlot Date: Sun, 29 Aug 2021 19:30:28 -0700 Subject: [PATCH 7/7] skill calculator: Add Urium remains --- .../client/plugins/skillcalculator/skill_prayer.json | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/runelite-client/src/main/resources/net/runelite/client/plugins/skillcalculator/skill_prayer.json b/runelite-client/src/main/resources/net/runelite/client/plugins/skillcalculator/skill_prayer.json index 6a0ef8a98f..1ddc633f4b 100644 --- a/runelite-client/src/main/resources/net/runelite/client/plugins/skillcalculator/skill_prayer.json +++ b/runelite-client/src/main/resources/net/runelite/client/plugins/skillcalculator/skill_prayer.json @@ -327,6 +327,12 @@ "icon": 22124, "name": "Superior Dragon Bones", "xp": 150 + }, + { + "level": 1, + "icon": 25419, + "name": "Urium Remains", + "xp": 120 } ] }