mirror of
https://gitlab.com/2009scape/09launcher.git
synced 2025-12-09 16:45:54 -07:00
No longer dump stuff in home folder on Linux
This commit is contained in:
parent
dfbe3414a1
commit
57f6ede15d
3 changed files with 22 additions and 5 deletions
|
|
@ -10,7 +10,7 @@ fun Component.placeAt(x: Int, y: Int, width: Int, height: Int){
|
||||||
|
|
||||||
fun launchClient() {
|
fun launchClient() {
|
||||||
println("Launching client now.")
|
println("Launching client now.")
|
||||||
var proc = Runtime.getRuntime().exec("java -jar " + Settings.SAVE_NAME, null, File(System.getProperty("user.home")))
|
var proc = Runtime.getRuntime().exec("java -jar " + Settings.SAVE_NAME, null, File(Settings.SAVE_DIR))
|
||||||
if(proc.isAlive && SettingsWindow.closeLauncherOnLaunch.isToggled){
|
if(proc.isAlive && SettingsWindow.closeLauncherOnLaunch.isToggled){
|
||||||
exitProcess(0)
|
exitProcess(0)
|
||||||
} else if(SettingsWindow.closeLauncherOnLaunch.isToggled) {
|
} else if(SettingsWindow.closeLauncherOnLaunch.isToggled) {
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,9 @@
|
||||||
object Settings {
|
object Settings {
|
||||||
val SAVE_DIR = System.getProperty("user.home")
|
val os = System.getProperty("os.name").toLowerCase()
|
||||||
|
var SAVE_DIR = when(os.contains("nix") || os.contains("nux") || os.contains("aix")) {
|
||||||
|
true -> System.getProperty("user.home") + "/.local/share/2009scape"
|
||||||
|
false -> System.getProperty("user.home")
|
||||||
|
}
|
||||||
val SAVE_NAME = "2009scape.jar"
|
val SAVE_NAME = "2009scape.jar"
|
||||||
val DOWNLOAD_URL = "http://play.2009scape.org/2009scape.jar"
|
val DOWNLOAD_URL = "http://play.2009scape.org/2009scape.jar"
|
||||||
val LAUNCHER_URL = "https://gitlab.com/2009scape/09launcher/-/jobs/artifacts/master/raw/build/libs/2009scape.jar?job=build"
|
val LAUNCHER_URL = "https://gitlab.com/2009scape/09launcher/-/jobs/artifacts/master/raw/build/libs/2009scape.jar?job=build"
|
||||||
|
|
|
||||||
|
|
@ -8,11 +8,24 @@ import java.io.FileWriter
|
||||||
|
|
||||||
object Json {
|
object Json {
|
||||||
|
|
||||||
val HOME = System.getProperty("user.home")
|
val os = System.getProperty("os.name").toLowerCase()
|
||||||
|
var HOME = when(os.contains("nix") || os.contains("nux") || os.contains("aix")) {
|
||||||
|
true -> System.getProperty("user.home") + "/.local/share/2009scape"
|
||||||
|
false -> System.getProperty("user.home")
|
||||||
|
}
|
||||||
val CONF = HOME + File.separator + "config.json"
|
val CONF = HOME + File.separator + "config.json"
|
||||||
|
|
||||||
var data: JSONObject = JSONObject()
|
var data: JSONObject = JSONObject()
|
||||||
|
|
||||||
|
init {
|
||||||
|
val dir = File(HOME)
|
||||||
|
if (!dir.exists()) {
|
||||||
|
dir.mkdirs()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
fun save(){
|
fun save(){
|
||||||
|
val osName = System.getProperty("os.name").toLowerCase()
|
||||||
val customization = data["customization"] as JSONObject
|
val customization = data["customization"] as JSONObject
|
||||||
val xpDrops = customization["xpdrops"] as JSONObject
|
val xpDrops = customization["xpdrops"] as JSONObject
|
||||||
val slayer = customization["slayer"] as JSONObject
|
val slayer = customization["slayer"] as JSONObject
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue