disposable UI; loading screen mockup (i heard like loading screen -- sonic 06)

This commit is contained in:
minjaesong
2017-07-13 17:53:40 +09:00
parent 49a9278c59
commit d241e5cbb0
33 changed files with 253 additions and 33 deletions

View File

@@ -286,4 +286,7 @@ class BasicDebugInfoWindow : UICanvas {
override fun endClosing(delta: Float) {
}
override fun dispose() {
}
}

View File

@@ -212,4 +212,7 @@ class ConsoleWindow : UICanvas, KeyControlled {
override fun processInput(delta: Float) {
}
override fun dispose() {
}
}

View File

@@ -99,4 +99,9 @@ object ItemSlotImageBuilder {
private data class ImageDesc(val color: Color, val number: Int, val isLarge: Boolean)
fun dispose() {
slotImage.dispose()
slotLarge.dispose()
}
}

View File

@@ -66,12 +66,16 @@ class MessageWindow(override var width: Int, isBlackVariant: Boolean) : UICanvas
override fun endClosing(delta: Float) {
}
override fun dispose() {
}
companion object {
// private int messagesShowingIndex = 0;
val MESSAGES_DISPLAY = 2
val OPEN_CLOSE_TIME = 0.16f
// will be disposed by Terrarum (application main instance)
val SEGMENT_BLACK = TextureRegionPack("assets/graphics/gui/message_black.tga", 8, 56)
val SEGMENT_WHITE = TextureRegionPack("assets/graphics/gui/message_white.tga", 8, 56)
}

View File

@@ -68,4 +68,7 @@ class Notification : UICanvas {
handler!!.opacity = 0f
handler!!.setAsOpen()
}
override fun dispose() {
}
}

View File

@@ -31,4 +31,7 @@ class NullUI : UICanvas {
override fun endClosing(delta: Float) {
}
override fun dispose() {
}
}

View File

@@ -131,4 +131,8 @@ class UIBasicNotifier(private val player: ActorHumanoid?) : UICanvas {
override fun endClosing(delta: Float) {
}
override fun dispose() {
atlas.dispose()
}
}

View File

@@ -67,6 +67,8 @@ interface UICanvas {
*/
fun endClosing(delta: Float)
fun dispose()
companion object {
const val OPENCLOSE_GENERIC = 0.2f

View File

@@ -287,4 +287,8 @@ class UIHandler(val UI: UICanvas,
}
return isVisible && !isOpening
}
fun dispose() {
UI.dispose()
}
}

View File

@@ -355,5 +355,8 @@ class UIInventory(
return false
}
override fun dispose() {
catButtons.dispose()
items.forEach { it.dispose() }
}
}

View File

@@ -41,5 +41,6 @@ abstract class UIItem(var parentUI: UICanvas) { // do not replace parentUI to UI
abstract fun touchDown(screenX: Int, screenY: Int, pointer: Int, button: Int): Boolean
abstract fun touchUp(screenX: Int, screenY: Int, pointer: Int, button: Int): Boolean
abstract fun scrolled(amount: Int): Boolean
abstract fun dispose()
}

View File

@@ -69,4 +69,8 @@ class UIItemImageGallery(
override fun scrolled(amount: Int): Boolean {
TODO("not implemented") //To change body of created functions use File | Settings | File Templates.
}
override fun dispose() {
imageList.forEach { it.dispose() }
}
}

View File

@@ -107,4 +107,7 @@ class UIItemTextButton(
override fun scrolled(amount: Int): Boolean {
return false
}
override fun dispose() {
}
}

View File

@@ -194,4 +194,8 @@ class UIItemTextButtonList(
override fun scrolled(amount: Int): Boolean {
return false
}
override fun dispose() {
iconSpriteSheet?.dispose()
}
}

View File

@@ -118,4 +118,7 @@ class UIPieMenu : UICanvas {
UICanvas.endClosingFade(handler)
handler!!.scale = 1f
}
override fun dispose() {
}
}

View File

@@ -112,6 +112,9 @@ class UIQuickBar : UICanvas, MouseControlled {
return true
}
override fun dispose() {
}
companion object {
val finalOpacity = 0.8f

View File

@@ -121,4 +121,9 @@ class UITierOneWatch(private val player: ActorHumanoid?) : UICanvas {
override fun endClosing(delta: Float) {
}
override fun dispose() {
atlas.dispose()
moonDial.dispose()
}
}

View File

@@ -123,6 +123,9 @@ class UIVitalMetre(
override fun endClosing(delta: Float) {
UICanvas.endClosingFade(handler)
}
override fun dispose() {
}
}
fun Float.abs() = FastMath.abs(this)