38 lines
1.0 KiB
Kotlin
38 lines
1.0 KiB
Kotlin
|
package net.shadowfacts.phycon.screen
|
||
|
|
||
|
import net.minecraft.client.gui.screen.Screen
|
||
|
import net.minecraft.client.util.math.MatrixStack
|
||
|
import net.minecraft.text.TranslatableText
|
||
|
import net.shadowfacts.phycon.network.DeviceBlockEntity
|
||
|
import org.lwjgl.glfw.GLFW
|
||
|
|
||
|
/**
|
||
|
* @author shadowfacts
|
||
|
*/
|
||
|
class DeviceConsoleScreen(
|
||
|
val device: DeviceBlockEntity,
|
||
|
): Screen(TranslatableText("item.phycon.onsole")) {
|
||
|
|
||
|
override fun init() {
|
||
|
super.init()
|
||
|
}
|
||
|
|
||
|
override fun isPauseScreen() = false
|
||
|
|
||
|
override fun keyPressed(key: Int, j: Int, k: Int): Boolean {
|
||
|
if (key == GLFW.GLFW_KEY_E) {
|
||
|
onClose();
|
||
|
return true;
|
||
|
}
|
||
|
return super.keyPressed(key, j, k)
|
||
|
}
|
||
|
|
||
|
override fun render(matrixStack: MatrixStack, mouseX: Int, mouseY: Int, delta: Float) {
|
||
|
renderBackground(matrixStack)
|
||
|
|
||
|
super.render(matrixStack, mouseX, mouseY, delta)
|
||
|
|
||
|
drawCenteredString(matrixStack, textRenderer, device.macAddress.toString(), width / 2, height / 2 - 5, 0xffffff)
|
||
|
drawCenteredString(matrixStack, textRenderer, device.ipAddress.toString(), width / 2, height / 2 + 5, 0xffffff)
|
||
|
}
|
||
|
}
|