diff --git a/dependencies.gradle b/dependencies.gradle index 4f80ebe..6acdfc2 100644 --- a/dependencies.gradle +++ b/dependencies.gradle @@ -1,7 +1,7 @@ // Add your dependencies here dependencies { - compile 'com.github.GTNewHorizons:Applied-Energistics-2-Unofficial:rv3-beta-84-GTNH:dev' + compile 'com.github.GTNewHorizons:Applied-Energistics-2-Unofficial:rv3-beta-104-GTNH:dev' compile 'com.github.GTNewHorizons:Forgelin:1.9.2-GTNH-1.7.10-Edition' compile 'com.github.GTNewHorizons:BuildCraft:7.1.27:dev' } diff --git a/src/main/java/com/projecturanus/betterp2p/client/gui/GuiAdvancedMemoryCard.kt b/src/main/java/com/projecturanus/betterp2p/client/gui/GuiAdvancedMemoryCard.kt index 4cf5b70..8813b54 100644 --- a/src/main/java/com/projecturanus/betterp2p/client/gui/GuiAdvancedMemoryCard.kt +++ b/src/main/java/com/projecturanus/betterp2p/client/gui/GuiAdvancedMemoryCard.kt @@ -12,26 +12,21 @@ import com.projecturanus.betterp2p.item.BetterMemoryCardModes import com.projecturanus.betterp2p.network.* import net.minecraft.client.gui.GuiButton import net.minecraft.client.gui.GuiScreen +import net.minecraft.client.renderer.Tessellator import net.minecraft.client.resources.I18n import net.minecraft.util.ResourceLocation import org.lwjgl.input.Mouse import java.util.* class GuiAdvancedMemoryCard(msg: S2CListP2P) : GuiScreen(), TextureBound { - private val outputColor = 0x4566ccff - private val selectedColor = 0x4545DA75 - private val errorColor = 0x45DA4527 - private val inactiveColor = 0x45FFEA05 - private val xSize = 238 + private val xSize = 288 private val ySize = 206 private val guiLeft: Int by lazy { (width - this.xSize) / 2 } private val guiTop: Int by lazy { (height - this.ySize) / 2 } private val tableX = 9 private val tableY = 19 - private val rowWidth = 203 - private val rowHeight = 22 private var selectedIndex = -1 @@ -55,7 +50,7 @@ class GuiAdvancedMemoryCard(msg: S2CListP2P) : GuiScreen(), TextureBound { private var mode = msg.memoryInfo.mode private var modeString = getModeString() - private val modeButton by lazy { GuiButton(0, guiLeft + 8, guiTop + 154, 205, 20, modeString) } + private val modeButton by lazy { GuiButton(0, guiLeft + 8, guiTop + 154, 256, 20, modeString) } init { selectInfo(msg.memoryInfo.selectedIndex) @@ -75,9 +70,9 @@ class GuiAdvancedMemoryCard(msg: S2CListP2P) : GuiScreen(), TextureBound { scrollBar = WidgetScrollBar() searchBar = MEGuiTextField(65, 10) searchBar.setMaxStringLength(25) - searchBar.x = guiLeft + 148 + searchBar.x = guiLeft + 198 searchBar.y = guiTop + 5 - scrollBar.displayX = guiLeft + 218 + scrollBar.displayX = guiLeft + 268 scrollBar.displayY = guiTop + 19 scrollBar.height = 114 scrollBar.setRange(0, infos.size.coerceIn(0..(infos.size - 4).coerceAtLeast(0)), 23) @@ -282,7 +277,17 @@ class GuiAdvancedMemoryCard(msg: S2CListP2P) : GuiScreen(), TextureBound { private fun drawBackground() { bindTexture(MODID, "textures/gui/advanced_memory_card.png") - drawTexturedModalRect(guiLeft, guiTop, 0, 0, this.xSize, this.ySize) + val tessellator = Tessellator.instance + val f = 1f / this.xSize.toFloat() + val f1 = 1f / this.ySize.toFloat() + val u = 0 + val v = 0 + tessellator.startDrawingQuads() + tessellator.addVertexWithUV(guiLeft.toDouble(), (guiTop + this.ySize).toDouble(), 0.0, (u.toFloat() * f).toDouble(), ((v + this.ySize).toFloat() * f1).toDouble()) + tessellator.addVertexWithUV(((guiLeft + this.xSize).toDouble()), ((guiTop + this.ySize).toDouble()), 0.0, ((u + this.xSize).toFloat() * f).toDouble(), ((v + this.ySize).toFloat() * f1).toDouble()) + tessellator.addVertexWithUV((guiLeft + this.xSize).toDouble(), guiTop.toDouble(), 0.0, ((u + this.xSize).toFloat() * f).toDouble(), (v.toFloat() * f1).toDouble()) + tessellator.addVertexWithUV(guiLeft.toDouble(), guiTop.toDouble(), 0.0, (u.toFloat() * f).toDouble(), (v.toFloat() * f1).toDouble()) + tessellator.draw() } override fun doesGuiPauseGame(): Boolean { diff --git a/src/main/java/com/projecturanus/betterp2p/client/gui/widget/WidgetP2PDevice.kt b/src/main/java/com/projecturanus/betterp2p/client/gui/widget/WidgetP2PDevice.kt index 16281e0..22cbe30 100644 --- a/src/main/java/com/projecturanus/betterp2p/client/gui/widget/WidgetP2PDevice.kt +++ b/src/main/java/com/projecturanus/betterp2p/client/gui/widget/WidgetP2PDevice.kt @@ -13,7 +13,7 @@ class WidgetP2PDevice(private val selectedInfoProperty: KMutableProperty0