diff --git a/plugin-playground/src/main/kotlin/KondoKit/plugin.kt b/plugin-playground/src/main/kotlin/KondoKit/plugin.kt index e8233f9..1bd9ecd 100644 --- a/plugin-playground/src/main/kotlin/KondoKit/plugin.kt +++ b/plugin-playground/src/main/kotlin/KondoKit/plugin.kt @@ -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) diff --git a/plugin-playground/src/main/kotlin/ToggleResizableSD/plugin.kt b/plugin-playground/src/main/kotlin/ToggleResizableSD/plugin.kt index 2ce17cd..58ed363 100644 --- a/plugin-playground/src/main/kotlin/ToggleResizableSD/plugin.kt +++ b/plugin-playground/src/main/kotlin/ToggleResizableSD/plugin.kt @@ -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) }