From 9090a0f095af855518cb899f36346d79e0a07b0b Mon Sep 17 00:00:00 2001 From: Bryson Steck Date: Sat, 20 May 2023 22:32:20 -0600 Subject: trying windows workaround --- .../ServerCraft/controllers/PrimaryController.kt | 8 +++++--- .../xyz/brysonsteck/ServerCraft/primary.fxml | 24 +++++++++++----------- 2 files changed, 17 insertions(+), 15 deletions(-) (limited to 'src') diff --git a/src/main/kotlin/xyz/brysonsteck/ServerCraft/controllers/PrimaryController.kt b/src/main/kotlin/xyz/brysonsteck/ServerCraft/controllers/PrimaryController.kt index d445923..11bcf5c 100644 --- a/src/main/kotlin/xyz/brysonsteck/ServerCraft/controllers/PrimaryController.kt +++ b/src/main/kotlin/xyz/brysonsteck/ServerCraft/controllers/PrimaryController.kt @@ -351,11 +351,13 @@ class PrimaryController { @FXML private fun onToggleConsole() { + // this os variable is a workaround for weird issues on windows + val os = System.getProperty("os.name").lowercase() if (showingConsole) { - primary.getScene().window.height = 743.0 + primary.getScene().window.height = if (os.contains("win")) 750.0 else 743.0 dropDownIcon.image = Image(App().javaClass.getResourceAsStream("icons/arrow_down.png")) } else { - primary.getScene().window.height = 905.0 + primary.getScene().window.height = if (os.contains("win")) 915.0 else 905.0 dropDownIcon.image = Image(App().javaClass.getResourceAsStream("icons/arrow_up.png")) } showingConsole = !showingConsole @@ -735,7 +737,7 @@ class PrimaryController { val hasProperties = File(directory + File.separator + "server.properties").isFile val hasServer = findServerJar() - if (hasDummy && hasServer && hasProperties) { + if (hasDummy && hasServer) { // server complete, just read jproperties statusBar.text = "Server found!" startButton.isDisable = false diff --git a/src/main/resources/xyz/brysonsteck/ServerCraft/primary.fxml b/src/main/resources/xyz/brysonsteck/ServerCraft/primary.fxml index ea5651f..21f2e5e 100644 --- a/src/main/resources/xyz/brysonsteck/ServerCraft/primary.fxml +++ b/src/main/resources/xyz/brysonsteck/ServerCraft/primary.fxml @@ -23,9 +23,9 @@ - + - +