From 78b09b27909b1f4221146cbe7367eccddc25a615 Mon Sep 17 00:00:00 2001 From: minjaesong Date: Thu, 20 Jul 2017 22:25:40 +0900 Subject: [PATCH] action listener on textbutton list --- src/net/torvald/terrarum/Ingame.kt | 11 ++-- src/net/torvald/terrarum/Terrarum.kt | 26 ++++---- src/net/torvald/terrarum/TitleScreen.kt | 64 +++++++++++++++++-- .../torvald/terrarum/UIItemInventoryElem.kt | 20 ++++++ ...{GameController.kt => IngameController.kt} | 43 ++++++------- .../terrarum/itemproperties/GameItem.kt | 2 +- src/net/torvald/terrarum/ui/UICanvas.kt | 5 ++ src/net/torvald/terrarum/ui/UIItem.kt | 6 +- .../torvald/terrarum/ui/UIItemImageButton.kt | 28 ++++++++ .../torvald/terrarum/ui/UIItemTextButton.kt | 28 ++++++++ .../terrarum/ui/UIItemTextButtonList.kt | 29 +++++++++ src/net/torvald/terrarum/ui/UIStartMenu.kt | 4 +- .../torvald/terrarum/weather/WeatherMixer.kt | 2 - 13 files changed, 215 insertions(+), 53 deletions(-) rename src/net/torvald/terrarum/gamecontroller/{GameController.kt => IngameController.kt} (78%) diff --git a/src/net/torvald/terrarum/Ingame.kt b/src/net/torvald/terrarum/Ingame.kt index 80f6ea6f8..4ba2625af 100644 --- a/src/net/torvald/terrarum/Ingame.kt +++ b/src/net/torvald/terrarum/Ingame.kt @@ -14,7 +14,7 @@ import net.torvald.terrarum.concurrent.ThreadParallel import net.torvald.terrarum.console.* import net.torvald.terrarum.gameactors.* import net.torvald.terrarum.gameactors.physicssolver.CollisionSolver -import net.torvald.terrarum.gamecontroller.GameController +import net.torvald.terrarum.gamecontroller.IngameController import net.torvald.terrarum.gamecontroller.KeyToggler import net.torvald.terrarum.gameworld.GameWorld import net.torvald.terrarum.gameworld.WorldSimulator @@ -32,7 +32,6 @@ import javax.swing.JOptionPane import com.badlogic.gdx.graphics.OrthographicCamera import net.torvald.random.HQRNG -import net.torvald.terrarum.blockproperties.BlockCodex import net.torvald.terrarum.ui.* import net.torvald.terrarum.worldgenerator.RoguelikeRandomiser import net.torvald.terrarum.worldgenerator.WorldGenerator @@ -281,6 +280,8 @@ class Ingame(val batch: SpriteBatch) : Screen { } } + private val ingameController = IngameController(this) + /** Load rest of the game with GL context */ fun postInit() { //LightmapRenderer.world = this.world @@ -288,7 +289,7 @@ class Ingame(val batch: SpriteBatch) : Screen { //FeaturesDrawer.world = this.world - Gdx.input.inputProcessor = GameController + Gdx.input.inputProcessor = ingameController initViewPort(Terrarum.WIDTH, Terrarum.HEIGHT) @@ -471,7 +472,7 @@ class Ingame(val batch: SpriteBatch) : Screen { KeyToggler.update() - GameController.update(delta) + ingameController.update(delta) if (!paused) { @@ -1529,7 +1530,7 @@ class Ingame(val batch: SpriteBatch) : Screen { // Set up viewport when window is resized - initViewPort(width, height) + initViewPort(Terrarum.WIDTH, Terrarum.HEIGHT) diff --git a/src/net/torvald/terrarum/Terrarum.kt b/src/net/torvald/terrarum/Terrarum.kt index 7c128985d..663230f33 100644 --- a/src/net/torvald/terrarum/Terrarum.kt +++ b/src/net/torvald/terrarum/Terrarum.kt @@ -13,9 +13,9 @@ import com.badlogic.gdx.graphics.glutils.ShaderProgram import com.badlogic.gdx.graphics.glutils.ShapeRenderer import com.google.gson.JsonArray import com.google.gson.JsonPrimitive -import net.torvald.random.HQRNG import net.torvald.terrarum.Terrarum.RENDER_FPS -import net.torvald.terrarum.gamecontroller.GameController +import net.torvald.terrarum.gameactors.floorInt +import net.torvald.terrarum.gamecontroller.IngameController import net.torvald.terrarum.imagefont.TinyAlphNum import net.torvald.terrarum.imagefont.Watch7SegMain import net.torvald.terrarum.imagefont.WatchDotAlph @@ -24,6 +24,8 @@ import net.torvald.terrarum.ui.ItemSlotImageBuilder import net.torvald.terrarum.ui.MessageWindow import net.torvald.terrarum.utils.JsonFetcher import net.torvald.terrarum.utils.JsonWriter +import net.torvald.terrarum.worlddrawer.FeaturesDrawer +import net.torvald.terrarum.worlddrawer.WorldCamera import net.torvald.terrarumsansbitmap.gdx.GameFontBase import net.torvald.terrarumsansbitmap.gdx.TextureRegionPack import org.lwjgl.input.Controllers @@ -400,18 +402,18 @@ object Terrarum : Game() { - ingame = Ingame(batch) + //ingame = Ingame(batch) //ingame!!.gameLoadInfoPayload = Ingame.NewWorldParameters(8192, 2048, HQRNG().nextLong()) // TODO: create world being used by title screen, and serialise it. - ingame!!.gameLoadInfoPayload = Ingame.NewWorldParameters(2400, 800, HQRNG().nextLong()) - ingame!!.gameLoadMode = Ingame.GameLoadMode.CREATE_NEW + //ingame!!.gameLoadInfoPayload = Ingame.NewWorldParameters(2400, 800, HQRNG().nextLong()) + //ingame!!.gameLoadMode = Ingame.GameLoadMode.CREATE_NEW - LoadScreen.screenToLoad = ingame!! + //LoadScreen.screenToLoad = ingame!! - //super.setScreen(TitleScreen(batch)) - super.setScreen(LoadScreen) + super.setScreen(TitleScreen(batch)) + //super.setScreen(LoadScreen) //super.setScreen(ingame) } @@ -645,13 +647,13 @@ object Terrarum : Game() { } inline val mouseX: Double - get() = GameController.mouseX.toDouble() + get() = WorldCamera.x + Gdx.input.x / (ingame?.screenZoom ?: 1f).toDouble() inline val mouseY: Double - get() = GameController.mouseY.toDouble() + get() = WorldCamera.y + Gdx.input.y / (ingame?.screenZoom ?: 1f).toDouble() @JvmStatic inline val mouseTileX: Int - get() = GameController.mouseTileX + get() = (mouseX / FeaturesDrawer.TILE_SIZE).floorInt() @JvmStatic inline val mouseTileY: Int - get() = GameController.mouseTileY + get() = (mouseY / FeaturesDrawer.TILE_SIZE).floorInt() inline val mouseScreenX: Int get() = Gdx.input.x inline val mouseScreenY: Int diff --git a/src/net/torvald/terrarum/TitleScreen.kt b/src/net/torvald/terrarum/TitleScreen.kt index f9b25a6f4..a164bb3a0 100644 --- a/src/net/torvald/terrarum/TitleScreen.kt +++ b/src/net/torvald/terrarum/TitleScreen.kt @@ -2,6 +2,7 @@ package net.torvald.terrarum import com.badlogic.gdx.Gdx import com.badlogic.gdx.Input +import com.badlogic.gdx.InputAdapter import com.badlogic.gdx.Screen import com.badlogic.gdx.graphics.* import com.badlogic.gdx.graphics.g2d.SpriteBatch @@ -67,7 +68,7 @@ class TitleScreen(val batch: SpriteBatch) : Screen { lateinit var logo: TextureRegion - + val uiContainer = ArrayList() private lateinit var uiMenu: UIHandler private fun loadThingsWhileIntroIsVisible() { @@ -92,6 +93,8 @@ class TitleScreen(val batch: SpriteBatch) : Screen { uiMenu.setAsOpen() + uiContainer.add(uiMenu) + loadDone = true } @@ -104,6 +107,9 @@ class TitleScreen(val batch: SpriteBatch) : Screen { logo = TextureRegion(Texture(Gdx.files.internal("assets/graphics/logo_placeholder.tga"))) logo.flip(false, true) + + + Gdx.input.inputProcessor = TitleScreenController(this) } private var blurWriteBuffer = lightmapFboA @@ -156,7 +162,7 @@ class TitleScreen(val batch: SpriteBatch) : Screen { // update UIs // - uiMenu.update(delta) + uiContainer.forEach { it.update(delta) } // render and blur lightmap @@ -217,7 +223,7 @@ class TitleScreen(val batch: SpriteBatch) : Screen { batch.shader = null - uiMenu.render(batch, camera) + uiContainer.forEach { it.render(batch, camera) } } private fun renderOverlayTexts() { @@ -249,7 +255,14 @@ class TitleScreen(val batch: SpriteBatch) : Screen { override fun resize(width: Int, height: Int) { // Set up viewport when window is resized - initViewPort(width, height) + initViewPort(Terrarum.WIDTH, Terrarum.HEIGHT) + + + if (loadDone) { + // resize UI by re-creating it (!!) + uiMenu.UI.resize(Terrarum.WIDTH, Terrarum.HEIGHT) + uiMenu.setPosition(0, UIStartMenu.menubarOffY) + } } override fun dispose() { @@ -260,6 +273,8 @@ class TitleScreen(val batch: SpriteBatch) : Screen { uiMenu.dispose() } + + fun setCameraPosition(newX: Float, newY: Float) { Ingame.setCameraPosition(batch, camera, newX, newY) } @@ -360,4 +375,45 @@ class TitleScreen(val batch: SpriteBatch) : Screen { } + class TitleScreenController(val screen: TitleScreen) : InputAdapter() { + override fun touchUp(screenX: Int, screenY: Int, pointer: Int, button: Int): Boolean { + screen.uiContainer.forEach { it.touchUp(screenX, screenY, pointer, button) } + return true + } + + override fun mouseMoved(screenX: Int, screenY: Int): Boolean { + screen.uiContainer.forEach { it.mouseMoved(screenX, screenY) } + return true + } + + override fun keyTyped(character: Char): Boolean { + screen.uiContainer.forEach { it.keyTyped(character) } + return true + } + + override fun scrolled(amount: Int): Boolean { + screen.uiContainer.forEach { it.scrolled(amount) } + return true + } + + override fun keyUp(keycode: Int): Boolean { + screen.uiContainer.forEach { it.keyUp(keycode) } + return true + } + + override fun touchDragged(screenX: Int, screenY: Int, pointer: Int): Boolean { + screen.uiContainer.forEach { it.touchDragged(screenX, screenY, pointer) } + return true + } + + override fun keyDown(keycode: Int): Boolean { + screen.uiContainer.forEach { it.keyDown(keycode) } + return true + } + + override fun touchDown(screenX: Int, screenY: Int, pointer: Int, button: Int): Boolean { + screen.uiContainer.forEach { it.touchDown(screenX, screenY, pointer, button) } + return true + } + } } \ No newline at end of file diff --git a/src/net/torvald/terrarum/UIItemInventoryElem.kt b/src/net/torvald/terrarum/UIItemInventoryElem.kt index b88449000..258f5ec17 100644 --- a/src/net/torvald/terrarum/UIItemInventoryElem.kt +++ b/src/net/torvald/terrarum/UIItemInventoryElem.kt @@ -178,4 +178,24 @@ class UIItemInventoryElem( override fun dispose() { itemImage?.texture?.dispose() } + + override fun keyUp(keycode: Int): Boolean { + return super.keyUp(keycode) + } + + override fun mouseMoved(screenX: Int, screenY: Int): Boolean { + return super.mouseMoved(screenX, screenY) + } + + override fun touchDragged(screenX: Int, screenY: Int, pointer: Int): Boolean { + return super.touchDragged(screenX, screenY, pointer) + } + + override fun touchUp(screenX: Int, screenY: Int, pointer: Int, button: Int): Boolean { + return super.touchUp(screenX, screenY, pointer, button) + } + + override fun scrolled(amount: Int): Boolean { + return super.scrolled(amount) + } } diff --git a/src/net/torvald/terrarum/gamecontroller/GameController.kt b/src/net/torvald/terrarum/gamecontroller/IngameController.kt similarity index 78% rename from src/net/torvald/terrarum/gamecontroller/GameController.kt rename to src/net/torvald/terrarum/gamecontroller/IngameController.kt index cc412d705..7d55fd6e8 100644 --- a/src/net/torvald/terrarum/gamecontroller/GameController.kt +++ b/src/net/torvald/terrarum/gamecontroller/IngameController.kt @@ -3,6 +3,7 @@ package net.torvald.terrarum.gamecontroller import com.badlogic.gdx.Gdx import com.badlogic.gdx.Input import com.badlogic.gdx.InputAdapter +import net.torvald.terrarum.Ingame import net.torvald.terrarum.worlddrawer.FeaturesDrawer import net.torvald.terrarum.Terrarum import net.torvald.terrarum.gameactors.* @@ -12,12 +13,9 @@ import net.torvald.terrarum.worlddrawer.WorldCamera /** * Created by minjaesong on 15-12-31. */ -object GameController : InputAdapter() { +class IngameController(val ingame: Ingame) : InputAdapter() { - - private val ingame = Terrarum.ingame!! - // these four values can also be accessed with GameContainer. // e.g. gc.mouseTileX @@ -58,16 +56,16 @@ object GameController : InputAdapter() { /////////////////// // Use item: assuming the player has only one effective grip (EquipPosition.HAND_GRIP) - if (ingame.player != null && ingame.canPlayerControl) { + if (ingame.canPlayerControl) { if (Gdx.input.isButtonPressed(Terrarum.getConfigInt("mouseprimary")) || Gdx.input.isButtonPressed(Terrarum.getConfigInt("mousesecondary"))) { - val itemOnGrip = ingame.player!!.inventory.itemEquipped[GameItem.EquipPosition.HAND_GRIP] + val itemOnGrip = ingame.player.inventory.itemEquipped[GameItem.EquipPosition.HAND_GRIP] itemOnGrip?.let { if (Gdx.input.isButtonPressed(Terrarum.getConfigInt("mouseprimary"))) { - ingame.player!!.consumePrimary(it) + ingame.player.consumePrimary(it) } if (Gdx.input.isButtonPressed(Terrarum.getConfigInt("mousesecondary"))) { - ingame.player!!.consumeSecondary(it) + ingame.player.consumeSecondary(it) } } } @@ -82,7 +80,7 @@ object GameController : InputAdapter() { override fun keyDown(keycode: Int): Boolean { if (ingame.canPlayerControl) { - ingame.player?.keyDown(keycode) + ingame.player.keyDown(keycode) } if (Terrarum.getConfigIntArray("keyquickselalt").contains(keycode) @@ -129,26 +127,23 @@ object GameController : InputAdapter() { } override fun touchUp(screenX: Int, screenY: Int, pointer: Int, button: Int): Boolean { - if (Terrarum.ingame != null) { - val ingame = Terrarum.ingame!! - // don't separate Player from this! Physics will break, esp. airborne manoeuvre - if (ingame.player != null && ingame.canPlayerControl) { - val itemOnGrip = ingame.player!!.inventory.itemEquipped[GameItem.EquipPosition.HAND_GRIP] + // don't separate Player from this! Physics will break, esp. airborne manoeuvre + if (ingame.canPlayerControl) { + val itemOnGrip = ingame.player.inventory.itemEquipped[GameItem.EquipPosition.HAND_GRIP] - if (itemOnGrip != null) { - if (button == Terrarum.getConfigInt("mouseprimary")) { - itemOnGrip.endPrimaryUse(Gdx.graphics.deltaTime) - } - if (button == Terrarum.getConfigInt("mousesecondary")) { - itemOnGrip.endSecondaryUse(Gdx.graphics.deltaTime) - } + if (itemOnGrip != null) { + if (button == Terrarum.getConfigInt("mouseprimary")) { + itemOnGrip.endPrimaryUse(Gdx.graphics.deltaTime) + } + if (button == Terrarum.getConfigInt("mousesecondary")) { + itemOnGrip.endSecondaryUse(Gdx.graphics.deltaTime) } } - - - ingame.uiContainer.forEach { it.touchUp(screenX, screenY, pointer, button) } // for MouseControlled UIcanvases } + + ingame.uiContainer.forEach { it.touchUp(screenX, screenY, pointer, button) } // for MouseControlled UIcanvases + return true } diff --git a/src/net/torvald/terrarum/itemproperties/GameItem.kt b/src/net/torvald/terrarum/itemproperties/GameItem.kt index 6fafb9b24..0c6a396c7 100644 --- a/src/net/torvald/terrarum/itemproperties/GameItem.kt +++ b/src/net/torvald/terrarum/itemproperties/GameItem.kt @@ -139,7 +139,7 @@ abstract class GameItem : Comparable, Cloneable { * * note: DO NOT super() this! * - * Consumption function is executed in net.torvald.terrarum.gamecontroller.GameController, + * Consumption function is executed in net.torvald.terrarum.gamecontroller.IngameController, * in which the function itself is defined in net.torvald.terrarum.gameactors.ActorInventory */ open fun primaryUse(delta: Float): Boolean = false diff --git a/src/net/torvald/terrarum/ui/UICanvas.kt b/src/net/torvald/terrarum/ui/UICanvas.kt index a3329e7fd..099deed22 100644 --- a/src/net/torvald/terrarum/ui/UICanvas.kt +++ b/src/net/torvald/terrarum/ui/UICanvas.kt @@ -110,6 +110,11 @@ abstract class UICanvas { //uiItems.forEach { it.keyT } } + open fun resize(width: Int, height: Int) { + this.width = width + this.height = height + } + companion object { const val OPENCLOSE_GENERIC = 0.2f diff --git a/src/net/torvald/terrarum/ui/UIItem.kt b/src/net/torvald/terrarum/ui/UIItem.kt index 6420a3fd4..8b09c5a56 100644 --- a/src/net/torvald/terrarum/ui/UIItem.kt +++ b/src/net/torvald/terrarum/ui/UIItem.kt @@ -114,8 +114,6 @@ abstract class UIItem(var parentUI: UICanvas) { // do not replace parentUI to UI return false } open fun touchDown(screenX: Int, screenY: Int, pointer: Int, button: Int): Boolean { - println("trsaneirsatneioarsteniotrsaneioarstineoarstneio") - var actionDone = false if (touchDownListener != null) { @@ -123,7 +121,9 @@ abstract class UIItem(var parentUI: UICanvas) { // do not replace parentUI to UI actionDone = true } - if (!clickOnceListenerFired && mouseUp) { + if (clickOnceListener != null && !clickOnceListenerFired && mouseUp) { + println("arstineotarsneio") + clickOnceListener!!.invoke(relativeMouseX, relativeMouseY, button) actionDone = true } diff --git a/src/net/torvald/terrarum/ui/UIItemImageButton.kt b/src/net/torvald/terrarum/ui/UIItemImageButton.kt index 3aa9f40d9..76ea18e1d 100644 --- a/src/net/torvald/terrarum/ui/UIItemImageButton.kt +++ b/src/net/torvald/terrarum/ui/UIItemImageButton.kt @@ -53,4 +53,32 @@ open class UIItemImageButton( override fun dispose() { image.texture.dispose() } + + override fun keyDown(keycode: Int): Boolean { + return super.keyDown(keycode) + } + + override fun keyUp(keycode: Int): Boolean { + return super.keyUp(keycode) + } + + override fun mouseMoved(screenX: Int, screenY: Int): Boolean { + return super.mouseMoved(screenX, screenY) + } + + override fun touchDragged(screenX: Int, screenY: Int, pointer: Int): Boolean { + return super.touchDragged(screenX, screenY, pointer) + } + + override fun touchDown(screenX: Int, screenY: Int, pointer: Int, button: Int): Boolean { + return super.touchDown(screenX, screenY, pointer, button) + } + + override fun touchUp(screenX: Int, screenY: Int, pointer: Int, button: Int): Boolean { + return super.touchUp(screenX, screenY, pointer, button) + } + + override fun scrolled(amount: Int): Boolean { + return super.scrolled(amount) + } } \ No newline at end of file diff --git a/src/net/torvald/terrarum/ui/UIItemTextButton.kt b/src/net/torvald/terrarum/ui/UIItemTextButton.kt index 1fef61403..1495e7419 100644 --- a/src/net/torvald/terrarum/ui/UIItemTextButton.kt +++ b/src/net/torvald/terrarum/ui/UIItemTextButton.kt @@ -77,4 +77,32 @@ open class UIItemTextButton( override fun dispose() { } + + override fun keyDown(keycode: Int): Boolean { + return super.keyDown(keycode) + } + + override fun keyUp(keycode: Int): Boolean { + return super.keyUp(keycode) + } + + override fun mouseMoved(screenX: Int, screenY: Int): Boolean { + return super.mouseMoved(screenX, screenY) + } + + override fun touchDragged(screenX: Int, screenY: Int, pointer: Int): Boolean { + return super.touchDragged(screenX, screenY, pointer) + } + + override fun touchDown(screenX: Int, screenY: Int, pointer: Int, button: Int): Boolean { + return super.touchDown(screenX, screenY, pointer, button) + } + + override fun touchUp(screenX: Int, screenY: Int, pointer: Int, button: Int): Boolean { + return super.touchUp(screenX, screenY, pointer, button) + } + + override fun scrolled(amount: Int): Boolean { + return super.scrolled(amount) + } } diff --git a/src/net/torvald/terrarum/ui/UIItemTextButtonList.kt b/src/net/torvald/terrarum/ui/UIItemTextButtonList.kt index 6bc61a5df..e1b9f1173 100644 --- a/src/net/torvald/terrarum/ui/UIItemTextButtonList.kt +++ b/src/net/torvald/terrarum/ui/UIItemTextButtonList.kt @@ -6,6 +6,7 @@ import com.badlogic.gdx.graphics.glutils.ShapeRenderer import net.torvald.terrarum.BlendMode import net.torvald.terrarum.fillRect import net.torvald.terrarum.gameactors.Second +import net.torvald.terrarum.gameactors.ai.toInt import net.torvald.terrarum.gameactors.roundInt import net.torvald.terrarum.inUse import net.torvald.terrarumsansbitmap.gdx.TextureRegionPack @@ -175,4 +176,32 @@ class UIItemTextButtonList( override fun dispose() { iconSpriteSheet?.dispose() } + + override fun keyDown(keycode: Int): Boolean { + return super.keyDown(keycode) || buttons.map { it.keyDown(keycode).toInt() }.sum() != 0 + } + + override fun keyUp(keycode: Int): Boolean { + return super.keyUp(keycode) || buttons.map { it.keyUp(keycode).toInt() }.sum() != 0 + } + + override fun mouseMoved(screenX: Int, screenY: Int): Boolean { + return super.mouseMoved(screenX, screenY) || buttons.map { it.mouseMoved(screenX, screenY).toInt() }.sum() != 0 + } + + override fun touchDragged(screenX: Int, screenY: Int, pointer: Int): Boolean { + return super.touchDragged(screenX, screenY, pointer) || buttons.map { it.touchDragged(screenX, screenY, pointer).toInt() }.sum() != 0 + } + + override fun touchDown(screenX: Int, screenY: Int, pointer: Int, button: Int): Boolean { + return super.touchDown(screenX, screenY, pointer, button) || buttons.map { it.touchDown(screenX, screenY, pointer, button).toInt() }.sum() != 0 + } + + override fun touchUp(screenX: Int, screenY: Int, pointer: Int, button: Int): Boolean { + return super.touchUp(screenX, screenY, pointer, button) || buttons.map { it.touchUp(screenX, screenY, pointer, button).toInt() }.sum() != 0 + } + + override fun scrolled(amount: Int): Boolean { + return super.scrolled(amount) || buttons.map { it.scrolled(amount).toInt() }.sum() != 0 + } } \ No newline at end of file diff --git a/src/net/torvald/terrarum/ui/UIStartMenu.kt b/src/net/torvald/terrarum/ui/UIStartMenu.kt index a578365f7..ab6f0fa9e 100644 --- a/src/net/torvald/terrarum/ui/UIStartMenu.kt +++ b/src/net/torvald/terrarum/ui/UIStartMenu.kt @@ -16,7 +16,7 @@ class UIStartMenu : UICanvas() { "MENU_LABEL_EXIT" ) - val menubarOffY = Terrarum.HEIGHT - 180 - 40 * menuLabels.size.plus(1) + val menubarOffY: Int; get() = Terrarum.HEIGHT / 2 - (Terrarum.fontGame.lineHeight * 1.5).toInt() } @@ -45,7 +45,7 @@ class UIStartMenu : UICanvas() { // attach listeners - menubar.buttons[3].clickOnceListener = { _, _, _ -> System.exit(0) } + menubar.buttons[menuLabels.indexOf("MENU_LABEL_EXIT")].clickOnceListener = { _, _, _ -> System.exit(0) } } override fun update(delta: Float) { diff --git a/src/net/torvald/terrarum/weather/WeatherMixer.kt b/src/net/torvald/terrarum/weather/WeatherMixer.kt index e74d22531..ab4b8e231 100644 --- a/src/net/torvald/terrarum/weather/WeatherMixer.kt +++ b/src/net/torvald/terrarum/weather/WeatherMixer.kt @@ -126,8 +126,6 @@ object WeatherMixer { val topCol = getGradientColour(skyboxColourMap, 0, timeNow) val bottomCol = getGradientColour(skyboxColourMap, 1, timeNow) - println("zero pos: $parallaxZeroPos, domain_size: $parallaxDomainSize") - //Terrarum.textureWhiteSquare.bind(0) Terrarum.shaderBayerSkyboxFill.begin()