mirror of
https://github.com/curioustorvald/Terrarum.git
synced 2026-06-11 19:14:05 +09:00
trying to make fixtures with UIs working, was not successful
This commit is contained in:
@@ -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()
|
||||
|
||||
@@ -365,4 +365,5 @@ abstract class UICanvas(
|
||||
}
|
||||
}
|
||||
|
||||
override fun toString(): String = "${this.javaClass.simpleName}@${this.hashCode().toString(16)}"
|
||||
}
|
||||
|
||||
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user