mirror of
https://gitlab.com/2009scape/rt4-client.git
synced 2025-12-09 16:45:46 -07:00
Restore comments, remove the black spacer bar on platforms where it is not required
This commit is contained in:
parent
413601d0e5
commit
de5cbda4f9
2 changed files with 10 additions and 5 deletions
|
|
@ -66,7 +66,7 @@ class plugin : Plugin() {
|
|||
@Exposed(description = "Start minimized/collapsed by default")
|
||||
var launchMinimized = false
|
||||
|
||||
private const val FIXED_WIDTH = 782
|
||||
private const val FIXED_WIDTH = 765
|
||||
private const val NAVBAR_WIDTH = 30
|
||||
private const val MAIN_CONTENT_WIDTH = 242
|
||||
private const val WRENCH_ICON = 907
|
||||
|
|
@ -118,16 +118,19 @@ class plugin : Plugin() {
|
|||
private fun UpdateDisplaySettings() {
|
||||
val mode = GetWindowMode()
|
||||
val currentScrollPaneWidth = if (mainContentPanel.isVisible) NAVBAR_WIDTH + MAIN_CONTENT_WIDTH else NAVBAR_WIDTH
|
||||
val osName = System.getProperty("os.name").toLowerCase()
|
||||
val offset = if (osName == "win") 16 else 0
|
||||
when (mode) {
|
||||
WindowMode.FIXED -> {
|
||||
if (frame.width < FIXED_WIDTH + currentScrollPaneWidth) {
|
||||
frame.setSize(FIXED_WIDTH + currentScrollPaneWidth, frame.height)
|
||||
if (frame.width < FIXED_WIDTH + currentScrollPaneWidth + offset) {
|
||||
frame.setSize(FIXED_WIDTH + currentScrollPaneWidth + offset, frame.height)
|
||||
}
|
||||
val difference = frame.width - (FIXED_WIDTH + currentScrollPaneWidth)
|
||||
|
||||
val difference = frame.width - (FIXED_WIDTH + offset + currentScrollPaneWidth)
|
||||
GameShell.leftMargin = difference / 2
|
||||
}
|
||||
WindowMode.RESIZABLE -> {
|
||||
GameShell.canvasWidth = frame.width - (currentScrollPaneWidth + 16)
|
||||
GameShell.canvasWidth = frame.width - (currentScrollPaneWidth + offset)
|
||||
}
|
||||
}
|
||||
rightPanelWrapper?.preferredSize = Dimension(currentScrollPaneWidth, frame.height)
|
||||
|
|
|
|||
|
|
@ -57,6 +57,7 @@ class plugin : Plugin() {
|
|||
}
|
||||
|
||||
fun toggleResizableSd() {
|
||||
//We only want to toggle resizable SD when we are logged in and the lobby/welcome interface is not open.
|
||||
if (InterfaceList.aClass13_26 == null || client.gameState != 30) {
|
||||
return
|
||||
}
|
||||
|
|
@ -85,6 +86,7 @@ class plugin : Plugin() {
|
|||
|
||||
override fun OnLogout() {
|
||||
if (DisplayMode.resizableSD && wantHd) {
|
||||
//Because resizable SD always uses the "HD" size canvas/window mode (check the in-game Graphics Options with resizeable SD enabled if you don't believe me!), useHD becomes true when logging out, so logging out with resizeSD enabled means "HD" will always be enabled on the login screen after logging out, so we might as well fix the HD flyover by setting resizableSD to false first, and then calling setWindowMode to replace the canvas and set newMode to 2.
|
||||
DisplayMode.resizableSD = false
|
||||
DisplayMode.setWindowMode(true, 2, GameShell.frameWidth, GameShell.frameHeight)
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue