uiitem and template refactoring; new smelter ui wip

This commit is contained in:
minjaesong
2024-01-29 18:51:53 +09:00
parent 8aedd7c78a
commit 3214f11375
14 changed files with 290 additions and 64 deletions

View File

@@ -97,7 +97,7 @@ abstract class UICanvas(
open var openCloseTime: Second = OPENCLOSE_GENERIC
protected val uiItems = ArrayList<UIItem>()
protected val uiItems = ArrayList<UIItemisable>()
val relativeMouseX: Int
@@ -189,12 +189,9 @@ abstract class UICanvas(
abstract override fun dispose()
fun addUIitem(uiItem: UIItem) {
fun addUIitem(uiItem: UIItemisable) {
if (!uiItems.contains(uiItem)) uiItems.add(uiItem)
}
fun addUIitem(template: UITemplate) {
template.getUIitems().forEach { addUIitem(it) }
}
fun mouseInScreen(x: Int, y: Int) = x in 0 until App.scr.windowW && y in 0 until App.scr.windowH