Merge remote-tracking branch 'runelite/master'
This commit is contained in:
@@ -159,6 +159,7 @@ public enum AgilityShortcut
|
||||
MOS_LEHARMLESS_STEPPING_STONE(60, "Stepping Stone", new WorldPoint(3710, 2970, 0), STEPPING_STONE_19042),
|
||||
WINTERTODT_GAP(60, "Gap", new WorldPoint(1629, 4023, 0), GAP_29326),
|
||||
UNGAEL_ICE(60, "Ice Chunks", null, NULL_25337, NULL_29868, NULL_29869, NULL_29870, ICE_CHUNKS_31822, NULL_31823, ICE_CHUNKS_31990),
|
||||
GWD_LITTLE_CRACK(60, "Little Crack", new WorldPoint(2900, 3712, 0), LITTLE_CRACK),
|
||||
SLAYER_TOWER_MEDIUM_CHAIN_FIRST(61, "Spiked Chain (Floor 1)", new WorldPoint(3421, 3550, 0), SPIKEY_CHAIN),
|
||||
SLAYER_TOWER_MEDIUM_CHAIN_SECOND(61, "Spiked Chain (Floor 2)", new WorldPoint(3420, 3551, 0), SPIKEY_CHAIN_16538),
|
||||
SLAYER_DUNGEON_CREVICE(62, "Narrow Crevice", new WorldPoint(2729, 10008, 0), CREVICE_16539),
|
||||
@@ -184,9 +185,9 @@ public enum AgilityShortcut
|
||||
FOSSIL_ISLAND_HARDWOOD_NORTH(70, "Hole", new WorldPoint(3712, 3828, 0), HOLE_31481, HOLE_31482),
|
||||
FOSSIL_ISLAND_HARDWOOD_SOUTH(70, "Hole", new WorldPoint(3714, 3816, 0), HOLE_31481, HOLE_31482),
|
||||
AL_KHARID_WINDOW(70, "Window", new WorldPoint(3293, 3158, 0), BROKEN_WALL_33344, BIG_WINDOW),
|
||||
GWD_SARADOMIN_ROPE_NORTH(70, "Rope Descent", new WorldPoint(2912, 5300, 0), NULL_26371),
|
||||
GWD_SARADOMIN_ROPE_SOUTH(70, "Rope Descent", new WorldPoint(2951, 5267, 0), NULL_26375),
|
||||
SLAYER_TOWER_ADVANCED_CHAIN_FIRST(71, "Spiked Chain (Floor 2)", new WorldPoint(3447, 3578, 0), SPIKEY_CHAIN),
|
||||
GWD_SARADOMIN_ROPE_NORTH(70, "Rope Descent", new WorldPoint(2912, 5300, 0), NULL_26371, NULL_26561),
|
||||
GWD_SARADOMIN_ROPE_SOUTH(70, "Rope Descent", new WorldPoint(2951, 5267, 0), NULL_26375, NULL_26562),
|
||||
SLAYER_TOWER_ADVANCED_CHAIN_FIRST(71, "Spiked Chain (Floor 2)", new WorldPoint(3447, 3578, 0), SPIKEY_CHAIN ),
|
||||
SLAYER_TOWER_ADVANCED_CHAIN_SECOND(71, "Spiked Chain (Floor 3)", new WorldPoint(3446, 3576, 0), SPIKEY_CHAIN_16538),
|
||||
STRONGHOLD_SLAYER_CAVE_TUNNEL(72, "Tunnel", new WorldPoint(2431, 9806, 0), TUNNEL_30174, TUNNEL_30175),
|
||||
TROLL_STRONGHOLD_WALL_CLIMB(73, "Rocks", new WorldPoint(2841, 3694, 0), ROCKS_16464),
|
||||
|
||||
@@ -188,6 +188,8 @@ public enum ItemMapping
|
||||
ITEM_CRAWS_BOW(CRAWS_BOW_U, CRAWS_BOW),
|
||||
ITEM_VIGGORAS_CHAINMACE(VIGGORAS_CHAINMACE_U, VIGGORAS_CHAINMACE),
|
||||
ITEM_THAMMARONS_SCEPTRE(THAMMARONS_SCEPTRE_U, THAMMARONS_SCEPTRE),
|
||||
ITEM_BRYOPHYTAS_STAFF(BRYOPHYTAS_STAFF_UNCHARGED, BRYOPHYTAS_STAFF),
|
||||
ITEM_RING_OF_ENDURANCE(RING_OF_ENDURANCE_UNCHARGED, RING_OF_ENDURANCE),
|
||||
|
||||
// Infinity colour kits
|
||||
ITEM_INFINITY_TOP(INFINITY_TOP, INFINITY_TOP_10605, INFINITY_TOP_20574, DARK_INFINITY_TOP, LIGHT_INFINITY_TOP),
|
||||
|
||||
@@ -36,6 +36,7 @@ import java.awt.Graphics;
|
||||
import java.awt.Graphics2D;
|
||||
import java.awt.GraphicsConfiguration;
|
||||
import java.awt.GraphicsDevice;
|
||||
import static java.awt.GraphicsDevice.WindowTranslucency.TRANSLUCENT;
|
||||
import java.awt.GraphicsEnvironment;
|
||||
import java.awt.LayoutManager;
|
||||
import java.awt.Rectangle;
|
||||
@@ -54,6 +55,7 @@ import java.util.concurrent.ExecutorService;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
import javax.annotation.Nullable;
|
||||
import javax.inject.Inject;
|
||||
import javax.inject.Named;
|
||||
import javax.inject.Provider;
|
||||
import javax.inject.Singleton;
|
||||
import javax.swing.BoxLayout;
|
||||
@@ -62,6 +64,7 @@ import javax.swing.JButton;
|
||||
import javax.swing.JComponent;
|
||||
import javax.swing.JFrame;
|
||||
import javax.swing.JOptionPane;
|
||||
import static javax.swing.JOptionPane.INFORMATION_MESSAGE;
|
||||
import javax.swing.JPanel;
|
||||
import javax.swing.JRootPane;
|
||||
import javax.swing.SwingUtilities;
|
||||
@@ -99,8 +102,6 @@ import net.runelite.client.util.WinUtil;
|
||||
import org.pushingpixels.substance.internal.SubstanceSynapse;
|
||||
import org.pushingpixels.substance.internal.utils.SubstanceCoreUtilities;
|
||||
import org.pushingpixels.substance.internal.utils.SubstanceTitlePaneUtilities;
|
||||
import static java.awt.GraphicsDevice.WindowTranslucency.TRANSLUCENT;
|
||||
import static javax.swing.JOptionPane.INFORMATION_MESSAGE;
|
||||
|
||||
/**
|
||||
* Client UI.
|
||||
@@ -139,7 +140,9 @@ public class ClientUI
|
||||
private final ConfigManager configManager;
|
||||
private final ExecutorService executorService;
|
||||
private final Provider<ClientThread> clientThreadProvider;
|
||||
private final EventBus eventBus;
|
||||
private final EventBus eventbus;
|
||||
private final boolean safeMode;
|
||||
|
||||
private final CardLayout cardLayout = new CardLayout();
|
||||
private final Rectangle sidebarButtonPosition = new Rectangle();
|
||||
private boolean withTitleBar;
|
||||
@@ -167,7 +170,8 @@ public class ClientUI
|
||||
ConfigManager configManager,
|
||||
ExecutorService executorService,
|
||||
Provider<ClientThread> clientThreadProvider,
|
||||
EventBus eventbus)
|
||||
EventBus eventbus,
|
||||
@Named("safeMode") boolean safeMode)
|
||||
{
|
||||
this.config = config;
|
||||
this.keyManager = keyManager;
|
||||
@@ -176,7 +180,8 @@ public class ClientUI
|
||||
this.configManager = configManager;
|
||||
this.executorService = executorService;
|
||||
this.clientThreadProvider = clientThreadProvider;
|
||||
this.eventBus = eventbus;
|
||||
this.eventbus = eventbus;
|
||||
this.safeMode = safeMode;
|
||||
|
||||
eventbus.subscribe(ConfigChanged.class, this, this::onConfigChanged);
|
||||
eventbus.subscribe(NavigationButtonAdded.class, this, this::onNavigationButtonAdded);
|
||||
@@ -532,7 +537,7 @@ public class ClientUI
|
||||
trayIcon = SwingUtil.createTrayIcon(ICON, RuneLiteProperties.getTitle(), frame);
|
||||
|
||||
// Move frame around (needs to be done after frame is packed)
|
||||
if (config.rememberScreenBounds())
|
||||
if (config.rememberScreenBounds() && !safeMode)
|
||||
{
|
||||
try
|
||||
{
|
||||
@@ -543,8 +548,8 @@ public class ClientUI
|
||||
frame.setBounds(clientBounds);
|
||||
|
||||
// frame.getGraphicsConfiguration().getBounds() returns the bounds for the primary display.
|
||||
// We have to find the correct graphics configuration by using the intersection of the client boundaries.
|
||||
GraphicsConfiguration gc = getIntersectingDisplay(clientBounds);
|
||||
// We have to find the correct graphics configuration by using the client boundaries.
|
||||
GraphicsConfiguration gc = findDisplayFromBounds(clientBounds);
|
||||
if (gc != null)
|
||||
{
|
||||
double scale = gc.getDefaultTransform().getScaleX();
|
||||
@@ -608,7 +613,7 @@ public class ClientUI
|
||||
}
|
||||
}
|
||||
|
||||
private GraphicsConfiguration getIntersectingDisplay(final Rectangle bounds)
|
||||
private GraphicsConfiguration findDisplayFromBounds(final Rectangle bounds)
|
||||
{
|
||||
GraphicsDevice[] gds = GraphicsEnvironment.getLocalGraphicsEnvironment().getScreenDevices();
|
||||
|
||||
@@ -617,7 +622,7 @@ public class ClientUI
|
||||
GraphicsConfiguration gc = gd.getDefaultConfiguration();
|
||||
|
||||
final Rectangle displayBounds = gc.getBounds();
|
||||
if (displayBounds.intersects(bounds))
|
||||
if (displayBounds.contains(bounds))
|
||||
{
|
||||
return gc;
|
||||
}
|
||||
@@ -645,7 +650,7 @@ public class ClientUI
|
||||
{
|
||||
saveClientBoundsConfig();
|
||||
ClientShutdown csev = new ClientShutdown();
|
||||
eventBus.post(ClientShutdown.class, csev);
|
||||
eventbus.post(ClientShutdown.class, csev);
|
||||
executorService.shutdown();
|
||||
|
||||
new Thread(() ->
|
||||
|
||||
@@ -481,53 +481,83 @@ public class OverlayRenderer extends MouseAdapter implements KeyListener
|
||||
|
||||
if (inOverlayResizingMode)
|
||||
{
|
||||
final Rectangle r = currentManagedBounds;
|
||||
final int left = p.x - currentManagedBounds.x; // Distance (in pixels) from the left edge of the bounds
|
||||
final int top = p.y - currentManagedBounds.y; // Distance (in pixels) from the top edge of the bounds
|
||||
final int originalX = currentManagedBounds.x;
|
||||
final int originalY = currentManagedBounds.y;
|
||||
int x = originalX;
|
||||
int y = originalY;
|
||||
int width = currentManagedBounds.width;
|
||||
int height = currentManagedBounds.height;
|
||||
|
||||
final int dx = p.x - r.x;
|
||||
final int dy = p.y - r.y;
|
||||
switch (clientUI.getCurrentCursor().getType())
|
||||
{
|
||||
case Cursor.N_RESIZE_CURSOR:
|
||||
int height = r.height - dy;
|
||||
r.setRect(r.x, r.y + dy, r.width, height);
|
||||
y += top;
|
||||
height -= top;
|
||||
break;
|
||||
case Cursor.NW_RESIZE_CURSOR:
|
||||
int width = r.width - dx;
|
||||
height = r.height - dy;
|
||||
r.setRect(r.x + dx, r.y + dy, width, height);
|
||||
x += left;
|
||||
y += top;
|
||||
width -= left;
|
||||
height -= top;
|
||||
break;
|
||||
case Cursor.W_RESIZE_CURSOR:
|
||||
width = r.width - dx;
|
||||
r.setRect(r.x + dx, r.y, width, r.height);
|
||||
x += left;
|
||||
width -= left;
|
||||
break;
|
||||
case Cursor.SW_RESIZE_CURSOR:
|
||||
width = r.width - dx;
|
||||
height = dy;
|
||||
r.setRect(r.x + dx, r.y, width, height);
|
||||
x += left;
|
||||
width -= left;
|
||||
height = top;
|
||||
break;
|
||||
case Cursor.S_RESIZE_CURSOR:
|
||||
height = dy;
|
||||
r.setRect(r.x, r.y, r.width, height);
|
||||
height = top;
|
||||
break;
|
||||
case Cursor.SE_RESIZE_CURSOR:
|
||||
width = dx;
|
||||
height = dy;
|
||||
r.setRect(r.x, r.y, width, height);
|
||||
width = left;
|
||||
height = top;
|
||||
break;
|
||||
case Cursor.E_RESIZE_CURSOR:
|
||||
width = dx;
|
||||
r.setRect(r.x, r.y, width, r.height);
|
||||
width = left;
|
||||
break;
|
||||
case Cursor.NE_RESIZE_CURSOR:
|
||||
width = dx;
|
||||
height = r.height - dy;
|
||||
r.setRect(r.x, r.y + dy, width, height);
|
||||
y += top;
|
||||
width = left;
|
||||
height -= top;
|
||||
break;
|
||||
default:
|
||||
// center
|
||||
}
|
||||
|
||||
currentManagedOverlay.setPreferredSize(new Dimension(Math.max(MIN_OVERLAY_SIZE, currentManagedBounds.width), Math.max(MIN_OVERLAY_SIZE, currentManagedBounds.height)));
|
||||
final int widthOverflow = Math.max(0, MIN_OVERLAY_SIZE - width);
|
||||
final int heightOverflow = Math.max(0, MIN_OVERLAY_SIZE - height);
|
||||
final int dx = x - originalX;
|
||||
final int dy = y - originalY;
|
||||
|
||||
// If this resize operation would cause the dimensions to go below the minimum width/height, reset the
|
||||
// dimensions and adjust the x/y position accordingly as needed
|
||||
if (widthOverflow > 0)
|
||||
{
|
||||
width = MIN_OVERLAY_SIZE;
|
||||
|
||||
if (dx > 0)
|
||||
{
|
||||
x -= widthOverflow;
|
||||
}
|
||||
}
|
||||
if (heightOverflow > 0)
|
||||
{
|
||||
height = MIN_OVERLAY_SIZE;
|
||||
|
||||
if (dy > 0)
|
||||
{
|
||||
y -= heightOverflow;
|
||||
}
|
||||
}
|
||||
|
||||
currentManagedBounds.setRect(x, y, width, height);
|
||||
currentManagedOverlay.setPreferredSize(new Dimension(currentManagedBounds.width, currentManagedBounds.height));
|
||||
|
||||
if (currentManagedOverlay.getPreferredLocation() != null)
|
||||
{
|
||||
|
||||
@@ -19,6 +19,15 @@ LABEL8:
|
||||
string_length
|
||||
iconst 0
|
||||
if_icmpgt LABEL15
|
||||
; this is a bank search with no input string. the bank tag plugin uses it to perform its tab searches.
|
||||
iconst 1 ; return value - default to true to match anything
|
||||
iload 0 ; load item id
|
||||
sconst "" ; we are not searching, so there is no search string
|
||||
sconst "bankSearchFilter" ; push event name
|
||||
runelite_callback ; invoke callback
|
||||
pop_int ; pop item id
|
||||
pop_string ; pop search string
|
||||
return ; return rv
|
||||
jump LABEL34
|
||||
LABEL15:
|
||||
iload 0
|
||||
@@ -32,13 +41,11 @@ LABEL19:
|
||||
sstore 0
|
||||
iconst -1 ; load return value
|
||||
iload 0 ; load item id
|
||||
sload 0 ; load item name
|
||||
sload 1 ; load search string
|
||||
sconst "bankSearchFilter" ; push event name
|
||||
runelite_callback ; invoke callback
|
||||
pop_int ; pop item id
|
||||
pop_string ; pop search string
|
||||
pop_string ; pop item name
|
||||
istore 1 ; store return value for the below comparisons
|
||||
iload 1
|
||||
iconst 0
|
||||
|
||||
@@ -10,9 +10,6 @@
|
||||
; callback "setBankScroll"
|
||||
; Fired before bank is calculated
|
||||
; Used by the TabInterface to show fake bank items for tag tabs
|
||||
;
|
||||
; callback "isTabMenuActive"
|
||||
; Used by the TabInterface to skip setting the bank title
|
||||
sconst "beforeBankLayout"
|
||||
runelite_callback
|
||||
get_varbit 5102
|
||||
@@ -968,12 +965,6 @@ LABEL848:
|
||||
add
|
||||
istore 20
|
||||
jump LABEL769
|
||||
SetTitle:
|
||||
iconst 0 ; Compare variable
|
||||
iconst 0 ;
|
||||
sconst "isTabMenuActive"
|
||||
runelite_callback ; skip setting the bank title if the tag tab menu is active
|
||||
if_icmpne FinishBuilding
|
||||
LABEL853:
|
||||
get_varbit 4170
|
||||
iconst 2
|
||||
|
||||
Reference in New Issue
Block a user