storage chest still wip

This commit is contained in:
minjaesong
2021-03-13 15:48:14 +09:00
parent d093c2cb30
commit c25e9f92be
11 changed files with 148 additions and 98 deletions

View File

@@ -113,8 +113,8 @@ class IngameController(val terrarumIngame: TerrarumIngame) : InputAdapter() {
}
}
terrarumIngame.uiContainer.forEach { it.keyDown(keycode) } // for KeyboardControlled UIcanvases
terrarumIngame.uiContainer.forEach { it?.keyDown(keycode) } // for KeyboardControlled UIcanvases
// Debug UIs
if (keycode == Input.Keys.GRAVE) {
terrarumIngame.consoleHandler.toggleOpening()
@@ -138,9 +138,8 @@ class IngameController(val terrarumIngame: TerrarumIngame) : InputAdapter() {
terrarumIngame.uiQuickBar.setAsOpen()
}
terrarumIngame.uiContainer.forEach { it.keyUp(keycode) } // for KeyboardControlled UIcanvases
terrarumIngame.uiContainer.forEach { it?.keyUp(keycode) } // for KeyboardControlled UIcanvases
// screenshot key
if (keycode == Input.Keys.F12) f12Down = false
@@ -149,12 +148,12 @@ class IngameController(val terrarumIngame: TerrarumIngame) : InputAdapter() {
}
override fun keyTyped(character: Char): Boolean {
terrarumIngame.uiContainer.forEach { if (it.isVisible) it.keyTyped(character) }
terrarumIngame.uiContainer.forEach { if (it?.isVisible == true) it.keyTyped(character) }
return true
}
override fun mouseMoved(screenX: Int, screenY: Int): Boolean {
terrarumIngame.uiContainer.forEach { it.mouseMoved(screenX, screenY) }
terrarumIngame.uiContainer.forEach { it?.mouseMoved(screenX, screenY) }
return true
}
@@ -162,7 +161,7 @@ class IngameController(val terrarumIngame: TerrarumIngame) : InputAdapter() {
// don't separate Player from this! Physics will break, esp. airborne manoeuvre
if (!terrarumIngame.paused) {
// fire world click events; the event is defined as Ingame's (or any others') WorldClick event
if (terrarumIngame.uiContainer.map { if ((it.isOpening || it.isOpened) && it.mouseUp) 1 else 0 }.sum() == 0) { // no UI on the mouse, right?
if (terrarumIngame.uiContainer.map { if ((it?.isOpening == true || it?.isOpened == true) && it.mouseUp) 1 else 0 }.sum() == 0) { // no UI on the mouse, right?
if (
button == AppLoader.getConfigInt("config_mouseprimary") ||
@@ -181,8 +180,7 @@ class IngameController(val terrarumIngame: TerrarumIngame) : InputAdapter() {
terrarumIngame.uiQuickBar.setAsOpen()
}
terrarumIngame.uiContainer.forEach { it.touchUp(screenX, screenY, pointer, button) } // for MouseControlled UIcanvases
terrarumIngame.uiContainer.forEach { it?.touchUp(screenX, screenY, pointer, button) } // for MouseControlled UIcanvases
return true
}
@@ -197,18 +195,18 @@ class IngameController(val terrarumIngame: TerrarumIngame) : InputAdapter() {
}
}
terrarumIngame.uiContainer.forEach { it.scrolled(amount) }
terrarumIngame.uiContainer.forEach { it?.scrolled(amount) }
return true
}
override fun touchDragged(screenX: Int, screenY: Int, pointer: Int): Boolean {
terrarumIngame.uiContainer.forEach { it.touchDragged(screenX, screenY, pointer) }
terrarumIngame.uiContainer.forEach { it?.touchDragged(screenX, screenY, pointer) }
return true
}
override fun touchDown(screenX: Int, screenY: Int, pointer: Int, button: Int): Boolean {
terrarumIngame.uiContainer.forEach { it.touchDown(screenX, screenY, pointer, button) }
terrarumIngame.uiContainer.forEach { it?.touchDown(screenX, screenY, pointer, button) }
// pie menu
if (button == AppLoader.getConfigInt("config_mousequicksel")) {
terrarumIngame.uiPieMenu.setAsOpen()