when it's not dev build, title bar shows less info

they take some processing time
This commit is contained in:
Minjae Song
2018-12-25 01:58:18 +09:00
parent 46284be77d
commit 934b252314
9 changed files with 110 additions and 92 deletions

View File

@@ -6,13 +6,12 @@ import com.badlogic.gdx.graphics.Color
import com.badlogic.gdx.graphics.g2d.SpriteBatch
import com.jme3.math.FastMath
import net.torvald.terrarum.*
import net.torvald.terrarum.worlddrawer.LightmapRenderer
import net.torvald.terrarum.worlddrawer.FeaturesDrawer
import net.torvald.terrarum.Terrarum.mouseTileX
import net.torvald.terrarum.Terrarum.mouseTileY
import net.torvald.terrarum.gameworld.GameWorld
import net.torvald.terrarum.modulebasegame.Ingame
import net.torvald.terrarum.modulebasegame.gameworld.GameWorldExtension
import net.torvald.terrarum.worlddrawer.FeaturesDrawer
import net.torvald.terrarum.worlddrawer.LightmapRenderer
/**
* Created by minjaesong on 2016-03-14.
@@ -91,8 +90,8 @@ class BasicDebugInfoWindow : UICanvas() {
+ "${(hitbox?.endY?.div(FeaturesDrawer.TILE_SIZE))?.toInt()}"
+ ")")
printLine(batch, 3, "veloX reported $ccG${player.externalForce?.x}")
printLine(batch, 4, "veloY reported $ccG${player.externalForce?.y}")
printLine(batch, 3, "veloX reported $ccG${player.externalForce.x}")
printLine(batch, 4, "veloY reported $ccG${player.externalForce.y}")
printLine(batch, 5, "p_WalkX $ccG${player.controllerMoveDelta?.x}")
printLine(batch, 6, "p_WalkY $ccG${player.controllerMoveDelta?.y}")

View File

@@ -4,8 +4,8 @@ import com.badlogic.gdx.Gdx
import com.badlogic.gdx.graphics.Camera
import com.badlogic.gdx.graphics.g2d.SpriteBatch
import net.torvald.terrarum.AppLoader
import net.torvald.terrarum.Terrarum
import net.torvald.terrarum.Second
import net.torvald.terrarum.Terrarum
import net.torvald.terrarum.roundInt
@@ -76,7 +76,7 @@ abstract class UICanvas(
}
inline fun addSubUI(ui: UICanvas) {
fun addSubUI(ui: UICanvas) {
handler.addSubUI(ui)
}
@@ -200,23 +200,23 @@ abstract class UICanvas(
// handler func aliases //
inline fun setPosition(x: Int, y: Int) {
fun setPosition(x: Int, y: Int) {
handler.setPosition(x, y)
}
inline fun setAsAlwaysVisible() {
fun setAsAlwaysVisible() {
handler.setAsAlwaysVisible()
}
inline fun setAsOpen() {
fun setAsOpen() {
handler.setAsOpen()
}
inline fun setAsClose() {
fun setAsClose() {
handler.setAsClose()
}
inline fun toggleOpening() {
fun toggleOpening() {
handler.toggleOpening()
}

View File

@@ -54,7 +54,7 @@ abstract class UIItem(var parentUI: UICanvas) { // do not replace parentUI to UI
get() = relativeMouseX in 0..width - 1 && relativeMouseY in 0..height - 1
/** If mouse is hovering over it and mouse is down */
open val mousePushed: Boolean
get() = mouseUp && Gdx.input.isButtonPressed(AppLoader.getConfigInt("mouseprimary")!!)
get() = mouseUp && Gdx.input.isButtonPressed(AppLoader.getConfigInt("mouseprimary"))
/** UI to call (show up) while mouse is up */

View File

@@ -4,7 +4,6 @@ import com.badlogic.gdx.graphics.Camera
import com.badlogic.gdx.graphics.Color
import com.badlogic.gdx.graphics.g2d.SpriteBatch
import net.torvald.terrarum.*
import java.lang.Error
/**
* Nextstep-themed menu bar with mandatory title line
@@ -43,8 +42,8 @@ class UINSMenu(
private data class MenuPack(val title: String, val ui: UIItemTextButtonList)
private fun ArrayList<MenuPack>.push(item: MenuPack) { this.add(item) }
private fun ArrayList<MenuPack>.pop() = this.removeAt(this.lastIndex)!!
private fun ArrayList<MenuPack>.peek() = this.last()!!
private fun ArrayList<MenuPack>.pop() = this.removeAt(this.lastIndex)
private fun ArrayList<MenuPack>.peek() = this.last()
val selectedIndex: Int?