42 lines
1.5 KiB
Kotlin
42 lines
1.5 KiB
Kotlin
package net.shadowfacts.phycon.network.block.terminal
|
|
|
|
import com.mojang.blaze3d.platform.GlStateManager
|
|
import net.minecraft.client.gui.screen.ingame.HandledScreen
|
|
import net.minecraft.client.util.math.MatrixStack
|
|
import net.minecraft.entity.player.PlayerInventory
|
|
import net.minecraft.text.LiteralText
|
|
import net.minecraft.text.Text
|
|
import net.minecraft.util.Identifier
|
|
import net.shadowfacts.phycon.PhysicalConnectivity
|
|
|
|
/**
|
|
* @author shadowfacts
|
|
*/
|
|
// todo: translate title
|
|
class TerminalScreen(handler: TerminalScreenHandler, playerInv: PlayerInventory, title: Text): HandledScreen<TerminalScreenHandler>(handler, playerInv, title) {
|
|
companion object {
|
|
val BACKGROUND = Identifier(PhysicalConnectivity.MODID, "textures/gui/terminal.png")
|
|
}
|
|
|
|
init {
|
|
backgroundWidth = 252
|
|
backgroundHeight = 222
|
|
}
|
|
|
|
override fun drawForeground(matrixStack: MatrixStack, mouseX: Int, mouseY: Int) {
|
|
textRenderer.draw(matrixStack, title, 65f, 6f, 0x404040)
|
|
textRenderer.draw(matrixStack, playerInventory.displayName, 65f, backgroundHeight - 94f, 0x404040)
|
|
// todo: translate this
|
|
textRenderer.draw(matrixStack, "Buffer", 7f, 6f, 0x404040)
|
|
}
|
|
|
|
override fun drawBackground(matrixStack: MatrixStack, delta: Float, mouseX: Int, mouseY: Int) {
|
|
GlStateManager.color4f(1f, 1f, 1f, 1f)
|
|
client!!.textureManager.bindTexture(BACKGROUND)
|
|
val x = (width - backgroundWidth) / 2
|
|
val y = (height - backgroundHeight) / 2
|
|
drawTexture(matrixStack, x, y, 0, 0, backgroundWidth, backgroundHeight)
|
|
}
|
|
|
|
}
|