trying to make fixtures with UIs working, was not successful

This commit is contained in:
minjaesong
2019-07-08 04:05:04 +09:00
parent 84e4c82b60
commit e8ba837b09
28 changed files with 366 additions and 86 deletions

View File

@@ -5,6 +5,7 @@ import com.badlogic.gdx.graphics.Camera
import com.badlogic.gdx.graphics.Color
import com.badlogic.gdx.graphics.g2d.SpriteBatch
import net.torvald.terrarum.AppLoader
import net.torvald.terrarum.Terrarum
import net.torvald.terrarum.console.Authenticator
import net.torvald.terrarum.console.CommandInterpreter
import net.torvald.terrarum.fillRect
@@ -186,6 +187,7 @@ class ConsoleWindow : UICanvas() {
}
override fun doOpening(delta: Float) {
Terrarum.ingame?.paused = true
/*openingTimeCounter += delta
drawOffY = MovementInterpolator.fastPullOut(openingTimeCounter.toFloat() / openCloseTime.toFloat(),
-height.toFloat(), 0f
@@ -193,6 +195,7 @@ class ConsoleWindow : UICanvas() {
}
override fun doClosing(delta: Float) {
Terrarum.ingame?.paused = false
/*openingTimeCounter += delta
drawOffY = MovementInterpolator.fastPullOut(openingTimeCounter.toFloat() / openCloseTime.toFloat(),
0f, -height.toFloat()

View File

@@ -365,4 +365,5 @@ abstract class UICanvas(
}
}
override fun toString(): String = "${this.javaClass.simpleName}@${this.hashCode().toString(16)}"
}

View File

@@ -88,7 +88,7 @@ class UIHandler(//var UI: UICanvas,
fun addSubUI(ui: UICanvas) {
if (subUIs.contains(ui))
throw IllegalArgumentException(
"Exact copy of the UI already exists: The instance of ${ui.javaClass.simpleName}"
"Exact copy of the UI already exists: The instance of $ui"
)
subUIs.add(ui)
@@ -136,6 +136,7 @@ class UIHandler(//var UI: UICanvas,
// println("UIHandler.opening ${UI.javaClass.simpleName}")
}
else {
ui.doOpening(0f)
ui.endOpening(delta)
isOpening = false
isClosing = false
@@ -156,6 +157,7 @@ class UIHandler(//var UI: UICanvas,
// println("UIHandler.closing ${UI.javaClass.simpleName}")
}
else {
ui.doClosing(0f)
ui.endClosing(delta)
isClosing = false
isOpening = false
@@ -218,7 +220,7 @@ class UIHandler(//var UI: UICanvas,
}
/**
* Send OPEN signal to the attached UI.
* Send OPEN signal to the attached UI. The actual job is done when the handler is being updated.
*/
fun setAsOpen() {
if (alwaysVisible && !doNotWarnConstant) {
@@ -235,7 +237,7 @@ class UIHandler(//var UI: UICanvas,
}
/**
* Send CLOSE signal to the attached UI.
* Send CLOSE signal to the attached UI. The actual job is done when the handler is being updated.
*/
fun setAsClose() {
if (alwaysVisible && !doNotWarnConstant) {