Merge remote-tracking branch 'origin/master' into HEAD

This commit is contained in:
Owain van Brakel
2021-09-24 01:24:20 +02:00
5 changed files with 33 additions and 6 deletions

View File

@@ -1917,6 +1917,8 @@ public interface Client extends GameEngine
TextureProvider getTextureProvider();
NodeCache getCachedModels2();
void setRenderArea(boolean[][] renderArea);
int getRasterizer3D_clipMidX2();

View File

@@ -33,4 +33,8 @@ public interface NodeCache
* Resets cache.
*/
void reset();
void setCapacity(int capacity);
void setRemainingCapacity(int remainingCapacity);
}

View File

@@ -122,6 +122,7 @@ public class ClientUI
private final Provider<ClientThread> clientThreadProvider;
private final EventBus eventBus;
private final boolean safeMode;
private final String title;
private final CardLayout cardLayout = new CardLayout();
private final Rectangle sidebarButtonPosition = new Rectangle();
@@ -166,6 +167,7 @@ public class ClientUI
this.clientThreadProvider = clientThreadProvider;
this.eventBus = eventBus;
this.safeMode = safeMode;
this.title = RuneLiteProperties.getTitle();
}
@Subscribe
@@ -299,7 +301,7 @@ public class ClientUI
return false;
}
frame.setTitle(RuneLiteProperties.getTitle() + " - " + name);
frame.setTitle(title + " - " + name);
return true;
});
}
@@ -326,7 +328,7 @@ public class ClientUI
// Try to enable fullscreen on OSX
OSXUtil.tryEnableFullscreen(frame);
frame.setTitle(RuneLiteProperties.getTitle());
frame.setTitle(title);
frame.setIconImage(ICON);
frame.getLayeredPane().setCursor(Cursor.getDefaultCursor()); // Prevent substance from using a resize cursor for pointing
frame.setLocationRelativeTo(frame.getOwner());
@@ -512,7 +514,7 @@ public class ClientUI
frame.revalidateMinimumSize();
// Create tray icon (needs to be created after frame is packed)
trayIcon = SwingUtil.createTrayIcon(ICON, RuneLiteProperties.getTitle(), frame);
trayIcon = SwingUtil.createTrayIcon(ICON, title, frame);
// Move frame around (needs to be done after frame is packed)
if (config.rememberScreenBounds() && !safeMode)
@@ -745,6 +747,7 @@ public class ClientUI
/**
* Returns current cursor set on game container
*
* @return awt cursor
*/
public Cursor getCurrentCursor()
@@ -754,6 +757,7 @@ public class ClientUI
/**
* Returns current custom cursor or default system cursor if cursor is not set
*
* @return awt cursor
*/
public Cursor getDefaultCursor()
@@ -764,6 +768,7 @@ public class ClientUI
/**
* Changes cursor for client window. Requires ${@link ClientUI#init()} to be called first.
* FIXME: This is working properly only on Windows, Linux and Mac are displaying cursor incorrectly
*
* @param image cursor image
* @param name cursor name
*/
@@ -782,6 +787,7 @@ public class ClientUI
/**
* Changes cursor for client window. Requires ${@link ClientUI#init()} to be called first.
*
* @param cursor awt cursor
*/
public void setCursor(final Cursor cursor)
@@ -791,6 +797,7 @@ public class ClientUI
/**
* Resets client window cursor to default one.
*
* @see ClientUI#setCursor(BufferedImage, String)
*/
public void resetCursor()
@@ -826,6 +833,7 @@ public class ClientUI
/**
* Paint UI related overlays to target graphics
*
* @param graphics target graphics
*/
public void paintOverlays(final Graphics2D graphics)
@@ -1035,16 +1043,16 @@ public class ClientUI
if (config.usernameInTitle() && (client instanceof Client))
{
final Player player = ((Client)client).getLocalPlayer();
final Player player = ((Client) client).getLocalPlayer();
if (player != null && player.getName() != null)
{
frame.setTitle(RuneLiteProperties.getTitle() + " - " + player.getName());
frame.setTitle(title + " - " + player.getName());
}
}
else
{
frame.setTitle(RuneLiteProperties.getTitle());
frame.setTitle(title);
}
if (frame.isAlwaysOnTopSupported())

View File

@@ -243,6 +243,17 @@ public class ContainableFrame extends JFrame
expandedClientOppositeDirection = false;
}
@Override
public void setExtendedState(int state)
{
if (OSType.getOSType() != OSType.MacOS)
{
super.setMaximizedBounds(getWindowAreaBounds());
}
super.setExtendedState(state);
}
/**
* 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

View File

@@ -13,8 +13,10 @@ public interface RSEvictingDualNodeHashTable extends NodeCache
void reset();
@Import("capacity")
@Override
void setCapacity(int capacity);
@Import("remainingCapacity")
@Override
void setRemainingCapacity(int remainingCapacity);
}