mirror of
https://gitlab.com/2009scape/09launcher.git
synced 2025-12-09 16:45:54 -07:00
Launcher now has selectable profiles for live, testing, and local
This commit is contained in:
parent
6ea4c51ad2
commit
b5e4dc3d23
2 changed files with 30 additions and 0 deletions
|
|
@ -48,6 +48,16 @@ object Json {
|
|||
launcher["closeOnClientLaunch"] = SettingsWindow.closeLauncherOnLaunch.isToggled
|
||||
launcher["notifyUpdates"] = Settings.CHECK_FOR_UPDATES
|
||||
|
||||
val ip = when(SettingsWindow.profileMode.selectedIndex)
|
||||
{
|
||||
0 -> "play.2009scape.org"
|
||||
1 -> "ryannathans.net"
|
||||
else -> "localhost"
|
||||
}
|
||||
|
||||
data["ip_management"] = ip
|
||||
data["ip_address"] = ip
|
||||
|
||||
FileWriter(CONF).use { writer ->
|
||||
writer.write(data.toJSONString())
|
||||
writer.flush()
|
||||
|
|
@ -106,6 +116,13 @@ object Json {
|
|||
|
||||
SettingsWindow.closeLauncherOnLaunch.isToggled = launcher.getOrDefault("closeOnClientLaunch", true) as Boolean
|
||||
Settings.CHECK_FOR_UPDATES = launcher.getOrDefault("notifyUpdates", true) as Boolean
|
||||
|
||||
SettingsWindow.profileMode.selectedIndex = when(data["ip_management"])
|
||||
{
|
||||
"play.2009scape.org" -> 0
|
||||
"ryannathans.net" -> 1
|
||||
else -> 2
|
||||
}
|
||||
} catch (e: Exception) {
|
||||
println("error parsing settings, replacing with defaults...")
|
||||
e.printStackTrace()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue