Collapsed conf values

This commit is contained in:
nelle 2023-10-30 01:45:09 -06:00
parent e51ae92ce7
commit 4f44bc1125

View file

@ -9,13 +9,8 @@ import java.nio.file.Path
import java.nio.file.Paths import java.nio.file.Paths
import java.util.* import java.util.*
//SET ALL PROPERTIES
val prop = Properties() val prop = Properties()
val winWS = prop.getProperty("WINDOW_HEIGHT")
//val WINDOW_WIDTH = 80
//TODO: make them variables work :(
class Config { class Config {
val file = File("./run/potrogue.conf") val file = File("./run/potrogue.conf")
@ -38,18 +33,15 @@ class Config {
prop.load(it) prop.load(it)
prop.setProperty("WINDOW_WIDTH", "80") prop.setProperty("WINDOW_WIDTH", "80")
prop.setProperty("WINDOW_HEIGHT", "50") prop.setProperty("WINDOW_HEIGHT", "50")
prop.setProperty("DUNGEON_LEVELS", "2")
prop.setProperty("SIDEBAR_WIDTH", "18")
prop.setProperty("LOG_AREA_HEIGHT", "12")
val out: OutputStream = FileOutputStream(file) val out: OutputStream = FileOutputStream(file)
prop.store(out, "some comment") prop.store(out, "some comment")
} }
//SET ALL PROPERTIES
//val winWS = prop.getProperty("WINDOW_WIDTH")
//val WINDOW_WIDTH = winWS.filter { it.isDigit() }
//println(WINDOW_WIDTH)
} }
val winWS = prop.getProperty("WINDOW_WIDTH") //SET ALL PROPERTIES
val WINDOW_WIDTH: Int = winWS.toInt() val WINDOW_WIDTH: Int = (prop.getProperty("WINDOW_WIDTH")).toInt()
} }