fixd a bug where HUD will draw on top of console window

This commit is contained in:
minjaesong
2019-08-19 02:05:00 +09:00
parent 89746c3b6e
commit 9e775d9d57
5 changed files with 15 additions and 8 deletions

View File

@@ -1114,12 +1114,14 @@ public class AppLoader implements ApplicationListener {
public static void printdbgerr(Object obj, Object message) { public static void printdbgerr(Object obj, Object message) {
if (IS_DEVELOPMENT_BUILD) { if (IS_DEVELOPMENT_BUILD) {
System.err.println("[" + obj.getClass().getSimpleName() + "] " + message.toString()); String out = (obj instanceof String) ? (String) obj : obj.getClass().getSimpleName();
System.err.println("[" + out + "] " + message.toString());
} }
} }
public static void printmsg(Object obj, Object message) { public static void printmsg(Object obj, Object message) {
System.out.println("[" + obj.getClass().getSimpleName() + "] " + message.toString()); String out = (obj instanceof String) ? (String) obj : obj.getClass().getSimpleName();
System.out.println("[" + out + "] " + message.toString());
} }
public static ShaderProgram loadShader(String vert, String frag) { public static ShaderProgram loadShader(String vert, String frag) {

View File

@@ -193,7 +193,14 @@ class TitleScreen(batch: SpriteBatch) : IngameInstance(batch) {
private var introUncoverDeltaCounter = 0f private var introUncoverDeltaCounter = 0f
private var updateAkku = 0.0 private var updateAkku = 0.0
private var fucklatch = false
override fun render(updateRate: Float) { override fun render(updateRate: Float) {
if (!fucklatch) {
printdbg(this, "render start")
fucklatch = true
}
// async update and render // async update and render
val dt = Gdx.graphics.rawDeltaTime val dt = Gdx.graphics.rawDeltaTime

View File

@@ -2,7 +2,6 @@ package net.torvald.terrarum.gamecontroller
import com.badlogic.gdx.Gdx import com.badlogic.gdx.Gdx
import com.badlogic.gdx.Input import com.badlogic.gdx.Input
import net.torvald.terrarum.AppLoader.printdbg
import net.torvald.util.sortedArrayListOf import net.torvald.util.sortedArrayListOf
import java.util.* import java.util.*
@@ -36,9 +35,6 @@ object KeyToggler {
fun update(toggleGameKeys: Boolean) { fun update(toggleGameKeys: Boolean) {
for (it in 0..255) { for (it in 0..255) {
if (!toggleGameKeys && gameKeys.contains(it)) { if (!toggleGameKeys && gameKeys.contains(it)) {
if (Gdx.input.isKeyPressed(it))
printdbg(this, "Disallowed key: $it")
continue continue
} }

View File

@@ -381,8 +381,10 @@ open class TerrarumIngame(batch: SpriteBatch) : IngameInstance(batch) {
consoleHandler, consoleHandler,
uiCheatMotherfuckerNootNoot uiCheatMotherfuckerNootNoot
) )
uiAliasesPausing.forEach { addUI(it) } // put them all to the UIContainer // UIFixture is handled "dirtily" (calling directly from the render/update code) because it's dynamic
// Therefore, console window will be drawn behind of the thing
uiAliases.forEach { addUI(it) } // put them all to the UIContainer uiAliases.forEach { addUI(it) } // put them all to the UIContainer
uiAliasesPausing.forEach { addUI(it) } // put them all to the UIContainer

View File

@@ -25,7 +25,7 @@ internal object JavaIMTest : ConsoleCommand {
Echo("[TextInputText] (input canceled)") Echo("[TextInputText] (input canceled)")
} }
} }
Gdx.input.getTextInput(inputListener, "TextInputTest", "Testing the text input", "type anything!") Gdx.input.getTextInput(inputListener, "TextInputTest", "", "type anything!")
} }
override fun printUsage() { override fun printUsage() {