more pictogrammes

Former-commit-id: 670df70bbed466e56034dbdd33d7a1da31cd88d7
Former-commit-id: 2b106753155be6080d4651acca1981f10d614421
This commit is contained in:
Song Minjae
2016-08-25 21:46:01 +09:00
parent fa5e95a89d
commit 720df532aa
50 changed files with 589 additions and 265 deletions

View File

@@ -27,7 +27,7 @@ object CommandDict {
Pair("tp", TeleportPlayer()),
Pair("cat", CatStdout()),
Pair("exportav", ExportAV()),
Pair("setgl", SetGlobalLightLevel()),
Pair("setgl", SetGlobalLightOverride()),
Pair("getfaction", GetFactioning()),
Pair("auth", Terrarum.ingame.auth),
Pair("spawnball", SpawnPhysTestBall()),

View File

@@ -6,7 +6,11 @@ import net.torvald.terrarum.Terrarum
/**
* Created by minjaesong on 16-02-17.
*/
class SetGlobalLightLevel : ConsoleCommand {
class SetGlobalLightOverride : ConsoleCommand {
var lightOverride = false
private set
override fun execute(args: Array<String>) {
if (args.size == 4) {
try {
@@ -15,6 +19,7 @@ class SetGlobalLightLevel : ConsoleCommand {
val b = args[3].toInt()
val GL = LightmapRenderer.constructRGBFromInt(r, g, b)
lightOverride = true
Terrarum.ingame.world.globalLight = GL
}
catch (e: NumberFormatException) {
@@ -37,7 +42,10 @@ class SetGlobalLightLevel : ConsoleCommand {
}
}
catch (e: NumberFormatException) {
Echo().execute("Wrong number input.")
if (args[1].toLowerCase() == "none")
lightOverride = false
else
Echo().execute("Wrong number input.")
}
}
@@ -47,6 +55,6 @@ class SetGlobalLightLevel : ConsoleCommand {
}
override fun printUsage() {
Echo().execute("Usage: setgl [raw_value|r g b]")
Echo().execute("Usage: setgl [raw_value|r g b|“none”]")
}
}