Florian Nücke | 7677d49 | 2014-11-07 19:08:35 +0100 | [diff] [blame] | 1 | package li.cil.oc.client.gui |
| 2 | |
| 3 | import li.cil.oc.client.Textures |
Florian Nücke | 7677d49 | 2014-11-07 19:08:35 +0100 | [diff] [blame] | 4 | import li.cil.oc.common.inventory.DatabaseInventory |
Florian Nücke | b110816 | 2014-12-23 04:31:19 +0100 | [diff] [blame] | 5 | import li.cil.oc.common.Tier |
| 6 | import li.cil.oc.common.container |
Florian Nücke | 7677d49 | 2014-11-07 19:08:35 +0100 | [diff] [blame] | 7 | import net.minecraft.entity.player.InventoryPlayer |
| 8 | import net.minecraft.inventory.Slot |
| 9 | import org.lwjgl.opengl.GL11 |
| 10 | |
| 11 | class Database(playerInventory: InventoryPlayer, val databaseInventory: DatabaseInventory) extends DynamicGuiContainer(new container.Database(playerInventory, databaseInventory)) { |
| 12 | ySize = 256 |
| 13 | |
Florian Nücke | f8277fe | 2015-01-15 16:37:28 +0100 | [diff] [blame] | 14 | override def drawSecondaryForegroundLayer(mouseX: Int, mouseY: Int) {} |
Florian Nücke | 7677d49 | 2014-11-07 19:08:35 +0100 | [diff] [blame] | 15 | |
| 16 | override protected def drawGuiContainerBackgroundLayer(dt: Float, mouseX: Int, mouseY: Int) { |
| 17 | GL11.glColor4f(1, 1, 1, 1) |
| 18 | mc.renderEngine.bindTexture(Textures.guiDatabase) |
| 19 | drawTexturedModalRect(guiLeft, guiTop, 0, 0, xSize, ySize) |
| 20 | |
| 21 | if (databaseInventory.tier > Tier.One) { |
| 22 | mc.renderEngine.bindTexture(Textures.guiDatabase1) |
| 23 | drawTexturedModalRect(guiLeft, guiTop, 0, 0, xSize, ySize) |
| 24 | } |
| 25 | |
| 26 | if (databaseInventory.tier > Tier.Two) { |
| 27 | mc.renderEngine.bindTexture(Textures.guiDatabase2) |
| 28 | drawTexturedModalRect(guiLeft, guiTop, 0, 0, xSize, ySize) |
| 29 | } |
| 30 | } |
| 31 | |
| 32 | override def doesGuiPauseGame = false |
| 33 | |
| 34 | protected override def handleMouseClick(slot: Slot, slotNumber: Int, button: Int, shift: Int) { |
| 35 | if (slot == null || slot.getStack != databaseInventory.container) { |
| 36 | super.handleMouseClick(slot, slotNumber, button, shift) |
| 37 | } |
| 38 | } |
| 39 | |
| 40 | protected override def checkHotbarKeys(slot: Int) = false |
| 41 | } |