mirror of
https://github.com/curioustorvald/Terrarum.git
synced 2026-06-10 18:44:05 +09:00
Former-commit-id: 851e141fc91b170190d6027f42f59906dda0f31f Former-commit-id: 03dbb9da1788e1c50e84ae33d95f76194ad9a08d
43 lines
1.0 KiB
Kotlin
43 lines
1.0 KiB
Kotlin
package net.torvald.terrarum.console
|
|
|
|
import net.torvald.imagefont.GameFontBase
|
|
import net.torvald.terrarum.langpack.Lang
|
|
import net.torvald.terrarum.Terrarum
|
|
import org.apache.commons.csv.CSVRecord
|
|
import org.newdawn.slick.SlickException
|
|
|
|
import java.io.IOException
|
|
|
|
/**
|
|
* Created by minjaesong on 16-01-25.
|
|
*/
|
|
internal object SetLocale : ConsoleCommand {
|
|
override fun execute(args: Array<String>) {
|
|
if (args.size == 2) {
|
|
val prevLocale = Terrarum.gameLocale
|
|
Terrarum.gameLocale = args[1]
|
|
try {
|
|
Echo("Set locale to '" + Terrarum.gameLocale + "'.")
|
|
}
|
|
catch (e: IOException) {
|
|
Echo("could not read lang file.")
|
|
Terrarum.gameLocale = prevLocale
|
|
}
|
|
|
|
}
|
|
else if (args.size == 1) {
|
|
|
|
Echo("Locales:")
|
|
|
|
Lang.languageList.forEach { Echo("--> $it") }
|
|
}
|
|
else {
|
|
printUsage()
|
|
}
|
|
}
|
|
|
|
override fun printUsage() {
|
|
Echo("Usage: setlocale [locale]")
|
|
}
|
|
}
|