2019-06-21 23:02:08 +00:00
|
|
|
package net.shadowfacts.shadowui
|
|
|
|
|
|
|
|
import net.minecraft.client.gui.screen.Screen
|
|
|
|
import net.minecraft.network.chat.TextComponent
|
|
|
|
import net.shadowfacts.shadowui.geometry.Point
|
|
|
|
import no.birkett.kiwi.Solver
|
|
|
|
|
2019-06-22 14:59:18 +00:00
|
|
|
/**
|
|
|
|
* @author shadowfacts
|
|
|
|
*/
|
2019-06-21 23:02:08 +00:00
|
|
|
open class Screen: Screen(TextComponent("Screen")) {
|
|
|
|
|
|
|
|
val windows = mutableListOf<Window>()
|
|
|
|
|
|
|
|
fun addWindow(window: Window, index: Int? = null) {
|
|
|
|
if (index != null) {
|
|
|
|
windows.add(index, window)
|
|
|
|
} else {
|
|
|
|
windows.add(window)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
override fun render(mouseX: Int, mouseY: Int, delta: Float) {
|
|
|
|
val mouse = Point(mouseX, mouseY)
|
|
|
|
windows.forEach {
|
|
|
|
it.draw(mouse, delta)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|