Separated langpack, concept art for inventory UI

Former-commit-id: 7a98df93b4ef50b47283abcd99576d6fbefc9cc5
Former-commit-id: db6e34417ccf84e59ba68547f30459cb4b188eb7
This commit is contained in:
Song Minjae
2016-07-04 23:08:16 +09:00
parent 2ed435165a
commit 2e46df67a8
91 changed files with 70088 additions and 720 deletions

View File

@@ -41,7 +41,8 @@ object CommandDict {
// Test codes
Pair("bulletintest", SetBulletin()),
Pair("gsontest", GsonTest())
Pair("gsontest", GsonTest()),
Pair("tips", PrintRandomTips())
)
fun getCommand(commandName: String): ConsoleCommand {

View File

@@ -15,7 +15,16 @@ import java.util.regex.Pattern
*/
object CommandInterpreter {
private val commandsNoAuth = arrayOf("auth", "qqq", "zoom", "setlocale", "getlocale", "help", "version")
private val commandsNoAuth = arrayOf(
"auth",
"qqq",
"zoom",
"setlocale",
"getlocale",
"help",
"version",
"tips"
)
private val ccW = GameFontBase.colToCode["w"]
private val ccG = GameFontBase.colToCode["g"]

View File

@@ -16,7 +16,16 @@ internal class Echo : ConsoleCommand {
}
fun execute(single_line: String) {
(Terrarum.game.consoleHandler.UI as ConsoleWindow).sendMessage(single_line)
val sb = StringBuilder()
for (ch in single_line) {
if (ch == '\n') {
(Terrarum.game.consoleHandler.UI as ConsoleWindow).sendMessage(sb.toString())
sb.delete(0, sb.length - 1)
}
else
sb.append(ch)
}
(Terrarum.game.consoleHandler.UI as ConsoleWindow).sendMessage(sb.toString())
}
override fun printUsage() {

View File

@@ -10,9 +10,9 @@ class GetLocale : ConsoleCommand {
override fun execute(args: Array<String>) {
Echo().execute(
"Locale: "
+ Lang.get("LANGUAGE_THIS")
+ Lang["MENU_LANGUAGE_THIS"]
+ " ("
+ Lang.get("LANGUAGE_EN")
+ Lang["MENU_LANGUAGE_THIS_EN"]
+ ")")
}

View File

@@ -0,0 +1,17 @@
package net.torvald.terrarum.console
import net.torvald.terrarum.langpack.Lang
import java.util.*
/**
* Created by minjaesong on 16-07-04.
*/
class PrintRandomTips : ConsoleCommand {
override fun execute(args: Array<String>) {
Echo().execute(Lang["GAME_TIPS_${Random().nextInt(Lang.TIPS_COUNT) + 1}"])
}
override fun printUsage() {
Echo().execute("Prints random tips for game.")
}
}

View File

@@ -29,8 +29,7 @@ class SetLocale : ConsoleCommand {
val echo = Echo()
echo.execute("Locales:")
val record = Lang.getRecord("LANGUAGE_ID")
record.forEach { field -> echo.execute("] " + field) }
Lang.languageList.forEach { echo.execute("--> $it") }
}
else {
printUsage()

View File

@@ -1,13 +1,16 @@
package net.torvald.terrarum.console
import net.torvald.terrarum.Terrarum
import net.torvald.terrarum.langpack.Lang
/**
* Created by minjaesong on 16-04-23.
*/
class Version : ConsoleCommand {
override fun execute(args: Array<String>) {
Echo().execute("${Terrarum.NAME} ${Terrarum.VERSION_STRING}")
val echo = Echo()
echo.execute("${Terrarum.NAME} ${Terrarum.VERSION_STRING}")
echo.execute("Polyglot language pack version ${Lang.POLYGLOT_VERSION}")
}
override fun printUsage() {