console: actor id shower to only show up when the console is authorised

This commit is contained in:
minjaesong
2021-09-07 20:47:47 +09:00
parent bbd7878630
commit 7c38e9a7fd
2 changed files with 12 additions and 7 deletions

View File

@@ -11,7 +11,6 @@ import net.torvald.terrarum.console.CommandInterpreter
import net.torvald.terrarum.gameactors.AVKey
import net.torvald.terrarum.langpack.Lang
import net.torvald.terrarum.modulebasegame.TerrarumIngame
import net.torvald.terrarumsansbitmap.gdx.GameFontBase
import net.torvald.util.CircularArray
@@ -56,14 +55,19 @@ class ConsoleWindow : UICanvas() {
override fun updateUI(delta: Float) {
Terrarum.ingame?.let {
lb.clear()
if (Authenticator.b()) {
lb.clear()
val actorsUnderCursor = it.getActorsAt(Terrarum.mouseX, Terrarum.mouseY)
actorsUnderCursor.forEach {
lb.add("${it.referenceID} (${it.actorValue[AVKey.NAME] ?: "\u03AF-${it.javaClass.simpleName}"})")
val actorsUnderCursor = it.getActorsAt(Terrarum.mouseX, Terrarum.mouseY)
actorsUnderCursor.forEach {
lb.add("${it.referenceID} (${it.actorValue[AVKey.NAME] ?: "\u03AF-${it.javaClass.simpleName}"})")
}
it.setTooltipMessage(if (lb.size > 0) lb.joinToString("\n") else null)
}
else {
it.setTooltipMessage(null)
}
it.setTooltipMessage(if (lb.size > 0) lb.joinToString("\n") else null)
}
}

View File

@@ -25,6 +25,7 @@ Each file on the Savegame has following convention:
|Worlds|world$n ($n is a world index)|$n|
|Actors|actor$n ($n is an Actor ID)|$n|
User formats can have ID of -2147483648..-65536
### Solving Problems