F4 to hide GUI

This commit is contained in:
minjaesong
2023-08-25 09:11:56 +09:00
parent 32e750eb6a
commit eeee1ebdbc
4 changed files with 10 additions and 3 deletions

View File

@@ -1,5 +1,6 @@
package net.torvald.terrarum
import com.badlogic.gdx.Input
import com.badlogic.gdx.utils.Disposable
import com.badlogic.gdx.utils.GdxRuntimeException
import net.torvald.terrarum.App.printdbg
@@ -9,6 +10,7 @@ import net.torvald.terrarum.gameactors.ActorID
import net.torvald.terrarum.gameactors.ActorWithBody
import net.torvald.terrarum.gameactors.ActorWithBody.Companion.PHYS_EPSILON_DIST
import net.torvald.terrarum.gameactors.BlockMarkerActor
import net.torvald.terrarum.gamecontroller.KeyToggler
import net.torvald.terrarum.gamecontroller.TerrarumKeyboardEvent
import net.torvald.terrarum.gameitems.ItemID
import net.torvald.terrarum.gameworld.GameWorld
@@ -165,6 +167,7 @@ open class IngameInstance(val batch: FlippingSpriteBatch, val isMultiplayer: Boo
override fun show() {
// the very basic show() implementation
KeyToggler.forceSet(Input.Keys.F4, false)
// add blockmarking_actor into the actorlist
(CommonResourcePool.get("blockmarking_actor") as BlockMarkerActor).let {

View File

@@ -67,7 +67,7 @@ basegame
// Commit counts up to the Release 0.3.1: 2278
// Commit counts up to the Release 0.3.2: 2732
const val VERSION_TAG: String = "test002"
const val VERSION_TAG: String = "test003"
//////////////////////////////////////////////////////////
// CONFIGURATION FOR TILE MAKER //

View File

@@ -391,8 +391,10 @@ object IngameRenderer : Disposable {
batch.shader = null
batch.color = Color.WHITE
uiContainer?.forEach {
it?.render(batch, camera)
if (!KeyToggler.isOn(Input.Keys.F4)) {
uiContainer?.forEach {
it?.render(batch, camera)
}
}
}

View File

@@ -258,6 +258,8 @@ class TitleScreen(batch: FlippingSpriteBatch) : IngameInstance(batch) {
override fun show() {
printdbg(this, "show() called")
KeyToggler.forceSet(Input.Keys.F4, false)
initViewPort(App.scr.width, App.scr.height)